SIZE contest - delfin454000's results

An on-chain sealed bid auction protocol.

General Information

Platform: Code4rena

Start Date: 04/11/2022

Pot Size: $42,500 USDC

Total HM: 9

Participants: 88

Period: 4 days

Judge: 0xean

Total Solo HM: 2

Id: 180

League: ETH

SIZE

Findings Distribution

Researcher Performance

Rank: 49/88

Findings: 1

Award: $44.29

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

44.2869 USDC - $44.29

Labels

bug
grade-b
QA (Quality Assurance)
Q-11

External Links

Named return variables are not used when a function returns


Named return variable (here, tokensAvailable) is never used

SizeSealed.sol: L451-454

    function tokensAvailableForWithdrawal(uint256 auctionId, uint128 baseAmount)
        public
        view
        returns (uint128 tokensAvailable)


Event is missing indexed fields

Each event should use three indexed fields if there are three or more fields


ISizeSealed.sol: L97-99

    event AuctionCreated(
        uint256 auctionId, address seller, AuctionParameters params, Timings timings, bytes encryptedPrivKey
    );

Similarly for the following events:

ISizeSealed.sol: L103-112

ISizeSealed.sol: L118

ISizeSealed.sol: L122



Missing @param statements

SizeSealed.sol: L172-178

    /// @notice Reveals the private key of the seller
    /// @dev All valid bids are decrypted after this
    ///      finalizeData should be empty if seller does not wish to finalize in this tx
    /// @param privateKey Private key corresponding to the auctions public key
    /// @param finalizeData Calldata that will be sent to finalize()
    function reveal(uint256 auctionId, uint256 privateKey, bytes calldata finalizeData)
        external

Missing: @param auctionId


ISizeSealed.sol: L70-84

    /// @param baseToken The ERC20 to be sold by the seller
    /// @param quoteToken The ERC20 to be bid by the bidders
    /// @param reserveQuotePerBase Minimum price that bids will be filled at
    /// @param totalBaseAmount Max amount of `baseToken` to be auctioned
    /// @param minimumBidQuote Minimum quote amount a bid can buy
    /// @param pubKey On-chain storage of seller's ephemeral public key
    struct AuctionParameters {
        address baseToken;
        address quoteToken;
        uint256 reserveQuotePerBase;
        uint128 totalBaseAmount;
        uint128 minimumBidQuote;
        bytes32 merkleRoot;
        ECCMath.Point pubKey;
    }

Missing: @param merkleRoot


Missing NatSpec

NatSpec is completely missing for the following function:

SizeSealed.sol: L466-467

    function computeCommitment(bytes32 message) public pure returns (bytes32) {
        return keccak256(abi.encode(message));

Similarly for the following public or external functions:

SizeSealed.sol: L470-471

SizeSealed.sol: L474-475

SizeSealed.sol: L478-479


NatSpec is also completely missing for the following struct:

SizeSealed.sol: L202-209

    // Used to get around stack too deep errors -- even with viaIr
    struct FinalizeData {
        uint256 reserveQuotePerBase;
        uint128 totalBaseAmount;
        uint128 filledBase;
        uint256 previousQuotePerBase;
        uint256 previousIndex;
    }

Similarly for the following structs:

ISizeSealed.sol: L40-48

ISizeSealed.sol: L63-68

ISizeSealed.sol: L86-91



Typos


SizeSealed.sol: L112

    /// @notice Bid on a runnning auction

Change runnning to running


SizeSealed.sol: L211

    /// @notice Finalises an auction by revealing all bids

Change Finalises to Finalizes. Note that the American English version of this word ("finalize") and its variants are used throughout for vaiable names and most of the remainder of comments in the contest.


SizeSealed.sol: L412

    /// @dev Transfers `quoteToken` back to bidder and prevents bid from being finalised

Change finalised to finalized


SizeSealed.sol: L431

        // Prevent any futher access to this EncryptedBid

Change futher to futher



Open item

Comments that refer to open items should be addressed

ECCMath.sol: L59

    /// @dev we hash the point because unsure if x,y is normal distribution (source needed)


Update sensitive terms

Terms incorporating "black," "white," "slave" or "master" are potentially problematic. Substituting more neutral terminology is becoming common practice.


SizeSealed.sol: L121

    /// @param proof Merkle proof that checks seller against `merkleRoot` if there is a whitelist

Suggestion: Change whitelist to allowlist



#0 - c4-judge

2022-11-10T02:47:12Z

0xean marked the issue as grade-b

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