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

Support Pair default fee in RouterV2 #122

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

Conversation

JanKuczma
Copy link
Contributor

No description provided.

Copy link
Contributor

@ggawryal ggawryal left a comment

Choose a reason for hiding this comment

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

LGTM

let fee = match contract_ref.call().get_fee().try_invoke() {
Ok(Ok(fee)) => fee,
// is not a Pair contract.
let token_0 = match contract_ref.call().get_token_0().try_invoke() {
Copy link
Contributor

@woocash2 woocash2 Oct 30, 2024

Choose a reason for hiding this comment

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

Why suddenly like this & why obtain token0 and token1 differently?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the Pair contract may not implement get_fee(), however, it must implement get_token_0() and get_token_1().
Given that get_token_0() call is successful, we assume that the contract is a Pair, and there's no need to control the invocation of the get_token_1().

Copy link
Contributor

@woocash2 woocash2 left a comment

Choose a reason for hiding this comment

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

Thank you sir

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.

3 participants