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

L2 direct bridging #792

Merged
merged 26 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
970fed2
Draft implementation of the `L2BitcoinDepositor` contract
lukasz-zimnoch Feb 28, 2024
9241003
Draft implementation of the `L1BitcoinDepositor` contract
lukasz-zimnoch Feb 28, 2024
df436e1
Change `calldata` to `memory` in `AbstractTBTCDepositor` contract
lukasz-zimnoch Feb 28, 2024
34971b0
Expose `tbtcToken` from the `ITBTCVault` interface
lukasz-zimnoch Feb 29, 2024
5a179fd
Finalize deposit flow
lukasz-zimnoch Feb 29, 2024
7f81fbe
Deployment adjustments
lukasz-zimnoch Mar 1, 2024
533e889
Deployment scripts for Base
lukasz-zimnoch Mar 1, 2024
e927830
Deployment artifacts for Base Sepolia
lukasz-zimnoch Mar 1, 2024
4adf553
Do not use Wormhole Relayer for L2 -> L1 deposit reveal
lukasz-zimnoch Mar 4, 2024
59a337f
Reimbursements for deposit initialization and finalization
lukasz-zimnoch Mar 4, 2024
4aa0886
Add note about `ReimbursementPool` reentrancy risk
lukasz-zimnoch Mar 5, 2024
49d2bb9
Remaining documentation for the `L1BitcoinDepositor` contract
lukasz-zimnoch Mar 5, 2024
2ea028b
Remaining documentation for the `L2BitcoinDepositor` contract
lukasz-zimnoch Mar 5, 2024
9a3555c
Suppress Slither false positives
lukasz-zimnoch Mar 5, 2024
fa89a62
Re-deploy contracts on Ethereum and Base Sepolia
lukasz-zimnoch Mar 5, 2024
fac595d
Another attempt to suppress Slither false positives
lukasz-zimnoch Mar 5, 2024
105a52d
Unit tests for `L2BitcoinDepositor` contract
lukasz-zimnoch Mar 6, 2024
3fc19ad
Make `finalizeDeposit` external
lukasz-zimnoch Mar 7, 2024
ce5f849
Use upgradable OZ token types
lukasz-zimnoch Mar 7, 2024
e902f81
Add missing test scenario for `attachL1BitcoinDepositor` function
lukasz-zimnoch Mar 7, 2024
d7c0955
Merge branch 'main' into l2-direct-bridging
lukasz-zimnoch Mar 7, 2024
4616e6d
Unit tests for `L1BitcoinDepositor` contract
lukasz-zimnoch Mar 8, 2024
d6cabdb
Optimize the `GasReimbursement` structure
lukasz-zimnoch Mar 8, 2024
f754ebc
Re-deploy contracts on Ethereum on Base Sepolia
lukasz-zimnoch Mar 8, 2024
a438e1a
Adjust default value of `initializeDepositGasOffset` again
lukasz-zimnoch Mar 8, 2024
b2d57ce
Merge branch 'main' into l2-direct-bridging
tomaszslabon Mar 13, 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
2 changes: 1 addition & 1 deletion .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ jobs:

- name: Install Slither
env:
SLITHER_VERSION: 0.8.3
SLITHER_VERSION: 0.9.0
run: pip3 install slither-analyzer==$SLITHER_VERSION

# We need this step because the `@keep-network/tbtc` which we update in
Expand Down
303 changes: 303 additions & 0 deletions cross-chain/base/.openzeppelin/sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
{
"manifestVersion": "3.2",
"admin": {
"address": "0xDd0007713CB99564B7835FD628A1718e8F9f9785",
"txHash": "0x078036699e010480a0d2a4c443352cf0f6311f8882dddcf0b4c6c5136bcc69b4"
},
"proxies": [
{
"address": "0x0c5e36731008f4AFC1AF5Da2C4D5E07eE4a3EB69",
"txHash": "0x5a405183332f623649fcf19f8506cf2582882d5dc2b05582e0066388ef122229",
"kind": "transparent"
}
],
"impls": {
"e1501c59bd3fc7501392b17ad132c0ef733008f7128caa90d854edd898c505ec": {
"address": "0x720Cb49A8b3c03E199075544F7f1F4d772Dd6d06",
"txHash": "0xf055a10c164376e93258e15ff257e76fc8eff5a737820237271a8fb3e3506fe4",
"layout": {
"solcVersion": "0.8.17",
"storage": [
{
"label": "bridge",
"offset": 0,
"slot": "0",
"type": "t_contract(IBridge)3414",
"contract": "AbstractTBTCDepositor",
"src": "@keep-network/tbtc-v2/contracts/integrator/AbstractTBTCDepositor.sol:95"
},
{
"label": "tbtcVault",
"offset": 0,
"slot": "1",
"type": "t_contract(ITBTCVault)3440",
"contract": "AbstractTBTCDepositor",
"src": "@keep-network/tbtc-v2/contracts/integrator/AbstractTBTCDepositor.sol:96"
},
{
"label": "__gap",
"offset": 0,
"slot": "2",
"type": "t_array(t_uint256)47_storage",
"contract": "AbstractTBTCDepositor",
"src": "@keep-network/tbtc-v2/contracts/integrator/AbstractTBTCDepositor.sol:111"
},
{
"label": "_initialized",
"offset": 0,
"slot": "49",
"type": "t_uint8",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62",
"retypedFrom": "bool"
},
{
"label": "_initializing",
"offset": 1,
"slot": "49",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67"
},
{
"label": "__gap",
"offset": 0,
"slot": "50",
"type": "t_array(t_uint256)50_storage",
"contract": "ContextUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36"
},
{
"label": "_owner",
"offset": 0,
"slot": "100",
"type": "t_address",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22"
},
{
"label": "__gap",
"offset": 0,
"slot": "101",
"type": "t_array(t_uint256)49_storage",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94"
},
{
"label": "reimbursementPool",
"offset": 0,
"slot": "150",
"type": "t_contract(ReimbursementPool)2999",
"contract": "Reimbursable",
"src": "@keep-network/random-beacon/contracts/Reimbursable.sol:51"
},
{
"label": "__gap",
"offset": 0,
"slot": "151",
"type": "t_array(t_uint256)49_storage",
"contract": "Reimbursable",
"src": "@keep-network/random-beacon/contracts/Reimbursable.sol:51"
},
{
"label": "deposits",
"offset": 0,
"slot": "200",
"type": "t_mapping(t_uint256,t_enum(DepositState)3465)",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:111"
},
{
"label": "tbtcToken",
"offset": 0,
"slot": "201",
"type": "t_contract(IERC20Upgradeable)6699",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:113"
},
{
"label": "wormhole",
"offset": 0,
"slot": "202",
"type": "t_contract(IWormhole)5318",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:115"
},
{
"label": "wormholeRelayer",
"offset": 0,
"slot": "203",
"type": "t_contract(IWormholeRelayer)5358",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:116"
},
{
"label": "wormholeTokenBridge",
"offset": 0,
"slot": "204",
"type": "t_contract(IWormholeTokenBridge)5443",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:118"
},
{
"label": "l2WormholeGateway",
"offset": 0,
"slot": "205",
"type": "t_address",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:119"
},
{
"label": "l2ChainId",
"offset": 20,
"slot": "205",
"type": "t_uint16",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:121"
},
{
"label": "l2BitcoinDepositor",
"offset": 0,
"slot": "206",
"type": "t_address",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:123"
},
{
"label": "l2FinalizeDepositGasLimit",
"offset": 0,
"slot": "207",
"type": "t_uint256",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:128"
},
{
"label": "gasReimbursements",
"offset": 0,
"slot": "208",
"type": "t_mapping(t_uint256,t_struct(GasReimbursement)3472_storage)",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:137"
},
{
"label": "initializeDepositGasOffset",
"offset": 0,
"slot": "209",
"type": "t_uint256",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:146"
},
{
"label": "finalizeDepositGasOffset",
"offset": 0,
"slot": "210",
"type": "t_uint256",
"contract": "L1BitcoinDepositor",
"src": "@keep-network/tbtc-v2/contracts/l2/L1BitcoinDepositor.sol:153"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_uint256)47_storage": {
"label": "uint256[47]",
"numberOfBytes": "1504"
},
"t_array(t_uint256)49_storage": {
"label": "uint256[49]",
"numberOfBytes": "1568"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_contract(IBridge)3414": {
"label": "contract IBridge",
"numberOfBytes": "20"
},
"t_contract(IERC20Upgradeable)6699": {
"label": "contract IERC20Upgradeable",
"numberOfBytes": "20"
},
"t_contract(ITBTCVault)3440": {
"label": "contract ITBTCVault",
"numberOfBytes": "20"
},
"t_contract(IWormhole)5318": {
"label": "contract IWormhole",
"numberOfBytes": "20"
},
"t_contract(IWormholeRelayer)5358": {
"label": "contract IWormholeRelayer",
"numberOfBytes": "20"
},
"t_contract(IWormholeTokenBridge)5443": {
"label": "contract IWormholeTokenBridge",
"numberOfBytes": "20"
},
"t_contract(ReimbursementPool)2999": {
"label": "contract ReimbursementPool",
"numberOfBytes": "20"
},
"t_enum(DepositState)3465": {
"label": "enum L1BitcoinDepositor.DepositState",
"members": [
"Unknown",
"Initialized",
"Finalized"
],
"numberOfBytes": "1"
},
"t_mapping(t_uint256,t_enum(DepositState)3465)": {
"label": "mapping(uint256 => enum L1BitcoinDepositor.DepositState)",
"numberOfBytes": "32"
},
"t_mapping(t_uint256,t_struct(GasReimbursement)3472_storage)": {
"label": "mapping(uint256 => struct L1BitcoinDepositor.GasReimbursement)",
"numberOfBytes": "32"
},
"t_struct(GasReimbursement)3472_storage": {
"label": "struct L1BitcoinDepositor.GasReimbursement",
"members": [
{
"label": "receiver",
"type": "t_address",
"offset": 0,
"slot": "0"
},
{
"label": "gasSpent",
"type": "t_uint96",
"offset": 20,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_uint16": {
"label": "uint16",
"numberOfBytes": "2"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint8": {
"label": "uint8",
"numberOfBytes": "1"
},
"t_uint96": {
"label": "uint96",
"numberOfBytes": "12"
}
}
}
}
}
}
Loading
Loading