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

Add missing docstrings #104

Open
wants to merge 2 commits into
base: sb-short-term-fee-model
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion contracts/MsgValueSimulator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT, ETH_TOKEN_SYSTEM_CONTRACT} from "./Co
*/
contract MsgValueSimulator is ISystemContract {
/// @notice Extract value, isSystemCall and to from the extraAbi params.
/// @dev The contract accepts value, the callee and whether the call should a system one via its ABI params.
/// @dev The contract accepts value, the callee and whether the call should be a system one via its ABI params.
/// @dev The first ABI param contains the value in the [0..127] bits. The 128th contains
/// the flag whether or not the call should be a system one.
/// The second ABI params contains the callee.
Expand All @@ -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 be 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 checked.
/// @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
Loading