PolicyRegistry
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
| Name | Type | Description | 
|---|---|---|
_governor | address | The governor's address. | 
changeGovernor
Changes the governor storage variable.
function changeGovernor(address _governor) external onlyByGovernor;
Parameters
| Name | Type | Description | 
|---|---|---|
_governor | address | The 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
| Name | Type | Description | 
|---|---|---|
_courtID | uint256 | The ID of the specified court. | 
_courtName | string | The name of the specified court. | 
_policy | string | The URI of the policy JSON. | 
Events
PolicyUpdate
Emitted when a policy is updated.
event PolicyUpdate(uint256 indexed _courtID, string _courtName, string _policy);