Skip to content

Audit/omnistaking #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 441 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
441 commits
Select commit Hold shift + click to select a range
475d064
fix
Sep 27, 2024
28171f1
l2 arb tx
Sep 27, 2024
c5eb1bc
opt fix
Sep 27, 2024
8cc3b66
optimism script
Sep 28, 2024
ba02787
optimism adapter upgrade
Sep 28, 2024
69a10e2
l2 tests wip
inception-qa Sep 28, 2024
7b4dfb9
l2 tests wip
inception-qa Sep 28, 2024
bac55f6
sendAssetsInfoToL1 payable
Sep 28, 2024
7dc7e15
removed redundant events
Sep 28, 2024
88839e1
Merge pull request #69 from inceptionlrt/omnistaking-adapters-qa
paul-ilvez Sep 28, 2024
0607a77
NatSpec for crosschain-adapters
Sep 28, 2024
c17e8d1
events update
Sep 29, 2024
96dbe90
NatSpec finished
Sep 29, 2024
36a7080
deploy script
Oct 2, 2024
60b842b
omnistaking deployment
Oct 4, 2024
7d0a008
omnistaking deployment
Oct 4, 2024
1625143
checkpoints
Oct 4, 2024
4e88a50
deploymet script improved
Oct 4, 2024
c263673
l2 script start
Oct 4, 2024
4d462d8
upd
Oct 4, 2024
e6ecdfb
upd
Oct 4, 2024
d9ff2d9
introduce ArbRetryableTx
Oct 14, 2024
e0c0f88
additions
Oct 14, 2024
2b4b960
use of tar.gz for cross-reference
Oct 15, 2024
e79b041
fixes
Oct 15, 2024
d2d0e4c
fixes
Oct 15, 2024
a3af845
fixes
Oct 15, 2024
6a4f2e2
yarn lock fix
Oct 15, 2024
168bc7b
L1 tests updated
inception-qa Oct 16, 2024
1041102
fixes
Oct 16, 2024
3f95abb
fixes
Oct 16, 2024
c169eee
L2 tests wip
inception-qa Oct 16, 2024
917f035
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 16, 2024
0a30cde
receive() for iov
Oct 16, 2024
bfe92fc
removed bridge variable
Oct 16, 2024
e694335
L2 tests wip
inception-qa Oct 16, 2024
113caaa
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 16, 2024
151fd54
updates
Oct 16, 2024
2d28949
L2 tests done
inception-qa Oct 16, 2024
f892c47
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 16, 2024
ee5efd4
arbsys mock disabled
inception-qa Oct 16, 2024
420b743
fixes
Oct 16, 2024
7933b99
fix opt
Oct 17, 2024
3426b46
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 17, 2024
0992f0b
added some natspec
Oct 17, 2024
2456fb6
public variables
Oct 17, 2024
cb6932f
impot fixes
Oct 17, 2024
1d65896
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 17, 2024
a8ecae6
tests small updates
inception-qa Oct 17, 2024
7f2aa9d
Merge pull request #72 from inceptionlrt/omnistaking-adapters-qa
paul-ilvez Oct 17, 2024
611c65d
bridge-lz
Oct 20, 2024
c01ca99
bridge-lz subproject
Oct 20, 2024
edf03a0
scripts
Oct 20, 2024
b205560
deployment config
Oct 20, 2024
27e0369
crosschain-flow
Oct 21, 2024
80c04d0
crosschainAdapterL2
Oct 21, 2024
ae76b56
removed dummy contract
Oct 21, 2024
d1c2670
removed extra
Oct 21, 2024
b7ffe05
updated to openzeppelin-contract v5
Oct 21, 2024
d2109c7
ethers update
Oct 21, 2024
83911b0
merged TxStorage to Rebalancer
Oct 21, 2024
55022ec
added upgradeable lzbridge
Oct 23, 2024
08037cd
fixes
Oct 23, 2024
3265555
fix
Oct 23, 2024
e9f55a8
fixed crossChainBridge
Oct 23, 2024
93c1da5
unified bridge-adapter
Oct 23, 2024
5f87a83
fixes
Oct 23, 2024
e93558c
fixes
Oct 23, 2024
6ad5b61
fixes
Oct 23, 2024
9455e6f
l1 tests wip
inception-qa Oct 24, 2024
b7f9c50
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 24, 2024
d1d7e7f
fixes
Oct 24, 2024
8559f09
new inheritance graph
Oct 24, 2024
50f4f4c
fixes
Oct 24, 2024
210cdea
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 24, 2024
376c556
Tests for addRewards
inception-qa Oct 24, 2024
69e98d3
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 24, 2024
f3c52f3
rebalancer change
Oct 24, 2024
2c7f5aa
l1ChainId fix
Oct 25, 2024
e8b43b6
refactoring imports
Oct 25, 2024
76e145e
refactoring
Oct 25, 2024
0a30468
refactoring
Oct 25, 2024
1365d3b
small refactoring
Oct 25, 2024
79e50b7
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 25, 2024
48734a1
fixes
Oct 25, 2024
82ec766
fixes
Oct 25, 2024
334a261
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 25, 2024
23ef42d
fixes
Oct 25, 2024
f0b0870
fixes
Oct 25, 2024
5da0104
fixes
Oct 25, 2024
2457868
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 25, 2024
c2c8e8c
addChainId
Oct 25, 2024
ebbe909
Merge remote-tracking branch 'origin/omnistaking-adapters' into omnis…
inception-qa Oct 25, 2024
112e9c2
rename vault to targetReceiver
Oct 25, 2024
3d2b62a
removed redundant dependencies
inception-qa Oct 25, 2024
8e00e12
rename vault to targetReceiver
Oct 25, 2024
2807be5
added bytes _options parameter to quoteSendEth()
Oct 25, 2024
a989eb0
_sendValue param
Oct 25, 2024
0930dad
tests wip
inception-qa Oct 25, 2024
ef5f39e
Merge remote-tracking branch 'origin/omnistaking-adapters' into omniv…
inception-qa Oct 25, 2024
8f931de
temporary console.logs
Oct 25, 2024
512f4e1
Merge remote-tracking branch 'origin/omnistaking-adapters' into omniv…
inception-qa Oct 25, 2024
cc723ea
upd logs
Oct 25, 2024
71fab88
Merge remote-tracking branch 'origin/omnistaking-adapters' into omniv…
inception-qa Oct 25, 2024
fb52430
fix
Oct 25, 2024
9c8ea2e
fixes
Oct 25, 2024
e39309c
Merge remote-tracking branch 'origin/omnistaking-adapters' into omniv…
inception-qa Oct 25, 2024
10fb22d
onlyTargetReceiverRestricted
Oct 25, 2024
58e8831
yarn inside bridge-lz
Oct 25, 2024
b8398e8
call-on-opts update
Oct 25, 2024
b7aca92
emit in reblancer + deploy scripts for bridge
Oct 25, 2024
5c68c6b
tests l2->l1
inception-qa Oct 25, 2024
f6ad75f
flow test 1
Oct 25, 2024
65cfdd7
checkpoints
Oct 25, 2024
e96da36
fixes
Oct 25, 2024
66598b0
Merge remote-tracking branch 'origin/omnivault-tests-reverted' into o…
Oct 25, 2024
b8a51ec
fixes to call-send-eth
Oct 25, 2024
6ced302
scripts for xchain txs
Oct 25, 2024
2da2b6e
call scripts fixes
Oct 25, 2024
0c0b3d8
fixes
Oct 25, 2024
d1a8135
some minor comments
mellaught Oct 27, 2024
819cacb
tests for rebalancer
Oct 27, 2024
8975d19
test update
Oct 27, 2024
ff480fd
deploy script upd
Oct 27, 2024
46aa2d2
script updates
Oct 27, 2024
7006469
deployment addresses
Oct 27, 2024
5889a1a
how-to-deploy
Oct 27, 2024
ec8b3fe
how-to-deploy upd
Oct 27, 2024
5ef12b4
updated the omniVaults
mellaught Oct 28, 2024
c1732a2
Merge branch 'omnistaking-adapters' into audit/omnistaking
mellaught Oct 28, 2024
d6152e7
removed defunct projects
Oct 28, 2024
963882a
removed foundry test
Oct 28, 2024
2e61dd8
renaming inETH to inceptionToken
Oct 28, 2024
f5e82a8
some minor changes
mellaught Oct 28, 2024
187cecb
fixed test script
Oct 28, 2024
622f697
updated the test with the prettier conf
mellaught Oct 28, 2024
e94d263
added the prettier config in the ./tests
mellaught Oct 28, 2024
66de6a4
NatSpec addition
Oct 28, 2024
02829ed
added missig dependency
Oct 28, 2024
5bfe5a7
prettier
inception-qa Oct 28, 2024
9623961
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 28, 2024
0c88d7b
renamed Rebalancer to NativeRebalancer
Oct 28, 2024
9b0662b
restiction on addChain
Oct 28, 2024
2a52176
IOV send eth to any chain
Oct 28, 2024
3a0e52b
event name changed accordingly sendCrossChainEth
Oct 28, 2024
f2db5da
added options to Rebalancer sendCrossChainEth
Oct 28, 2024
213c7f0
changed event name
Oct 28, 2024
80b5546
added a requirement on the 0 fee
mellaught Oct 28, 2024
d6a5d9b
added readme.md
Oct 28, 2024
d2dc729
l2 tests wip
inception-qa Oct 28, 2024
08a4259
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 28, 2024
8f83262
rollbacked the changes for the calculateFlashUnstakeFee, calculateDep…
mellaught Oct 28, 2024
0ce5164
Merge remote-tracking branch 'origin/feat/omnivaults-tests' into omni…
inception-qa Oct 28, 2024
d22a837
function rename in IOV
Oct 28, 2024
8827910
fixed a typo
mellaught Oct 28, 2024
a7d6ece
Merge remote-tracking branch 'origin/feat/omnivaults-tests' into omni…
inception-qa Oct 28, 2024
a559aea
test update
Oct 28, 2024
185269b
l2 tests wip
inception-qa Oct 28, 2024
3179de2
updated restaking tests
Oct 28, 2024
4b66ca6
fixed modifier access in LZCrossChainAdapterL2
Oct 28, 2024
fc829a7
l2 tests wip
inception-qa Oct 28, 2024
fde658e
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 28, 2024
5bcb08b
contracts in tests to ignore
inception-qa Oct 28, 2024
31a18e3
MessageToL1Sent with pure ETH value
Oct 28, 2024
62891e6
updated .gitignore
Oct 28, 2024
d22f034
readme edit
Oct 28, 2024
31485ab
events and error update
Oct 29, 2024
5109b9a
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 29, 2024
787c1f6
l2 tests wip
inception-qa Oct 29, 2024
6715e3b
Revert "readme edit"
mellaught Oct 29, 2024
6059643
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 29, 2024
98ef957
quoteSendEthCrossChain returns only fees without value - to test
paul-ilvez Oct 29, 2024
bac9ebf
quoteSendEthCrossChain NatSpec
paul-ilvez Oct 29, 2024
1f5738e
removed FutureTimestamp error check
paul-ilvez Oct 29, 2024
58b4bae
l2 tests wip
inception-qa Oct 29, 2024
8884c8e
l2 tests wip
inception-qa Oct 29, 2024
953aa22
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 29, 2024
bfccbe7
bytes array fix
paul-ilvez Oct 29, 2024
f313fba
added rebalancer modifier
paul-ilvez Oct 29, 2024
e1b6633
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 29, 2024
66ed262
joined l1 and l2 tests
inception-qa Oct 29, 2024
c9e1c90
calculate fees working
paul-ilvez Oct 29, 2024
006f5ea
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 29, 2024
7a50cfb
updated quoteSendEth in NativeRebalancer
paul-ilvez Oct 29, 2024
4a92f1d
added self-test for L2
paul-ilvez Oct 29, 2024
9748497
tests wip2
inception-qa Oct 29, 2024
8165d3d
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 29, 2024
8cb93a7
main flow done
inception-qa Oct 29, 2024
8e5141d
deleteChainId deletes by chainId, not index
paul-ilvez Oct 30, 2024
bac2825
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 30, 2024
78b6de2
NatSpec changes in Reblancer
paul-ilvez Oct 30, 2024
e968c18
improved deleteChainId
paul-ilvez Oct 30, 2024
7fea7dd
deleteChainId
paul-ilvez Oct 30, 2024
1f4f4f2
external view getAdapter
paul-ilvez Oct 30, 2024
ce0d129
reordered external func
paul-ilvez Oct 30, 2024
64e6792
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 30, 2024
9d1c783
getAdapter optmz
paul-ilvez Oct 30, 2024
0f277cf
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 30, 2024
c71099d
display pure fees in CrossChainMessageSent
paul-ilvez Oct 30, 2024
f104789
removed redundant restriction
paul-ilvez Oct 30, 2024
f85c1ea
all chainIds are now uint256
paul-ilvez Oct 30, 2024
f0c3405
fixes to extract fees
paul-ilvez Oct 30, 2024
ec13f06
pure fees refactoring in IOV and Rebalancer
paul-ilvez Oct 30, 2024
5f63249
coverage wip
inception-qa Oct 30, 2024
80c34af
Merge remote-tracking branch 'origin/audit/omnistaking' into omnivaul…
inception-qa Oct 30, 2024
b8f6ab4
small updates
inception-qa Oct 31, 2024
125e795
small updates
inception-qa Oct 31, 2024
21a2e27
config fix; omniVault tests update
inception-qa Oct 31, 2024
3bd6b06
fixed the InceptionToken pausable functionality
mellaught Oct 31, 2024
d4513b9
prettier config
inception-qa Oct 31, 2024
a0492ad
WIP
mellaught Oct 31, 2024
b65b1a8
prettier config
inception-qa Oct 31, 2024
5053e14
fixed the omni vaults flash functionality
mellaught Oct 31, 2024
306cf4d
Merge remote-tracking branch 'origin/feat/omnivault-fixes' into omniv…
inception-qa Oct 31, 2024
8c865f3
inceptionVault tests updated
inception-qa Oct 31, 2024
03dcbf5
fixed the ZeroFlashWithdrawFee
mellaught Oct 31, 2024
ee19d06
omniVaultErc20 tests updated
inception-qa Oct 31, 2024
6ee224f
config uncommented
inception-qa Oct 31, 2024
bf70ade
redundant files removed
inception-qa Oct 31, 2024
2a66442
removed redundant files from bridge-lz, added lz dep to vaults
paul-ilvez Oct 31, 2024
84c16ae
pool takes rebalancer address from config;
inception-qa Nov 1, 2024
42ae67d
Fixed runs number
inception-qa Nov 1, 2024
768e395
Merge pull request #79 from inceptionlrt/omnivault-tests-reverted
mellaught Nov 5, 2024
9ead766
audit fixes except OwnableUpgradeable
Nov 5, 2024
426ba50
removed redundant dotenv from restaking-pool
Nov 5, 2024
bdc8dd0
Ownable2StepUpgradeable
Nov 5, 2024
c2346ca
small fixes
Nov 5, 2024
f497387
test updates 1
Nov 5, 2024
bcdef6f
fixed event back
Nov 5, 2024
9897f6e
new deployment scripts
Nov 9, 2024
3e6d676
added some scripts
Nov 11, 2024
565a092
sample app for crosschain testing
Nov 13, 2024
23d4871
sample app script
Nov 13, 2024
3f8cd73
root config fixes
Nov 14, 2024
e34b7cb
test deployment scripts upd
Nov 14, 2024
be6cef6
more scripts
Nov 22, 2024
6423fd2
added migration scripts from master
Nov 22, 2024
f989cd3
migration scripts
Nov 22, 2024
6469246
lzbridge address placeholder
Nov 22, 2024
30715a5
deployment scripts for l2
Nov 22, 2024
83aa2b6
Merge branch 'master' of https://github.com/inceptionlrt/smart-contra…
Nov 25, 2024
6b70ae3
replaced Genesis with InceptionLRT
Nov 25, 2024
888c343
sending value for lzReceive instead of total invoked msg.value
Nov 25, 2024
27f6910
updated to OZ library version 5.10
Nov 26, 2024
1e7a25e
hh config inheritance
Nov 26, 2024
8c1efa8
fix for options < 32 bytes
Nov 26, 2024
582c3f1
fixed event expectations
inception-qa Nov 26, 2024
9cd49cb
fixed getValueFromOpts
Nov 26, 2024
d1126c1
added eids
Nov 27, 2024
f6618c1
added eids for mainnets
Nov 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ typechain-types
# Hardhat files
cache
artifacts
*.bin
*.abi

# Inception LRT custom ignore
*.tgz
/projects/tests/omnivault-rebalancer/contracts/
36 changes: 36 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"arrowParens": "avoid",
"bracketSameLine": true,
"bracketSpacing": true,
"endOfLine": "crlf",
"semi": true,
"experimentalTernaries": false,
"singleQuote": false,
"jsxSingleQuote": false,
"quoteProps": "as-needed",
"trailingComma": "all",
"singleAttributePerLine": false,
"htmlWhitespaceSensitivity": "css",
"vueIndentScriptAndStyle": false,
"proseWrap": "preserve",
"insertPragma": false,
"printWidth": 120,
"requirePragma": false,
"tabWidth": 2,
"useTabs": false,
"embeddedLanguageFormatting": "auto",
"plugins": ["prettier-plugin-solidity"],
"overrides": [
{
"files": "*.sol",
"options": {
"parser": "solidity-parse",
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
}
]
}
Binary file added OmniStaking_Architecture.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
![OmniStaking Architecture](./OmniStaking_Architecture.jpg)

# OmniStaking

OmniStaking is a cross-chain staking system designed to maintain the balance of Inception Tokens across Layer 1 (L1) and multiple Layer 2 (L2) networks. By managing both data and ETH transfers between chains, OmniStaking ensures that the protocol maintains a consistent supply of Inception Tokens across all deployed chains, creating a unified and decentralized staking ecosystem.

## Overview

OmniStaking operates through a sequence of cross-chain communications involving several key contracts and components:

1. **InceptionOmniVault**: This contract initiates the transfer process. Operators (backend) interact with it to send either:
- **Data Messages**: For reporting asset balances, using `sendAssetsInfoToL1()`.
- **ETH Transfers**: For transferring ETH across chains, using `sendEthCrossChain()`.

2. **LZCrossChainAdapterL2**: This contract, specific to L2 chains, is responsible for processing and transmitting cross-chain messages. It receives calls from `InceptionOmniVault` and initiates cross-chain transfers using the LayerZero protocol.

3. **LZCrossChainAdapterL1**: After a specified delay (e.g., 7 days for mainnets or 20 minutes for testnets), messages or ETH transfers from L2 arrive at this L1 contract. Here, the contract:
- Decodes data messages.
- Relays the decoded information or ETH to the **NativeRebalancer**.

4. **NativeRebalancer**: This L1 contract aggregates data from all L2 chains. When data from each L2 is received, users can call `updateTreasuryData` on **NativeRebalancer**. This function recalculates the token supply, minting or burning tokens to maintain the invariant:

$$
\text{sum(Inception Tokens on L2s)} = \text{Inception Tokens on L1}
$$

## Message Flow

### L2 to L1 (Data and ETH Transfer)

1. **Data Transfer**:
- The operator calls `sendAssetsInfoToL1()` on **InceptionOmniVault**.
- This data message is forwarded to **LZCrossChainAdapterL2**, which encodes and sends the data across chains.

2. **ETH Transfer**:
- The operator initiates `sendEthCrossChain()` on **InceptionOmniVault**.
- **LZCrossChainAdapterL2** processes and sends the ETH transfer request to **LZCrossChainAdapterL1**.

### L1 Reception and Balancing

After the specified waiting period, **LZCrossChainAdapterL1** receives the cross-chain message or ETH transfer:

1. **Data Message**: **LZCrossChainAdapterL1** decodes the data and relays it to **NativeRebalancer**.
2. **ETH Transfer**: The ETH is directly forwarded as specified in the initial transfer request.

Once all L2 data has been received, users call `updateTreasuryData()` on **NativeRebalancer**, which mints or burns Inception Tokens on L1 as needed to ensure cross-chain token balance.

## Components

- **InceptionOmniVault**: Initiates L2 to L1 cross-chain transfers.
- **LZCrossChainAdapterL2**: Manages cross-chain messaging from L2 to L1.
- **LZCrossChainAdapterL1**: Receives and processes messages or ETH on L1.
- **NativeRebalancer**: Maintains the Inception Token invariant across chains by adjusting L1 supply.

## Invariant Guarantee

OmniStaking maintains the invariant:

$$
\text{sum(Inception Tokens on L2s)} = \text{Inception Tokens on L1}
$$


This ensures that the total supply of Inception Tokens is balanced across all chains in the OmniStaking ecosystem.
96 changes: 92 additions & 4 deletions hh.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,74 @@ export const CONFIG = {
gas: 8000000,
gasPrice,
accounts,
eid: 30101
},
holesky: {
url: process.env.HOLESKY_RPC || "https://rpc.ankr.com/eth_holesky",
chainId: 17000,
gasPrice,
gas: 8000000,
gasPrice,
accounts,
eid: 40217,
verify: {
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
apiUrl: "https://api-holesky.etherscan.io",
},
},
},
arbitrum: {
url: process.env.RPC_URL_ARBITRUM,
chainId: 42161,
gas: 8000000,
gasPrice,
accounts,
eid: 30110,
},
sepolia: {
url: process.env.RPC_URL_SEPOLIA,
chainId: 11155111,
gas: 800000,
gasPrice,
accounts,
eid: 40161,
verify: {
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
apiUrl: "https://api-sepolia.etherscan.io",
},
},
},
optimism: {
url: process.env.RPC_URL_OPTIMISM,
chainId: 10,
gas: 8000000,
gasPrice,
accounts,
eid: 30111,
verify: {
etherscan: {
apiKey: process.env.OPTIMISM_API_KEY,
apiUrl: "https://api-optimistic.etherscan.io/api",
},
},
},
arbitrumSepolia: {
url: process.env.RPC_URL_ARBITRUM_TESTNET,
chainId: 421614,
gas: 8000000,
gasPrice,
accounts,
eid: 40231,
},
optimismSepolia: {
url: process.env.RPC_URL_OPTIMISM_SEPOLIA,
chainId: 11155420,
gas: 8000000,
gasPrice,
accounts,
eid: 40232,
},
local: {
url: process.env.LOCAL_RPC || "http://127.0.0.1:8545",
chainId: 1337,
Expand All @@ -35,8 +89,20 @@ export const CONFIG = {
},
hardhat: {
forking: {
url: `${process.env.MAINNET_RPC}`,
blockNumber: 20871635,
url: `${process.env.RPC_URL_SEPOLIA}`,
},
accounts: process.env.DEPLOYER_PRIVATE_KEY
? [{ privateKey: process.env.DEPLOYER_PRIVATE_KEY, balance: "10000000000000000000" }]
: []
},
},
solidity: {
version: "0.8.26",
settings: {
viaIR: true,
optimizer: {
enabled: true,
runs: 200,
},
},
},
Expand Down Expand Up @@ -83,8 +149,13 @@ export const CONFIG = {
},
etherscan: {
apiKey: {
holesky: "PP5CDPZBG6AF6FBGE9CJNYGCRYXYN549M1",
holesky: process.env.HOLESKY_ETHERSCAN_API_KEY,
mainnet: process.env.ETHERSCAN_API_KEY,
sepolia: process.env.ETHERSCAN_API_KEY,
arbitrum: process.env.ARBISCAN_API_KEY,
arbitrumSepolia: process.env.ARBISCAN_API_KEY,
optimism: process.env.OPTIMISM_API_KEY,
optimismSepolia: process.env.OPTIMISM_API_KEY,
},
customChains: [
{
Expand All @@ -95,6 +166,23 @@ export const CONFIG = {
browserURL: "https://holesky.etherscan.io",
},
},
{
network: "arbitrumSepolia",
chainId: 421614,
urls: {
apiURL: "https://api-sepolia.arbiscan.io/api",
browserURL: "https://sepolia.arbiscan.io",
},
},

{
network: "optimismSepolia",
chainId: 11155420,
urls: {
apiURL: "https://api-sepolia-optimistic.etherscan.io/api",
browserURL: "https://sepolia-optimism.etherscan.io/",
},
},
],
},
sourcify: {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"license": "MIT",
"private": true,
"scripts": {
"prettier:sol": "prettier --write --plugin=prettier-plugin-solidity './**/*.sol'",
"prettier:sol": "prettier --write --plugin=prettier-plugin-solidity ./**/*.sol",
"prettier:ts": "prettier --write ./**/*.ts",
"prettier:js": "prettier --write ./**/*.js"
}
}
}
4 changes: 4 additions & 0 deletions projects/bridge-lz/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DEPLOYER_PRIVATE_KEY=
RPC_URL_SEPOLIA=
RPC_URL_ARBITRUM_SEPOLIA=
RPC_URL_OPTIMISM_SEPOLIA=
17 changes: 17 additions & 0 deletions projects/bridge-lz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
node_modules
.env
coverage
coverage.json
typechain
typechain-types

# Hardhat files
cache
artifacts
*.bin
*.abi

# Inception LRT custom ignore
deployment_checkpoint.json
*.tgz
deployments
1 change: 1 addition & 0 deletions projects/bridge-lz/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.18.0
10 changes: 10 additions & 0 deletions projects/bridge-lz/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
artifacts/
cache/
dist/
node_modules/
out/
*.log
*ignore
*.yaml
*.lock
package-lock.json
3 changes: 3 additions & 0 deletions projects/bridge-lz/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// module.exports = {
// ...require('@layerzerolabs/prettier-config-next'),
// };
Loading