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

feat: xlayer #28

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions contracts/implementations/xlayer/AngleRouterXlayer.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.17;

import "../../BaseRouter.sol";

/// @title AngleRouterXlayer
/// @author Angle Core Team
/// @notice Router contract built specifially for Angle use cases on Xlayer
contract AngleRouterXlayer is BaseRouter {
/// @inheritdoc BaseRouter
function _getNativeWrapper() internal pure override returns (IWETH9) {
return IWETH9(0xe538905cf8410324e03A5A23C1c177a474D59b2b);
}
}
4 changes: 4 additions & 0 deletions deploy/networks/xlayer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"oneInchRouter": "0x0000000000000000000000000000000000000000",
"uniswapV3Router": "0x0000000000000000000000000000000000000000"
}
16 changes: 7 additions & 9 deletions deploy/routerDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,28 @@ const func: DeployFunction = async ({ ethers, deployments, network }) => {
let chainName: string;

if (!network.live) {
chainId = ChainId.LINEA;
chainName = 'Linea';
chainId = ChainId.XLAYER;
chainName = 'Xlayer';
} else {
chainId = ChainId.LINEA;
chainId = ChainId.XLAYER;
chainName = network.name.charAt(0).toUpperCase() + network.name.substring(1);
}

const contractName = `AngleRouter${chainName}`;

console.log('Now deploying the implementation');
/*
await deploy(`${contractName}V3_0_Implementation`, {
contract: contractName,
from: deployer.address,
log: !argv.ci,
});
*/

const routerImplementation = (await ethers.getContract(`${contractName}V3_0_Implementation`)).address;
console.log(`Successfully deployed the implementation for the router at ${routerImplementation}`);

const proxyAdmin = registry(chainId)?.ProxyAdminGuardian;
const proxyAdmin = registry(chainId)?.ProxyAdminAngleLabs;
const coreBorrow = registry(chainId)?.CoreBorrow;
// const coreBorrow = "0x4b1E2c2762667331Bc91648052F646d1b0d35984";

console.log(proxyAdmin, coreBorrow);
console.log('Now deploying the proxy contract');
const dataRouter = new ethers.Contract(
Expand All @@ -53,8 +51,8 @@ const func: DeployFunction = async ({ ethers, deployments, network }) => {
args: [routerImplementation, proxyAdmin, dataRouter],
log: !argv.ci,
});
const router = (await deployments.get(`${contractName}V2`)).address;
console.log(`Successfully deployed ${contractName}V2 at the address ${router}`);
const router = (await deployments.get(`${contractName}V3`)).address;
console.log(`Successfully deployed ${contractName}V3 at the address ${router}`);

console.log(`${router} ${routerImplementation} ${proxyAdmin} ${dataRouter}`);
console.log('');
Expand Down
1 change: 1 addition & 0 deletions deployments/xlayer/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
196
247 changes: 247 additions & 0 deletions deployments/xlayer/AngleRouterXlayerV3.json

Large diffs are not rendered by default.

Loading
Loading