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

@xessential/contracts

v0.0.1-beta-2

Published

Essential Tooling contracts package

Downloads

2

Readme

@0xessential/contracts

This repo contains the Solidity source code for the contracts used in 0xEssential's Cross-Chain Token Gating meta-transaction stack.

The contracts are available as an NPM package and can also be installed as a Foundry dependency.

0xEssential provides deployed versions of EssentialForwarder on Polygon's Mumbai testnet and Matic mainnet.

Developers are also free to deploy their own versions of EssentialForwarder - you may want to deploy your own version so that you can change the domainName that is displayed to users when signing a meta-transaction with their wallet.

Install

With NPM:

  yarn add @0xessential/contracts

With Foundry:

Then add the following line to your remappings.txt:

essential-contracts/=lib/essential-contracts/

Use Deployed Instances

If you're building a layer 2 contract that uses Cross-Chain Token Gating and don't wish to customize the domain name displayed to users, you need to inherit EssentialContext in your contract. We also provide EssentialContextUpgradeable if your contract is an upgradeable proxy.

pragma solidity ^0.8.13;

import "essential-contracts/contracts/fwd/EssentialContext.sol";

contract MyContract is EssentialContext {}

Then add the EssentialContext constructor call:

  constructor(address trustedForwarder) EssentialContext(trustedForwarder) {

The deployed EssentialForwarder instances are available at the following addresses. You will need the name value in your frontend.

| Network | Address | name| | ------- | -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | | Mumbai | 0x9928351FD354D4E45416fc53e90457a428960cF4 | 0xEssential Playsession | | Mainnet | 0x9bbb4217115B7296630183Bb23703DEC93E8edCf | 0xEssential Playsession |

Deploy Your Own

If you require customizing the name of the forwarder shown to users when signing meta-transactions, you need to deploy your own version of an EssentialForwarder.

You can do this by creating your own contract that inherits EssentialForwarder and calls its constructor with your custom name:

pragma solidity ^0.8.13;

import "@0xessential/contracts/fwd/EssentialForwarder.sol";

contract MyCustomForwarder is EssentialForwarder {
  constructor(string[] memory _urls) 
  EssentialForwarder("My Custom Forwarder Name", _urls)
  {}
}

The _urls constructor argument is an array of HTTPS URLs that serve 0xEssential's open source Ownership Lookup RPC API.

You may specify the instance 0xEssential runs - https://middleware.nfight.xyz or see that repo for deploying your own version.