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: Add new Sonic tokens, some SVM tooling drive-bys #5334

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

Conversation

tkporter
Copy link
Collaborator

@tkporter tkporter commented Jan 29, 2025

Description

Drive-bys for the SVM tooling:

  • make sure that metadata for an SVM synthetic matches some basic expectations, e.g.
    • points to a legit machine readable URL (we had an issue here once)
    • image is a valid URL that's queryable
    • symbol / name match the token config (we had an issue here once)
  • No longer require explicitly specifying if a collateral token is SPL Token or SPL Token 2022. We imply this instead by looking at the owner of the collateral mint. Removes this from all previous configs

And adds the following tokens between Solana and Sonic: sSOL, USDStar, USDC, USDT, SONIC

Drive-by changes

Related issues

Backward compatibility

Testing

Copy link

changeset-bot bot commented Jan 29, 2025

⚠️ No Changeset found

Latest commit: e7b7e2f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.53%. Comparing base (f250b19) to head (e7b7e2f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5334   +/-   ##
=======================================
  Coverage   77.53%   77.53%           
=======================================
  Files         103      103           
  Lines        2110     2110           
  Branches      190      190           
=======================================
  Hits         1636     1636           
  Misses        453      453           
  Partials       21       21           
Components Coverage Δ
core 87.80% <ø> (ø)
hooks 79.39% <ø> (ø)
isms 83.68% <ø> (ø)
token 91.27% <ø> (ø)
middlewares 79.80% <ø> (ø)

Copy link
Contributor

@paulbalaji paulbalaji left a comment

Choose a reason for hiding this comment

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

lgtm but would also appreciate a second review from @daniel-savu on the rust improvements

Comment on lines +64 to +73
assert!(
self.description.is_some(),
"Description must be provided for token with name: {}",
self.name
);
assert!(
self.image.is_some(),
"Image must be provided for token with name: {}",
self.name
);
Copy link
Contributor

Choose a reason for hiding this comment

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

if these are mandatory, should their types have the Options removed?

Comment on lines +453 to +460
let metadata_response = reqwest::blocking::get(metadata_uri).unwrap();
let metadata_contents: SplTokenOffchainMetadata = metadata_response
.json()
.expect("Failed to parse metadata JSON");
metadata_contents.validate();

// Ensure that the metadata contents match the provided token config.
assert_eq!(metadata_contents.name, synthetic.name, "Name mismatch");
Copy link
Contributor

Choose a reason for hiding this comment

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

amazing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

3 participants