Skip to content

feat(wip): direct pool#192

Draft
dantop114 wants to merge 8 commits intomainfrom
feat/gnosis-aave-liquidity-pool
Draft

feat(wip): direct pool#192
dantop114 wants to merge 8 commits intomainfrom
feat/gnosis-aave-liquidity-pool

Conversation

@dantop114
Copy link
Copy Markdown
Collaborator

@dantop114 dantop114 commented Apr 14, 2026

Solves #187

@dantop114 dantop114 marked this pull request as draft April 14, 2026 14:44
Comment thread contracts/interfaces/ILiquidityPoolDirect.sol Outdated
Comment thread contracts/interfaces/ILiquidityPoolDirect.sol Outdated
Comment thread contracts/LiquidityPoolDirect.sol Outdated
@dantop114 dantop114 requested a review from mpetrunic April 15, 2026 07:53
Copy link
Copy Markdown
Member

@mpetrunic mpetrunic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you still need to remove all lint errors

bytes calldata signature
) external;

function borrowManyDirect(address[] calldata borrowTokens, uint256[] calldata amounts) external;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this is pointless. Calling contract can just call borrowDirect multiple times

Comment on lines +473 to +475
// If borrowing directly we don't allow native as the caller
// will take care of pulling funds and unwrapping eventual
// wrapped tokens.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why do we care? if we already have logic, might as well leave it to avoid ifs

/// targetCallData is a trusted and checked calldata.
/// @param borrowToken can be specified as native token address which is 0x0. In this case, the function will
/// borrow wrapped native token, then unwrap it and include the native value in the target call.
function borrow(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you changing this function?

whenBorrowNotPaused
onlyDirectBorrower
{
_borrow(borrowToken, amount, _msgSender(), msg.data[0:0], true);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_borrow(borrowToken, amount, _msgSender(), msg.data[0:0], true);
amount = _processBorrowAmount(amount, msg.data[0:0]);
(uint256 nativeValue, address actualBorrowToken, bytes memory context) =
_borrow(borrowToken, amount, _msgSender(), false, "");
_afterBorrowLogic(actualBorrowToken, context);
// store borrowed amount in mapping

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why are you modifying so much. The only diff is that we don't validate signature and don't call finalizeBorrow which calls target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants