Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Return final withdraw amount in L2Pool withdraw fn #831

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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