Skip to content

Commit

Permalink
Merge pull request #10 from yieldnest/feature/extra-chains
Browse files Browse the repository at this point in the history
Feature/extra chains
  • Loading branch information
danoctavian authored Oct 9, 2024
2 parents 8bd2a7a + 1331e63 commit 3945ec2
Show file tree
Hide file tree
Showing 10 changed files with 733 additions and 8 deletions.
17 changes: 17 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ BASESCAN_API_KEY=
FRAXSCAN_API_KEY=
MORPHSCAN_API_KEY=

MANTASCAN_API_KEY=
TAIKOSCAN_API_KEY=
SCROLLSCAN_API_KEY=
FANTOMSCAN_API_KEY=
MANTLESCAN_API_KEY=
BLASTSCAN_API_KEY=
LINEASCAN_API_KEY=


# for testing and deploying the contracts please use full arhcival nodes
BASE_RPC_URL=
ARBITRUM_RPC_URL=
Expand All @@ -16,6 +25,14 @@ SEPOLIA_RPC_URL=
MAINNET_RPC_URL=
FRAX_TESTNET_RPC_URL=
MORPH_TESTNET_RPC_URL=
MANTA_RPC_URL=
TAIKO_RPC_URL=
SCROLL_RPC_URL=
FANTOM_RPC_URL=
MANTLE_RPC_URL=
BLAST_RPC_URL=
LINEA_RPC_URL=


# for use with cast wallet. store the deployer private key in the keystore and put the public address here.
DEPLOYER_ACCOUNT_NAME=
Expand Down
19 changes: 17 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,33 @@ arbitrum = "${ARBITRUM_RPC_URL}"
optimism = "${OPTIMISM_RPC_URL}"
base = "${BASE_RPC_URL}"
fraxtal = "${FRAX_RPC_URL}"
manta = "${MANTA_RPC_URL}"
taiko = "${TAIKO_RPC_URL}"
scroll = "${SCROLL_RPC_URL}"
fantom = "${FANTOM_RPC_URL}"
mantle = "${MANTLE_RPC_URL}"
blast = "${BLAST_RPC_URL}"
linea = "${LINEA_RPC_URL}"

holesky = "${HOLESKY_RPC_URL}"
sepolia = "${SEPOLIA_RPC_URL}"
fraxtal_testnet = "${FRAX_TESTNET_RPC_URL}"
morph_testnet = "${MORPH_TESTNET_RPC_URL}"

[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY}" }
arbitrum = { key = "${ARBISCAN_API_KEY}" }
optimism = { key = "${OPTIMISTIC_ETHERSCAN_API_KEY}" }
arbitrum = { key = "${ARBISCAN_API_KEY}", url = "https://api.arbiscan.io/api/" }
optimism = { key = "${OPTIMISTIC_ETHERSCAN_API_KEY}", url = "https://api-optimistic.etherscan.io/api" }
base = { key = "${BASESCAN_API_KEY}", url = "https://api.basescan.org/api/" }
holesky = { key = "${ETHERSCAN_API_KEY}" }
sepolia = { key = "${ETHERSCAN_API_KEY}" }
fraxtal = { key = "${FRAXSCAN_API_KEY}", url = "https://api.fraxscan.io/api/" }
fraxtal_testnet = { key = "${FRAXSCAN_API_KEY}", url = "https://api-holesky.fraxscan.io/api/" }
morph_testnet = { key = "${MORPHSCAN_API_KEY}", url = "https://explorer-api-holesky.morphl2.io/api/" }
scroll = { key = "${SCROLLSCAN_API_KEY}", url = "https://api.scrollscan.com/" }
fantom = { key = "${FANTOMSCAN_API_KEY}", url = "https://api.ftmscan.com/api/" }
taiko = { key = "${TAIKOSCAN_API_KEY}", url = "https://api.taikoscan.io/api" }
mantle = { key = "${MANTLESCAN_API_KEY}", url = "https://explorer.mantle.xyz/api/" }
blast = { key = "${BLASTSCAN_API_KEY}", url = "https://api.blastscan.io/api/" }
linea = { key = "${LINEASCAN_API_KEY}", url = "https://api.lineascan.build/api/" }

73 changes: 71 additions & 2 deletions script/BaseData.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ contract BaseData is Script {
uint256 optimism;
uint256 arbitrum;
uint256 fraxtal;
uint256 manta;
uint256 taiko;
uint256 scroll;
uint256 fantom;
uint256 mantle;
uint256 blast;
uint256 linea;
// testnets
uint256 holesky;
uint256 sepolia;
uint256 fraxtalTestnet;
Expand All @@ -33,6 +41,14 @@ contract BaseData is Script {
optimism: 10,
arbitrum: 42161,
fraxtal: 252,
manta: 169,
taiko: 167000,
scroll: 534352,
fantom: 250,
mantle: 5000,
blast: 81457,
linea: 59144,
// testnets
holesky: 17000,
sepolia: 11155111,
fraxtalTestnet: 2522,
Expand Down Expand Up @@ -86,6 +102,56 @@ contract BaseData is Script {
LZ_EID: 30255
});

__chainIdToData[__chainIds.manta] = Data({
OFT_OWNER: TEMP_GNOSIS_SAFE,
TOKEN_ADMIN: TEMP_GNOSIS_SAFE,
PROXY_ADMIN: TEMP_PROXY_CONTROLLER,
LZ_ENDPOINT: 0x1a44076050125825900e736c501f859c50fE728c,
LZ_EID: 30217
});
__chainIdToData[__chainIds.taiko] = Data({
OFT_OWNER: TEMP_GNOSIS_SAFE,
TOKEN_ADMIN: TEMP_GNOSIS_SAFE,
PROXY_ADMIN: TEMP_PROXY_CONTROLLER,
LZ_ENDPOINT: 0x1a44076050125825900e736c501f859c50fE728c,
LZ_EID: 30290
});
__chainIdToData[__chainIds.scroll] = Data({
OFT_OWNER: TEMP_GNOSIS_SAFE,
TOKEN_ADMIN: TEMP_GNOSIS_SAFE,
PROXY_ADMIN: TEMP_PROXY_CONTROLLER,
LZ_ENDPOINT: 0x1a44076050125825900e736c501f859c50fE728c,
LZ_EID: 30214
});
__chainIdToData[__chainIds.fantom] = Data({
OFT_OWNER: TEMP_GNOSIS_SAFE,
TOKEN_ADMIN: TEMP_GNOSIS_SAFE,
PROXY_ADMIN: TEMP_PROXY_CONTROLLER,
LZ_ENDPOINT: 0x1a44076050125825900e736c501f859c50fE728c,
LZ_EID: 30112
});
__chainIdToData[__chainIds.mantle] = Data({
OFT_OWNER: TEMP_GNOSIS_SAFE,
TOKEN_ADMIN: TEMP_GNOSIS_SAFE,
PROXY_ADMIN: TEMP_PROXY_CONTROLLER,
LZ_ENDPOINT: 0x1a44076050125825900e736c501f859c50fE728c,
LZ_EID: 30181
});
__chainIdToData[__chainIds.blast] = Data({
OFT_OWNER: TEMP_GNOSIS_SAFE,
TOKEN_ADMIN: TEMP_GNOSIS_SAFE,
PROXY_ADMIN: TEMP_PROXY_CONTROLLER,
LZ_ENDPOINT: 0x1a44076050125825900e736c501f859c50fE728c,
LZ_EID: 30243
});
__chainIdToData[__chainIds.linea] = Data({
OFT_OWNER: TEMP_GNOSIS_SAFE,
TOKEN_ADMIN: TEMP_GNOSIS_SAFE,
PROXY_ADMIN: TEMP_PROXY_CONTROLLER,
LZ_ENDPOINT: 0x1a44076050125825900e736c501f859c50fE728c,
LZ_EID: 30183
});

// testnets
__chainIdToData[__chainIds.holesky] = Data({
OFT_OWNER: TEMP_GNOSIS_SAFE,
Expand Down Expand Up @@ -142,8 +208,11 @@ contract BaseData is Script {

function isSupportedChainId(uint256 chainId) internal view returns (bool isSupported) {
isSupported = chainId == __chainIds.mainnet || chainId == __chainIds.base || chainId == __chainIds.fraxtal
|| chainId == __chainIds.optimism || chainId == __chainIds.arbitrum || chainId == __chainIds.holesky
|| chainId == __chainIds.fraxtalTestnet || chainId == __chainIds.sepolia
|| chainId == __chainIds.optimism || chainId == __chainIds.arbitrum || chainId == __chainIds.manta
|| chainId == __chainIds.taiko || chainId == __chainIds.scroll || chainId == __chainIds.fantom
|| chainId == __chainIds.mantle || chainId == __chainIds.blast || chainId == __chainIds.linea
// testnets
|| chainId == __chainIds.holesky || chainId == __chainIds.fraxtalTestnet || chainId == __chainIds.sepolia
|| chainId == __chainIds.morphTestnet;
}

Expand Down
21 changes: 21 additions & 0 deletions script/BatchScript.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,27 @@ abstract contract BatchScript is Script {
} else if (chainId == 2810) {
SAFE_API_BASE_URL = "";
SAFE_MULTISEND_ADDRESS = 0x998739BFdAAdde7C933B942a68053933098f9EDa;
} else if (chainId == 169) {
SAFE_API_BASE_URL = "";
SAFE_MULTISEND_ADDRESS = 0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761;
} else if (chainId == 167000) {
SAFE_API_BASE_URL = "";
SAFE_MULTISEND_ADDRESS = 0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761;
} else if (chainId == 534352) {
SAFE_API_BASE_URL = "";
SAFE_MULTISEND_ADDRESS = 0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761;
} else if (chainId == 250) {
SAFE_API_BASE_URL = "";
SAFE_MULTISEND_ADDRESS = 0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761;
} else if (chainId == 5000) {
SAFE_API_BASE_URL = "";
SAFE_MULTISEND_ADDRESS = 0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761;
} else if (chainId == 81457) {
SAFE_API_BASE_URL = "";
SAFE_MULTISEND_ADDRESS = 0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761;
} else if (chainId == 59144) {
SAFE_API_BASE_URL = "";
SAFE_MULTISEND_ADDRESS = 0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761;
} else {
revert("Unsupported chain");
}
Expand Down
21 changes: 21 additions & 0 deletions script/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,27 @@ function getRPC() {
252)
echo "fraxtal"
;;
169)
echo "manta"
;;
167000)
echo "taiko"
;;
534352)
echo "scroll"
;;
250)
echo "fantom"
;;
5000)
echo "mantle"
;;
81457)
echo "blast"
;;
59144)
echo "linea"
;;
17000)
echo "holesky"
;;
Expand Down
2 changes: 1 addition & 1 deletion script/inputs/mainnet-ynETH.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"l1ChainId": 1,
"l2ChainIds": [
10,
8453
42161
],
"l1ERC20Address": "0x09db87A538BD693E9d08544577d5cCfAA6373A48",
"rateLimitConfig": {
Expand Down
4 changes: 2 additions & 2 deletions src/L2YnERC20Upgradeable.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "src/external/AccessControlUpgradeable.sol";
import "src/external/ERC20Upgradeable.sol";

import {IMintableBurnableERC20} from "@/interfaces/IMintableBurnableERC20.sol";

Expand Down
Loading

0 comments on commit 3945ec2

Please sign in to comment.