@@ -41,35 +41,6 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
4141 using SafeERC20 for IERC20 ;
4242 using Address for address ;
4343
44- // A data worker can optimistically store several merkle roots on this contract by staking a bond and calling
45- // proposeRootBundle. By staking a bond, the data worker is alleging that the merkle roots all
46- // contain valid leaves that can be executed later to:
47- // - Send funds from this contract to a SpokePool or vice versa
48- // - Send funds from a SpokePool to Relayer as a refund for a relayed deposit
49- // - Send funds from a SpokePool to a deposit recipient to fulfill a "slow" relay
50- // Anyone can dispute this struct if the merkle roots contain invalid leaves before the
51- // requestExpirationTimestamp. Once the expiration timestamp is passed, executeRootBundle to execute a leaf
52- // from the poolRebalanceRoot on this contract and it will simultaneously publish the relayerRefundRoot and
53- // slowRelayRoot to a SpokePool. The latter two roots, once published to the SpokePool, contain
54- // leaves that can be executed on the SpokePool to pay relayers or recipients.
55- struct RootBundle {
56- // Contains leaves instructing this contract to send funds to SpokePools.
57- bytes32 poolRebalanceRoot;
58- // Relayer refund merkle root to be published to a SpokePool.
59- bytes32 relayerRefundRoot;
60- // Slow relay merkle root to be published to a SpokePool.
61- bytes32 slowRelayRoot;
62- // This is a 1D bitmap, with max size of 256 elements, limiting us to 256 chainsIds.
63- uint256 claimedBitMap;
64- // Proposer of this root bundle.
65- address proposer;
66- // Number of pool rebalance leaves to execute in the poolRebalanceRoot. After this number
67- // of leaves are executed, a new root bundle can be proposed
68- uint8 unclaimedPoolRebalanceLeafCount;
69- // When root bundle challenge period passes and this root bundle becomes executable.
70- uint32 requestExpirationTimestamp;
71- }
72-
7344 // Only one root bundle can be stored at a time. Once all pool rebalance leaves are executed, a new proposal
7445 // can be submitted.
7546 RootBundle public rootBundleProposal;
@@ -85,30 +56,9 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
8556 // to 0x0 to disable a pool rebalance route and block executeRootBundle() from executing.
8657 mapping (bytes32 => address ) private poolRebalanceRoutes;
8758
88- struct PooledToken {
89- // LP token given to LPs of a specific L1 token.
90- address lpToken;
91- // True if accepting new LP's.
92- bool isEnabled;
93- // Timestamp of last LP fee update.
94- uint32 lastLpFeeUpdate;
95- // Number of LP funds sent via pool rebalances to SpokePools and are expected to be sent
96- // back later.
97- int256 utilizedReserves;
98- // Number of LP funds held in contract less utilized reserves.
99- uint256 liquidReserves;
100- // Number of LP funds reserved to pay out to LPs as fees.
101- uint256 undistributedLpFees;
102- }
103-
10459 // Mapping of L1 token addresses to the associated pool information.
10560 mapping (address => PooledToken) public pooledTokens;
10661
107- // Helper contracts to facilitate cross chain actions between HubPool and SpokePool for a specific network.
108- struct CrossChainContract {
109- address adapter;
110- address spokePool;
111- }
11262 // Mapping of chainId to the associated adapter and spokePool contracts.
11363 mapping (uint256 => CrossChainContract) public crossChainContracts;
11464
@@ -590,8 +540,8 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
590540 * @param bundleEvaluationBlockNumbers should contain the latest block number for all chains, even if there are no
591541 * relays contained on some of them. The usage of this variable should be defined in an off chain UMIP.
592542 * @notice The caller of this function must approve this contract to spend bondAmount of bondToken.
593- * @param poolRebalanceLeafCount Number of leaves contained in pool rebalance root. Max is the number of whitelisted chains.
594- * @param poolRebalanceRoot Pool rebalance root containing leaves that will send tokens from this contract to a SpokePool.
543+ * @param poolRebalanceLeafCount Number of leaves contained in pool rebalance root. Max is # of whitelisted chains.
544+ * @param poolRebalanceRoot Pool rebalance root containing leaves that sends tokens from this contract to SpokePool.
595545 * @param relayerRefundRoot Relayer refund root to publish to SpokePool where a data worker can execute leaves to
596546 * refund relayers on their chosen refund chainId.
597547 * @param slowRelayRoot Slow relay root to publish to Spoke Pool where a data worker can execute leaves to
0 commit comments