npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bonfida/sub-register

v0.0.1-alpha.3

Published

<h1 align="center">SNS Subdomain Registrar</h1> <br /> <p align="center"> <img width="250" src="https://bafybeigmoph2jbhw4hjbqqgfj453tenw25g5je6ps35tftfe4tyil2k2re.ipfs.dweb.link/"/> </p> <p align="center"> <a href="https://twitter.com/bonfida"> <img src=

Downloads

9

Readme

The SNS Subdomain Registrar is a smart contract repository that provides functionalities for subdomain registration.

Program ID

  • Mainnet program ID 2KkyPzjaAYaz2ojQZ9P3xYakLd96B5UH6a2isLaZ4Cgs

Design

The SNS Subdomain Registrar allows .sol domain owners to establish a subdomain registrar, referred to as "registrar". Each registrar is a Program Derived Account (PDA) of the smart contract tasked with managing subdomain issuance. Upon the creation of a registrar, ownership of the .sol domain is transferred to the registrar's account to facilitate subdomain management. The creator of the registrar is required to define several parameters during its setup:

  • Price Schedule: This outlines the cost for registering subdomains, which varies based on the length of the subdomain.
  • Admin Authority: Identifies the individual or entity with permissions to modify the registrar's settings.
  • NFT Mint: For scenarios where subdomain issuance is restricted to holders of specific NFT collections, the admin must specify a cap on the number of subdomains per NFT.
  • Revocation Rights: Determines whether the admin has the authority to revoke previously issued subdomains.

To reclaim the .sol domain and dissolve the registrar, it is mandatory to delete all associated subdomains.

Subdomain issuance is monitored through SubRecord accounts, which track each subdomain. In cases where issuance is limited to NFT holders, MintRecord accounts are used to keep a count of subdomains issued per NFT, ensuring adherence to the specified limits.

Example

// Creating a registrar

const domain = "awesome.sol"; // Domain name
const domainOwner = new PublicKey("..."); // Domain owner
const feePayer = new PublicKey("..."); // Fee payer
const tokenMint = new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"); // Token mint used for payments e.g USDC
const admin = new PublicKey("..."); // Admin authority of the registrar
const feeAccount = getAssociatedTokenAddressSync(mint, admin); // Token account used to receive funds
const allowRevoke = false; // Whether to allow admin authority to revoke subdomains

const schedule = [
  new Schedule({ price: BigInt(".."), length: BigInt(1) }),
  new Schedule({ price: BigInt(".."), length: BigInt(2) }),
  new Schedule({ price: BigInt(".."), length: BigInt(3) }),
  // ...
];

const ix = await createRegistrar(
  domain,
  domainOwner,
  feePayer,
  tokenMint,
  admin,
  schedule,
  feeAccount,
  null, // Non NFT Gated case
  null, // Non NFT Gated case
  allowRevoke
);

Reproducible build

A reproducible build script (build.sh) can be used to build the program using docker

Security

For security disclosures or to report a bug, please visit ImmuneFi for more information on our bug bounty program.