Skip to content

Commit 37b4d1f

Browse files
authored
fix: Return final withdraw amount in L2Pool withdraw fn (#831)
1 parent 7b2a284 commit 37b4d1f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

contracts/interfaces/IL2Pool.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ interface IL2Pool {
3939
* @dev the shortenedAmount is cast to 256 bits at decode time, if type(uint128).max the value will be expanded to
4040
* type(uint256).max
4141
* @dev assetId is the index of the asset in the reservesList.
42+
* @return The final amount withdrawn
4243
*/
43-
function withdraw(bytes32 args) external;
44+
function withdraw(bytes32 args) external returns (uint256);
4445

4546
/**
4647
* @notice Calldata efficient wrapper of the borrow function, borrowing on behalf of the caller

contracts/protocol/pool/L2Pool.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ contract L2Pool is Pool, IL2Pool {
4040
}
4141

4242
/// @inheritdoc IL2Pool
43-
function withdraw(bytes32 args) external override {
43+
function withdraw(bytes32 args) external override returns (uint256) {
4444
(address asset, uint256 amount) = CalldataLogic.decodeWithdrawParams(_reservesList, args);
4545

46-
withdraw(asset, amount, msg.sender);
46+
return withdraw(asset, amount, msg.sender);
4747
}
4848

4949
/// @inheritdoc IL2Pool

0 commit comments

Comments
 (0)