Skip to content

add swapAndLombardTransfer - #27

Open
thal0x wants to merge 3 commits into
mainfrom
jw/lombard-swap-and-tranfer
Open

add swapAndLombardTransfer#27
thal0x wants to merge 3 commits into
mainfrom
jw/lombard-swap-and-tranfer

Conversation

@thal0x

@thal0x thal0x commented Apr 11, 2025

Copy link
Copy Markdown
Contributor

Adds swapAndLombardTransfer to the EurekaHandler contract.

The flow:

  1. Transfer input token to contract
  2. Swap input token for LBTC
  3. Send relay fee (in LBTC) to relayer address
  4. Wrap amountIn - fee to iLBTCv
  5. Eureka transfer iLBTCv to Ledger

@thal0x thal0x self-assigned this Apr 11, 2025
@thal0x
thal0x marked this pull request as ready for review April 11, 2025 15:21
@thal0x thal0x changed the title add lombardSwapAndTransfer add swapAndLombardTransfer Apr 11, 2025
IERC20(lbtc).safeTransfer(fees.relayFeeRecipient, fees.relayFee);
}

uint256 amountOutAfterFees = amountOut - _totalFees(fees);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why do we deduct the relay fee from the amount out here, when during the lombardTransfer function collect the fee but don't actually subtract it from the input amount. I'm assuming its some difference between lombardTransfer using safeTransferFrom(msg.sender, ...) and the swapAndLombardTransfer using safeTransfer to send the relay fee to the recipient, but not completely sure.

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