Catalog npm
PACKAGE EXPLORERView in registry

@0xflair/react-openzeppelin

npm

Ready-made React hooks on top of OpenZeppelin smart contracts. This library is built on top of amazing [wagmi](https://wagmi.sh).

Versions collected383
Direct dependencies10From release 0.123.2
Last observed20 Oct, 23:30 UTC

README

Current package documentation

Flair SDK: react-openzeppelin

Ready-made React hooks on top of OpenZeppelin smart contracts. This library is built on top of amazing wagmi.

Getting Started

Installation

npm install @0xflair/react-openzeppelin

The dependencies:

  • ethers: ^5.6.5
  • wagmi: ^0.3.5

Hooks

useOzHasRole

Check if a certain address has a specific Openzeppelin's AccessControl role or not.

import { keccak256, toUtf8Bytes } from "ethers/lib/utils";
import { useOzHasRole } from "@0xflair/react-openzeppelin";

const { data, error, isLoading } = useOzHasRole({
  // You contract address that is using Openzeppelin's AccessControl
  contractAddress: "0x111111111111111111111111111111",

  // The address to check if it has the role or not
  address: "0x222222222222222222222222222222",

  // The role hash you want to check
  role: keccak256(toUtf8Bytes("MINTER_ROLE")),
});

useOzRoleGranter

Assign a certain role to a specific address.

useOzRoleRenouncer

Renounce a certain role from an already granted address.

useOzOwner

Check if a certain address is owner based on Openzeppelin's Ownable.

Missing something?

This library is a work in progress and we'll be adding new hooks as we need them. If there's a method you want to see as a simple hook feel free to open an issue or better create a PR :)

Downloads & popularity

Awaiting observations

No metric observations yet

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

Versions 383

Collected releases
VersionPublishedDirect dependenciesOpen version
0.123.2Registry latest27 Nov 202210
0.123.112 Nov 202210
0.123.08 Nov 202210
0.122.228 Oct 202210
0.122.128 Oct 202210
0.122.028 Oct 202210
0.121.227 Oct 202210
0.121.124 Oct 202210
0.121.020 Oct 202210
0.120.1120 Oct 202210
0.120.1019 Oct 202210
0.120.910 Oct 202210
0.120.810 Oct 202210
0.120.710 Oct 202210
0.120.63 Oct 202210
0.120.53 Oct 202210
0.120.43 Oct 202210
0.120.33 Oct 202210
0.120.23 Oct 202210
0.120.130 Sept 202210

Package advisories

0
No matching advisories collected

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

Repository

PENDING
0xflair/typescript-sdk

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:29 UTC

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

Record identity

package:df5dbad4e1e617061b7a3690e1e9e1e854dd0883d7cbe114c3f96c2968a9e38d