Catalog npm
PACKAGE EXPLORERView in registry

@0xessential/contracts

npm

contracts for nFight

contractsethereumsmartsolidity
Versions collected16
Direct dependencies0From release 0.0.1-beta-16
Last observed20 Oct, 23:07 UTC

README

Current package documentation

@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 EssentialERC2771Context in your contract. We also provide EssentialERC2771ContextUpgradeable if your contract is an upgradeable proxy.

pragma solidity ^0.8.13;

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

contract MyContract is EssentialERC2771Context {}

Then add the EssentialERC2771Context constructor call:

  constructor(address trustedForwarder) EssentialERC2771Context(trustedForwarder) {

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

NetworkAddressname
Mumbai0x9928351FD354D4E45416fc53e90457a428960cF40xEssential Playsession
Mainnet0x9bbb4217115B7296630183Bb23703DEC93E8edCf0xEssential 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.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 16

Collected releases
VersionPublishedDirect dependenciesOpen version
0.0.1-beta-16Registry latest30 Dec 20220
0.0.1-beta-1530 Dec 202241
0.0.1-beta-1411 Oct 20220
0.0.1-beta-1321 Sept 20220
0.0.1-beta-1221 Sept 202236
0.0.1-beta-1119 Sept 20220
0.0.1-beta-1019 Sept 202236
0.0.1-beta-94 Sept 20220
0.0.1-beta-84 Sept 202236
0.0.1-beta-71 Sept 202236
0.0.1-beta-624 Aug 20220
0.0.1-beta-524 Aug 202236
0.0.1-beta-420 May 20220
0.0.1-beta-34 May 20220
0.0.1-beta-24 May 202233
0.0.1-beta2 May 20220

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
0xessential/nfight

Shared repository data · GitHub

License detected in repository
Not collected

Repository

NOT_FOUND
0xessential/0xessential-contracts

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:07 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:d1dd66ab9ed8daa18a70f78d8612e75c7f1b02b941881ada78c926edb992c823