Platform: Code4rena
Start Date: 20/09/2022
Pot Size: $100,000 USDC
Total HM: 4
Participants: 109
Period: 7 days
Judge: GalloDaSballo
Id: 163
League: ETH
Rank: 70/109
Findings: 1
Award: $55.20
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0x4non, 0x52, 0x5rings, 0xNazgul, 0xRobocop, 0xSmartContract, 0xdeadbeef, 0xsanson, 8olidity, Amithuddar, Aymen0909, B2, B353N, CertoraInc, Ch_301, Chom, CodingNameKiki, Deivitto, ElKu, Funen, JC, JohnnyTime, Kresh, Lambda, Noah3o6, RaymondFam, ReyAdmirado, RockingMiles, Rolezn, Sm4rty, SuldaanBeegsi, Tadashi, TomJ, Tomio, V_B, Waze, __141345__, a12jmx, ak1, arcoun, asutorufos, aviggiano, berndartmueller, bharg4v, bin2chen, brgltd, bulej93, c3phas, catchup, cccz, ch0bu, cryptonue, cryptphi, csanuragjain, delfin454000, devtooligan, djxploit, durianSausage, eighty, erictee, exd0tpy, fatherOfBlocks, giovannidisiena, hansfriese, ignacio, joestakey, ladboy233, lukris02, m9800, malinariy, martin, minhtrng, obront, oyc_109, pedr02b2, pedroais, pfapostol, philogy, prasantgupta52, rbserver, ronnyx2017, rotcivegaf, rvierdiiev, sach1r0, shung, simon135, throttle, tnevler, tonisives, wagmi, yixxas, zkhorse, zzykxx, zzzitron
55.1985 USDC - $55.20
File: /src/ArtGobblers.sol 316: team = _team; 317: community = _community;
File: /src/Pages.sol 181: community = _community;
File: /src/Goo.sol 83: artGobblers = _artGobblers; 84: pages = _pages;
File: /src/auth/Owned.sol 30: owner = _owner;
There are several occurrences of literal values with unexplained meaning .Literal values in the codebase without an explained meaning make the code harder to read, understand and maintain, thus hindering the experience of developers, auditors and external contributors alike.
Developers should define a constant variable for every magic value used , giving it a clear and self-explanatory name.
File: /src/ArtGobblers.sol 304: 69.42e18, // Target price. 305: 0.31e18, // Price decay percent. 308: 0.0023e18 // Time scale.
File: /src/Pages.sol 168: 4.2069e18, // Target price. 169: 0.31e18, // Price decay percent. 170: 9000e18, // Logistic asymptote. 171: 0.014e18, // Logistic time scale. 174: 9e18 // Pages to target per day.
File: /src/LibGOO.sol //@audit:1e18 38: (emissionMultiple * lastBalanceWad * 1e18).sqrt()
File: /src/VRGDA.sol //@audit:1e18 29: decayConstant = wadLn(1e18 - _priceDecayPercent);
File: /src/LogisticVRGDA.sol //@audit: 1e18 44: logisticLimit = _maxSellable + 1e18; //@audit: 2e18 47: logisticLimitDoubled = logisticLimit * 2e18; //@audit: 1e18 62: return -unsafeWadDiv(wadLn(unsafeDiv(logisticLimitDoubled, sold + logisticLimit) - 1e18), timeScale);
Contracts are allowed to override their parents' functions and change the visibility from external to public.
File: /src/ArtGobblers.sol 693: function tokenURI(uint256 gobblerId) public view virtual override returns (string memory) {
File: /src/Pages.sol 265: function tokenURI(uint256 pageId) public view virtual override returns (string memory) {
File: /src/LogisticVRGDA.sol //@audit: of tokens of tokens --> of tokens (repeated words) 17: /// @dev The maximum number of tokens of tokens to sell + 1. We add //@audit: of tokens of tokens --> of tokens (repeated words) 22: /// @dev The maximum number of tokens of tokens to sell + 1 multiplied
File: /src/utils/rand/ChainlinkV1RandProvider.sol //@audit: Missing @return requestId 61: /// @notice Request random bytes from Chainlink VRF. Can only by called by the ArtGobblers contract. 62: function requestRandomBytes() external returns (bytes32 requestId) { 70: }
The best-practice layout for a contract should follow the following order: state variables, events, modifiers, constructor and functions. Function ordering helps readers identify which functions they can call and find constructor and fallback functions easier. Functions should be grouped according to their visibility and ordered as: constructor, receive function (if exists), fallback function (if exists), external, public, internal, private. Some constructs deviate from this recommended best-practice: Modifiers are in the middle of contracts. External/public functions are mixed with internal/private ones.
The following contract do not adhere to the standard
The above only represents a small part of the project that doesn't adhere to the best practices, but majority of the code is not following this best practices
#0 - GalloDaSballo
2022-10-06T19:04:01Z
L
R
R
NC
NC
NC
1L 2R 3NC