-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated scripts to write and read from single json for one token
- Loading branch information
Showing
15 changed files
with
501 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"chains": { | ||
"10": { | ||
"chainId": 10, | ||
"erc20Address": "0x0000000000000000000000000000000000000000", | ||
"isL1": false, | ||
"lzEID": 30111, | ||
"lzEndpoint": "0x6EDCE65403992e310A62460808c4b910D972f10f", | ||
"multiChainDeployer": "0x5Eea17c4588348fCAD6aE8Ec00EAb447A139B04D", | ||
"oftAdapter": "0x0000000000000000000000000000000000000000" | ||
} | ||
}, | ||
"deployerAddress": "0x19a8eb80c1483CEAA1278B16C5D5eF0104F85905" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.24; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
|
||
contract BaseData is Script { | ||
struct Addresses { | ||
address OFT_DELEGATE; | ||
address TOKEN_ADMIN; | ||
address PROXY_ADMIN; | ||
address LZ_ENDPOINT; | ||
} | ||
|
||
struct ChainIds { | ||
uint256 mainnet; | ||
uint256 base; | ||
uint256 optimism; | ||
uint256 arbitrum; | ||
uint256 fraxtal; | ||
uint256 holesky; | ||
uint256 fraxtalTestnet; | ||
} | ||
|
||
mapping(bool => Addresses) private __addresses; // isTestnet => Actors | ||
|
||
mapping(uint256 => uint32) private __chainIdToLzEID; | ||
|
||
ChainIds private __chainIds = ChainIds({ | ||
mainnet: 1, | ||
base: 8453, | ||
optimism: 10, | ||
arbitrum: 42161, | ||
fraxtal: 252, | ||
holesky: 17000, | ||
fraxtalTestnet: 2522 | ||
}); | ||
|
||
function setUp() public virtual { | ||
// mainnets | ||
__addresses[true] = Addresses({ | ||
OFT_DELEGATE: 0xfcad670592a3b24869C0b51a6c6FDED4F95D6975, // yn security council | ||
TOKEN_ADMIN: 0xfcad670592a3b24869C0b51a6c6FDED4F95D6975, | ||
PROXY_ADMIN: 0xfcad670592a3b24869C0b51a6c6FDED4F95D6975, | ||
LZ_ENDPOINT: 0x1a44076050125825900e736c501f859c50fE728c | ||
}); | ||
|
||
// testnets | ||
__addresses[false] = Addresses({ | ||
OFT_DELEGATE: 0x743b91CDB1C694D4F51bCDA3a4A59DcC0d02b913, // yn security council | ||
TOKEN_ADMIN: 0x743b91CDB1C694D4F51bCDA3a4A59DcC0d02b913, | ||
PROXY_ADMIN: 0x743b91CDB1C694D4F51bCDA3a4A59DcC0d02b913, | ||
LZ_ENDPOINT: 0x6EDCE65403992e310A62460808c4b910D972f10f | ||
}); | ||
|
||
__chainIdToLzEID[__chainIds.mainnet] = 30101; | ||
__chainIdToLzEID[__chainIds.base] = 30184; | ||
__chainIdToLzEID[__chainIds.optimism] = 30111; | ||
__chainIdToLzEID[__chainIds.arbitrum] = 30110; | ||
__chainIdToLzEID[__chainIds.fraxtal] = 30255; | ||
|
||
__chainIdToLzEID[__chainIds.holesky] = 40217; | ||
__chainIdToLzEID[__chainIds.fraxtalTestnet] = 40255; | ||
} | ||
|
||
function getAddresses() internal view returns (Addresses storage) { | ||
require(isSupportedChainId(block.chainid), "BaseData: unsupported chainId"); | ||
return __addresses[isTestnet()]; | ||
} | ||
|
||
function getEID(uint256 chainId) internal view returns (uint32) { | ||
require(isSupportedChainId(chainId), "BaseData: unsupported chainId"); | ||
return __chainIdToLzEID[chainId]; | ||
} | ||
|
||
function isSupportedChainId(uint256 chainId) internal view returns (bool) { | ||
bool isSupported = chainId == __chainIds.mainnet || chainId == __chainIds.base || chainId == __chainIds.fraxtal | ||
|| chainId == __chainIds.optimism || chainId == __chainIds.arbitrum || chainId == __chainIds.holesky | ||
|| chainId == __chainIds.fraxtalTestnet; | ||
bool isEID = __chainIdToLzEID[chainId] != 0; | ||
return isSupported && isEID; | ||
} | ||
|
||
function isTestnet() internal view returns (bool) { | ||
return block.chainid == __chainIds.holesky || block.chainid == __chainIds.fraxtalTestnet; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.