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

Indexer: BRC-20 indexed as news #32

Open
whoabuddy opened this issue May 9, 2023 · 0 comments
Open

Indexer: BRC-20 indexed as news #32

whoabuddy opened this issue May 9, 2023 · 0 comments

Comments

@whoabuddy
Copy link
Contributor

Would be interesting to investigate what happened here, on 1btc.news home page there is an entry with no title:

anonymous • May 4, 2023 • Inscription # 3,668,162

Looking up that inscription in the API shows it's a BRC-20 mint operation:

{"p":"brc-20","op":"mint","tick":"XUNI","amt":"1"}

https://inscribe.news/api/content/3668162

Related inscription info:

{
  "id": "0aeb138bf3e08749d2f86523bafd47787d3df178456fc362218c3d868f059d6ei0",
  "number": 3668162,
  "address": "bc1p5mf5y9lpu22qhwgy2ylvaw5cxpzxdh09d0ekwlgqxkthghx8hg6qcujzuu",
  "content_type": "text/plain;charset=utf-8",
  "content_length": 50,
  "genesis_block_height": 788323,
  "genesis_tx_id": "0aeb138bf3e08749d2f86523bafd47787d3df178456fc362218c3d868f059d6e",
  "timestamp": "2023-05-05T03:34:57.000Z",
  "last_updated": "2023-05-09T20:58:37.742Z"
}

https://inscribe.news/api/info/3668162

Code path that should've prevented this:

client/lib/api-helpers.ts

Lines 120 to 125 in 6133181

// check that it's a valid news inscription
if (news.p === 'ons' && news.title) {
// if yes, store in V2 KV key for news only
const kvNewsContent = content.clone();
await env.ORD_NEWS_V2.put(keyName, await kvNewsContent.arrayBuffer(), { metadata });
}

Maybe needs a better check on news.title?

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

No branches or pull requests

1 participant