1.2.1 • Published 2 years ago

@privylabs/authorized v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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 ...
1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago