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.88.031 Jul 20229
0.87.1031 Jul 20229
0.87.930 Jul 20229
0.87.830 Jul 20229
0.87.730 Jul 20229
0.87.630 Jul 20229
0.87.530 Jul 20229
0.87.429 Jul 20229
0.87.229 Jul 20229
0.87.129 Jul 20229
0.87.029 Jul 20229
0.86.028 Jul 20229
0.85.028 Jul 20229
0.84.226 Jul 20229
0.84.126 Jul 20229
0.84.026 Jul 20229
0.83.025 Jul 20229
0.82.025 Jul 20229
0.81.121 Jul 20229
0.81.021 Jul 20229

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