Platform: Code4rena
Start Date: 26/07/2022
Pot Size: $75,000 USDC
Total HM: 29
Participants: 179
Period: 6 days
Judge: LSDan
Total Solo HM: 6
Id: 148
League: ETH
Rank: 147/179
Findings: 1
Award: $35.17
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0x4non, 0x52, 0xA5DF, 0xDjango, 0xLovesleep, 0xNazgul, 0xNineDec, 0xSmartContract, 0xackermann, 0xc0ffEE, 0xf15ers, 0xmatt, 0xsanson, 0xsolstars, 8olidity, AuditsAreUS, Bahurum, Bnke0x0, CRYP70, CertoraInc, Ch_301, Chom, CryptoMartian, Deivitto, DevABDee, Dravee, ElKu, Franfran, Funen, GalloDaSballo, GimelSec, GiveMeTestEther, Green, JC, Jmaxmanblue, JohnSmith, Jujic, Junnon, Kenshin, Krow10, Kumpa, Lambda, MEP, Maxime, MiloTruck, Mohandes, NoamYakov, Picodes, RedOneN, Rohan16, Rolezn, Ruhum, RustyRabbit, Sm4rty, Soosh, StErMi, StyxRave, Tadashi, TomJ, Treasure-Seeker, TrungOre, Waze, _Adam, __141345__, ajtra, ak1, apostle0x01, arcoun, asutorufos, async, benbaessler, berndartmueller, bin2chen, brgltd, c3phas, cRat1st0s, carlitox477, chatch, codetilda, codexploder, cryptonue, cryptphi, csanuragjain, cthulhu_cult, delfin454000, dipp, dirk_y, djxploit, ellahi, exd0tpy, fatherOfBlocks, giovannidisiena, hansfriese, horsefacts, hyh, idkwhatimdoing, indijanc, jayfromthe13th, jayphbee, joestakey, kenzo, kyteg, lucacez, luckypanda, mics, minhquanym, obront, oyc_109, pedr02b2, rajatbeladiya, rbserver, reassor, robee, rokinot, rotcivegaf, sach1r0, saian, saneryee, sashik_eth, scaraven, shenwilly, simon135, sseefried, supernova, teddav, ych18, zuhaibmohd, zzzitron
35.1687 USDC - $35.17
addFee()
emissions. The last emission can result in totalSupply >= 1_000_000_000
if (rewardToken.totalSupply() > 1000000000 * 10**18) { return; }
Example:
Say that totalSupply()
is at 999_900_000
and total staked is 200_000_000
.
uint256 tokenToEmit = (dailyEmission * (rewardToken.totalSupply() - rewardToken.balanceOf(address(ve)))) / rewardToken.totalSupply();
tokensToEmit = (600,000 * (999,900,000 - 200,000,000)) / 999,900,000 tokensToEmit = 479988 totalSupply = 999,900,000 + 4799878 totalSupply = 1,000,379,988
addFee()
is called)Link:
Link:
name
and symbol
of VoteEscrowCore.sol is 'veNFT'. The documentation (https://docs.golom.io/rewards) suggests it should be called 'veGOLOM'.Link:
uint256 internal constant MAXTIME = 4 * 365 * 86400; int128 internal constant iMAXTIME = 4 * 365 * 86400; uint256 constant secsInDay = 24 * 60 * 60;
uint256 internal constant MAXTIME = 4 years; int128 internal constant iMAXTIME = 4 years; uint256 constant secsInDay = 1 days;
Links:
For example, instead of
require(status == 3);
It can be cleaner
require(status == VALID);
Recommended enums:
enum OrderStatus { INVALID, EXPIRED, FILLED_OR_CANCELLED, VALID } enum OrderType { ASK, BID, CRITERIA_BID }
Link:
The signaturesigner != o.signer
if check is not needed as if it were true, the transaction would have already reverted from the above require(signaturesigner == o.signer, 'invalid signature')
check.
require(signaturesigner == o.signer, 'invalid signature'); if (signaturesigner != o.signer) { return (0, hashStruct, 0); }
Link: