Skip to content

Commit

Permalink
Merge pull request #51 from forta-network/caner/incomplete-docstrings
Browse files Browse the repository at this point in the history
Fix incomplete docstrings
  • Loading branch information
canercidam authored Dec 26, 2024
2 parents 48af12f + 4a11ed1 commit 45a7a92
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/AttesterWallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/CheckpointExecutor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/ExternalFirewall.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down
6 changes: 6 additions & 0 deletions src/Firewall.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 2 additions & 0 deletions src/FirewallRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down
9 changes: 8 additions & 1 deletion src/SecurityValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,18 @@ 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());
}

/**
* @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(
Expand All @@ -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());
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/TrustedAttesters.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 45a7a92

Please sign in to comment.