Skip to content
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

L1 to L3 Bridgers #353

Closed
wants to merge 89 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
ed2fac0
teleporter
godzillaba Oct 2, 2023
b5896f8
rename
godzillaba Oct 2, 2023
4d74fb5
fmt
godzillaba Oct 2, 2023
0ba6bcb
waitForDeposit
godzillaba Oct 2, 2023
6bddbd3
stub relayer related functions
godzillaba Oct 2, 2023
9619e30
wip: relayer related functions
godzillaba Oct 2, 2023
a820671
start types refactor
godzillaba Oct 3, 2023
7119f0a
types look better
godzillaba Oct 3, 2023
752dd2f
...
godzillaba Oct 3, 2023
90b4655
start to split into 3 classes
godzillaba Oct 3, 2023
3b8b600
class split done
godzillaba Oct 3, 2023
2c6fbf7
rename some types
godzillaba Oct 3, 2023
d121bbc
reorganize tests
godzillaba Oct 4, 2023
772ca7e
untested eth bridger
godzillaba Oct 4, 2023
22b4956
happy path eth bridge test
godzillaba Oct 4, 2023
a36a232
deposit state for erc20 bridger
godzillaba Oct 4, 2023
d9dafb5
add note about race condition
godzillaba Oct 4, 2023
26f8758
add randomNonce
godzillaba Oct 5, 2023
341d4f8
untested relayed erc20 bridger
godzillaba Oct 6, 2023
6ca5701
relayed e2e happy path works
godzillaba Oct 6, 2023
ece6ade
cache
godzillaba Oct 6, 2023
7dafe6d
to is optional, remove caching
godzillaba Oct 9, 2023
b4467a0
change Erc20DepositStatus type
godzillaba Oct 9, 2023
c3ba30a
change pctIncrease
godzillaba Oct 9, 2023
0480daf
Merge branch 'test-setup-l3' into teleporter-tests
godzillaba Oct 9, 2023
b150104
test base getters
godzillaba Oct 9, 2023
2ae922a
remove randomNonce
godzillaba Oct 10, 2023
df472ab
modify getDepositStatus to account for frontrunning scenario
godzillaba Oct 10, 2023
abfc4f3
test status when retryable is frontran: wip
godzillaba Oct 10, 2023
2baabfd
finish get deposit status
godzillaba Oct 11, 2023
6fbbfa3
fmt
godzillaba Oct 11, 2023
2f8f18f
tweak types and add comments
godzillaba Oct 11, 2023
0670a50
types comments
godzillaba Oct 11, 2023
476b526
...
godzillaba Oct 11, 2023
78cb2db
...
godzillaba Oct 11, 2023
ed79b15
add final review notes
godzillaba Oct 12, 2023
482fa65
fmt
godzillaba Oct 12, 2023
2fc7667
l1 gas price override
godzillaba Oct 12, 2023
fa23c2c
l2 forwarder owner override
godzillaba Oct 12, 2023
b83cfec
change eth deposit status type
godzillaba Oct 12, 2023
6dd417e
remove old unit test file
godzillaba Oct 12, 2023
f75e4c2
update index.ts
godzillaba Oct 12, 2023
5b2f531
remove .sub(1) resulting from old contract optimization strategy
godzillaba Oct 12, 2023
3751add
rename Teleporter to L1Teleporter
godzillaba Oct 13, 2023
0185e29
remove comment
godzillaba Oct 16, 2023
84f6ed8
fmt
godzillaba Oct 16, 2023
98b9526
test non default gateway throw
godzillaba Oct 17, 2023
fa841a8
...
godzillaba Oct 17, 2023
e741d07
Update src/lib/assetBridger/l1l3Bridger.ts
godzillaba Oct 20, 2023
10abd8f
Update src/lib/assetBridger/l1l3Bridger.ts
godzillaba Oct 20, 2023
0121ce1
Update src/lib/assetBridger/l1l3Bridger.ts
godzillaba Oct 20, 2023
a7b1c4c
Update src/lib/assetBridger/l1l3Bridger.ts
godzillaba Oct 20, 2023
cca52aa
Update src/lib/assetBridger/l1l3Bridger.ts
godzillaba Oct 20, 2023
1d96650
Update src/lib/assetBridger/l1l3Bridger.ts
godzillaba Oct 20, 2023
50662b1
remove 'value' from getApproveTokenRequest
godzillaba Oct 20, 2023
13dc195
use hexDataSlice
godzillaba Oct 20, 2023
0c9d2ea
comment
godzillaba Oct 20, 2023
9aeaab2
reuse erc20bridger to get l2 and l3 token addrs
godzillaba Oct 20, 2023
95ee6a6
Merge branch 'test-setup-l3' into teleporter-tests
godzillaba Oct 25, 2023
95dd404
leg -> step
godzillaba Oct 27, 2023
8885e15
use teleporter npm package
godzillaba Oct 27, 2023
a227816
add sepolia teleporter deployment
godzillaba Oct 27, 2023
9502673
use parseLog
godzillaba Oct 30, 2023
d6cbb45
format
godzillaba Oct 30, 2023
5d1b86c
don't create new erc20bridgers
godzillaba Oct 30, 2023
f60201a
_getApproveTokenRequest and use the erc20bridger for a couple more th…
godzillaba Oct 30, 2023
7b61e13
format
godzillaba Oct 30, 2023
fc95eb1
Merge branch 'test-setup-l3' into teleporter-tests
godzillaba Oct 30, 2023
4ac2726
fix yarn.lock
godzillaba Oct 30, 2023
5d7388a
append relayer info
godzillaba Nov 14, 2023
c3fd64c
remove unused imports and fmt
godzillaba Nov 14, 2023
6b34ed5
measure L2 gas use and add L1 gas when using relayer
godzillaba Nov 15, 2023
b1070fb
Merge branch 'test-setup-l3' into teleporter-tests
godzillaba Nov 16, 2023
a23237e
use new contracts package
godzillaba Nov 17, 2023
7208794
teleporter artifacts dir
godzillaba Nov 17, 2023
385890b
format
godzillaba Nov 17, 2023
a2c8f0c
use other test token
godzillaba Nov 17, 2023
f97dc14
use more-traffic testnode branch
godzillaba Nov 17, 2023
15e1ff9
Merge branch 'teleporter-tests' into tune-teleporter-fees
godzillaba Nov 20, 2023
c4008f1
Merge branch 'test-setup-l3' into teleporter-tests
godzillaba Nov 20, 2023
c0062b4
Merge branch 'teleporter-tests' into tune-teleporter-fees
godzillaba Nov 20, 2023
5630c84
...
godzillaba Nov 20, 2023
0f654bf
Merge pull request #377 from OffchainLabs/tune-teleporter-fees
godzillaba Nov 21, 2023
6268fad
change run-nitro-test-node branch
godzillaba Nov 30, 2023
ac87dc7
Merge branch 'teleporter-tests' of https://github.com/OffchainLabs/ar…
godzillaba Nov 30, 2023
aed1c3d
add some comments about failure modes
godzillaba Dec 13, 2023
622de48
executeDepositRequest
godzillaba Dec 28, 2023
d3c858e
use release nitro-testnode
godzillaba Dec 28, 2023
8034259
...
godzillaba Dec 28, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
uses: OffchainLabs/actions/node-modules/restore@main

- name: Set up the local node
uses: OffchainLabs/actions/run-nitro-test-node@wait-for-l3
uses: OffchainLabs/actions/run-nitro-test-node@main
with:
no-token-bridge: true
l3-node: true
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@arbitrum/nitro-contracts": "1.0.1",
"@arbitrum/token-bridge-contracts": "1.1.0",
"@nomiclabs/hardhat-ethers": "^2.0.4",
"@offchainlabs/l1-l3-teleport-contracts": "^0.1.0-alpha.0",
"@typechain/ethers-v5": "9.0.0",
"@types/chai": "^4.2.11",
"@types/mocha": "^9.0.0",
Expand Down
9 changes: 9 additions & 0 deletions scripts/genAbi.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ async function main() {
const cwd = process.cwd()

const nitroPath = getPackagePath('@arbitrum/nitro-contracts')
const teleporterPath = getPackagePath(
'@offchainlabs/l1-l3-teleport-contracts'
)
const tokenBridgePath = getPackagePath('@arbitrum/token-bridge-contracts')

console.log('Compiling paths.')
Expand All @@ -32,6 +35,11 @@ async function main() {
cwd: nitroPath,
})

console.log('building teleporter')
execSync(`${npmExec} run build --config ./hardhat.config.js`, {
cwd: teleporterPath,
})

// copy the hardhat config to the token-bridge-contracts package
execSync(`cp ${cwd}/hardhat-abigen.ts ${tokenBridgePath}/hardhat-abigen.ts`)

Expand All @@ -45,6 +53,7 @@ async function main() {
const nitroFiles = glob(cwd, [
`${tokenBridgePath}/build/contracts/!(build-info)/**/+([a-zA-Z0-9_]).json`,
`${nitroPath}/build/contracts/!(build-info)/**/+([a-zA-Z0-9_]).json`,
`${teleporterPath}/build/contracts/!(build-info)/**/+([a-zA-Z0-9_]).json`,
])

// TODO: generate files into different subfolders (ie `/nitro/*`) to avoid overwrite of contracts with the same name
Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
/* eslint-env node */
'use strict'

export {
Erc20L1L3Bridger,
RelayedErc20L1L3Bridger,
EthL1L3Bridger,
} from './lib/assetBridger/l1l3Bridger'
export { EthBridger } from './lib/assetBridger/ethBridger'
export { Erc20Bridger } from './lib/assetBridger/erc20Bridger'
export {
Expand Down
Loading
Loading