From 4a11ed1fc06dffb29e1edf6f14413b677db22e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caner=20=C3=87=C4=B1dam?= Date: Thu, 26 Dec 2024 22:45:37 +0300 Subject: [PATCH] fix incomplete docstrings --- src/AttesterWallet.sol | 5 +++++ src/CheckpointExecutor.sol | 1 + src/ExternalFirewall.sol | 2 ++ src/Firewall.sol | 6 ++++++ src/FirewallRouter.sol | 2 ++ src/SecurityValidator.sol | 9 ++++++++- src/TrustedAttesters.sol | 1 + 7 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/AttesterWallet.sol b/src/AttesterWallet.sol index f048446..e132f0d 100644 --- a/src/AttesterWallet.sol +++ b/src/AttesterWallet.sol @@ -88,6 +88,8 @@ contract AttesterWallet is IAttesterWallet, ERC20Upgradeable, AccessControlUpgra /** * @notice Withdraws balance back to sender. + * @param amount Withdrawn amount. + * @param beneficiary Beneficiary of the withdrawal. */ function withdraw(uint256 amount, address beneficiary) public { if (beneficiary == address(0)) revert ZeroBeneficiary(); @@ -98,6 +100,7 @@ contract AttesterWallet is IAttesterWallet, ERC20Upgradeable, AccessControlUpgra /** * @notice Withdraws all balance back to sender. + * @param beneficiary Beneficiary of the withdrawal. */ function withdrawAll(address beneficiary) public { if (beneficiary == address(0)) revert ZeroBeneficiary(); @@ -110,6 +113,8 @@ contract AttesterWallet is IAttesterWallet, ERC20Upgradeable, AccessControlUpgra * @param attestation The set of fields that correspond to and enable the execution of call(s) * @param attestationSignature Signature of EIP-712 message * @param beneficiary The tx.origin which will benefit from this attestation + * @param chargeAccount The account charged for this attestation transaction. + * @param chargeAmount The amount which the charged account is charged for this attestation transaction. */ function storeAttestationForOrigin( Attestation calldata attestation, diff --git a/src/CheckpointExecutor.sol b/src/CheckpointExecutor.sol index b7b3ff1..b325907 100644 --- a/src/CheckpointExecutor.sol +++ b/src/CheckpointExecutor.sol @@ -52,6 +52,7 @@ abstract contract CheckpointExecutor { * @param attestation The set of fields that correspond to and enable the execution of call(s) * @param attestationSignature Signature of EIP-712 message * @param data Call data which contains the function selector and the encoded arguments + * @return Call return value. */ function attestedCall(Attestation calldata attestation, bytes calldata attestationSignature, bytes calldata data) public diff --git a/src/ExternalFirewall.sol b/src/ExternalFirewall.sol index a74d580..381821a 100644 --- a/src/ExternalFirewall.sol +++ b/src/ExternalFirewall.sol @@ -28,6 +28,7 @@ contract ExternalFirewall is IExternalFirewall, Firewall { /** * @notice Allows executing checkpoints externally from an integrator contract. The selector * is checked against the checkpoints configured on this contract. + * @param caller The caller observed by the checkpoint executor (protected) contract * @param selector Selector of the function which the checkpoint is configured and executed for * @param ref The reference number to compare with the threshold */ @@ -38,6 +39,7 @@ contract ExternalFirewall is IExternalFirewall, Firewall { /** * @notice Allows executing checkpoints externally from an integrator contract. The selector * is checked against the checkpoints configured on this contract. + * @param caller The caller observed by the checkpoint executor (protected) contract * @param selector Selector of the function which the checkpoint is configured and executed for * @param input The input value to use in checkpoint hash computation */ diff --git a/src/Firewall.sol b/src/Firewall.sol index 3edc35e..6b4d8bc 100644 --- a/src/Firewall.sol +++ b/src/Firewall.sol @@ -122,6 +122,7 @@ abstract contract Firewall is IFirewall, IAttesterInfo, FirewallPermissions { /** * @notice Returns the attester controller id from the configuration. + * @return Attester controller ID */ function getAttesterControllerId() public view returns (bytes32) { return _getFirewallStorage().attesterControllerId; @@ -150,6 +151,11 @@ abstract contract Firewall is IFirewall, IAttesterInfo, FirewallPermissions { /** * @notice Gets the checkpoint values for given function selector. * @param selector Selector of the function. + * @return Checkpoint threshold + * @return Checkpoint reference start + * @return Checkpoint reference end + * @return Checkpoint activation mode + * @return Checkpoint trusted origin mode enablement state */ function getCheckpoint(bytes4 selector) public view virtual returns (uint192, uint16, uint16, Activation, bool) { Checkpoint storage checkpoint = _getFirewallStorage().checkpoints[selector]; diff --git a/src/FirewallRouter.sol b/src/FirewallRouter.sol index 994accb..1305086 100644 --- a/src/FirewallRouter.sol +++ b/src/FirewallRouter.sol @@ -23,6 +23,7 @@ contract FirewallRouter is IExternalFirewall, FirewallPermissions { /** * @notice Allows executing checkpoints externally from an integrator contract. The selector * is checked against the checkpoints configured on this contract. + * @param caller The caller observed by the checkpoint executor (protected) contract * @param selector Selector of the function which the checkpoint is configured and executed for * @param ref The reference number to compare with the threshold */ @@ -33,6 +34,7 @@ contract FirewallRouter is IExternalFirewall, FirewallPermissions { /** * @notice Allows executing checkpoints externally from an integrator contract. The selector * is checked against the checkpoints configured on this contract. + * @param caller The caller observed by the checkpoint executor (protected) contract * @param selector Selector of the function which the checkpoint is configured and executed for * @param input The input value to use in checkpoint hash computation */ diff --git a/src/SecurityValidator.sol b/src/SecurityValidator.sol index caf6d06..2d19d95 100644 --- a/src/SecurityValidator.sol +++ b/src/SecurityValidator.sol @@ -124,7 +124,10 @@ contract SecurityValidator is ISecurityValidator, EIP712 { _initAttestation(attestation, attester); } - /// @notice Returns the attester address which attested to the current execution + /** + * @notice Returns the attester address which attested to the current execution + * @return The attester of the currently consumed attestation. + */ function getCurrentAttester() public view returns (address) { return TransientSlot.tload(ATTESTER_SLOT.asAddress()); } @@ -132,6 +135,7 @@ contract SecurityValidator is ISecurityValidator, EIP712 { /** * @notice Produces the EIP-712 hash of the attestation message. * @param attestation The set of fields that correspond to and enable the execution of call(s) + * @return Hash of attestation */ function hashAttestation(Attestation calldata attestation) public view returns (bytes32) { return _hashTypedDataV4( @@ -152,6 +156,8 @@ contract SecurityValidator is ISecurityValidator, EIP712 { * * @param checkpointHash An arbitrary hash which can be computed by using variety of values * that occur during a call + * @return Execution hash value, produced from current checkpoint hash, msg.sender and + * previous execution hash */ function executeCheckpoint(bytes32 checkpointHash) public returns (bytes32) { bytes32 executionHash = TransientSlot.tload(HASH_SLOT.asBytes32()); @@ -265,6 +271,7 @@ contract SecurityValidator is ISecurityValidator, EIP712 { * that occur during a call * @param caller msg.sender of executeCheckpoint() call * @param executionHash Previous execution hash + * @return Execution hash */ function executionHashFrom(bytes32 checkpointHash, address caller, bytes32 executionHash) public diff --git a/src/TrustedAttesters.sol b/src/TrustedAttesters.sol index de2884e..48928f5 100644 --- a/src/TrustedAttesters.sol +++ b/src/TrustedAttesters.sol @@ -23,6 +23,7 @@ contract TrustedAttesters is AccessControl, ITrustedAttesters { /** * @notice Checks if the given address is a trusted attester. * @param caller Caller address. + * @return Boolean result */ function isTrustedAttester(address caller) public view returns (bool) { return hasRole(TRUSTED_ATTESTER_ROLE, caller);