Skip to content

Commit

Permalink
fix: linea router
Browse files Browse the repository at this point in the history
  • Loading branch information
sogipec committed Jul 18, 2024
1 parent 1ce56ee commit 94a60d1
Show file tree
Hide file tree
Showing 11 changed files with 1,601 additions and 43 deletions.
15 changes: 15 additions & 0 deletions contracts/implementations/linea/AngleRouterLinea.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 AngleRouterLinea
/// @author Angle Core Team
/// @notice Router contract built specifially for Angle use cases on Linea
contract AngleRouterLinea is BaseRouter {
/// @inheritdoc BaseRouter
function _getNativeWrapper() internal pure override returns (IWETH9) {
return IWETH9(0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f);
}
}
4 changes: 4 additions & 0 deletions deploy/networks/linea.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"oneInchRouter": "0x0000000000000000000000000000000000000000",
"uniswapV3Router": "0x0000000000000000000000000000000000000000"
}
14 changes: 8 additions & 6 deletions deploy/routerDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,38 @@ const func: DeployFunction = async ({ ethers, deployments, network }) => {
let chainName: string;

if (!network.live) {
chainId = ChainId.GNOSIS;
chainName = 'Base';
chainId = ChainId.LINEA;
chainName = 'Linea';
} else {
chainId = ChainId.MAINNET;
chainId = ChainId.LINEA;
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 coreBorrow = registry(chainId)?.CoreBorrow;
// const coreBorrow = "0x4b1E2c2762667331Bc91648052F646d1b0d35984";
console.log(proxyAdmin, coreBorrow);
console.log('Now deploying the proxy contract');
const dataRouter = new ethers.Contract(
routerImplementation,
AngleRouterPolygon__factory.createInterface(),
).interface.encodeFunctionData('initializeRouter', [coreBorrow, json.uniswapV3Router, json.oneInchRouter]);

await deploy(`${contractName}V2`, {
await deploy(`${contractName}V3`, {
contract: 'TransparentUpgradeableProxy',
from: deployer.address,
args: [routerImplementation, proxyAdmin, dataRouter],
Expand All @@ -56,7 +59,6 @@ const func: DeployFunction = async ({ ethers, deployments, network }) => {
console.log(`${router} ${routerImplementation} ${proxyAdmin} ${dataRouter}`);
console.log('');
console.log('Success');
*/
};

func.tags = ['router'];
Expand Down
1 change: 1 addition & 0 deletions deployments/linea/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
59144
247 changes: 247 additions & 0 deletions deployments/linea/AngleRouterLineaV2.json

Large diffs are not rendered by default.

247 changes: 247 additions & 0 deletions deployments/linea/AngleRouterLineaV3.json

Large diffs are not rendered by default.

Loading

0 comments on commit 94a60d1

Please sign in to comment.