Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
proletesseract committed Nov 14, 2023
1 parent d7d7bb3 commit 26e1764
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/interfaces/root/flowrate/IRootERC20BridgeFlowRate.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache 2.0
pragma solidity ^0.8.19;
pragma solidity 0.8.19;

interface IRootERC20BridgeFlowRate {}

Expand Down
2 changes: 1 addition & 1 deletion src/root/flowrate/FlowRateDetection.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Immutable Pty Ltd 2018 - 2023
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
pragma solidity 0.8.19;

/**
* @title Flow Rate Detection
Expand Down
3 changes: 2 additions & 1 deletion src/root/flowrate/FlowRateWithdrawalQueue.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Immutable Pty Ltd 2018 - 2023
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
pragma solidity 0.8.19;

/**
* @title Flow Rate Withdrawal Queue
Expand Down Expand Up @@ -107,6 +107,7 @@ abstract contract FlowRateWithdrawalQueue {
* @param amount The amount to withdraw.
*/
function _enqueueWithdrawal(address receiver, address withdrawer, address token, uint256 amount) internal {
// @TODO look at using a mapping instead of an array to make the withdraw function simpler
if (token == address(0)) {
revert TokenIsZero(receiver);
}
Expand Down
3 changes: 2 additions & 1 deletion src/root/flowrate/RootERC20BridgeFlowRate.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache 2.0
pragma solidity ^0.8.19;
pragma solidity 0.8.19;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
Expand Down Expand Up @@ -166,6 +166,7 @@ contract RootERC20BridgeFlowRate is
* Only when not paused.
*/
function _withdraw(bytes memory data) internal override {
// @TODO abstract this inside the RootERC20Bridge.sol
(address rootToken, address withdrawer, address receiver, uint256 amount) =
abi.decode(data, (address, address, address, uint256));
address childToken;
Expand Down
8 changes: 8 additions & 0 deletions test/unit/root/flowrate/RootERC20BridgeFlowRate.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,12 @@ contract RootERC20BridgeFlowRateUnitTest is Test, IRootERC20BridgeFlowRateEvents
);
}

//RootBridge initialiser should revert

//Flow rate settings with roles

//Flow rate withdraw

//Processing the queued withdraws

}

0 comments on commit 26e1764

Please sign in to comment.