Port3-audit

CertiKFiles named in the report

CertiK reviewed Port3 (Port3-audit) on 30 Oct 2023: 10 findings, 1 critical; 2 marked fixed, 3 acknowledged, 5 open.

1 critical acknowledged, not fixed
Open the reportOpen Port3’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings10

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

SeverityOpenAcknowledgedFixed
Critical010
High010
Medium010
Low502
LowConfusing function implementation and function naOpen

The "claimRandomPool" function allows owners to withdraw certain amount of assets from the contract without any restrictions. The auditor would like to understand how such an implementation matches the function name "claimRandomPool." What does the word "Random" mean in the context of the function?

LowIncompatibility with Deflationary TokensOpen

When transferring deflationary ERC20 tokens, the input amount may not be equal to the received amount due to the charged transaction fee. For example, if a user sends 100 deflationary tokens (with a 10% transaction fee), only 90 tokens actually arrived to the contract. However, a failure to discount such fees may allow the same user to withdraw 100 tokens from the contract, which causes the contract to lose 10 tokens in such a transaction. Reference: https://thoreum-finance.medium.com/what-exploit-happened-today-for-gocerberus-and-garuda-also-for-lokum-ybear-piggy-caramelswap-3943ee23a39f ```solidity=106 IERC20(rewardToken).safeTransferFrom(msg.sender, address(this), amount); ``` - Transferring tokens by `amount`. ```solidity=110 totalReward = totalReward.add(amount); ``` - This function call executes the following operation. - In `SafeMath.add`, - `uint256 c = a + b;` - The `amount` appears to be used for bookkeeping purposes without compensating the potential transfer fees.

LowThird-Party Dependency UsageOpen

The contract is serving as the underlying entity to interact with one or more third party protocols. The scope of the audit treats third party entities as black boxes and assumes their functional correctness. However, in the real world, third parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of third parties can possibly create severe impacts, such as increasing fees of third parties, migrating to new LP pools, etc. ```solidity=18 address public rewardToken; ``` - The contract `PrizePool` interacts with third party contract with `IERC20` interface via `rewardToken`.

LowUnnecessary Use of SafeMathOpen

The `SafeMath` library is used unnecessarily. With Solidity compiler versions 0.8.0 or newer, arithmetic operations will automatically revert in case of integer overflow or underflow. ```solidity=13 using SafeMath for uint256; ``` - `SafeMath` library is used for `uint256` type in `PrizePool` contract. ```solidity=83 userFeePool[_users[i]] = userFeePool[_users[i]].add(_amounts[i]); ``` - `SafeMath.add` is called in `setWhitelist` function of `PrizePool` contract. *Note: Only a sample of 2 `SafeMath` library usage in this contract (out of 18) are shown above.* --- ```solidity=17 library SafeMath { ``` - An implementation of `SafeMath` library is found.

LowVariables That Could Be Declared as ImmutableOpen

The linked variables assigned in the constructor can be declared as `immutable`. Immutable state variables can be assigned during contract creation but will remain constant throughout the lifetime of a deployed contract. A big advantage of immutable variables is that reading them is significantly cheaper than reading from regular state variables since they will not be stored in storage.

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)

  • contracts/PrizePool.sol
  • contracts/Port3BQLSharesV1.sol

Part of Port3’s security record

Port3
Audits1 audit by 1 firmLast audit Oct 2023, by CertiK.
Critical findings1 critical acknowledged, not fixedReported in “Port3-audit” by CertiK, Oct 2023. The team acknowledged it.
Open Port3’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 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