Skip to content

Commit

Permalink
fix: Return final withdraw amount in L2Pool withdraw fn (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf authored Mar 15, 2023
1 parent 7b2a284 commit 37b4d1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion contracts/interfaces/IL2Pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ interface IL2Pool {
* @dev the shortenedAmount is cast to 256 bits at decode time, if type(uint128).max the value will be expanded to
* type(uint256).max
* @dev assetId is the index of the asset in the reservesList.
* @return The final amount withdrawn
*/
function withdraw(bytes32 args) external;
function withdraw(bytes32 args) external returns (uint256);

/**
* @notice Calldata efficient wrapper of the borrow function, borrowing on behalf of the caller
Expand Down
4 changes: 2 additions & 2 deletions contracts/protocol/pool/L2Pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ contract L2Pool is Pool, IL2Pool {
}

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

withdraw(asset, amount, msg.sender);
return withdraw(asset, amount, msg.sender);
}

/// @inheritdoc IL2Pool
Expand Down

0 comments on commit 37b4d1f

Please sign in to comment.