Skip to content

Commit

Permalink
fix(doc): add missing Natspec docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PierrickGT committed Mar 7, 2024
1 parent bb4da72 commit 4621cd5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/ERC3009.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import { StatefulERC712 } from "./StatefulERC712.sol";
abstract contract ERC3009 is IERC3009, StatefulERC712 {
/* ============ Variables ============ */

// @inheritdoc IERC3009
// solhint-disable-next-line max-line-length
// @dev keccak256("TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)")
/// @dev keccak256("TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)")
/// @inheritdoc IERC3009
bytes32 public constant TRANSFER_WITH_AUTHORIZATION_TYPEHASH =
0x7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a2267;

// inheritdoc IERC3009
// solhint-disable-next-line max-line-length
// @dev keccak256("ReceiveWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)")
/// @dev keccak256("ReceiveWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)")
/// @inheritdoc IERC3009
bytes32 public constant RECEIVE_WITH_AUTHORIZATION_TYPEHASH =
0xd099cc98ef71107a616c4f0f941f04c322d8e254fe26b3c6668db87aae413de8;

Expand Down
4 changes: 2 additions & 2 deletions src/ERC712Extended.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import { SignatureChecker } from "./libs/SignatureChecker.sol";
abstract contract ERC712Extended is IERC712Extended {
/* ============ Variables ============ */

// keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")
/// @dev keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")
bytes32 internal constant _EIP712_DOMAIN_HASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;

// keccak256("1")
/// @dev keccak256("1")
bytes32 internal constant _EIP712_VERSION_HASH = 0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6;

/// @dev Initial Chain ID set at deployment.
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IERC20Extended.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ interface IERC20Extended is IERC20, IERC3009 {
/* ============ View/Pure Functions ============ */

/// @notice Returns the EIP712 typehash used in the encoding of the digest for the permit function.
function PERMIT_TYPEHASH() external view returns (bytes32 typehash);
function PERMIT_TYPEHASH() external view returns (bytes32);
}
9 changes: 9 additions & 0 deletions src/libs/SignatureChecker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ import { IERC1271 } from "../interfaces/IERC1271.sol";
library SignatureChecker {
/* ============ Enums ============ */

/**
* @notice An enum representing the possible errors that can be emitted during signature validation.
* @param NoError No error occurred during signature validation.
* @param InvalidSignature The signature is invalid.
* @param InvalidSignatureLength The signature length is invalid.
* @param InvalidSignatureS The signature parameter S is invalid.
* @param InvalidSignatureV The signature parameter V is invalid.
* @param SignerMismatch The signer does not match the recovered signer.
*/
enum Error {
NoError,
InvalidSignature,
Expand Down

0 comments on commit 4621cd5

Please sign in to comment.