Skip to content

Commit

Permalink
docs: fix natstpec
Browse files Browse the repository at this point in the history
  • Loading branch information
ilpepepig committed Aug 28, 2024
1 parent 1360fdf commit 0168a34
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions contracts/core/Allo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ contract Allo is IAllo, Native, Initializable, Ownable, AccessControlUpgradeable
}

/// @dev Logic copied from ERC2771ContextUpgradeable OZ contracts
/// @return the sender of the call
function _msgSender() internal view virtual override returns (address) {
uint256 calldataLength = msg.data.length;
if (isTrustedForwarder(msg.sender) && calldataLength >= 20) {
Expand All @@ -704,6 +705,7 @@ contract Allo is IAllo, Native, Initializable, Ownable, AccessControlUpgradeable
}

/// @dev Logic copied from ERC2771ContextUpgradeable OZ contracts
/// @return calldata filterring the sender address when the trusted forward is the operator
function _msgData() internal view override returns (bytes calldata) {
uint256 calldataLength = msg.data.length;
if (isTrustedForwarder(msg.sender) && calldataLength >= 20) {
Expand Down
3 changes: 2 additions & 1 deletion contracts/core/libraries/Clone.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ import {ClonesUpgradeable} from "openzeppelin-contracts-upgradeable/contracts/pr
/// @notice A helper library to create deterministic clones of the strategy contracts when a pool is created
/// @dev Handles the creation of clones for the strategy contracts and returns the address of the clone
library Clone {
/// @dev Create a clone of the contract
/// @notice Create a clone of the contract
/// @param _contract The address of the contract to clone
/// @param _nonce The nonce to use for the clone
/// @return address of the new contract
function createClone(address _contract, uint256 _nonce) internal returns (address) {
bytes32 salt = keccak256(abi.encodePacked(msg.sender, _nonce));

Expand Down
2 changes: 2 additions & 0 deletions contracts/factories/ContractFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ contract ContractFactory {
/// ======================

/// @notice Emitted when a contract is deployed.
/// @param deployed address
/// @param salt used in contract creation
event Deployed(address indexed deployed, bytes32 indexed salt);

/// ======================
Expand Down
2 changes: 2 additions & 0 deletions contracts/factories/DGLFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ contract DGLFactory is Ownable {
}

/// @notice Creates a new DirectGrantsLiteStrategy
/// @return strategy The address of the new strategy
function createStrategy() external returns (address strategy) {
strategy = address(new DirectGrantsLiteStrategy(allo, name));
emit StrategyCreated(strategy);
Expand All @@ -80,6 +81,7 @@ contract DGLFactory is Ownable {
/// @notice Creates a new DirectGrantsLiteStrategy with custom params
/// @param _allo The 'Allo' contract
/// @param _name The name of the strategy
/// @return strategy The address of the new strategy
function createCustomStrategy(address _allo, string memory _name) external returns (address strategy) {
strategy = address(new DirectGrantsLiteStrategy(_allo, _name));
emit StrategyCreated(strategy);
Expand Down
2 changes: 2 additions & 0 deletions contracts/factories/DVMDTFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ contract DVMDTFactory is Ownable {
}

/// @notice Creates a new DonationVotingMerkleDistributionDirectTransferStrategy
/// @return strategy The address of the new strategy
function createStrategy() external returns (address strategy) {
strategy = address(new DonationVotingMerkleDistributionDirectTransferStrategy(allo, name, permit2));
emit StrategyCreated(strategy);
Expand All @@ -97,6 +98,7 @@ contract DVMDTFactory is Ownable {
/// @param _allo The 'Allo' contract
/// @param _name The name of the strategy
/// @param _permit2 The permit2 contract
/// @return strategy The address of the new strategy
function createStrategyCustom(address _allo, string memory _name, ISignatureTransfer _permit2)
external
returns (address strategy)
Expand Down
4 changes: 3 additions & 1 deletion contracts/strategies/examples/easy-rpgf/EasyRPGF.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {Transfer} from "contracts/core/libraries/Transfer.sol";
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣧⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠹⢿⣿⣿⣿⣿⣾⣾⣷⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠙⠋⠛⠙⠋⠛⠙⠋⠛⠙⠋⠃⠀⠀⠀⠀⠀⠀⠀⠀⠠⠿⠻⠟⠿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠟⠿⠟⠿⠆⠀⠸⠿⠿⠟⠯⠀⠀⠀⠸⠿⠿⠿⠏⠀⠀⠀⠀⠀⠈⠉⠻⠻⡿⣿⢿⡿⡿⠿⠛⠁⠀⠀⠀⠀⠀⠀
// allo.gitcoin.co

contract EasyRPGF is BaseStrategy {
using Transfer for address;

Expand All @@ -46,7 +47,8 @@ contract EasyRPGF is BaseStrategy {

/// @notice Initialize the strategy
/// @param _poolId The pool id
function initialize(uint256 _poolId, bytes memory) external override {
/// @param _data Not used
function initialize(uint256 _poolId, bytes memory _data) external override {
__BaseStrategy_init(_poolId);

emit Initialized(_poolId, "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ contract QVImpactStream is QVSimple {
/// ==== Internal Functions =====
/// =============================

/// @inheritdoc BaseStrategy
/// @inheritdoc QVSimple
function _distribute(address[] memory _recipientIds, bytes memory, address _sender)
internal
virtual
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ interface IRecipientsExtension {
/// | recipient1 | recipient2 | recipient3 | recipient4 | recipient5 | 'rowIndex'
/// | 0000 | 0001 | 0010 | 0011 | 0100 | 'statusRow'
/// | none | pending | accepted | rejected | appealed | converted status (0, 1, 2, 3, 4)
///
/// @param index along a word
/// @param statusRow is the word index
struct ApplicationStatus {
uint256 index;
uint256 statusRow;
Expand Down
2 changes: 1 addition & 1 deletion contracts/strategies/libraries/QFHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ library QFHelper {
/// @notice Error thrown when the number of recipients and amounts are not equal
error QFHelper_LengthMissmatch();

/// Struct that defines the state of the donations to recipients
/// @notice Struct that defines the state of the donations to recipients
/// @param sqrtDonationsSum The sum of the square root of the donations for each recipient
/// @param totalContributions The total contributions of all recipients
struct State {
Expand Down
2 changes: 1 addition & 1 deletion natspec-smells.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module.exports = {
],
exclude: [
'contracts/strategies/deprecated/**/*.sol',
'contracts/factories/**/*.sol',
'contracts/migration/**/*.sol',
'contracts/core/interfaces/IDAI.sol',
],
enforceInheritdoc: false,
};

0 comments on commit 0168a34

Please sign in to comment.