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.120.030 Sept 202210
0.119.229 Sept 202210
0.119.129 Sept 202210
0.119.029 Sept 202210
0.118.329 Sept 202210
0.118.229 Sept 202210
0.118.129 Sept 202210
0.118.029 Sept 202210
0.117.129 Sept 202210
0.117.027 Sept 202210
0.116.522 Sept 202210
0.116.421 Sept 202210
0.116.316 Sept 202210
0.116.215 Sept 202210
0.116.111 Sept 202210
0.116.08 Sept 202210
0.115.37 Sept 202210
0.115.27 Sept 202210
0.115.17 Sept 202210
0.115.07 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