PolicyRegistry

Git Source

Author: Enrique Piqueras - epiquerass@gmail.com

A contract to maintain a policy for each court.

State Variables

governor

address public governor;

policies

mapping(uint256 => string) public policies;

Functions

onlyByGovernor

Requires that the sender is the governor.

modifier onlyByGovernor();

constructor

Constructs the PolicyRegistry contract.

constructor(address _governor);

Parameters

NameTypeDescription
_governoraddressThe governor's address.

changeGovernor

Changes the governor storage variable.

function changeGovernor(address _governor) external onlyByGovernor;

Parameters

NameTypeDescription
_governoraddressThe new value for the governor storage variable.

setPolicy

Sets the policy for the specified court.

function setPolicy(uint256 _courtID, string calldata _courtName, string calldata _policy) external onlyByGovernor;

Parameters

NameTypeDescription
_courtIDuint256The ID of the specified court.
_courtNamestringThe name of the specified court.
_policystringThe URI of the policy JSON.

Events

PolicyUpdate

Emitted when a policy is updated.

event PolicyUpdate(uint256 indexed _courtID, string _courtName, string _policy);