Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into validate-blob
Browse files Browse the repository at this point in the history
  • Loading branch information
9yoi authored Jun 8, 2024
2 parents 8720d08 + d3b47c7 commit f2dae22
Show file tree
Hide file tree
Showing 7 changed files with 623 additions and 39 deletions.
29 changes: 29 additions & 0 deletions banned-tokens.csv
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,32 @@ Fnwi33q7AGn8rCvFz9NBCSYCvncxKSryadAh32zGRp6x,fake HADES
EMwgbWScCYyXcNA6F4D7P3GJCaGtmKVGZXCNkJsWBvTB,fake HNT
FTTrdeXMJtFhqa23h1oC37m9ZrsXgqcmvY8HMGiyohFs,fake FTT
AtXoHRmGzePmWdJTVzmchX9VTggMaccKoTMx2oGpogVJ,fake JUP
iomr3VGV7EpifYcoyZbY7exD9UghbWTmxzUSPxSQ6WN,fake JUPSOL
HCeGCKbChGPLr6a3PeeLfTfLHjE6dSWNsmnP5boeGYpD,fake JUP
5zvYtRNaFfqiFtipoeomdRXfrmCoX2pSeRREVHGPvN3A,fake JUPSOL
58Xx2G4uodhJtoeDzF5T2r67Z5tqbjZbsfpnBvyeJqiF,fake Game of Memes
9yLXPgDh3pzjDqfA8p8UYoreNzjeDcPqxVFiLsPAx9Ax,fake KMNO
Gnkrukuv9HhDCpTMuUuYnSmjXeTTxezbs3DPjSCyygao,fake KMNO
KMNzEPKWHvJadchBE1kwMwHs8bKVnq7jQ9tUnmKvqKn,fake KMNO
8iEnNnf2Zrv1gkUqeahwhucAMBNyY6vYYetMWHqog7vU,fake KMNO
FyPcy9q2oUXta8DyeEG98SWhBsNFDQDFtBniajoMSCpD,fake KMNO
AuhHd6SJuyoZUQHu5HDCMCcxogCEEKHi9Auu1tUebugn,fake KMNO
9PqhiAMGSaXvyma193Tt2GBHpvtGcLTZpZZbP8nuNMQ,fake KMNO
3LDjnhekVVqdxDmhD5vLHg5LfhxfW9naVyG9NfZqs7DT,fake KMNO
4QYjfQYdhycSRg6ftrcMaMcPTxmHYeeueT8Kux1ehp84,fake PICHI with real CA in name
BqCD3EkMe2b9mpmjRyNmWNVEpZ9YcL8QNEeA4qUCn8i9,fake PYUSD
C3FzfF92nsDAbzTm28tBzYuUJZrtccY8ShPcsRoCexyc,fake PYUSD
8xW4CPZexJprXjmMgLcA8g3jPYxTYxMPpJHSnkKeLYSw,fake PYUSD
9x31u76fpkwN22QGsRe5LBC5mqwWUZdQ5zeYMP8P63t5,fake PYUSD
2L1jmBpcQdvY2DZtRGLrVMe6a81mNhETqAqKxW6Wbctz,fake PYUSD
goadkd3P4SP1w8ZNW5GsGum3vdGw4Q4wRdLWhMPjyua,fake PYUSD
CwRGsGTNzvjjoHhxYxpZquQsapxJ4wRkwS4H9Kvdw8dy,fake PYUSD
Ckbo1yL4QWQ7APYvV1wfBSJu59T53Qh7jbeV6tZVdvB9,fake PYUSD
Bzmx2vzc6kVzsfTU2uCAw1rhtBZKiutbZWHGTtfZKBX2,fake PYUSD
EDBM1GyjydH3ohC4q3WgWe1XS8T8bjukPd3aBPjk32GS,fake PYUSD
BqCD3EkMe2b9mpmjRyNmWNVEpZ9YcL8QNEeA4qUCn8i9,fake PYUSD
4SoypJ9n8aTPjC856rDSW6XroaF5V78W3QmXZtoyaEpt,fake PYUSD
bpWLNxxKo7vzVZfCAzKuNzzjiAFMNQnC47zNZANyeSS,fake PYUSD
BqCD3EkMe2b9mpmjRyNmWNVEpZ9YcL8QNEeA4qUCn8i9,fake PYUSD
F1VCjLrg4Z1AeztQkFdCgHsja89i7HhXmNbv6mSWhqfw,fake PYUSD
BYk5tQT9SaSevAT3ULN1VRJ7MNw8wdgLYKhSqNSBVP3H,fake PYUSD
19 changes: 19 additions & 0 deletions examples/README_tags_submission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Display tags for your protocol's tokens

We can ingest your list of tokens and get them tagged automatically, to help your users to trade the right tokens. For example, we have "LST", "pump".fun tokens, and "Strict" list tokens.

We need:
- A url endpoint (e.g. https://raw.githubusercontent.com/jup-ag/token-list/main/examples/sample_tags.csv)
- That points to a simple [.csv file with a mint address per row](./sample_tags.csv) -- click on link to see sample.
- That we can poll at a set interval (tell us how often you expect updates to happen)

The endpoint should be public, with our IP whitelisted for rate limits where necessary.

Tell us if you have a preferred word or acronym for your tag, hopefully short and mobile friendly.


That's it!

Example of tags displayed to the right of the token:

![Example tags](./sample_token_tags.png)
3 changes: 3 additions & 0 deletions examples/sample_tags.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN
27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4
jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v
Binary file added examples/sample_token_tags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
128 changes: 127 additions & 1 deletion src/utils/duplicate-symbols.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { AllowedException } from "../types/types";

export const allowedDuplicateSymbols: AllowedException[] = [
{
Name: 'achi',
Symbol: 'ACHI',
Mint: '4rUfhWTRpjD1ECGjw1UReVhA8G63CrATuoFLRVRkkqhs',
"Community Validated": true
},
{
Name: 'Any Inu (Wormhole)',
Symbol: 'AI',
Expand Down Expand Up @@ -31,6 +37,18 @@ export const allowedDuplicateSymbols: AllowedException[] = [
Mint: '5hmf8Jt9puwoqiFQTb3vr22732ZTKYRLRw9Vo7tN3rcz',
'Community Validated': true,
},
{
Name: 'BIRKIN',
Symbol: 'BAG',
Mint: 'Dnpy7ZkE1LvhyTC1hmTb8opJ6g9rgt2oRvN8z7y35WRJ',
'Community Validated': true,
},
{
Name: 'BASC',
Symbol: 'BASC',
Mint: 'DM3Y4R7n1HGhP9AkNT6Ex4w1qQTpgq1TyujrMDX11FMT',
'Community Validated': true,
},
{
Name: 'Boo',
Symbol: 'BOO',
Expand All @@ -43,6 +61,12 @@ export const allowedDuplicateSymbols: AllowedException[] = [
Mint: 'EXA537HSBVpsFijENbt6Muuy9AADUN8dUmYKD4oKbjJE',
'Community Validated': true,
},
{
Name: 'JustAnEgg',
Symbol: 'EGG',
Mint: 'wo1zgt8rfrYpvdVi4nidoj1SYfcR4pQx69bmNv2JLhQ',
'Community Validated': true,
},
{
Name: 'Food',
Symbol: 'FOOD',
Expand Down Expand Up @@ -73,18 +97,48 @@ export const allowedDuplicateSymbols: AllowedException[] = [
Mint: 'CNL2opdqaQDY7yudm5V4MAaTwuuY32LTKqNP93jZM8X6',
'Community Validated': true,
},
{
Name: 'Hide the pain Harold',
Symbol: 'Harold',
Mint: 'B8AmDZRJeHuq8CPciey6jocq9p4ivc4ZurDXPwtqs2Qg',
'Community Validated': true,
},
{
Name: 'LILY',
Symbol: 'LILY',
Mint: '7FYvphuZtRxB7BZd8PZ65yZmEEuWYYdxiHubthyd38BE',
"Community Validated": true
},
{
Name: "TRUMP'S HAT",
Symbol: 'MAGA',
Mint: 'AwduJQUJoSCZm5BUdhF99iZkUTUGHU34TPft8w5kNbw1',
"Community Validated": true
},
{
Name: "MAGA",
Symbol: 'MAGA',
Mint: 'sfYDFZJguyF4YLZjje7qwwh41NRymFfZ3QXZbVm7Eyg',
"Community Validated": true
},
{
Name: 'Solmedia',
Symbol: 'MEDIA',
Mint: 'BNT4uhSStq1beFADv3cq4wQAVfWB392PjAaxTBpNeWxu',
"Community Validated": true
},
{
Name: 'MILK',
Symbol: 'MILK',
Mint: 'MLKmUCaj1dpBY881aFsrBwR9RUMoKic8SWT3u1q5Nkj',
"Community Validated": false
},
{
Name: 'MoonMarket',
Symbol: 'MOON',
Mint: 'CcPYxgVbSmP9VgNRLdT7KkznZJQ7DyFJ2ZvSPwgdN62e',
"Community Validated": true
},
{
Name: 'NANA Token',
Symbol: 'NANA',
Expand All @@ -97,18 +151,48 @@ export const allowedDuplicateSymbols: AllowedException[] = [
Mint: 'DFrJxDoLMYt6bNYeNe8Wrjzj2UPUSLZLEMMYBLuTKcTk',
"Community Validated": true
},
{
Name: 'NYAN',
Symbol: 'NYAN',
Mint: 'NYANpAp9Cr7YarBNrby7Xx4xU6No6JKTBuohNA3yscP',
"Community Validated": true
},
{
Name: 'Shinobi',
Symbol: 'NINJA',
Mint: '2xP43MawHfU7pwPUmvkc6AUWg4GX8xPQLTGMkSZfCEJT',
"Community Validated": true
},
{
Name: 'Only Possible On Solana',
Symbol: 'OPOS',
Mint: 'BqVHWpwUDgMik5gbTciFfozadpE2oZth5bxCDrgbDt52',
"Community Validated": true
},
{
Name: 'Procreation AI',
Symbol: 'PAI',
Mint: '2TybzwN2X1g7Y6GRbB4cRx4KPK7bqdK9tYCozBXxiTfr',
'Community Validated': true,
},
{
Name: 'PayPaw',
Symbol: 'PAW',
Mint: 'pawSXHWsonrTey4SX7tz1fM9ksuLpE13Y54K57ym4Rg',
'Community Validated': true,
},
{
Name: 'PEPESOLANA',
Symbol: 'PEPE',
Mint: 'CYuXNHURE8cF3rQc1687DZnmsWx9ATNG3mZPFmryu22S',
"Community Validated": true
},
{
Name: 'PEPE',
Symbol: 'PEPE',
Mint: 'B5WTLaRwaUQpKk7ir1wniNB6m5o8GgMrimhKMYan2R6B',
"Community Validated": true
},
{
Name: 'Rocky',
Symbol: 'ROCKY',
Expand All @@ -120,6 +204,30 @@ export const allowedDuplicateSymbols: AllowedException[] = [
Symbol: 'SB',
Mint: '8twuNzMszqWeFbDErwtf4gw13E6MUS4Hsdx5mi3aqXAM',
'Community Validated': true,
},
{
Name: 'Sharky',
Symbol: 'SHARK',
Mint: ' SHARKSYJjqaNyxVfrpnBN9pjgkhwDhatnMyicWPnr1s',
'Community Validated': true,
},
{
Name: 'SHIBA INU',
Symbol: 'SHIB',
Mint: '5MBBsoCVddAuF8XixvCcXNbHAw6WfpZ8WyTKMmczxxRN',
'Community Validated': true,
},
{
Name: 'shibwifhat',
Symbol: 'SHIB',
Mint: 'F6qoefQq4iCBLoNZ34RjEqHjHkD8vtmoRSdw9Nd55J1k',
'Community Validated': true,
},
{
Name: 'Sol Eye',
Symbol: 'EYE',
Mint: '74Eyos32V2B6ineYgAcRMZsiDpz65z7sXHq7D5MSMYgF',
"Community Validated": true
},
{
Name: 'Soul Scanner',
Expand All @@ -139,6 +247,24 @@ export const allowedDuplicateSymbols: AllowedException[] = [
Mint: 'sRLY3migNrkC1HLgqotpvi66qGkdNedqPZ9TJpAQhyh',
"Community Validated": false
},
{
Name: 'SWOLE',
Symbol: 'SWOLE',
Mint: 'sio28ienC3iABUKJFzkikHknbR3xyhjzhJE34tipyDP',
"Community Validated": true
},
{
Name: 'TREN',
Symbol: 'TREN',
Mint: 'HLnTNCG5RD7jYVduFc1pMCHiuApoWGn9LveqEFanQFZb',
'Community Validated': true,
},
{
Name: 'TRUMP',
Symbol: 'TRUMP',
Mint: 'AwRErBEFGTnohzfLeRSBH9HddQEy2oeRxnWLrbvFFh95',
'Community Validated': true,
},
{
Name: 'Whales Market',
Symbol: 'WHALES',
Expand Down Expand Up @@ -3826,4 +3952,4 @@ export const allowedNotCommunityValidated: AllowedException[] = [
"Mint": "A7rqejP8LKN8syXMr4tvcKjs2iJ4WtZjXNs1e6qP3m9g",
"Community Validated": false
}
]
]
27 changes: 0 additions & 27 deletions src/utils/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,33 +263,6 @@ export async function newTokensHaveMatchingOnchainMeta(connection: Connection, n
errors += 1;
}

// URI mismatch
// what a mess. On-chain metadata URIs are actually a JSON to a URL
// which has the actual Logo URL. So we have to try and fetch before we
// make an actual comparison.
let newLogoURI = null;
if (metadata.uri !== newToken.LogoURI) {
let uriMismatch = true; // Assume there's a mismatch initially
// it might be a JSON. Let's try to fetch it and see if it has an image key
if (await checkContentType(metadata.uri) === 'application/json') {
newLogoURI = await getLogoURIFromJson(metadata.uri);
if (newLogoURI === newToken.LogoURI) {
uriMismatch = false; // The URIs match after fetching the JSON, so no mismatch
}
}

if (uriMismatch) {
let errorMessage = `${ValidationError.INVALID_METADATA}: ${newToken.Mint} URI mismatch Expected: ${newToken.LogoURI}, Found Onchain: `;
if (newLogoURI) {
errorMessage += `${newLogoURI} (from JSON ${metadata.uri})`;
} else {
errorMessage += `${metadata.uri}`;
}
console.log(errorMessage);
errors += 1;
}
}

// Decimals mismatch
if (metadata.decimals !== Number(newToken.Decimals)) {
console.log(`${ValidationError.INVALID_METADATA}: ${newToken.Mint} Decimals mismatch Expected: ${newToken.Decimals}, Found: ${metadata.decimals}`);
Expand Down
Loading

0 comments on commit f2dae22

Please sign in to comment.