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

feat: data provider for wrapped tokens #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

grothem
Copy link
Contributor

@grothem grothem commented Sep 24, 2024

  • Adds in a new data provider contract to fetch token in/token out details

Copy link

height bot commented Sep 24, 2024

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Comment on lines +14 to +21
struct TokenDetails {
address token;
uint256 balance;
int256 latestAnswer;
uint8 decimals;
string name;
string symbol;
}
Copy link
Contributor

@miguelmtzinf miguelmtzinf Sep 27, 2024

Choose a reason for hiding this comment

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

Suggested change
struct TokenDetails {
address token;
uint256 balance;
int256 latestAnswer;
uint8 decimals;
string name;
string symbol;
}
struct UserPosition {
address token;
uint256 balance;
int256 tokenPrice;
uint8 tokenDecimals;
string tokenName;
string tokenSymbol;
}

we can cast the int256 into uint256 as well.

WrappedToken[] memory wrappedTokens = new WrappedToken[](wrappedTokenConfigs.length);

for (uint256 i = 0; i < wrappedTokenConfigs.length; i++) {
WrappedToken memory wrappedToken;
Copy link
Contributor

Choose a reason for hiding this comment

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

move out of the loop

address tokenWrapperContract;
}

struct WrappedTokenConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
struct WrappedTokenConfig {
struct TokenWrapperData {

Copy link
Contributor

Choose a reason for hiding this comment

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

missing docs in general

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