chore: sync submodule state (parent ref update)
Made-with: Cursor
This commit is contained in:
@@ -52,12 +52,14 @@ contract DeployTrustlessBridge is Script {
|
||||
console.log("Deployer:", deployer);
|
||||
console.log("Chain ID:", block.chainid);
|
||||
|
||||
// Detect which chain we're on
|
||||
// Detect which chain we're on (138, 1, or L2 with TRUSTLESS_WETH_ADDRESS)
|
||||
bool isChain138 = block.chainid == 138;
|
||||
bool isEthereum = block.chainid == 1;
|
||||
address l2Weth = vm.envOr("TRUSTLESS_WETH_ADDRESS", address(0));
|
||||
bool isL2 = !isChain138 && !isEthereum && l2Weth != address(0);
|
||||
|
||||
if (!isChain138 && !isEthereum) {
|
||||
revert("DeployTrustlessBridge: unsupported chain");
|
||||
if (!isChain138 && !isEthereum && !isL2) {
|
||||
revert("DeployTrustlessBridge: unsupported chain (set TRUSTLESS_WETH_ADDRESS for L2)");
|
||||
}
|
||||
|
||||
vm.startBroadcast(deployerPrivateKey);
|
||||
@@ -100,6 +102,30 @@ contract DeployTrustlessBridge is Script {
|
||||
_authorizeInbox(addresses.liquidityPool, addresses.inbox);
|
||||
}
|
||||
|
||||
if (isL2) {
|
||||
console.log("\n--- Deploying Trustless stack on L2 (chain id ", block.chainid, ") ---");
|
||||
uint256 bondMultiplier = vm.envOr("BOND_MULTIPLIER_BPS", DEFAULT_BOND_MULTIPLIER);
|
||||
uint256 minBond = vm.envOr("MIN_BOND", DEFAULT_MIN_BOND);
|
||||
uint256 challengeWindow = vm.envOr("CHALLENGE_WINDOW_SECONDS", DEFAULT_CHALLENGE_WINDOW);
|
||||
uint256 lpFeeBps = vm.envOr("LP_FEE_BPS", DEFAULT_LP_FEE_BPS);
|
||||
uint256 minLiquidityRatioBps = vm.envOr("MIN_LIQUIDITY_RATIO_BPS", DEFAULT_MIN_LIQUIDITY_RATIO_BPS);
|
||||
|
||||
addresses.bondManager = _deployBondManager(bondMultiplier, minBond);
|
||||
addresses.challengeManager = _deployChallengeManager(addresses.bondManager, challengeWindow);
|
||||
addresses.liquidityPool = _deployLiquidityPool(l2Weth, lpFeeBps, minLiquidityRatioBps);
|
||||
addresses.inbox = _deployInboxETH(
|
||||
addresses.bondManager,
|
||||
addresses.challengeManager,
|
||||
addresses.liquidityPool
|
||||
);
|
||||
_authorizeInbox(addresses.liquidityPool, addresses.inbox);
|
||||
|
||||
string memory deployLb = vm.envOr("TRUSTLESS_DEPLOY_LOCKBOX", string("0"));
|
||||
if (keccak256(bytes(deployLb)) == keccak256("1") || keccak256(bytes(deployLb)) == keccak256("true")) {
|
||||
addresses.lockbox138 = _deployLockbox138();
|
||||
}
|
||||
}
|
||||
|
||||
vm.stopBroadcast();
|
||||
|
||||
// Print deployment summary
|
||||
@@ -115,6 +141,13 @@ contract DeployTrustlessBridge is Script {
|
||||
console.log("SwapRouter:", addresses.swapRouter);
|
||||
console.log("BridgeSwapCoordinator:", addresses.coordinator);
|
||||
}
|
||||
if (isL2) {
|
||||
console.log("BondManager:", addresses.bondManager);
|
||||
console.log("ChallengeManager:", addresses.challengeManager);
|
||||
console.log("LiquidityPoolETH:", addresses.liquidityPool);
|
||||
console.log("InboxETH:", addresses.inbox);
|
||||
if (addresses.lockbox138 != address(0)) console.log("Lockbox:", addresses.lockbox138);
|
||||
}
|
||||
}
|
||||
|
||||
function _deployLockbox138() internal returns (address) {
|
||||
|
||||
Reference in New Issue
Block a user