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

@nexeraid/sig-gating-contracts

v3.0.0

Published

Nexera ID Signature Based Gating Contracts

Downloads

54

Readme

@nexeraid/sig-gating-contracts

@nexeraid/sig-gating-contracts

Signature Based Gating: users are verified in our back-end and receive authorization signatures through our api.

Smart Contract Architecture Overview

Architecture Overview

Contracts Files

Examples

./contracts/gatedExamples/ contains examples of an NFT Minter using our signature based gating contracts. /**

  • Example Gated NFT Minter NFT minting contract with gated access based on off-chain signature verification. This contract extends ERC721 for NFT functionality, TxAuthDataVerifier for signature verification, and Ownable for ownership management.

  • Example Gated NFT Minter (Upgradeable) Upgradeable NFT minting contract with gated access based on off-chain signature verification. This contract extends ERC721Upgradeable for NFT functionality, TxAuthDataVerifierUpgradeable for signature verification, and OwnableUpgradeable for ownership management.

  • Example Multiple Inputs Contract This contract demonstrates a contract inheriting from TxAuthDataVerifier to update variables with signature verification. This contract tests more complex inputs such as bytes inputs or no inputs

  • Non Gated Example NFT Minter for comparison

Verifiers

./contracts/sigVerifiers/ contains the smart contracts used to verify signatures

  • Base Transaction Authentication Data Verifier Provides mechanisms for verifying transaction authentication data, including signature verification and nonce management. This contract is designed to be extended by other contracts requiring transaction authentication based on digital signatures. It includes functionality for:

  • Verifying transaction signatures against a specified signer address.

  • Ensuring transactions have not expired based on their block expiration.

  • Incrementing nonces to prevent replay attacks.

  • The contract utilizes OZ SignatureChecker for signature verification (compatible with both EOA and smart contract signers). We recommend our customers set this to point to our deployed NexeraIDSignerManager contract.

  • Transaction Authentication Data Verifier Contract for verifying transaction authentication data, including signature verification and nonce management. It extends BaseTxAuthDataVerifier to provide core functionality for transaction data verification and inherits Context for access control utilities.

  • Transaction Authentication Data Verifier (Upgradeable) Upgradeable contract for verifying transaction authentication data, including signature verification and nonce management. It extends BaseTxAuthDataVerifier to provide core functionality for transaction data verification. It is intended to be deployed behind a proxy for upgradeability.

Signer Manager

./contracts/signerManager/NexeraIDSignerManager.sol is a smart contract that we use to manage the signer address used in our API.

That way, if this address is compromised, we can change it without every customer having to call _setSigner.

This smart contract will be deployed by us and will eventually be controlled by the SIGNER_MANAGER_CONTROLLER_ADDRESS.

Addresses/Roles

DEPLOYER_ADDRESS: deploys example contracts and signerManager, setup in git secrets

We will use 0x8b6c7Df09b65B1f81d9b3Bda73F5f22c50460c35 on all networks.

TX_SIGNER_ADDRESS: signs txAuthData in our api back end, setup and secured by Amazon Secrets Manager

We will use 0x03DF23c4dEA7B52Daf9B7920Ec6CFeDFFA691689 on all networks.

SIGNER_MANAGER_CONTROLLER_ADDRESS: can change the TX_SIGNER_ADDRESS on the SignerManager contract, is a MultiSig gnosis address => SIGNER_MANAGER_CONTROLLER_ROLE

This is a different address on each network:

  • Sepolia: 0x745B6d5f858047Daf7516aa4Fc34878f4BD3b73D
  • Polygon Mainnet: 0x191A193F5D5A88D7Ac52565c5ad3992da6D11183
  • Base: 0xb748Cf0409bDc6f8039090EF6b09ba9722886d18
  • Ethereum: 0x5818DD2D71c33e6078A9dEFD78829290FD25Dab2
  • Arbitrum: 0xB071EC779D41D6aa43261A9BB275269f53A4a67c
  • Optimism: 0xD5FE72cb8195518E9E5D6cB3E5Ab5A352670f5fB
  • BSC/BNB: 0xB071EC779D41D6aa43261A9BB275269f53A4a67c
  • Avalanche: 0xD5FE72cb8195518E9E5D6cB3E5Ab5A352670f5fB

Deployments

SignerManager is deployed on 0x29A75f22AC9A7303Abb86ce521Bb44C4C69028A0 on

  • Sepolia
  • Polygon Amoy
  • Polygon Mainnet
  • Base
  • Base Sepolia
  • Ethereum
  • Arbitrum
  • Arbitrum Sepolia
  • Optimism
  • Optimism Sepolia
  • BSC/BNB
  • BNB Testnet
  • Avalanche
  • Avalanche Fuji

Sig Gating Tests

./test/ features tests for signature gating using our examples.