Rigor Protocol contest - 0xf15ers's results

Community lending and instant payments for new home construction.

General Information

Platform: Code4rena

Start Date: 01/08/2022

Pot Size: $50,000 USDC

Total HM: 26

Participants: 133

Period: 5 days

Judge: Jack the Pug

Total Solo HM: 6

Id: 151

League: ETH

Rigor Protocol

Findings Distribution

Researcher Performance

Rank: 107/133

Findings: 1

Award: $40.62

🌟 Selected for report: 0

🚀 Solo Findings: 0

1. ecrecover precompile internally checks if the value is 27 or 28. No need to check in the client side.

  • Library SignatureDecoder uses if block to check the values for v.
 function recoverKey(
        bytes32 messageHash,
        bytes memory messageSignatures,
        uint256 pos
    ) internal pure returns (address) {
        if (messageSignatures.length % 65 != 0) {
            return (address(0));
        }

        uint8 v;
        bytes32 r;
        bytes32 s;
        (v, r, s) = signatureSplit(messageSignatures, pos);

        // If the version is correct return the signer address
        if (v != 27 && v != 28) { // @audit this check is performed by `ecrecover` internally 
            return (address(0));
 ..........           
}

reference: https://github.com/ethereum/yellowpaper/pull/860

2. Typecast to uint256 maynot be required

      uint256 _newTotalLent = totalLent + _cost;
        require(
            projectCost() >= uint256(_newTotalLent), // here 
            "Project::value>required"
        );

3. Adding a return statement when the function defines a named return variable is redundant.

  function _msgSender()
        internal
        view
        override(ContextUpgradeable, ERC2771ContextUpgradeable)
        returns (address sender)
    {
        // We want to use the _msgSender() implementation of ERC2771ContextUpgradeable
        return super._msgSender();
        // sender = super._msgSender()
    }

4. Redundant assignment

  _community.publishNonce = ++_community.publishNonce;
  //recommendation 
  // ++_community.publishNonce;
AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter