Forgotten Runes Warrior Guild contest - AlleyCat's results

16,000 Warrior NFTs sold in a phased Dutch Auction.

General Information

Platform: Code4rena

Start Date: 03/05/2022

Pot Size: $30,000 USDC

Total HM: 6

Participants: 93

Period: 3 days

Judge: gzeon

Id: 118

League: ETH

Forgotten Runes

Findings Distribution

Researcher Performance

Rank: 90/93

Findings: 1

Award: $15.45

🌟 Selected for report: 0

🚀 Solo Findings: 0

https://github.com/code-423n4/2022-05-runes/blob/main/contracts/ForgottenRunesWarriorsGuild.sol#L104

You could save gas here by removing the very gas heavy reentrancy guard from OZ and just fixing your reentry issue.

function mint(address recipient)
        public
        override
        returns (uint256)
    {
        require(numMinted < MAX_WARRIORS, 'All warriors have been summoned');
        require(_msgSender() == minter, 'Not a minter');
        uint256 tokenId = numMinted;
        numMinted += 1;
        _safeMint(recipient, tokenId);

        return tokenId;
    }

or

function mint(address recipient) public override returns (uint256) { require(numMinted < MAX_WARRIORS, 'All warriors have been summoned'); require(_msgSender() == minter, 'Not a minter'); numMinted += 1; _safeMint(recipient, numMinted - 1); return tokenId; }

Instead of relying on a gas heavy reentrancy lib use check-effects-interactions patterns.. Especially for minting/etc where you're going to be most gas heavy.

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