@@ -3,43 +3,35 @@ pragma solidity ^0.8;
33
44import "../libraries/TypesLib.sol " ;
55
6- // todo subscription and payments
7- // todo we could embed the following for subscription and payments - subscriptionID, numberOfRequestTxConfirmations, callbackGasLimit, numRandomValues
8- // todo check for potential gaps in using uint256 as id compared to bytes32
6+ /// @title IRandomnessSender interface
7+ /// @author Randamu
8+ /// @notice Interface for randomness sender contract which sends randomness via callbacks to randomness consumer contracts.
99interface IRandomnessSender {
10- /**
11- * @notice Requests the generation of a random value for a specified blockchain height.
12- * @dev Initiates a randomness request.
13- * The generated randomness will be associated with the returned `requestID`.
14- * @return requestID The unique identifier assigned to this randomness request.
15- */
10+ /// @notice Requests the generation of a random value for a specified blockchain height.
11+ /// @dev Initiates a randomness request.
12+ /// The generated randomness will be associated with the returned `requestID`.
13+ /// @return requestID The unique identifier assigned to this randomness request.
1614 function requestRandomness () external returns (uint256 requestID );
17- /**
18- * @notice Retrieves a specific request by its ID.
19- * @dev This function returns the Request struct associated with the given requestId.
20- * @param requestId The ID of the request to retrieve.
21- * @return The Request struct corresponding to the given requestId.
22- */
15+
16+ /// @notice Retrieves a specific request by its ID.
17+ /// @dev This function returns the Request struct associated with the given requestId.
18+ /// @param requestId The ID of the request to retrieve.
19+ /// @return The Request struct corresponding to the given requestId.
2320 function getRequest (uint256 requestId ) external view returns (TypesLib.RandomnessRequest memory );
2421
25- /**
26- * @notice Sets signatureSender contract address.
27- * @param newSignatureSender The new address to set.
28- */
22+ /// @notice Sets signatureSender contract address.
23+ /// @param newSignatureSender The new address to set.
2924 function setSignatureSender (address newSignatureSender ) external ;
3025
31- /**
32- * @notice Retrieves all requests.
33- * @dev This function returns an array of all Request structs stored in the contract.
34- * @return An array containing all the Request structs.
35- */
26+ /// @notice Retrieves all requests.
27+ /// @dev This function returns an array of all Request structs stored in the contract.
28+ /// @return An array containing all the Request structs.
3629 function getAllRequests () external view returns (TypesLib.RandomnessRequest[] memory );
37- /**
38- * @notice Generates a message from the given request.
39- * @dev Creates a hash-based message using the `DST` and `nonce` fields of the `Request` struct.
40- * The resulting message is the hash of the encoded values, packed into a byte array.
41- * @param r The `Request` struct containing the data for generating the message.
42- * @return A byte array representing the hashed and encoded message.
43- */
30+
31+ /// @notice Generates a message from the given request.
32+ /// @dev Creates a hash-based message using the `DST` and `nonce` fields of the `Request` struct.
33+ /// The resulting message is the hash of the encoded values, packed into a byte array.
34+ /// @param r The `Request` struct containing the data for generating the message.
35+ /// @return A byte array representing the hashed and encoded message.
4436 function messageFrom (TypesLib.RandomnessRequest memory r ) external pure returns (bytes memory );
4537}
0 commit comments