Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
add missing docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless committed Jan 8, 2024
1 parent 0b238cd commit 6a9f353
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contracts/MsgValueSimulator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ contract MsgValueSimulator is ISystemContract {
to = address(uint160(addressAsUint));
}

/// @notice The fallback function that is the main entry point for the MsgValueSimulator.
/// @dev The contract accepts value, the callee and whether the call should a system one via its ABI params.
/// @param _data The calldata to be passed to the callee.
/// @return The return data from the callee.
fallback(bytes calldata _data) external onlySystemCall returns (bytes memory) {
(uint256 value, bool isSystemCall, address to) = _getAbiParams();

Expand Down
4 changes: 4 additions & 0 deletions contracts/NonceHolder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ contract NonceHolder is INonceHolder, ISystemContract {
(prevDeploymentNonce, ) = _splitRawNonce(oldRawNonce);
}

/// @notice A method that checks whether the nonce has been used before.
/// @param _address The address the nonce of which is being checked.
/// @param _nonce The nonce value which is check.
/// @return `true` if the nonce has been used, `false` otherwise.
function isNonceUsed(address _address, uint256 _nonce) public view returns (bool) {
uint256 addressAsKey = uint256(uint160(_address));
return (_nonce < getMinNonce(_address) || nonceValues[addressAsKey][_nonce] > 0);
Expand Down

0 comments on commit 6a9f353

Please sign in to comment.