@@ -149,8 +149,8 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
149149 bool depositsEnabled
150150 );
151151 event ProposeRootBundle (
152- uint32 requestExpirationTimestamp ,
153- uint64 unclaimedPoolRebalanceLeafCount ,
152+ uint32 challengePeriodEndTimestamp ,
153+ uint64 poolRebalanceLeafCount ,
154154 uint256 [] bundleEvaluationBlockNumbers ,
155155 bytes32 indexed poolRebalanceRoot ,
156156 bytes32 indexed relayerRefundRoot ,
@@ -161,10 +161,10 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
161161 uint256 groupIndex ,
162162 uint256 indexed leafId ,
163163 uint256 indexed chainId ,
164- address [] l1Token ,
164+ address [] l1Tokens ,
165165 uint256 [] bundleLpFees ,
166- int256 [] netSendAmount ,
167- int256 [] runningBalance ,
166+ int256 [] netSendAmounts ,
167+ int256 [] runningBalances ,
168168 address indexed caller
169169 );
170170 event SpokePoolAdminFunctionTriggered (uint256 indexed chainId , bytes message );
@@ -560,11 +560,11 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
560560 // technically valid but not useful. This could also potentially be enforced at the UMIP-level.
561561 require (poolRebalanceLeafCount > 0 , "Bundle must have at least 1 leaf " );
562562
563- uint32 requestExpirationTimestamp = uint32 (getCurrentTime ()) + liveness;
563+ uint32 challengePeriodEndTimestamp = uint32 (getCurrentTime ()) + liveness;
564564
565565 delete rootBundleProposal; // Only one bundle of roots can be executed at a time. Delete the previous bundle.
566566
567- rootBundleProposal.requestExpirationTimestamp = requestExpirationTimestamp ;
567+ rootBundleProposal.challengePeriodEndTimestamp = challengePeriodEndTimestamp ;
568568 rootBundleProposal.unclaimedPoolRebalanceLeafCount = poolRebalanceLeafCount;
569569 rootBundleProposal.poolRebalanceRoot = poolRebalanceRoot;
570570 rootBundleProposal.relayerRefundRoot = relayerRefundRoot;
@@ -575,7 +575,7 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
575575 bondToken.safeTransferFrom (msg .sender , address (this ), bondAmount);
576576
577577 emit ProposeRootBundle (
578- requestExpirationTimestamp ,
578+ challengePeriodEndTimestamp ,
579579 poolRebalanceLeafCount,
580580 bundleEvaluationBlockNumbers,
581581 poolRebalanceRoot,
@@ -611,7 +611,7 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
611611 address [] memory l1Tokens ,
612612 bytes32 [] memory proof
613613 ) public nonReentrant unpaused {
614- require (getCurrentTime () > rootBundleProposal.requestExpirationTimestamp , "Not passed liveness " );
614+ require (getCurrentTime () > rootBundleProposal.challengePeriodEndTimestamp , "Not passed liveness " );
615615
616616 // Verify the leafId in the poolRebalanceLeaf has not yet been claimed.
617617 require (! MerkleLib.isClaimed1D (rootBundleProposal.claimedBitMap, leafId), "Already claimed " );
@@ -703,7 +703,7 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
703703 */
704704 function disputeRootBundle () public nonReentrant zeroOptimisticOracleApproval {
705705 uint32 currentTime = uint32 (getCurrentTime ());
706- require (currentTime <= rootBundleProposal.requestExpirationTimestamp , "Request passed liveness " );
706+ require (currentTime <= rootBundleProposal.challengePeriodEndTimestamp , "Request passed liveness " );
707707
708708 // Request price from OO and dispute it.
709709 uint256 finalFee = _getBondTokenFinalFee ();
@@ -949,10 +949,12 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
949949 // that will flow from L2 to L1. In this case, we can use it normally in the equation. However, if it is
950950 // negative, then it is already counted in liquidReserves. This occurs if tokens are transferred directly to the
951951 // contract. In this case, ignore it as it is captured in liquid reserves and has no meaning in the numerator.
952- PooledToken memory pooledToken = pooledTokens[l1Token]; // Note this is storage so the state can be modified.
953- uint256 flooredUtilizedReserves = pooledToken.utilizedReserves > 0 ? uint256 (pooledToken.utilizedReserves) : 0 ;
952+ PooledToken memory pooledL1Token = pooledTokens[l1Token];
953+ uint256 flooredUtilizedReserves = pooledL1Token.utilizedReserves > 0
954+ ? uint256 (pooledL1Token.utilizedReserves) // If positive: take the uint256 cast utilizedReserves.
955+ : 0 ; // Else, if negative, then the is already captured in liquidReserves and should be ignored.
954956 uint256 numerator = relayedAmount + flooredUtilizedReserves;
955- uint256 denominator = pooledToken .liquidReserves + flooredUtilizedReserves;
957+ uint256 denominator = pooledL1Token .liquidReserves + flooredUtilizedReserves;
956958
957959 // If the denominator equals zero, return 1e18 (max utilization).
958960 if (denominator == 0 ) return 1e18 ;
0 commit comments