Skip to content

Commit 1e5db52

Browse files
committed
rename and typo fix
1 parent e2fc255 commit 1e5db52

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

src/core/DepositExecutor.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ contract DepositExecutor is ILayerZeroComposer, Ownable2Step, ReentrancyGuardTra
7474
/// @custom:field leafToWithdrawn Mapping to keep track of which leaves have already withdrawn.
7575
/// Only set for wallets created by MERKLE_DEPOSITORS bridges.
7676
/// @custom:field depositorToTokenToAmountDepositedOnDest Mapping to account for depositor's balance of each token in this Weiroll Wallet.
77-
/// Only set for wallets created by INDIVUAL_DEPOSITORS bridges.
77+
/// Only set for wallets created by INDIVIDUAL_DEPOSITORS bridges.
7878
/// @custom:field tokenToTotalAmountDepositedOnDest Mapping to account for total amounts deposited for each token in this Weiroll Wallet.
79-
/// Set for MERKLE_DEPOSITORS and INDIVUAL_DEPOSITORS bridges.
79+
/// Set for MERKLE_DEPOSITORS and INDIVIDUAL_DEPOSITORS bridges.
8080
struct WeirollWalletAccounting {
8181
bytes32 merkleRoot;
8282
uint256 totalMerkleTreeAmountDepositedOnSource;

src/core/DepositLocker.sol

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,21 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
8383
uint256 token1_DecimalConversionRate;
8484
}
8585

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.
8787
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.
8989
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.
9291
}
9392

9493
/// @notice Struct to hold the info about a depositor.
95-
struct DepositorInfo {
94+
struct IndividualDepositorInfo {
9695
uint256 totalAmountDeposited; // Total amount deposited by this depositor for this market.
9796
uint256 latestCcdmNonce; // Most recent CCDM nonce of the bridge txn that this depositor was included in for this market.
9897
}
9998

10099
/// @notice Struct to hold the info about a Weiroll Wallet.
101-
struct WeirollWalletInfo {
100+
struct WeirollWalletDepositInfo {
102101
uint256 amountDeposited; // The amount deposited by this specific Weiroll Wallet.
103102
uint256 ccdmNonceOnDeposit; // The global CCDM nonce when this Weiroll Wallet deposited into the Deposit Locker.
104103
}
@@ -141,11 +140,11 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
141140
/// @notice Mapping from market hash to the MerkleDepositsInfo struct.
142141
mapping(bytes32 => MerkleDepositsInfo) public marketHashToMerkleDepositsInfo;
143142

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;
146145

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;
149148

150149
/// @notice Used to keep track of CCDM bridge transactions.
151150
/// @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 {
544543
marketInputToken.safeTransferFrom(msg.sender, address(this), amountDeposited);
545544

546545
// 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];
549548
walletInfo.ccdmNonceOnDeposit = ccdmNonce;
550549
walletInfo.amountDeposited = amountDeposited;
551550

@@ -564,8 +563,8 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
564563
address depositor = wallet.owner();
565564

566565
// 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];
569568

570569
// Get amount to withdraw for this Weiroll Wallet
571570
uint256 amountToWithdraw = walletInfo.amountDeposited;
@@ -760,7 +759,7 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
760759
nonce,
761760
NUM_TOKENS_BRIDGED_FOR_SINGLE_TOKEN_BRIDGE,
762761
marketInputToken.decimals(),
763-
CCDMPayloadLib.BridgeType.INDIVUAL_DEPOSITORS
762+
CCDMPayloadLib.BridgeType.INDIVIDUAL_DEPOSITORS
764763
);
765764

766765
// Array to store the actual depositors bridged
@@ -839,7 +838,7 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
839838
uint256 lp_TotalDepositsInBatch = 0;
840839
uint256[] memory lp_DepositAmounts = new uint256[](_depositors.length);
841840
for (uint256 i = 0; i < _depositors.length; ++i) {
842-
DepositorInfo storage depositorInfo = marketHashToDepositorToDepositorInfo[_marketHash][_depositors[i]];
841+
IndividualDepositorInfo storage depositorInfo = marketHashToDepositorToIndividualDepositorInfo[_marketHash][_depositors[i]];
843842
lp_DepositAmounts[i] = depositorInfo.totalAmountDeposited;
844843
lp_TotalDepositsInBatch += lp_DepositAmounts[i];
845844
// Set the total amount deposited by this depositor (AP) for this market to zero
@@ -867,10 +866,10 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
867866

868867
// Initialize compose messages for both tokens
869868
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
871870
);
872871
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
874873
);
875874

876875
// Create params struct
@@ -958,17 +957,17 @@ contract DepositLocker is Ownable2Step, ReentrancyGuardTransient {
958957
returns (uint256 depositAmount)
959958
{
960959
// Get amount deposited by the depositor (AP)
961-
depositAmount = marketHashToDepositorToDepositorInfo[_marketHash][_depositor].totalAmountDeposited;
960+
depositAmount = marketHashToDepositorToIndividualDepositorInfo[_marketHash][_depositor].totalAmountDeposited;
962961

963962
if (depositAmount == 0 || depositAmount > type(uint96).max) {
964963
return 0; // Skip if no deposit or deposit amount exceeds limit
965964
}
966965

967966
// 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;
969968

970969
// 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;
972971

973972
// Add depositor to the compose message
974973
_composeMsg.writeDepositor(_depositorIndex, _depositor, uint96(depositAmount));

src/libraries/CCDMPayloadLib.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ library CCDMPayloadLib {
1919
- Merkle Root: bytes32 (32 bytes)
2020
- Total Amount Deposited on Source: uint256 (32 bytes)
2121
22-
INDIVUAL_DEPOSITORS Data:
22+
INDIVIDUAL_DEPOSITORS Data:
2323
Per Depositor (following 32 byte blocks):
2424
- Depositor / AP address: address (20 bytes)
2525
- Amount Deposited: uint96 (12 bytes)
@@ -28,7 +28,7 @@ library CCDMPayloadLib {
2828
/// @notice Enum for indicating the type of CCDM bridge (merkle or individual).
2929
enum BridgeType {
3030
MERKLE_DEPOSITORS,
31-
INDIVUAL_DEPOSITORS
31+
INDIVIDUAL_DEPOSITORS
3232
}
3333

3434
/// @notice Size of a MERKLE_DEPOSITORS payload.
@@ -46,6 +46,7 @@ library CCDMPayloadLib {
4646

4747
/// @dev Initializes a compose message for CCDM.
4848
/// @param _numDepositors The number of depositors that will be bridged using this compose message.
49+
/// This is only set for INDIVIDUAL_DEPOSITORS bridges.
4950
/// @param _marketHash The Royco market hash associated with the deposits.
5051
/// @param _ccdmNonce The ccdmNonce associated with the DUAL_OR_LP_TOKEN deposits.
5152
/// @param _numTokensBridged The number of input tokens bridged for the destination campaign.

test/TestDepositExecutor.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ contract E2E_Test_DepositExecutor is RecipeMarketHubTestBase {
371371
recipeMarketHub.fillIPOffers(ipOfferHashes, fillAmounts, address(0), FRONTEND_FEE_RECIPIENT);
372372
vm.stopPrank();
373373

374-
(uint256 totalAmountDeposited,) = depositLocker.marketHashToDepositorToDepositorInfo(result.marketHash, ap);
374+
(uint256 totalAmountDeposited,) = depositLocker.marketHashToDepositorToIndividualDepositorInfo(result.marketHash, ap);
375375
result.depositAmounts[i] = totalAmountDeposited;
376376
}
377377

test/TestDepositLocker.t.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ contract Test_DepositsAndWithdrawals_DepositLocker is RecipeMarketHubTestBase {
134134

135135
withdrawnSoFar += fillAmount;
136136

137-
(uint256 totalAmountDeposited,) = depositLocker.marketHashToDepositorToDepositorInfo(marketHash, aps[i]);
138-
(uint256 amountDeposited,) = depositLocker.depositorToWeirollWalletToWeirollWalletInfo(aps[i], depositorWallets[i]);
137+
(uint256 totalAmountDeposited,) = depositLocker.marketHashToDepositorToIndividualDepositorInfo(marketHash, aps[i]);
138+
(uint256 amountDeposited,) = depositLocker.depositorToWeirollWalletToWeirollWalletDepositInfo(aps[i], depositorWallets[i]);
139139

140140
assertEq(totalAmountDeposited, 0);
141141
assertEq(amountDeposited, 0);
@@ -201,8 +201,8 @@ contract Test_DepositsAndWithdrawals_DepositLocker is RecipeMarketHubTestBase {
201201
}
202202

203203
function assertDepositorState(address ap, address weirollWallet, uint256 fillAmount, uint256 filledSoFar) internal {
204-
(uint256 totalAmountDeposited,) = depositLocker.marketHashToDepositorToDepositorInfo(marketHash, ap);
205-
(uint256 amountDeposited,) = depositLocker.depositorToWeirollWalletToWeirollWalletInfo(ap, weirollWallet);
204+
(uint256 totalAmountDeposited,) = depositLocker.marketHashToDepositorToIndividualDepositorInfo(marketHash, ap);
205+
(uint256 amountDeposited,) = depositLocker.depositorToWeirollWalletToWeirollWalletDepositInfo(ap, weirollWallet);
206206
assertEq(totalAmountDeposited, fillAmount);
207207
assertEq(amountDeposited, fillAmount);
208208
assertEq(ERC20(WETH_MAINNET_ADDRESS).balanceOf(address(depositLocker)), filledSoFar);

0 commit comments

Comments
 (0)