Skip to content

Commit

Permalink
feat: add support for L1 to L3 bridging (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
godzillaba authored Jul 2, 2024
1 parent a125bed commit 34a88ef
Show file tree
Hide file tree
Showing 8 changed files with 3,134 additions and 25 deletions.
21 changes: 20 additions & 1 deletion audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
// from @arbitrum/nitro-contracts>@offchainlabs/upgrade-executor>@openzeppelin/contracts-upgradeable
// from @arbitrum/nitro-contracts>@offchainlabs/upgrade-executor>@openzeppelin/contracts
"GHSA-wprv-93r4-jj2p",
// https://github.com/advisories/GHSA-3787-6prv-h9w3
// Undici proxy-authorization header not cleared on cross-origin redirect in fetch
"GHSA-3787-6prv-h9w3",
// https://github.com/advisories/GHSA-699g-q6qh-q4v8
// OpenZeppelin Contracts and Contracts Upgradeable duplicated execution of subcalls in v4.9.4
// from: @offchainlabs/l1-l3-teleport-contracts>@openzeppelin/contracts
"GHSA-699g-q6qh-q4v8",
// https://github.com/advisories/GHSA-9vx6-7xxf-x967
// OpenZeppelin Contracts base64 encoding may read from potentially dirty memory
// we don't use the base64 functions
Expand Down Expand Up @@ -85,6 +92,18 @@
// Uncontrolled resource consumption in braces
// eslint and hardhat dependency, only used in dev
// from: hardhat>braces & eslint>braces
"GHSA-grv7-fg5c-xmjg"
"GHSA-grv7-fg5c-xmjg",
// https://github.com/advisories/GHSA-3h5v-q93c-6h6q
// Exposure of Sensitive Information in ws
// Issue with sol2uml library that generates UML diagrams from Solidity code. Only used at build time.
// from: @offchainlabs/l1-l3-teleport-contracts>@arbitrum/nitro-contracts>sol2uml>convert-svg-to-png>convert-svg-core>puppeteer>ws
// from: @offchainlabs/l1-l3-teleport-contracts>@arbitrum/token-bridge-contracts>@arbitrum/nitro-contracts>sol2uml>convert-svg-to-png>convert-svg-core>puppeteer>ws
"GHSA-3h5v-q93c-6h6q",
// https://github.com/advisories/GHSA-wf5p-g6vw-rhxx
// Axios: Server-Side Request Forgery vulnerability
// Issue with sol2uml library that generates UML diagrams from Solidity code. Only used at build time.
// from: @offchainlabs/l1-l3-teleport-contracts>@arbitrum/nitro-contracts>sol2uml>axios
// from: @offchainlabs/l1-l3-teleport-contracts>@arbitrum/token-bridge-contracts>@arbitrum/nitro-contracts>sol2uml>axios
"GHSA-wf5p-g6vw-rhxx"
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@arbitrum/nitro-contracts": "^1.1.1",
"@arbitrum/token-bridge-contracts": "^1.2.1",
"@nomiclabs/hardhat-ethers": "^2.0.4",
"@offchainlabs/l1-l3-teleport-contracts": "1.0.1",
"@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 @@ -17,6 +17,9 @@ async function main() {

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

console.log('Compiling paths.')

Expand All @@ -38,11 +41,17 @@ async function main() {
console.log('building @arbitrum/token-bridge-contracts')
execSync(`${npmExec} run build`, { cwd: tokenBridgePath })

console.log('building @offchainlabs/l1-l3-teleport-contracts')
execSync(`${npmExec} run build`, {
cwd: teleporterPath,
})

console.log('Done compiling')

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
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
/* eslint-env node */
'use strict'

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

0 comments on commit 34a88ef

Please sign in to comment.