@privylabs/authorized

1.2.1 • Public • Published

Authorized

This package is an extension to to be used to register/manage Admins and operators to control the desired functions in a Smart Contract.

Install:

npm install @privylabs/authorized
yarn add @privylabs/authorized

Usage:

import { Authorized } from "@privylabs/authorized/contracts/Authorized.sol";

The deployer waller will be registered as the root Admin

constructor() {
        /// @notice Add the deployer as an authorized admin
        authorizedAdmins[msg.sender] = true;
    }

More admins can be managed at:

setAuthorizedAdmin(address _admin, bool status)

To magane Operators:

setAuthorizedOperator(address _operator, bool status)

Use the modifiers onlyAuthorizedAdmin onlyAuthorizedOperator to secure functions:

function foo( string  _var ) external onlyAuthorizedOperator ...

Readme

Keywords

none

Package Sidebar

Install

npm i @privylabs/authorized

Weekly Downloads

0

Version

1.2.1

License

MIT

Unpacked Size

6.85 kB

Total Files

4

Last publish

Collaborators

  • lofimichael
  • aurelianoa