-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add helper and modifier to Shared tests.
- Loading branch information
1 parent
97c0d28
commit 71a09e6
Showing
2 changed files
with
29 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.23; | ||
|
||
// Test imports | ||
import {Base_Test_} from "test/Base.sol"; | ||
|
||
// Utils | ||
import {Mainnet} from "test/utils/Addresses.sol"; | ||
|
||
abstract contract Helpers is Base_Test_ { | ||
/// @notice Override `deal()` function to handle OETH special case. | ||
function deal(address token, address to, uint256 amount) internal override { | ||
// Handle OETH special case, as rebasing tokens are not supported by the VM. | ||
if (token == address(oeth)) { | ||
// Check than whale as enough OETH. | ||
require(oeth.balanceOf(Mainnet.WHALE_OETH) >= amount, "Fork_Shared_Test_: Not enough OETH in WHALE_OETH"); | ||
|
||
// Transfer OETH from WHALE_OETH to the user. | ||
vm.prank(Mainnet.WHALE_OETH); | ||
oeth.transfer(to, amount); | ||
} else { | ||
super.deal(token, to, amount); | ||
} | ||
} | ||
} |