Skip to content

Commit 351c0a8

Browse files
test: Don't assume 0 balance on live wrapper contracts
1 parent 26d22ed commit 351c0a8

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/BaseTokenWrapper.sol

+5
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ abstract contract BaseTokenWrapper is Ownable, IBaseTokenWrapper {
103103
return _withdrawToken(amount, to, aTokenOut);
104104
}
105105

106+
/// @inheritdoc IBaseTokenWrapper
107+
function borrowToken(uint256 amount, address to) external {
108+
// Implement borrow logic here
109+
}
110+
106111
/// @inheritdoc IBaseTokenWrapper
107112
function rescueTokens(
108113
IERC20 token,

src/interfaces/IBaseTokenWrapper.sol

+7
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ interface IBaseTokenWrapper {
6161
PermitSignature calldata signature
6262
) external returns (uint256);
6363

64+
/**
65+
* @notice Borrows the wrapped token from the Pool, unwraps it, sending to the recipient
66+
* @param amount The amount of the token to borrow from the Pool and unwrap
67+
* @param to The address that will receive the unwrapped token
68+
*/
69+
function borrowToken(uint256 amount, address to) external;
70+
6471
/**
6572
* @notice Provides way for the contract owner to rescue ERC-20 tokens
6673
* @param token The address of the token to withdraw from this contract

test/BaseTokenWrapper.t.sol

+1
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ abstract contract BaseTokenWrapperTest is Test {
638638

639639
function testRescueETH() public {
640640
uint256 ethAmount = 100 ether;
641+
vm.deal(address(tokenWrapper), 0);
641642
assertEq(
642643
address(tokenWrapper).balance,
643644
0,

0 commit comments

Comments
 (0)