CertiK reviewed POPG (POPG Token - Audit) on 10 Sep 2024: 12 findings, 0 critical; 3 acknowledged, 9 open.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 0 | 2 | 0 |
| Medium | 0 | 1 | 0 |
| Low | 9 | 0 | 0 |
In the `release()` function, the variables `_erc20Released[token]` and `milestones` are updated after the `distributeRecipient()` and perform an external calls `IERC20(token).transfer`, which violates the check-effect-interaction pattern.
The token contract has inconsistent token name definitions in its constructor. The token name defined for the ERC20 contract is "POPG", while the token name defined for the EIP 712 domain separator (used in ERC20Permit) is "POPG Token": ```solidity=12 constructor(address _vestingWallet) ERC20("POPG", "POPG") ERC20Permit("POPG Token") ``` According to the [ERC20Permit](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/c1d6ad5a307945c7825cb3c4c911f2fd017c8725/contracts/token/ERC20/extensions/ERC20Permit.sol#L37) comment: "It's a good idea to use the same `name` that is defined as the ERC20 token name.". This implies that the token name used to initiate the `ERC20` potentially incorrect.
Addresses are not validated before assignment or external calls, potentially allowing the use of zero addresses and leading to unexpected behavior or vulnerabilities. For example, transferring tokens to a zero address can result in a permanent loss of those tokens. ```solidity=51 businessMarketing = _defaultBenificiary; ``` ```solidity=52 presale = _defaultBenificiary; ``` ```solidity=53 reserve = _defaultBenificiary; ``` ```solidity=54 advisor = _defaultBenificiary; ``` - `_defaultBenificiary` is not zero-checked before being used.
There is a misconfiguration in the `inforDistributes` mapping, which associates distribution percentages with recipient indices that correspond to the `_recipients` array: ```solidity=56 _recipients = [businessMarketing, presale, reserve, advisor]; ``` The `inforDistributes` mapping is structured to hold an array of `InforDistribute` structs, keyed by the recipient index: `recipient_index => [{beneficiary, percentage, phase}, ...]`. ```solidity=40 mapping(uint8 => InforDistribute[]) internal inforDistributes; ``` - The `recipient_index` is the array index of the `_recipients` array. - The `beneficiary` address is the token recipient. A discrepancy has been found where entries intended for the `presale` account are mistakenly assigned to the `reserve` account, for example: ```solidity=71 inforDistributes[2].push(InforDistribute(presale, 55, 2)); ``` Here, the `recipient_index` is set to `2`, which, according to the `_recipients` array, corresponds to the `reserve`, not the `presale`. However, the `beneficiary` is set to the `presale` address. Although all recipients are defaulted to the same address in the constructor, the inconsistency in the code logic would lead to confusion.
The `POPGToken` contract inherits from `ERC20`, `ERC20Permit` and `Ownable`, but the ownership functionality appears unused. This redundancy can cause confusion and might be optimized for efficiency: ```solidity=9 contract POPGToken is ERC20, ERC20Permit, Ownable { ```
In the `release()` function, the `currentPhase` is calculated and cached in L263: ```solidity=263 uint256 currentPhase = getPhaseAtTime(block.timestamp); ``` However, it is recalculated again in the function: ```solidity=276 milestones[getPhaseAtTime(block.timestamp)].released = true; ``` Recalculating the `currentPhase` is redundant since it has already been determined and stored earlier in the function.
The `changeAddressBeneficiary()` function intends to update the beneficiary address within the `InforDistribute` struct for a given recipient index. However, the function only updates the beneficiary address of the first entry in the `InforDistribute` array associated with the provided index: ```solidity=146 inforDistributes[_index][0].benificiary = _benificiary; ``` When this function is called with an index and a new beneficiary address, it does not iterate through the entire array of `InforDistribute` structs at that index. As a result, only the first entry is updated, which can lead to inconsistencies where subsequent entries retain the old beneficiary address. For example, calling `changeAddressBeneficiary(3, newAdvisor)` only updates the beneficiary for the first entry at index 3, while other entries such as `inforDistributes[3][1]` and `inforDistributes[3][2]` remain unchanged.
The index of `milestones` array should match with the phrase number based on the logic in the `getTotalDistributedAmount()`, `release()` and `unlockRestAmount()` functions. The contract contains a mismatch between the index of the `milestones` array and the associated phrase number. The `milestones` array uses zero-based indexing, where the first milestone is at index 0: ```solidity milestones[0] = Milestone(MILESTONE_1_DATE, 20, false); ``` However, the first phrase number in the `InforDistribute` struct is initialized with a value of 1, as shown below: ```solidity inforDistributes[0].push(InforDistribute(businessMarketing, 35, 1)); ``` This discrepancy could lead to inconsistencies and confusion.
The `VestingWallet` contract imports and declares usage of the `SafeERC20` library for the `IERC20` interface: ```solidity=11 using SafeERC20 for IERC20; ``` However, throughout the contract, the `SafeERC20` library functions are not utilized when transferring tokens. This can lead to missed safety checks during token transfers, such as checking for a successful transfer, which `SafeERC20` provides.
| Address | Chain | Source code |
|---|---|---|
| 0x59ca…5ba20x59caf3854a29d886080fe28dfecb2dec61cf5ba2 | Chain: Ethereum | Source code: Verified source |
| 0xdac0…db710xdac070102b0cfde1493026454c9c608924f6db71 | Chain: Ethereum | Source code: Verified source |
1,045 projects reviewed · 1,376 reports · latest May 2025
See CertiK’s auditsSomething 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