Skip to content

add swapAndLombardTransfer #27

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

thal0x
Copy link
Member

@thal0x thal0x commented Apr 11, 2025

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);

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