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: Update readme to make code example run #75

Merged
merged 2 commits into from
Jul 25, 2024

Conversation

cazeth
Copy link
Contributor

@cazeth cazeth commented Jul 24, 2024

Hi, had to to make a couple updates to the code example in the readme to get it to run on my machine. Might have been something I did wrong, but this runs out of the box for me. Sharing in case it's useful.

@malik672
Copy link
Owner

ohh, make sense tbh

@malik672 malik672 requested a review from shuhuiluo July 24, 2024 10:09
README.md Outdated
Comment on lines 62 to 63
const ANOTHER_TOKEN_ADDRESS: &str = "0x0000000000000000000000000000000000000002";
let another_token = token!(CHAIN_ID, ANOTHER_TOKEN_ADDRESS, DECIMALS, "ETH", "Ethereum");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const ANOTHER_TOKEN_ADDRESS: &str = "0x0000000000000000000000000000000000000002";
let another_token = token!(CHAIN_ID, ANOTHER_TOKEN_ADDRESS, DECIMALS, "ETH", "Ethereum");
let another_token = token!(
CHAIN_ID,
"0000000000000000000000000000000000000002",
DECIMALS,
"ETH",
"Ethereum"
);

token! can take either string literal or &str. If passing string literal to address! macro, "0x" should be stripped.

README.md Outdated
Comment on lines 39 to 40
use uniswap_sdk_core::prelude::*;
use uniswap_sdk_core::token;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
use uniswap_sdk_core::prelude::*;
use uniswap_sdk_core::token;
use crate::{prelude::*, token};

@shuhuiluo shuhuiluo changed the title Update readme to make code example run. fix: Update readme to make code example run Jul 25, 2024
Copy link
Collaborator

@shuhuiluo shuhuiluo left a comment

Choose a reason for hiding this comment

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

Thx.

@shuhuiluo shuhuiluo merged commit 549435c into malik672:master Jul 25, 2024
2 checks passed
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