Skip to content

Commit 55c41d9

Browse files
0xIrynaPierrickGT
authored andcommitted
script: deploy SwapFacility to Linea
1 parent 38053cb commit 55c41d9

8 files changed

Lines changed: 314 additions & 1 deletion

File tree

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export LOCALHOST_RPC_URL=http://127.0.0.1:8545
33

44
# Mainnet RPC URLs
55
export MAINNET_RPC_URL=
6+
export LINEA_RPC_URL=
67

78
# Testnet RPC URLs
89
export SEPOLIA_RPC_URL=

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ deploy-swap-facility-mainnet: deploy-swap-facility
9999
deploy-swap-facility-sepolia: RPC_URL=$(SEPOLIA_RPC_URL)
100100
deploy-swap-facility-sepolia: deploy-swap-facility
101101

102+
deploy-swap-facility-linea: RPC_URL=$(LINEA_RPC_URL)
103+
deploy-swap-facility-linea: deploy-swap-facility
104+
102105
upgrade-swap-facility:
103106
FOUNDRY_PROFILE=production PRIVATE_KEY=$(PRIVATE_KEY) \
104107
forge script script/upgrade/UpgradeSwapFacility.s.sol:UpgradeSwapFacility \

broadcast/DeploySwapFacility.s.sol/59144/run-1754962087.json

Lines changed: 70 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeploySwapFacility.s.sol/59144/run-latest.json

Lines changed: 218 additions & 0 deletions
Large diffs are not rendered by default.

deployments/59144.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extensionAddresses": [],
3+
"extensionNames": [],
4+
"swapAdapter": "0x0000000000000000000000000000000000000000",
5+
"swapFacility": "0xB6807116b3B1B321a390594e31ECD6e0076f6278"
6+
}

foundry.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ depth = 250
4242
localhost = "${LOCALHOST_RPC_URL}"
4343
mainnet = "${MAINNET_RPC_URL}"
4444
sepolia = "${SEPOLIA_RPC_URL}"
45+
linea = "${LINEA_RPC_URL}"
4546

4647
[etherscan]
4748
mainnet = { key = "${ETHERSCAN_API_KEY}", url = "https://api.etherscan.io/api" }

script/Config.sol

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ contract Config {
3535
uint256 public constant ETHEREUM_CHAIN_ID = 1;
3636
uint256 public constant ARBITRUM_CHAIN_ID = 42161;
3737
uint256 public constant OPTIMISM_CHAIN_ID = 10;
38+
uint256 public constant LINEA_CHAIN_ID = 59144;
3839

3940
// Testnet chain IDs
4041
uint256 public constant LOCAL_CHAIN_ID = 31337;
@@ -90,6 +91,15 @@ contract Config {
9091
return config;
9192
}
9293

94+
if (chainId_ == LINEA_CHAIN_ID) {
95+
config.mToken = M_TOKEN;
96+
config.wrappedMToken = address(0);
97+
config.registrar = REGISTRAR;
98+
config.uniswapV3Router = address(0);
99+
config.admin = address(0xF2f1ACbe0BA726fEE8d75f3E32900526874740BB);
100+
return config;
101+
}
102+
93103
// Testnet configs
94104
if (chainId_ == LOCAL_CHAIN_ID) {
95105
config.mToken = M_TOKEN;

script/ScriptBase.s.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ contract ScriptBase is Script, Config {
5959
function _writeDeployment(uint256 chainId_, string memory key_, address value_) internal {
6060
string memory root = "";
6161

62-
Deployments memory deployments_ = _readDeployment(chainId_);
62+
Deployments memory deployments_;
63+
64+
if (vm.isFile(_deployOutputPath(chainId_))) {
65+
deployments_ = _readDeployment(chainId_);
66+
}
6367

6468
if (
6569
keccak256(bytes(key_)) != keccak256(bytes("swapAdapter")) &&

0 commit comments

Comments
 (0)