Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
c70c490
feat(script): redeploy layer y
ZeroEkkusu Jun 2, 2025
c8182e2
fix(ct): skip minting if address zero
ZeroEkkusu May 27, 2025
4dc00fc
docs(ct): v0.5.1
ZeroEkkusu May 27, 2025
ab4defd
docs: v0.6.0
ZeroEkkusu May 27, 2025
3cae6eb
refactor: global versioning
ZeroEkkusu May 27, 2025
78f8929
fix: backing migration
ZeroEkkusu Jun 2, 2025
e616939
fix: tests
JDawg287 Jun 3, 2025
4d38439
feat: vault bridge v1
ZeroEkkusu Jun 13, 2025
b60774c
fix(mm): invalid wrapped gas token
ZeroEkkusu Jun 13, 2025
b349c62
fix(ct): decimals check
ZeroEkkusu Jun 19, 2025
786291d
fix: unit tests
JDawg287 Jun 24, 2025
e30b4da
docs: update natspec
ZeroEkkusu Jun 24, 2025
5bd3c8f
docs: generated => produced
ZeroEkkusu Jun 24, 2025
4e6c7b8
build: docs setup
ZeroEkkusu Jun 26, 2025
587cea1
build: forge doc
ZeroEkkusu Jun 26, 2025
85d2364
build: remove docs ci
ZeroEkkusu Jun 26, 2025
118077c
docs: update readme
ZeroEkkusu Jun 27, 2025
3603bd1
docs: fix links
ZeroEkkusu Jun 27, 2025
8ab459f
docs: fix readme
ZeroEkkusu Jun 27, 2025
edb2adb
docs: fix readme
ZeroEkkusu Jun 27, 2025
f31a312
docs: improve readme
ZeroEkkusu Jun 27, 2025
7394f59
docs: link
ZeroEkkusu Jun 27, 2025
7897d56
fix(vb): revert claimAndRedeem interface change
ZeroEkkusu Jun 30, 2025
284fb96
docs: fix readme
ZeroEkkusu Jun 30, 2025
ea67fd1
docs(readme): add github
ZeroEkkusu Jun 30, 2025
5f440f9
fix: round up
ZeroEkkusu Jul 1, 2025
823a95b
docs: fix typo
ZeroEkkusu Jul 1, 2025
257f093
fix(nc): round up
ZeroEkkusu Jul 4, 2025
e138afb
fix(test): round off
JDawg287 Jul 7, 2025
74976cc
fix(ci): change to public rpc
JDawg287 Jul 7, 2025
75eba7c
fix(test): rework integration tests
JDawg287 Jul 8, 2025
bdcef85
chore: improve vault bridge token test coverage
JDawg287 Jul 8, 2025
c0a2c86
feat: fuzz test for `depositIntoYieldVault`
JDawg287 Jul 8, 2025
42c5d9a
fix: script build errors
JDawg287 Jul 10, 2025
3c82128
fix(test): suppress warnings
JDawg287 Jul 10, 2025
d7488ef
docs: update license
ZeroEkkusu Jul 30, 2025
2dc50b8
docs: update links
ZeroEkkusu Jul 30, 2025
370232b
docs: stylize
ZeroEkkusu Jul 30, 2025
ed0302e
chore: remove banner
ZeroEkkusu Aug 7, 2025
4756a9f
docs: reword
ZeroEkkusu Aug 11, 2025
2bb2f42
refactor: rename concepts
ZeroEkkusu Aug 11, 2025
4fa8df0
test: rename concepts
ZeroEkkusu Aug 11, 2025
ad94ab4
docs: rename concepts
ZeroEkkusu Aug 12, 2025
9687e41
build: restructure directories
ZeroEkkusu Aug 12, 2025
2f3130d
docs: fix tables
ZeroEkkusu Aug 12, 2025
9df78a0
build: update imports
ZeroEkkusu Aug 12, 2025
16702ed
docs: clean up
ZeroEkkusu Aug 12, 2025
36eb940
docs: update deployments
ZeroEkkusu Aug 12, 2025
5355af3
docs: format deployments
ZeroEkkusu Aug 13, 2025
60c3f1e
docs: format deployments
ZeroEkkusu Aug 13, 2025
ab9ff8e
build: prepare for wormhole contracts
ZeroEkkusu Aug 13, 2025
e5136ee
feat: polygon portal support, bridged usdc standard for agglayer, adv…
ZeroEkkusu Aug 18, 2025
ac88552
feat: add polygon portal contracts
ZeroEkkusu Aug 18, 2025
0e0b4c6
refactor: import path
ZeroEkkusu Aug 18, 2025
6434001
fix: add modifiers
ZeroEkkusu Aug 18, 2025
a891f93
feat: v1.0.0-alpha.1
ZeroEkkusu Aug 19, 2025
13c5516
feat: wormhole support and refactoring
ZeroEkkusu Aug 21, 2025
2a40fa2
refactor: move function
ZeroEkkusu Aug 21, 2025
968c335
refactor: `version` => `VAULT_BRIDGE_VERSION`
ZeroEkkusu Aug 21, 2025
fd7aa4f
feat: weth wormhole support
ZeroEkkusu Aug 22, 2025
26ce703
chore: empty generic files
ZeroEkkusu Aug 25, 2025
150133e
fix: compile
simonDos Aug 28, 2025
8082f6b
fmt
simonDos Aug 28, 2025
7207f5a
fix: tests
simonDos Aug 28, 2025
5e2d59f
fix: agglayer tokens
ZeroEkkusu Sep 2, 2025
9ba04e0
Certora formal verification 1 (feat/v1) (#29)
JDawg287 Aug 18, 2025
61449e0
refactor: misc mods
ZeroEkkusu Sep 3, 2025
e01b75f
feat: secondary chain token adjustments
ZeroEkkusu Sep 5, 2025
e7a6cc9
chore(polygon): rename generic files
ZeroEkkusu Sep 5, 2025
f1aecee
docs: update deployments
ZeroEkkusu Sep 5, 2025
b6c9f9e
fix(weth): remove receive
ZeroEkkusu Sep 5, 2025
bd53cee
feat: custom token weth extension
ZeroEkkusu Sep 10, 2025
0f1548a
fix(weth): enable withdrawals and migrations
ZeroEkkusu Sep 10, 2025
0cbb213
docs: update deployments
ZeroEkkusu Sep 10, 2025
40ba5ba
chore: reorg tests
JDawg287 Sep 2, 2025
4afabd9
chore: improve vault bridge token test orchastration
JDawg287 Sep 2, 2025
852916d
chore: remove unneeded vbUSDT test
JDawg287 Sep 3, 2025
bea9887
feat: refactor primary chain tests
JDawg287 Sep 5, 2025
052bfb2
feat: refactor secondary chain tests
JDawg287 Sep 9, 2025
8bcc632
fix: build after rebase
JDawg287 Sep 10, 2025
f057eb5
fix: unit tests after rebase
JDawg287 Sep 10, 2025
1033401
chore: improve coverage
JDawg287 Sep 11, 2025
101c654
chore: change fork testing for fuzz tests
JDawg287 Sep 11, 2025
c33787e
fix: warnings
JDawg287 Sep 11, 2025
2e55205
feat: tests for custom token agglayer
JDawg287 Sep 12, 2025
489cb6f
feat: tests for custom token polygon
JDawg287 Sep 12, 2025
3c6b451
feat: tests for custom token wormhole
JDawg287 Sep 12, 2025
51972c4
feat: tests for weth wormhole
JDawg287 Sep 12, 2025
36aa7a8
chore: sanitize integration tests
JDawg287 Sep 12, 2025
762a4d6
feat: test for vbUSDC native converter agglayer
JDawg287 Sep 15, 2025
d20c016
fix: misc improvements
ZeroEkkusu Sep 16, 2025
ededc38
docs: add deployment procedure
ZeroEkkusu Sep 16, 2025
fa8a2aa
fix: tests
JDawg287 Sep 16, 2025
1212beb
feat: tests for InitializationCounterUpgradeable
JDawg287 Sep 16, 2025
ede0bc3
fix: suppress warnings
JDawg287 Sep 17, 2025
a8b6988
feat: integration test polygon
JDawg287 Sep 17, 2025
78fda02
fix: misc improvements
ZeroEkkusu Sep 19, 2025
f569cd5
fix: tests
JDawg287 Sep 19, 2025
3f7ab3f
refactor: remove outdated cast
ZeroEkkusu Sep 23, 2025
d87a219
docs(wh): update procedure
ZeroEkkusu Sep 23, 2025
9fb92ae
script(pol): deploy custom tokens
ZeroEkkusu Sep 23, 2025
d27e531
feat(ct/nc): inherit multicall
ZeroEkkusu Sep 24, 2025
6e8e046
feat: reinitialize
ZeroEkkusu Sep 24, 2025
158e45e
fix(ct): prevent claiming to address zero
ZeroEkkusu Sep 25, 2025
e79a059
refactor(nc): rename param
ZeroEkkusu Sep 25, 2025
30a44e4
refactor(nc): rename vars
ZeroEkkusu Sep 25, 2025
12f56cf
docs(wh): update procedure
ZeroEkkusu Sep 25, 2025
3657b8e
fix: initialization counter upgradeable
ZeroEkkusu Sep 25, 2025
eadf2ba
script(polygon): update
ZeroEkkusu Sep 25, 2025
2687f08
script(etc): reverting contract
ZeroEkkusu Sep 25, 2025
2d62aac
test: comment out test
ZeroEkkusu Sep 29, 2025
c658c36
docs: document version
ZeroEkkusu Sep 29, 2025
9989677
build(ci): comment out forge fmt check
ZeroEkkusu Sep 29, 2025
a94a768
docs: update deployments
ZeroEkkusu Sep 30, 2025
fa09255
script: rename files
ZeroEkkusu Sep 30, 2025
ab06573
docs: update procedures
ZeroEkkusu Sep 30, 2025
d71f22a
refactor: version => protocol
ZeroEkkusu Sep 30, 2025
8b53bc2
docs: update deployments
ZeroEkkusu Sep 30, 2025
0c82f42
docs: update deployments
ZeroEkkusu Sep 30, 2025
f1f7f88
feat: manual weth setting
ZeroEkkusu Oct 1, 2025
90daf32
fix(script): deployerAddress => ownerAddress
ZeroEkkusu Oct 1, 2025
3dcd559
fix(nc): add `setCustomToken(address)`
ZeroEkkusu Oct 1, 2025
4c0e403
script: deploy wormhole custom tokens
ZeroEkkusu Oct 1, 2025
c70ecf7
docs: correct
ZeroEkkusu Oct 7, 2025
f2ee23c
docs: protection
ZeroEkkusu Oct 9, 2025
fa7c1fe
docs: fix link
ZeroEkkusu Oct 9, 2025
33e709d
feat(wip): layerzero oft
ZeroEkkusu Oct 10, 2025
82c7479
feat: layerzero oft support
ZeroEkkusu Oct 13, 2025
9018f29
docs: rearrange headers
ZeroEkkusu Oct 13, 2025
879f6ed
fix: disable ownable
ZeroEkkusu Oct 14, 2025
79c4d57
fix: silence compiler warnings
ZeroEkkusu Oct 14, 2025
f830283
fix: generic oft adapter
ZeroEkkusu Oct 14, 2025
1257d52
feat(lz): separate oft and token
ZeroEkkusu Oct 14, 2025
59d1f17
fix(nc): enable migration while paused
ZeroEkkusu Oct 15, 2025
91995cb
fix(vbeth): check agglayer id
ZeroEkkusu Oct 15, 2025
c5c4bd5
fix(wnc): round up non migratable gas backing
ZeroEkkusu Oct 15, 2025
e5ef957
fix(weth): add receive
ZeroEkkusu Oct 15, 2025
81238f3
docs(wh): add step
ZeroEkkusu Oct 15, 2025
bad8842
fix(weth): add modifier
ZeroEkkusu Oct 15, 2025
40a4142
fix(test): proper reinitiazation in tests
JDawg287 Oct 16, 2025
87a576e
feat(test): reinitialization tests
JDawg287 Oct 16, 2025
023a7bc
fix(test): rebase issues
JDawg287 Oct 16, 2025
e0abdbf
docs(nc): rename header
ZeroEkkusu Oct 17, 2025
71710a4
feat(oft): secondary chain balance & bridged usdc standard support
ZeroEkkusu Oct 17, 2025
6127539
feat(lz): add vbTokens
ZeroEkkusu Oct 17, 2025
d817d8f
feat(lz): bridged usdc standard
ZeroEkkusu Oct 17, 2025
0640c60
feat(test): extended test VbETH
JDawg287 Oct 17, 2025
c84442b
feat(test): extended tests WethAgglayer
JDawg287 Oct 17, 2025
cecdbc6
feat(test): extended tests NativeConverter
JDawg287 Oct 17, 2025
aca263d
fix(nc): remove duplicate event emmission
ZeroEkkusu Oct 20, 2025
0ce9963
fix(test): to address zero emits transfer
JDawg287 Oct 20, 2025
81f3ee1
docs: link to github
ZeroEkkusu Oct 20, 2025
f44572f
feat(oft): simulate agglayer local balance tree
ZeroEkkusu Oct 20, 2025
d12f7cd
chore: remove unneeded version validation in tests
JDawg287 Oct 20, 2025
084d969
feat(test): GenericCustomTokenLayerZero unit tests
JDawg287 Oct 20, 2025
d8924e8
fix(weth): moveGasBackingToNativeConverter
ZeroEkkusu Oct 21, 2025
4989fcb
docs(oft): remove typo
ZeroEkkusu Oct 21, 2025
0888ae8
feat(test): NonDefaultMintBurnOftAdapter unit tests
JDawg287 Oct 21, 2025
0380d60
docs: add support information
ZeroEkkusu Oct 22, 2025
2f5b9b0
docs: clarify support
ZeroEkkusu Oct 22, 2025
a30db6c
docs: fix typo
ZeroEkkusu Oct 22, 2025
86a3403
docs: improve
ZeroEkkusu Oct 22, 2025
3aeea7d
feat(test): debit with approval test NonDefaultMintBurnOftAdapter
JDawg287 Oct 22, 2025
d30cc4d
feat(test): fee token reception test NonDefaultMintBurnOftAdapter
JDawg287 Oct 22, 2025
15979ef
docs: supported vms
ZeroEkkusu Oct 23, 2025
ff9cb31
docs: add supported chains
ZeroEkkusu Oct 23, 2025
6cab919
fix(lz): check inputs
ZeroEkkusu Oct 24, 2025
4b616f1
feat(wnc): add event
ZeroEkkusu Oct 24, 2025
7e8562b
docs: add notes to readme
ZeroEkkusu Oct 24, 2025
035d4a7
fix: version
ZeroEkkusu Oct 24, 2025
29605a6
chore: clean up
ZeroEkkusu Oct 24, 2025
26b3faa
chore: undo clean up
ZeroEkkusu Oct 24, 2025
0014358
feat: update version
ZeroEkkusu Oct 24, 2025
41c9784
docs: deprecate external docs site
ZeroEkkusu Oct 24, 2025
c42f909
docs: add weth functionality
ZeroEkkusu Oct 27, 2025
91f7296
feat: only self reinitializers
ZeroEkkusu Oct 28, 2025
1e26870
test: import error
ZeroEkkusu Oct 28, 2025
54b3474
feat: rearrange local counters
ZeroEkkusu Oct 28, 2025
965aead
fix: reinitializers
ZeroEkkusu Oct 28, 2025
30c910c
test: fix onlySelf reinitializers
JDawg287 Oct 28, 2025
a051b3b
test: fmt
JDawg287 Oct 28, 2025
6ab301d
fix: onlySelf => locked
ZeroEkkusu Oct 29, 2025
ddbb065
test: fix reinitialization tests
JDawg287 Oct 29, 2025
cf073cb
test: check the reinitializer locking mechanism
JDawg287 Oct 29, 2025
1e34801
test: add test for calling subsequent reinitializer
JDawg287 Oct 29, 2025
eeb0789
fix(wh): remove weth functionality
ZeroEkkusu Oct 30, 2025
37c3487
test: remove wethFunctionalityEnabled check
JDawg287 Oct 30, 2025
42926d8
test: tests for `setNativeConverter` & `setWethFunctionalityEnabled`
JDawg287 Oct 30, 2025
7bd6f83
docs: update version
ZeroEkkusu Oct 31, 2025
cf3fd49
fix(lz): weth
ZeroEkkusu Oct 31, 2025
aafff0f
chore: remove import
ZeroEkkusu Oct 31, 2025
1bd55ba
docs: update wormhole docs
ZeroEkkusu Oct 31, 2025
a0ba9c7
docs: update layerzero docs
ZeroEkkusu Oct 31, 2025
fdb98e5
docs: improve layerzero docs
ZeroEkkusu Oct 31, 2025
816c660
docs(lz): add reference
ZeroEkkusu Oct 31, 2025
5c3819a
docs(lz): correct reference
ZeroEkkusu Oct 31, 2025
597fa8b
test: complete test for gasTokenIsETH
JDawg287 Oct 31, 2025
53fb340
test: unit tests for WethLayerZero
JDawg287 Oct 31, 2025
19d7d24
feat(ct): bridge control
ZeroEkkusu Nov 13, 2025
e7a7fc8
chore(feat/layerzero): prepare for conflicts resolution
ZeroEkkusu Nov 18, 2025
072944f
chore(feat/layerzero): prepare for conflict resolution pt2
ZeroEkkusu Nov 19, 2025
121850b
build(cli): remove certora
ZeroEkkusu Nov 19, 2025
f589a89
docs: add faucet
ZeroEkkusu Nov 20, 2025
4a50cdc
fix(nc): check migrations in progress
ZeroEkkusu Nov 20, 2025
9e8fdbd
feat(vb): yield vault approval controls
ZeroEkkusu Nov 20, 2025
aebcc2d
feat(vb): precollect yield option
ZeroEkkusu Nov 20, 2025
f63129d
fix(ct): allow migration completion while paused
ZeroEkkusu Nov 20, 2025
05bc043
test: update
ZeroEkkusu Nov 20, 2025
794c7ee
fix(ct-al): previous decimals
ZeroEkkusu Nov 20, 2025
9eda45f
fix(vb): no minimum when rebalancing
ZeroEkkusu Nov 20, 2025
b540d4d
fix(lz): non transient guard
ZeroEkkusu Nov 20, 2025
d6d1fd7
feat(ct-al): already minted event
ZeroEkkusu Nov 20, 2025
69a03eb
feat(ct-al): bridge sender check
ZeroEkkusu Nov 20, 2025
96111d8
fix(lz): no address zero credit
ZeroEkkusu Nov 20, 2025
4bb4148
docs(al): correct headers
ZeroEkkusu Nov 20, 2025
afbc1dd
Fix conflicts
Nov 21, 2025
fcca991
fix(vb): remove `whenNotPaused` from `setYieldRecipient`
ZeroEkkusu Nov 24, 2025
44c2cf1
fix(weth-al): previous decimals
ZeroEkkusu Nov 24, 2025
150bd08
style: fmt
JDawg287 Nov 21, 2025
9459119
test: fix
JDawg287 Nov 24, 2025
b905312
test(vb): revoke/restore yield vault approval
JDawg287 Nov 24, 2025
e7790de
test(nc): cannot set custom token if migration in progress
JDawg287 Nov 24, 2025
0f243df
test(ag-weth): fix fetching original decimal
JDawg287 Nov 24, 2025
950e64d
chore: format
ZeroEkkusu Nov 25, 2025
8e502b4
docs: add v1.1.0 audit report
ZeroEkkusu Nov 28, 2025
f1f5061
script: add layerzero scripts
ZeroEkkusu Dec 16, 2025
c349235
script: polish
ZeroEkkusu Dec 17, 2025
bc7dffc
script: remove input
ZeroEkkusu Dec 17, 2025
d863a96
script(lz): polish
ZeroEkkusu Dec 18, 2025
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: 1 addition & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
API_KEY=
INFURA_KEY=
POLYGONSCAN_API_KEY=
TATARA_TOKEN=
KATANA_TOKEN=
ETHERSCAN_API_KEY=
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
certora/confs/GenericVaultBridgeToken.conf --verify GenericVaultBridgeToken:certora/specs/GVBTBalances.spec
certora/confs/GenericVaultBridgeToken.conf --verify GenericVaultBridgeToken:certora/specs/tokenMockBalances.spec
certora/confs/GenericNativeConverter.conf
certora/confs/MigrationManager-generic.conf --rule onMsgReceived_doesntAlwaysRevert
certora/confs/base/MigrationManager.conf --rule onMsgReceived_doesntAlwaysRevert
jobs:
check:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,6 +52,9 @@ jobs:
git checkout v10.1.0-rc.1
npm install

- name: Certora munge
run: ./certora/scripts/munge.sh

- name: run configs
uses: Certora/certora-run-action@v2
with:
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ jobs:
run: |
forge --version

- name: Run Forge fmt
run: |
forge fmt --check
id: fmt
# - name: Run Forge fmt
# run: |
# forge fmt --check
# id: fmt

- name: Run Forge build
run: |
forge --version
forge soldeer install
forge build --sizes
id: build
Expand All @@ -54,6 +53,4 @@ jobs:
run: |
npm install
forge test --no-match-contract "Generic" -vvv
env:
TATARA_TOKEN: ${{ secrets.TATARA_TOKEN }}
id: test
123 changes: 88 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,142 @@
> [!IMPORTANT]
> You are viewing a development version of the codebase.
<div align="center">

# Vault Bridge

Vault Bridge Token is the core of the Vault Bridge protocol. Built from the ground up to be reusable, it offers full Vault Bridge functionality out of the box, allowing you to create vbTokens in just a few lines of code.
**[⛓️ Deployments](#deployments)**
**&nbsp;&nbsp; [📙 Documentation](#documentation)**
**&nbsp;&nbsp; [🧭 Website](https://www.agglayer.dev/agglayer-vaultbridge)**
**&nbsp;&nbsp; [🦙 DefiLlama](https://defillama.com/protocol/vault-bridge)**

</div>

## Contents

- [Contents](#contents)
- [Overview](#overview)
- [TL;DR](#tldr)
- [Vault Bridge Token](#vault-bridge-token)
- [Migration Manager](#migration-manager)
- [Custom Token](#custom-token)
- [Native Converter](#native-converter)
- [Get Started](#get-started)
- [Documentation](#documentation)
- [Deployments](#deployments)
- [Usage](#usage)
- [License](#license)

## Overview

The Vault Bridge protocol is comprised of:
> [!NOTE]
> This section should be updated, as Vault Bridge has evolved into a larger protocol.

Vault Bridge enables chains and apps to generate native yield on TVL by putting bridged assets to work.

The protocol is comprised of:

- One Primary Chain
- [Vault Bridge Token](#vault-bridge-token)
- [Migration Manager](#migration-manager)
- Many Secondary Chains
- [Custom Token](#custom-token)
- [Native Converter](#native-converter)

### TL;DR

Select assets are bridged from Primary Chain to Secondary Chain. These assets are deposited into Vault Bridge Token contract on Primary Chain, which mints and bridges vbToken to Secondary Chain. Deposited assets are used to generate yield on Primary Chain, while bridged vbTokens are used in DeFi on Secondary Chain. Generated yield gets distributed to chains and apps participating in the revenue sharing program.

- Layer X (the main network)
- [Vault Bridge Token](#vault-bridge-token-)
- [Migration Manager (singleton)](#migration-manager-singleton-)
- Layer Y (other networks)
- [Custom Token](#custom-token-)
- [Native Converter](#native-converter-)
Native Converter contract can be deployed on Secondary Chain to enable acquisition of vbToken on Secondary Chain without having to bridge from Primary Chain. Accumulated backing in Native Converter on Secondary Chain gets migrated to Primary Chain and deposited into Vault Bridge Token contract.

### Vault Bridge Token [↗](src/VaultBridgeToken.sol)
### Vault Bridge Token

A Vault Bridge Token is an
A Vault Bridge Token is:

- [ERC-20](https://eips.ethereum.org/EIPS/eip-20) token
- [ERC-4626](https://eips.ethereum.org/EIPS/eip-4626) vault
- [LxLy Bridge](https://github.com/0xPolygonHermez/zkevm-contracts) extension
- [Agglayer Bridge](https://github.com/agglayer/agglayer-contracts) extension

enabling bridging of select assets, such as WBTC, WETH, USDT, USDC, and USDS, while producing yield.
Assets in high demand with available yield strategies, such as WETH and USDC, can get their versions of vbTokens. The underlying asset is deposited into Vault Bridge Token contract, and vbToken is minted in a 1:1 ratio. The same can be withdrawn by burning vbToken. Vault Bridge Token contract doubles a pseudo bridge, so vbToken can be minted and bridged, or claimed and redeemed, in a single call. Deposited underlying assets are put into an external, ERC-4626 compatible vault ("yield vault") where they generate yield. Yield is distributed to chains and apps that participate in the revenue sharing program. Vault Bridge Token contracts also includes functionality that enables minting of vbToken directly on Secondary Chain via Native Converter, with backing migration to Primary Chain via Migration Manager.

### Migration Manager (singleton) [↗](src/MigrationManager.sol)
### Migration Manager

The Migration Manager is a
The Migration Manager is:

- [Vault Bridge Token](#vault-bridge-token-) dependency
- [Vault Bridge Token](#vault-bridge-token) dependency

handling migration of backing from Native Converters.
vbTokens can be minted directly on Secondary Chain. In order for an underlying asset that backs vbToken minted on Secondary Chain to be deposited in Vault Bridge Token contract on Primary Chain, backing is migrated to Primary Chain via Native Converter and Migration Manager. Migration Manager completes migrations by interacting with Vault Bridge Token contract. All vbTokens share the same Migration Manager contract.

### Custom Token [↗](src/CustomToken.sol)
### Custom Token

A Custom Token is an
A Custom Token is:

- [ERC-20](https://eips.ethereum.org/EIPS/eip-20) token

an upgrade for [LxLy Bridge](https://github.com/0xPolygonHermez/zkevm-contracts)'s generic wrapped token.
Bridged vbToken can be upgraded to Custom Token on Secondary Chain. This enables custom behavior, such as bridged vbETH to integrate WETH9 interface, replacing WETH on Secondary Chain.

### Native Converter [↗](src/NativeConverter.sol)
### Native Converter

A Native Converter is a
A Native Converter is:

- pseudo [ERC-4626](https://eips.ethereum.org/EIPS/eip-4626) vault
- [LxLy Bridge](https://github.com/0xPolygonHermez/zkevm-contracts) extension
- [Vault Bridge Token](#vault-bridge-token) extension
- [Agglayer Bridge](https://github.com/agglayer/agglayer-contracts) extension

allowing conversion to, and deconversion of, Custom Token, as well as migration of backing to Vault Bridge Token.
Native Converter can be deployed on Secondary Chain to enable minting of vbToken directly on Secondary Chain by converting the bridged underlying asset, in a 1:1 ratio. The same can be deconverted to by burning bridged vbToken. Accumulated backing in Native Converter on Secondary Chain can be migrated to Primary Chain to be deposited into Vault Bridge Token contract via Migration Manger. For this reason, liqudity for deconverting to the bridged underlying token on Secondary Chain is guaranteed only up to a certain percentage. Native Converter doubles a bridge extension, so vbToken can be deconverted and bridged in a single call.

## Get Started

> [!NOTE]
> This section needs to be updated, as the official support for several third-party bridges has been added!

Getting started should be easy as Vault Bridge Token contracts follow the ERC-4626 interface. Variants of the standard ERC-4626 functions include `depositAndBridge` and `claimAndRedeem`. Please see [Documentation](#documentation) for more information.

If your chain is part of Agglayer, you can start using the official vbTokens immediately. Please note that you will get vbToken when bridging, not the underlying token, therefore activity should be incentivized in vbToken. You must participate in the revenue sharing program in order to receive yield. [Contact our team](https://info.polygon.technology/vaultbridge-intake-form) if interested in revenue sharing.

If your chain is not part of Agglayer, you can start using the official vbTokens immediately. Please note that you will need to use a third-party bridge to bridge vbTokens to your chain, and Native Converter functionality will not be supported. You must participate in the revenue sharing program in order to receive yield. [Contact our team](https://info.polygon.technology/vaultbridge-intake-form) if interested in revenue sharing.

Full support for non-Agglayer chains, third-party bridges, as well as non-EVM chains is coming soon. [Contact our team](https://info.polygon.technology/vaultbridge-intake-form) to register interest.

## Documentation

Please see NatSpec documentation inside of the files.
> [!NOTE]
> This section needs to be updated, as some NatSpec is outdated and/or missing.

- [General Documentation](https://docs.agglayer.dev/vault-bridge/get-started/overview/)
- [Source Code](./src/): The Source Code is 100% documented and you are encouraged to take a reference it.
- Pay attention to the following bookmarks:
- `@note CAUTION!`
- `@note IMPORTANT:`
- `@note (ATTENTION)`

## Deployments

Please see `@note` documentation for important information.
See [`broadcast/README.md`](./broadcast/README.md).

## Usage

#### Prerequisite
Clone:

```
foundryup
git clone git@github.com:agglayer/vault-bridge.git
```

#### Install
Install:

```
forge soldeer install & npm install
```

#### Build
Build:

```
forge build
```

#### Test
Test:

```
forge test
```

#### Coverage
Coverage:

```
forge coverage --ir-minimum --report lcov && genhtml -o coverage lcov.info
Expand All @@ -93,6 +146,6 @@ forge coverage --ir-minimum --report lcov && genhtml -o coverage lcov.info

This codebase is licensed under Source Available License.

See [`LICENSE-SOURCE-AVAILABLE`](https://github.com/agglayer/vault-bridge/blob/main/LICENSE-SOURCE-AVAILABLE).
See [`LICENSE-SOURCE-AVAILABLE`](./LICENSE-SOURCE-AVAILABLE).

Your use of this software constitutes acceptance of these license terms.
File renamed without changes.
Binary file added audit/v1.0.0_Certora.pdf
Binary file not shown.
Binary file added audit/v1.1.0_Certora.pdf
Binary file not shown.
Loading