@@ -83,22 +83,21 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
83
83
uint256 token1_DecimalConversionRate;
84
84
}
85
85
86
- /// @notice Struct to hold the info about merkelized deposits for a specific market.
86
+ /// @notice Struct to hold the info about merklized deposits for a specific market.
87
87
struct MerkleDepositsInfo {
88
- MerkleTree.Bytes32PushTree merkleTree; // Merkle tree storing depositor info in the leaves .
88
+ MerkleTree.Bytes32PushTree merkleTree; // Merkle tree storing each deposit as a leaf .
89
89
bytes32 merkleRoot; // Merkle root of the merkle tree representing deposits for this market.
90
- uint256 totalAmountDeposited; // Total amount deposited by this depositor for this market.
91
- bool canBeBridged;
90
+ uint256 totalAmountDeposited; // Total amount deposited by depositors for this market.
92
91
}
93
92
94
93
/// @notice Struct to hold the info about a depositor.
95
- struct DepositorInfo {
94
+ struct IndividualDepositorInfo {
96
95
uint256 totalAmountDeposited; // Total amount deposited by this depositor for this market.
97
96
uint256 latestCcdmNonce; // Most recent CCDM nonce of the bridge txn that this depositor was included in for this market.
98
97
}
99
98
100
99
/// @notice Struct to hold the info about a Weiroll Wallet.
101
- struct WeirollWalletInfo {
100
+ struct WeirollWalletDepositInfo {
102
101
uint256 amountDeposited; // The amount deposited by this specific Weiroll Wallet.
103
102
uint256 ccdmNonceOnDeposit; // The global CCDM nonce when this Weiroll Wallet deposited into the Deposit Locker.
104
103
}
@@ -141,11 +140,11 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
141
140
/// @notice Mapping from market hash to the MerkleDepositsInfo struct.
142
141
mapping (bytes32 => MerkleDepositsInfo) public marketHashToMerkleDepositsInfo;
143
142
144
- /// @notice Mapping from market hash to depositor's address to the DepositorInfo struct.
145
- mapping (bytes32 => mapping (address => DepositorInfo )) public marketHashToDepositorToDepositorInfo ;
143
+ /// @notice Mapping from market hash to depositor's address to the IndividualDepositorInfo struct.
144
+ mapping (bytes32 => mapping (address => IndividualDepositorInfo )) public marketHashToDepositorToIndividualDepositorInfo ;
146
145
147
- /// @notice Mapping from depositor's address to Weiroll Wallet to the WeirollWalletInfo struct.
148
- mapping (address => mapping (address => WeirollWalletInfo )) public depositorToWeirollWalletToWeirollWalletInfo ;
146
+ /// @notice Mapping from depositor's address to Weiroll Wallet to the WeirollWalletDepositInfo struct.
147
+ mapping (address => mapping (address => WeirollWalletDepositInfo )) public depositorToWeirollWalletToWeirollWalletDepositInfo ;
149
148
150
149
/// @notice Used to keep track of CCDM bridge transactions.
151
150
/// @notice A CCDM bridge transaction that results in multiple OFTs being bridged (LP bridge) will have the same nonce.
@@ -544,8 +543,8 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
544
543
marketInputToken.safeTransferFrom (msg .sender , address (this ), amountDeposited);
545
544
546
545
// Account for deposit
547
- marketHashToDepositorToDepositorInfo [targetMarketHash][depositor].totalAmountDeposited += amountDeposited;
548
- WeirollWalletInfo storage walletInfo = depositorToWeirollWalletToWeirollWalletInfo [depositor][msg .sender ];
546
+ marketHashToDepositorToIndividualDepositorInfo [targetMarketHash][depositor].totalAmountDeposited += amountDeposited;
547
+ WeirollWalletDepositInfo storage walletInfo = depositorToWeirollWalletToWeirollWalletDepositInfo [depositor][msg .sender ];
549
548
walletInfo.ccdmNonceOnDeposit = ccdmNonce;
550
549
walletInfo.amountDeposited = amountDeposited;
551
550
@@ -564,8 +563,8 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
564
563
address depositor = wallet.owner ();
565
564
566
565
// Get the necessary depositor and Weiroll Wallet info to process the withdrawal
567
- DepositorInfo storage depositorInfo = marketHashToDepositorToDepositorInfo [targetMarketHash][depositor];
568
- WeirollWalletInfo storage walletInfo = depositorToWeirollWalletToWeirollWalletInfo [depositor][msg .sender ];
566
+ IndividualDepositorInfo storage depositorInfo = marketHashToDepositorToIndividualDepositorInfo [targetMarketHash][depositor];
567
+ WeirollWalletDepositInfo storage walletInfo = depositorToWeirollWalletToWeirollWalletDepositInfo [depositor][msg .sender ];
569
568
570
569
// Get amount to withdraw for this Weiroll Wallet
571
570
uint256 amountToWithdraw = walletInfo.amountDeposited;
@@ -760,7 +759,7 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
760
759
nonce,
761
760
NUM_TOKENS_BRIDGED_FOR_SINGLE_TOKEN_BRIDGE,
762
761
marketInputToken.decimals (),
763
- CCDMPayloadLib.BridgeType.INDIVUAL_DEPOSITORS
762
+ CCDMPayloadLib.BridgeType.INDIVIDUAL_DEPOSITORS
764
763
);
765
764
766
765
// Array to store the actual depositors bridged
@@ -839,7 +838,7 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
839
838
uint256 lp_TotalDepositsInBatch = 0 ;
840
839
uint256 [] memory lp_DepositAmounts = new uint256 [](_depositors.length );
841
840
for (uint256 i = 0 ; i < _depositors.length ; ++ i) {
842
- DepositorInfo storage depositorInfo = marketHashToDepositorToDepositorInfo [_marketHash][_depositors[i]];
841
+ IndividualDepositorInfo storage depositorInfo = marketHashToDepositorToIndividualDepositorInfo [_marketHash][_depositors[i]];
843
842
lp_DepositAmounts[i] = depositorInfo.totalAmountDeposited;
844
843
lp_TotalDepositsInBatch += lp_DepositAmounts[i];
845
844
// Set the total amount deposited by this depositor (AP) for this market to zero
@@ -867,10 +866,10 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
867
866
868
867
// Initialize compose messages for both tokens
869
868
bytes memory token0_ComposeMsg = CCDMPayloadLib.initComposeMsg (
870
- _depositors.length , _marketHash, nonce, NUM_TOKENS_BRIDGED_FOR_LP_TOKEN_BRIDGE, token0.decimals (), CCDMPayloadLib.BridgeType.INDIVUAL_DEPOSITORS
869
+ _depositors.length , _marketHash, nonce, NUM_TOKENS_BRIDGED_FOR_LP_TOKEN_BRIDGE, token0.decimals (), CCDMPayloadLib.BridgeType.INDIVIDUAL_DEPOSITORS
871
870
);
872
871
bytes memory token1_ComposeMsg = CCDMPayloadLib.initComposeMsg (
873
- _depositors.length , _marketHash, nonce, NUM_TOKENS_BRIDGED_FOR_LP_TOKEN_BRIDGE, token1.decimals (), CCDMPayloadLib.BridgeType.INDIVUAL_DEPOSITORS
872
+ _depositors.length , _marketHash, nonce, NUM_TOKENS_BRIDGED_FOR_LP_TOKEN_BRIDGE, token1.decimals (), CCDMPayloadLib.BridgeType.INDIVIDUAL_DEPOSITORS
874
873
);
875
874
876
875
// Create params struct
@@ -958,17 +957,17 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
958
957
returns (uint256 depositAmount )
959
958
{
960
959
// Get amount deposited by the depositor (AP)
961
- depositAmount = marketHashToDepositorToDepositorInfo [_marketHash][_depositor].totalAmountDeposited;
960
+ depositAmount = marketHashToDepositorToIndividualDepositorInfo [_marketHash][_depositor].totalAmountDeposited;
962
961
963
962
if (depositAmount == 0 || depositAmount > type (uint96 ).max) {
964
963
return 0 ; // Skip if no deposit or deposit amount exceeds limit
965
964
}
966
965
967
966
// Mark the current CCDM nonce as the latest CCDM bridge txn that this depositor was included in for this market.
968
- marketHashToDepositorToDepositorInfo [_marketHash][_depositor].latestCcdmNonce = _ccdmNonce;
967
+ marketHashToDepositorToIndividualDepositorInfo [_marketHash][_depositor].latestCcdmNonce = _ccdmNonce;
969
968
970
969
// Set the total amount deposited by this depositor (AP) for this market to zero
971
- delete marketHashToDepositorToDepositorInfo [_marketHash][_depositor].totalAmountDeposited;
970
+ delete marketHashToDepositorToIndividualDepositorInfo [_marketHash][_depositor].totalAmountDeposited;
972
971
973
972
// Add depositor to the compose message
974
973
_composeMsg.writeDepositor (_depositorIndex, _depositor, uint96 (depositAmount));
0 commit comments