Crate open_block_ei_open_roles_near_core[][src]

Expand description

SPDX-License-Identifier: APACHE 2.0

OpenRoles crate for NEAR blockchain


@author : Block Star Logic
@coder : T Ushewokunze
@license : Apache 2.0


The obei_or_near_core crate contains the functionality to enable remote governance of function level access for smart contracts built on the NEAR blockchain.

The OpenRolesContract is the core functional struct of this crate. It enables the independent creation of ’ParticipantList’s the registration of ’DependentContract’s to be placed under management and the assignment of ‘ParticipantLists’ to ‘DependentContracts’.

’ParticipantList’s hold the participants to be either ‘allowed’ or ‘barred’ access to a given function on a given smart contract.

’DependentContact’s are the contracts for the dApp under governance of the ‘OpenRolesContract’

As the OpenRolesContract is deployed separately from the main ‘functional contract’ the access scheme can be shared and retained across deployments and migrations, without altering the governance model

Integration

To integrate Open Roles into a dApp contract you need to ‘use’ [\or_traits::TOpenRoles] and implement this where ever needed in your dApp contract as follows:
[ext_open_roles::is_allowed ( near_account_id, registered_contract_name, contract_operation, signer_account_id, no_deposit, base_gas_fee );]

A Promise will be returned from the OpenRolesContract containing a ‘bool’ as per the function definition

Structs