Skip to content

feat: add ADNL (TON Sites) content hash support - #1144

Closed
TONresistor wants to merge 2 commits into
ensdomains:mainfrom
TONresistor:adnl-contenthash
Closed

feat: add ADNL (TON Sites) content hash support#1144
TONresistor wants to merge 2 commits into
ensdomains:mainfrom
TONresistor:adnl-contenthash

Conversation

@TONresistor

Copy link
Copy Markdown

Two commits.

chore: bump @ensdomains/ensjs to 4.3.0
content-hash 3.1.1 (#1141) added the adnl codec (0xb69910), but the app encodes/decodes through @ensdomains/ensjs, whose contentHash util gates protocols on its own allow-list (ProtocolType, the matchProtocol regex, getDisplayCodec). So adnl had to be added there too. 4.3.0 does that.

feat: add ADNL (TON Sites) content hash support

  • adnl added to supportedContentHashKeys, ContentHashProtocol / ContentHashProvider, and the provider map
  • validateContentHash: adnl:// requires a 32-byte hex address
  • TON icon (ton.svg) for the Website group
  • ADNL label + adnl://... placeholder (i18n)
  • unit tests

Input adnl://<hex> is stored on-chain as 0x90b2da05<32-byte hex> and decoded back for display, like the other protocols.

ensjs 4.3.0 adds the adnl content hash codec (via content-hash 3.1.1), required for ADNL/TON Sites support.
- register adnl provider: types, validation (32-byte hex), TON icon, i18n
- users enter adnl://<hex>, encoded and decoded through ensjs like other protocols
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​ensdomains/​ensjs@​4.3.0881008897100

View full report

@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm @ensdomains/ensjs is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: package.jsonnpm/@ensdomains/ensjs@4.3.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@ensdomains/ensjs@4.3.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant