Skip to content

Commit

Permalink
Adjust TBTC Transfer Amount to Include Fee and Update Sepolia Deploym…
Browse files Browse the repository at this point in the history
…ent (#827)

**Summary:**

This Pull Request includes the following updates:

**- Adjust TBTC Transfer Amount to Include Fee for L2 Deposit Owner**

The Threshold DAO has decided to set depositTxMaxFee to zero. Instead of
changing the deposit parameters, we have adjusted the amount of TBTC
transferred to the L2 deposit owner by adding back the fee amount.
This change is implemented in the contracts inheriting from
AbstractTBTCDepositor, without modifying the abstract contract itself.
Specifically, depositTxMaxFee is added to the tbtcAmount value returned
by _finalizeDeposit.

**- Update BaseL1BitcoinDepositor Deployment on Sepolia Network**

Deployed the updated BaseL1BitcoinDepositor contract to the Sepolia
testnet. This deployment includes the changes where the TBTC transfer
amount now accounts for the fee. Ensured compatibility with existing
contracts implementing AbstractTBTCDepositor.

**Rationale**: Align the TBTC transfer mechanism with the Threshold
DAO's decision to set the deposit transaction maximum fee to zero,
enhancing consistency across the contract implementations.

**Implementation**: Made minimal changes by adjusting only the
inheriting contracts and leaving the abstract contract unchanged,
promoting code reusability and maintainability.
  • Loading branch information
lukasz-zimnoch authored Jan 29, 2025
2 parents 7972a18 + e2e8cc3 commit 2edf945
Show file tree
Hide file tree
Showing 8 changed files with 689 additions and 201 deletions.
137 changes: 137 additions & 0 deletions cross-chain/base/.openzeppelin/base-sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"manifestVersion": "3.2",
"admin": {
"address": "0xbbe11Cb434f9DDAc9CC2eEC7D88D5C6ED4C41EA7",
"txHash": "0xf28a215383f01f3f757eac8e950907959b47f488c5233363cf4d11c3afd269b0"
},
"proxies": [
{
"address": "0xDEbD9aA9BC4845c7Cd2d9a997F82A2Daea540bD5",
"txHash": "0x8338ef2cea60670e4cce6c0ef68592abe2a1e7fc0cde5b2e5d74468438f3cecd",
"kind": "transparent"
}
],
"impls": {
"6f8a080eb3d81df72370bb32bfb791d146b0b8bb3ffba9da54d6a2155f00b013": {
"address": "0xda04b0Ae3E07dd4a14Ca993C47461b5Be18C3D4A",
"txHash": "0x410681893ea908a34d396cd25fa019b3cad441852df67f6bb54f79b3592bf07c",
"layout": {
"solcVersion": "0.8.17",
"storage": [
{
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "t_uint8",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63",
"retypedFrom": "bool"
},
{
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68"
},
{
"label": "__gap",
"offset": 0,
"slot": "1",
"type": "t_array(t_uint256)50_storage",
"contract": "ContextUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40"
},
{
"label": "_owner",
"offset": 0,
"slot": "51",
"type": "t_address",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22"
},
{
"label": "__gap",
"offset": 0,
"slot": "52",
"type": "t_array(t_uint256)49_storage",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94"
},
{
"label": "wormholeRelayer",
"offset": 0,
"slot": "101",
"type": "t_contract(IWormholeRelayer)4663",
"contract": "L2BitcoinDepositor",
"src": "contracts/baseSepolia/L2BitcoinDepositor.sol:55"
},
{
"label": "l2WormholeGateway",
"offset": 0,
"slot": "102",
"type": "t_contract(IL2WormholeGateway)4393",
"contract": "L2BitcoinDepositor",
"src": "contracts/baseSepolia/L2BitcoinDepositor.sol:59"
},
{
"label": "l1ChainId",
"offset": 20,
"slot": "102",
"type": "t_uint16",
"contract": "L2BitcoinDepositor",
"src": "contracts/baseSepolia/L2BitcoinDepositor.sol:65"
},
{
"label": "l1BitcoinDepositor",
"offset": 0,
"slot": "103",
"type": "t_address",
"contract": "L2BitcoinDepositor",
"src": "contracts/baseSepolia/L2BitcoinDepositor.sol:68"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"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(IL2WormholeGateway)4393": {
"label": "contract IL2WormholeGateway",
"numberOfBytes": "20"
},
"t_contract(IWormholeRelayer)4663": {
"label": "contract IWormholeRelayer",
"numberOfBytes": "20"
},
"t_uint16": {
"label": "uint16",
"numberOfBytes": "2"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint8": {
"label": "uint8",
"numberOfBytes": "1"
}
},
"namespaces": {}
}
}
}
}
Loading

0 comments on commit 2edf945

Please sign in to comment.