From 3aee2def7f32d575ad3dc8a83b02ef86289a8498 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Thu, 18 Aug 2022 14:33:25 +0300 Subject: [PATCH] chore: documentation --- .../registry/AbstractGuardRegistry.sol | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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); }