Affyn Land

CertiKFiles named in the report

CertiK reviewed Affyn (Affyn Land) on 7 Oct 2022: 17 findings, 0 critical; 11 marked fixed, 1 acknowledged, 5 open.

No open critical findings
Open the reportOpen Affyn’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings17

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High010
Medium000
Low5011
Low`soldLands` mapping not updatedFixed

In `PrivateLandSale()`, after a private land is minted to `target` address the value stored in `soldLands[]` is not updated to `true` allowing the same `hexID` to be reused.

LowComparison to Boolean ConstantFixed

Boolean constants can be used directly and do not need to be compared to true or false. ```solidity=2861 require(soldLands[hexID] == false, "Selected HexID is already sold"); ``` --- ```solidity=2877 require(soldLands[hexID] == false, "Selected HexID is already sold"); ``` --- ```solidity=2898 require(soldLands[hexIDs[i]] == false, "One of selected HexIDs is already sold"); ```

LowEmit Events issuesFixed

There should always be events emitted in the sensitive functions that are controlled by centralization roles. The functions in which it is necessary to emit events are given in the finding locations. --- Also, in the `ModifyReleaseTime()` function, the name of the emitted event `DepositedRevoked` is not relevant to the purpose of the function. It is intended to change the timelock release time value and not to revoke the user's deposits.

LowFunction Name TypoFixed

The function named `setWhitelistMerkleRoots()` is used to change the value of `whitelistedMerkleRoot` and only a single root is passed as input.

LowFunction Should Be Declared ExternalFixed

The functions which are never called internally within the contract should have external visibility.

LowMissing Error MessagesFixed

**require** can be used to check for conditions and throw an exception if the condition is not met. It is better to provide a string message containing details about the error that will be passed back to the caller.

LowMissing License IdentifiersFixed

The contracts `AccessPassContract.sol` and `LandAndFlagContract.sol` are missing a SPDX license identifier.

LowMissing Zero Address ValidationFixed

Addresses should be checked before assignment or external call to make sure they are not zero addresses. ```solidity=728 _beneficiary = beneficiary_; ``` - `beneficiary_` is not zero-checked before being used. --- ```solidity=730 _admin = admin; ``` - `admin` is not zero-checked before being used. --- ```solidity=2650 teamAddr = payable(_teamAddr); ``` - `_teamAddr` is not zero-checked before being used.

LowMultiple meanings and goals associated with the sFixed

Within the codebase the word `category` is used as input to different functions in order to access mappings or emit events. The same word is used to indicate both the different categories of lands and flags. In particular, the possible flag categories are 0,1,2 or 3; therefore LAND_FLAG_COST[category] has values only for category values in the range [0;3]. Assume, however, the following scenario: - The `CreateNewCitySale()` function is called for the first time, passing as input appropriate arrays with length = 5. Therefore merkleRoots.length = overallLandQuota.length = presaleLandQuotas.length = 5. - The 3 require statements placed at lines 2944, 2945, 2946 succeed and the value of `currentCitySaleIndex` is incremented to 1 - In the 5 iterations of each for loop, calls to the functions `SetHexRarityMerkleRoot()`, `SetCitySaleQuota()`, `SetCityPreSaleQuota()` occur by passing as the second parameter destined for `category` the value of loop index i. Specifically in the last iteration of the loops the index i is equal to 4. - This means making the following assignments: ```solidity PRESALE_LAND_SALE_LIMITS[1][4] = share; // line 2932 LAND_SALE_LIMITS[1][4] = dimension; // line 2938 saleHexRarity[1][4] = merkleRoot; // line 2973 ``` - Calling the `GetFlagBalanceAndLimits()` function with category = 4 as parameter will result in accessing LAND_FLAG_COST in a position that can never be set. On the other hand, accessing with a category value in the range [0;3] in order to have a valid LAND_FLAG_COST value will result in never accessing all LAND_SALE_LIMITS positions greater than index 3.

LowState Variable Should Be Declared ConstantFixed

State variables that never change should be declared as `constant` to save gas. In `AccessPassContract.sol`: - `LOCKUP_DURATION` - `AAP_PRICE` - `EAP_PRICE` In `LandAndFlagContract.sol`: - `membershipContract` - `COLLECTION_NAME` - `TICKER`

Show 1 more
LowUnused State VariableFixed

The variable `spentFlags` in `LandSale` is never used in `LandSale`.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (2)

  • LandAndFlagContract.sol
  • AccessPassContract.sol

Part of Affyn’s security record

Affyn
Audits1 audit by 1 firmLast audit Oct 2022, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open Affyn’s security record

Security firm

CertiK

1,044 projects reviewed · 1,375 reports · latest May 2025

See CertiK’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us