Skip to content

Commit

Permalink
feat: xlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtekgrinder committed Aug 30, 2024
1 parent 4e0fe04 commit 5c95319
Show file tree
Hide file tree
Showing 9 changed files with 1,342 additions and 9 deletions.
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

0 comments on commit 5c95319

Please sign in to comment.