Skip to content

Commit

Permalink
Format @return NatSpecs correctly (#9733)
Browse files Browse the repository at this point in the history
* Format @return NatSpecs correctly

* lint fix

* PR comment

* Update packages/protocol/contracts/common/Accounts.sol

Co-authored-by: Martin <martin@clabs.co>

* Update packages/protocol/contracts/common/linkedlists/AddressSortedLinkedList.sol

Co-authored-by: Martin <martin@clabs.co>

* PR comments 2

* typo fix

* Update packages/protocol/contracts/governance/BlockchainParameters.sol

Co-authored-by: Martin <martin@clabs.co>

Co-authored-by: pahor167 <pavel.hornak@clabs.co>
Co-authored-by: Martin <martin@clabs.co>
  • Loading branch information
3 people authored Aug 8, 2022
1 parent d5c3c6f commit 4dbc0b3
Show file tree
Hide file tree
Showing 35 changed files with 258 additions and 98 deletions.
16 changes: 10 additions & 6 deletions packages/protocol/contracts/common/Accounts.sol
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ contract Accounts is

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 4, 0);
Expand Down Expand Up @@ -287,7 +290,8 @@ contract Accounts is
/**
* @notice Returns the full list of offchain storage roots for an account.
* @param account The account whose storage roots to return.
* @return List of storage root URLs.
* @return Concatenated storage root URLs.
* @return Lengths of storage root URLs.
*/
function getOffchainStorageRoots(address account)
external
Expand Down Expand Up @@ -347,7 +351,8 @@ contract Accounts is
/**
* @notice Gets validator payment delegation settings.
* @param account Account of the validator.
* @return Beneficiary address and fraction of payment delegated.
* @return Beneficiary address of payment delegated.
* @return Fraction of payment delegated.
*/
function getPaymentDelegation(address account) external view returns (address, uint256) {
PaymentDelegation storage delegation = paymentDelegations[account];
Expand Down Expand Up @@ -946,9 +951,8 @@ contract Accounts is
/**
* @notice Getter for the metadata of multiple accounts.
* @param accountsToQuery The addresses of the accounts to get the metadata for.
* @return (stringLengths[] - the length of each string in bytes
* data - all strings concatenated
* )
* @return The length of each string in bytes.
* @return All strings concatenated.
*/
function batchGetMetadataURL(address[] calldata accountsToQuery)
external
Expand Down
5 changes: 4 additions & 1 deletion packages/protocol/contracts/common/GasPriceMinimum.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ contract GasPriceMinimum is

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 1, 0);
Expand Down
5 changes: 4 additions & 1 deletion packages/protocol/contracts/common/GoldToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ contract GoldToken is

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 1, 1);
Expand Down
8 changes: 6 additions & 2 deletions packages/protocol/contracts/common/MetaTransactionWallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ contract MetaTransactionWallet is

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 1, 1);
Expand Down Expand Up @@ -260,7 +263,8 @@ contract MetaTransactionWallet is
* @param values The CELO value to be sent with each transaction.
* @param data The concatenated data to be sent in each transaction.
* @param dataLengths The length of each transaction's data.
* @return The return values of all transactions appended as bytes and an array of the length
* @return All transactions appended as bytes
* @return An array of the length
* of each transaction output which will be 0 if a transaction had no output
*/
function executeTransactions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ contract MetaTransactionWalletDeployer is IMetaTransactionWalletDeployer, ICeloV
event WalletDeployed(address indexed owner, address indexed wallet, address implementation);

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 0, 1);
Expand Down
3 changes: 2 additions & 1 deletion packages/protocol/contracts/common/UsingPrecompiles.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ contract UsingPrecompiles {
* @param bDenominator Denominator of exponentiated fraction
* @param exponent exponent to raise b to
* @param _decimals precision
* @return numerator/denominator of the computed quantity (not reduced).
* @return Numerator of the computed quantity (not reduced).
* @return Denominator of the computed quantity (not reduced).
*/
function fractionMulExp(
uint256 aNumerator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ pragma solidity ^0.5.13;
interface ICeloVersionedContract {
/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256);
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ library AddressSortedLinkedList {

/**
* @notice Gets all elements from the doubly linked list.
* @return An unpacked list of elements from largest to smallest.
* @return Array of all keys in the list.
* @return Values corresponding to keys, which will be ordered largest to smallest.
*/
function getElements(SortedLinkedList.List storage list)
public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ library AddressSortedLinkedListWithMedian {
/**
* @notice Gets all elements from the doubly linked list.
* @param list A storage pointer to the underlying list.
* @return An unpacked list of elements from largest to smallest.
* @return Array of all keys in the list.
* @return Values corresponding to keys, which will be ordered largest to smallest.
* @return Array of relations to median of corresponding list elements.
*/
function getElements(SortedLinkedListWithMedian.List storage list)
public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ library IntegerSortedLinkedList {
/**
* @notice Gets all elements from the doubly linked list.
* @param list A storage pointer to the underlying list.
* @return An unpacked list of elements from largest to smallest.
* @return Array of all keys in the list.
* @return Values corresponding to keys, which will be ordered largest to smallest.
*/
function getElements(SortedLinkedList.List storage list)
public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ library SortedLinkedList {
/**
* @notice Gets all elements from the doubly linked list.
* @param list A storage pointer to the underlying list.
* @return An unpacked list of elements from largest to smallest.
* @return Array of all keys in the list.
* @return Values corresponding to keys, which will be ordered largest to smallest.
*/
function getElements(List storage list)
internal
Expand Down Expand Up @@ -165,7 +166,8 @@ library SortedLinkedList {
* @param value The element value.
* @param lesserKey The key of the element which could be just left of the new value.
* @param greaterKey The key of the element which could be just right of the new value.
* @return The correct lesserKey/greaterKey keys.
* @return The correct lesserKey keys.
* @return The correct greaterKey keys.
*/
function getLesserAndGreater(
List storage list,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ library SortedLinkedListWithMedian {
/**
* @notice Gets all elements from the doubly linked list.
* @param list A storage pointer to the underlying list.
* @return An unpacked list of elements from largest to smallest.
* @return Array of all keys in the list.
* @return Values corresponding to keys, which will be ordered largest to smallest.
* @return Array of relations to median of corresponding list elements.
*/
function getElements(List storage list)
internal
Expand Down
11 changes: 8 additions & 3 deletions packages/protocol/contracts/governance/BlockchainParameters.sol
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ contract BlockchainParameters is Ownable, Initializable, UsingPrecompiles {

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 2, 0, 0);
Expand Down Expand Up @@ -147,8 +150,10 @@ contract BlockchainParameters is Ownable, Initializable, UsingPrecompiles {
}

/**
* @notice Query minimum client version.
* @return Returns major, minor, and patch version numbers.
* @notice Query minimum client version.
* @return Major version number.
* @return Minor version number.
* @return Patch version number.
*/
function getMinimumClientVersion()
external
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ contract DoubleSigningSlasher is ICeloVersionedContract, SlasherUtil {

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 1, 0);
Expand Down
5 changes: 4 additions & 1 deletion packages/protocol/contracts/governance/DowntimeSlasher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ contract DowntimeSlasher is ICeloVersionedContract, SlasherUtil {

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (2, 0, 0, 0);
Expand Down
13 changes: 9 additions & 4 deletions packages/protocol/contracts/governance/Election.sol
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ contract Election is

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 2, 1);
Expand Down Expand Up @@ -188,7 +191,8 @@ contract Election is

/**
* @notice Returns the minimum and maximum number of validators that can be elected.
* @return The minimum and maximum number of validators that can be elected.
* @return The minimum number of validators that can be elected.
* @return The maximum number of validators that can be elected.
*/
function getElectableValidators() external view returns (uint256, uint256) {
return (electableValidators.min, electableValidators.max);
Expand Down Expand Up @@ -928,8 +932,9 @@ contract Election is
}

/**
* @notice Returns lists of all validator groups and the number of votes they've received.
* @return Lists of all validator groups and the number of votes they've received.
* @notice Returns list of all validator groups and the number of votes they've received.
* @return List of all validator groups
* @return Number of votes each validator group received.
*/
function getTotalVotesForEligibleValidatorGroups()
external
Expand Down
19 changes: 14 additions & 5 deletions packages/protocol/contracts/governance/EpochRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ contract EpochRewards is

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 1, 0);
Expand Down Expand Up @@ -148,7 +151,9 @@ contract EpochRewards is

/**
* @notice Returns the target voting yield parameters.
* @return The target, max, and adjustment factor for target voting yield.
* @return The target factor for target voting yield.
* @return The max factor for target voting yield.
* @return The adjustment factor for target voting yield.
*/
function getTargetVotingYieldParameters() external view returns (uint256, uint256, uint256) {
TargetVotingYieldParameters storage params = targetVotingYieldParams;
Expand All @@ -157,7 +162,9 @@ contract EpochRewards is

/**
* @notice Returns the rewards multiplier parameters.
* @return The max multiplier and under/over spend adjustment factors.
* @return The max multiplier.
* @return The underspend adjustment factors.
* @return The overspend adjustment factors.
*/
function getRewardsMultiplierParameters() external view returns (uint256, uint256, uint256) {
RewardsMultiplierParameters storage params = rewardsMultiplierParams;
Expand Down Expand Up @@ -514,8 +521,10 @@ contract EpochRewards is

/**
* @notice Calculates the per validator epoch payment and the total rewards to voters.
* @return The per validator epoch reward, the total rewards to voters, the total community
* reward, and the total carbon offsetting partner reward.
* @return The per validator epoch reward.
* @return The total rewards to voters.
* @return The total community reward.
* @return The total carbon offsetting partner reward.
*/
function calculateTargetEpochRewards()
external
Expand Down
Loading

0 comments on commit 4dbc0b3

Please sign in to comment.