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

add 4626 integration #66

Merged
merged 28 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
89612cd
add initial tranche4626 draft
ilinzweilin May 22, 2023
1ff48a6
add -deposit/mint flow
ilinzweilin Jun 19, 2023
0e1f55d
fix error message
ilinzweilin Jun 19, 2023
9cda91f
decrease Order handling + more refactoring
ilinzweilin Jun 19, 2023
a7d4845
more refactoring
ilinzweilin Jun 19, 2023
9afdcff
add handle collectRedeem/Invest
ilinzweilin Jun 20, 2023
20b94f9
add requestDeposit
ilinzweilin Jun 20, 2023
2b1a4ac
fix function signature
ilinzweilin Jun 20, 2023
fe06d4a
add requestRedeem + more refactoring
ilinzweilin Jun 21, 2023
a6f10dd
Connector - add processRedeem & processWitdraw flows
ilinzweilin Jun 21, 2023
e644a16
refactor and build fixes
ilinzweilin Jun 22, 2023
e18ac1c
fix build
ilinzweilin Jun 22, 2023
1c9d1ac
add public Liquidity Pool deployment
ilinzweilin Jun 25, 2023
f60ab4e
fix build
ilinzweilin Jun 26, 2023
93cb56c
add multi tranche support
ilinzweilin Jun 26, 2023
060dbb5
refactor test cases and add liquidity pool deployment tests
ilinzweilin Jun 27, 2023
068dcb5
format connectors file
ilinzweilin Jun 27, 2023
985d193
add global escrow limits and more docs
ilinzweilin Jun 28, 2023
2e12724
add global escrow limits and more docs
ilinzweilin Jun 28, 2023
6122c50
merge main
ilinzweilin Jun 28, 2023
728d04f
fix fix incoming message interfaces
ilinzweilin Jun 28, 2023
901cefb
Apply suggestions from code review
ilinzweilin Jun 28, 2023
1a3e71c
improve liquidity pool docs
ilinzweilin Jun 28, 2023
d5a81ea
Merge branch 'eip-4626-support' of github.com:centrifuge/connectors i…
ilinzweilin Jun 28, 2023
8319eef
EIP4626 deployment mvp
ilinzweilin Aug 16, 2023
3eba82f
remove test env
ilinzweilin Aug 16, 2023
e377984
merge main
ilinzweilin Aug 17, 2023
58ac242
sign commit
ilinzweilin Aug 17, 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
38 changes: 19 additions & 19 deletions script/Connector-Axelar-EVM.s.sol → script/Axelar-EVM.s.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.18;

import {ConnectorAxelarEVMRouter} from "src/routers/axelar/EVMRouter.sol";
import {ConnectorGateway} from "src/routers/Gateway.sol";
import {CentrifugeConnector} from "src/Connector.sol";
import {ConnectorEscrow} from "src/Escrow.sol";
import {ConnectorPauseAdmin} from "src/admin/PauseAdmin.sol";
import {ConnectorDelayedAdmin} from "src/admin/DelayedAdmin.sol";
import {AxelarEVMRouter} from "src/routers/axelar/EVMRouter.sol";
import {Gateway} from "src/Gateway.sol";
import {InvestmentManager} from "src/InvestmentManager.sol";
import {Escrow} from "src/Escrow.sol";
import {PauseAdmin} from "src/admin/PauseAdmin.sol";
import {DelayedAdmin} from "src/admin/DelayedAdmin.sol";
import {TrancheTokenFactory, MemberlistFactory} from "src/token/factory.sol";
import "forge-std/Script.sol";

// Script to deploy Connectors with an AxelarEVM router.
contract ConnectorAxelarEVMScript is Script {
contract AxelarEVMScript is Script {
// address(0)[0:20] + keccak("Centrifuge")[21:32]
bytes32 SALT = 0x000000000000000000000000000000000000000075eb27011b69f002dc094d05;

Expand All @@ -25,27 +25,27 @@ contract ConnectorAxelarEVMScript is Script {
uint256 gracePeriod = 48 hours;
address tokenFactory_ = address(new TrancheTokenFactory{ salt: SALT }());
address memberlistFactory_ = address(new MemberlistFactory{ salt: SALT }());
address escrow_ = address(new ConnectorEscrow{ salt: SALT }());
CentrifugeConnector connector =
new CentrifugeConnector{ salt: SALT }(escrow_, tokenFactory_, memberlistFactory_);
address escrow_ = address(new Escrow{ salt: SALT }());
InvestmentManager investmentManager =
new InvestmentManager{ salt: SALT }(escrow_, tokenFactory_, memberlistFactory_);

ConnectorAxelarEVMRouter router = new ConnectorAxelarEVMRouter{ salt: SALT }(
address(connector),
AxelarEVMRouter router = new AxelarEVMRouter{ salt: SALT }(
address(investmentManager),
address(vm.envAddress("AXELAR_GATEWAY"))
);
connector.file("router", address(router));
ConnectorPauseAdmin pauseAdmin = new ConnectorPauseAdmin();
ConnectorDelayedAdmin delayedAdmin = new ConnectorDelayedAdmin();
ConnectorGateway gateway =
new ConnectorGateway{ salt: SALT }(address(connector), address(router), shortWait, longWait, gracePeriod);
investmentManager.file("router", address(router));
PauseAdmin pauseAdmin = new PauseAdmin();
DelayedAdmin delayedAdmin = new DelayedAdmin();
Gateway gateway =
new Gateway{ salt: SALT }(address(investmentManager), address(router), shortWait, longWait, gracePeriod);
gateway.rely(address(pauseAdmin));
gateway.rely(address(delayedAdmin));
pauseAdmin.file("gateway", address(gateway));
delayedAdmin.file("gateway", address(gateway));
router.file("gateway", address(gateway));
connector.rely(address(gateway));
investmentManager.rely(address(gateway));
router.rely(address(gateway));
ConnectorEscrow(address(escrow_)).rely(address(gateway));
Escrow(address(escrow_)).rely(address(gateway));

// TODO: rely pauseMultisig on pauseAdmin
pauseAdmin.rely(address(0));
Expand Down
6 changes: 3 additions & 3 deletions script/Connector-Axelar-XCM.s.sol → script/Axelar-XCM.s.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.18;

import {ConnectorAxelarXCMRouter} from "src/routers/axelar/XCMRouter.sol";
import {AxelarXCMRouter} from "src/routers/axelar/XCMRouter.sol";
import "forge-std/Script.sol";

// Script to deploy Connectors with an AxelarXCM router.
contract ConnectorAxelarXCMScript is Script {
contract AxelarXCMScript is Script {
// address(0)[0:20] + keccak("Centrifuge")[21:32]
bytes32 SALT = 0x000000000000000000000000000000000000000075eb27011b69f002dc094d05;

Expand All @@ -14,7 +14,7 @@ contract ConnectorAxelarXCMScript is Script {
function run() public {
vm.startBroadcast();

ConnectorAxelarXCMRouter router = new ConnectorAxelarXCMRouter{ salt: SALT }(
AxelarXCMRouter router = new AxelarXCMRouter{ salt: SALT }(
address(vm.envAddress("CENTRIFUGE_CHAIN_ORIGIN")),
address(vm.envAddress("AXELAR_GATEWAY")),
address(vm.envAddress("AXELAR_EVM_ROUTER_ORIGIN"))
Expand Down
36 changes: 18 additions & 18 deletions script/Connector-XCM.s.sol → script/XCM.s.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.18;

import {ConnectorXCMRouter} from "src/routers/xcm/Router.sol";
import {ConnectorGateway} from "src/routers/Gateway.sol";
import {CentrifugeConnector} from "src/Connector.sol";
import {ConnectorEscrow} from "src/Escrow.sol";
import {ConnectorPauseAdmin} from "src/admin/PauseAdmin.sol";
import {ConnectorDelayedAdmin} from "src/admin/DelayedAdmin.sol";
import {XCMRouter} from "src/routers/xcm/Router.sol";
import {Gateway} from "src/Gateway.sol";
import {InvestmentManager} from "src/InvestmentManager.sol";
import {Escrow} from "src/Escrow.sol";
import {PauseAdmin} from "src/admin/PauseAdmin.sol";
import {DelayedAdmin} from "src/admin/DelayedAdmin.sol";
import {TrancheTokenFactory, MemberlistFactory} from "src/token/factory.sol";
import "forge-std/Script.sol";

// Script to deploy Connectors with an XCM router.
contract ConnectorXCMScript is Script {
contract XCMScript is Script {
// address(0)[0:20] + keccak("Centrifuge")[21:32]
bytes32 SALT = 0x000000000000000000000000000000000000000075eb27011b69f002dc094d05;

Expand All @@ -25,28 +25,28 @@ contract ConnectorXCMScript is Script {
uint256 gracePeriod = 48 hours;
address tokenFactory_ = address(new TrancheTokenFactory{ salt: SALT }());
address memberlistFactory_ = address(new MemberlistFactory{ salt: SALT }());
address escrow_ = address(new ConnectorEscrow{ salt: SALT }());
CentrifugeConnector connector =
new CentrifugeConnector{ salt: SALT }(escrow_, tokenFactory_, memberlistFactory_);
address escrow_ = address(new Escrow{ salt: SALT }());
InvestmentManager investmentManager =
new InvestmentManager{ salt: SALT }(escrow_, tokenFactory_, memberlistFactory_);

ConnectorXCMRouter router = new ConnectorXCMRouter{ salt: SALT }(
XCMRouter router = new XCMRouter{ salt: SALT }(
address(vm.envAddress("CENTRIFUGE_CHAIN_ORIGIN")),
uint8(vm.envUint("CENTRIFUGE_CHAIN_CONNECTORS_PALLET_INDEX")),
uint8(vm.envUint("CENTRIFUGE_CHAIN_CONNECTORS_PALLET_HANDLE_INDEX"))
);
connector.file("router", address(router));
ConnectorPauseAdmin pauseAdmin = new ConnectorPauseAdmin();
ConnectorDelayedAdmin delayedAdmin = new ConnectorDelayedAdmin();
ConnectorGateway gateway =
new ConnectorGateway{ salt: SALT }(address(connector), address(router), shortWait, longWait, gracePeriod);
investmentManager.file("router", address(router));
PauseAdmin pauseAdmin = new PauseAdmin();
DelayedAdmin delayedAdmin = new DelayedAdmin();
Gateway gateway =
new Gateway{ salt: SALT }(address(investmentManager), address(router), shortWait, longWait, gracePeriod);
gateway.rely(address(pauseAdmin));
gateway.rely(address(delayedAdmin));
pauseAdmin.file("gateway", address(gateway));
delayedAdmin.file("gateway", address(gateway));
router.file("gateway", address(gateway));
connector.rely(address(gateway));
investmentManager.rely(address(gateway));
router.rely(address(gateway));
ConnectorEscrow(address(escrow_)).rely(address(gateway));
Escrow(address(escrow_)).rely(address(gateway));

// rely multisig on pauseAdmin
pauseAdmin.rely(address(0));
Expand Down
Loading