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
Rank: 25/93
Findings: 3
Award: $292.31
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: Kulk0
Also found by: 0x1f8b, 0xDjango, BowTiedWardens, Dinddle, broccolirob, defsec, dirk_y, hyh, rajatbeladiya, throttle, unforgiven
The teamSummon
method is too centralized.
Using the teamSummon function of ForgottenRunesWarriorsMinter
, the owner address can mint arbitrary amount of warriors.
If the private key of the owner or minter address is compromised, the attacker will be able to mint an unlimited amount of warriors.
I believe this is unnecessary and poses a serious centralization risk.
Consider reduce centralization risks with timelock contracts.
#0 - KenzoAgada
2022-06-06T05:43:45Z
Duplicate of #104.
🌟 Selected for report: defsec
Also found by: 0v3rf10w, 0x1f8b, 0x4non, 0x52, 0xDjango, 0xf15ers, 0xkatana, 0xliumin, AuditsAreUS, BowTiedWardens, CertoraInc, Cr4ckM3, Funen, GimelSec, Hawkeye, IllIllI, Kulk0, M0ndoHEHE, MaratCerby, Picodes, Ruhum, TerrierLover, TrungOre, VAD37, WatchPug, berndartmueller, broccolirob, catchup, cccz, cryptphi, csanuragjain, delfin454000, dirk_y, eccentricexit, ellahi, fatherOfBlocks, gzeon, hake, hansfriese, hickuphh3, horsefacts, hubble, hyh, ilan, joestakey, kebabsec, kenta, kenzo, leastwood, m9800, marximimus, minhquanym, oyc_109, p4st13r4, pauliax, pedroais, peritoflores, plotchy, rajatbeladiya, reassor, rfa, robee, rotcivegaf, samruna, shenwilly, shung, simon135, sorrynotsorry, sseefried, teddav, throttle, tintin, unforgiven, z3s
30.2807 USDC - $30.28
METADATA_PROVENANCE_HASH is not restricted to be a hash. It could be any kind of string.
It was found some transfer
without checking the boolean result, ERC20 standard specify that the token can return false if this call was not made, so it's mandatory to check the result of these calls.
ForgottenRunesWarriorsMinter
must emit an event in order to be detected by dapps.ForgottenRunesWarriorsMinter
is Ownable
and Pausable
, so the owner could resign while the contract is paused, causing a Denial of Service. Owner resignation while paused should be avoided.🌟 Selected for report: BowTiedWardens
Also found by: 0v3rf10w, 0x1f8b, 0x4non, 0xDjango, 0xNazgul, 0xProf, 0xc0ffEE, 0xf15ers, 0xkatana, 0xliumin, ACai, AlleyCat, CertoraInc, Cityscape, Cr4ckM3, DavidGialdi, Dinddle, FSchmoede, Funen, GimelSec, Hawkeye, IllIllI, Kulk0, M0ndoHEHE, MaratCerby, MiloTruck, Picodes, RoiEvenHaim, Tadashi, TerrierLover, TrungOre, VAD37, WatchPug, antonttc, catchup, defsec, delfin454000, dirk_y, eccentricexit, ellahi, fatherOfBlocks, gzeon, hake, hansfriese, hickuphh3, horsefacts, ilan, joestakey, kebabsec, kenta, kenzo, marximimus, minhquanym, noobie, oyc_109, p4st13r4, pauliax, rajatbeladiya, reassor, rfa, robee, rotcivegaf, saian, samruna, shenwilly, shung, simon135, slywaters, sorrynotsorry, throttle, unforgiven, z3s
15.491 USDC - $15.49
require
messages bigger than 32 bytes. More than 32 bytes for message will incur an extra gas costs.R
is not used and could be removednonReentrant
modifier from mint method.It's possible to remove the modifier if the storage changes are produced before the _safeMint
method.
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++; _safeMint(recipient, tokenId); return tokenId; }
i++
to ++i
in order to save some opcodes:require(numSold + numWarriors <= maxDaSupply, 'Not enough remaining');
already checked the previous one.== false
, instead of using the boolean value, or NOT
opcode, it's cheaper to use NOT
when the value it's false, or just the value without == true
, when it's true, because it will use less opcode inside the VM.