diff --git a/packages/contracts/contracts/registry/AbstractGuardRegistry.sol b/packages/contracts/contracts/registry/AbstractGuardRegistry.sol index 814121489a..a3937d5458 100644 --- a/packages/contracts/contracts/registry/AbstractGuardRegistry.sol +++ b/packages/contracts/contracts/registry/AbstractGuardRegistry.sol @@ -10,6 +10,15 @@ abstract contract AbstractGuardRegistry { using Report for bytes29; using TypedMemView for bytes29; + /** + * @notice Checks all following statements are true: + * - `_report` is a formatted Report payload + * - `_report` contains a signature + * - such signature belongs to an authorized Guard + * @param _report Report on a Attestation of Origin merkle root + * @return _guard Notary that signed the Attestation + * @return _view Memory view on report + */ function _checkGuardAuth(bytes memory _report) internal view @@ -21,5 +30,11 @@ abstract contract AbstractGuardRegistry { require(_isGuard(_guard), "Signer is not a guard"); } - function _isGuard(address _guard) internal view virtual returns (bool); + /** + * @notice Checks whether a given account in an authorized Guard. + * @dev Child contracts should implement this depending on how Guards are stored. + * @param _account Address to check for being a Guard + * @return TRUE if the account is an authorized Guard. + */ + function _isGuard(address _account) internal view virtual returns (bool); }