Platform: Code4rena
Start Date: 31/01/2023
Pot Size: $90,500 USDC
Total HM: 47
Participants: 169
Period: 7 days
Judge: LSDan
Total Solo HM: 9
Id: 211
League: ETH
Rank: 121/169
Findings: 1
Award: $35.48
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x3b, 0xAgro, 0xBeirao, 0xMirce, 0xNineDec, 0xRobocop, 0xSmartContract, 0xTraub, 0xWeiss, 2997ms, 41i3xn, Awesome, Aymen0909, Bauer, Bnke0x0, Breeje, Cryptor, DadeKuma, Deathstore, Deekshith99, DevABDee, DevTimSch, Dewaxindo, Diana, Ermaniwe, Guild_3, H0, IceBear, Inspectah, JDeryl, Kaiziron, Kaysoft, Kenshin, Mukund, Praise, RaymondFam, Rickard, Rolezn, Ruhum, Sathish9098, SkyWalkerMan, SleepingBugs, UdarTeam, Udsen, Walter, aashar, adeolu, apvlki, arialblack14, ast3ros, btk, chaduke, chandkommanaboyina, chrisdior4, climber2002, codetilda, cryptonue, cryptostellar5, csanuragjain, ddimitrov22, descharre, dharma09, doublesharp, eccentricexit, ethernomad, fs0c, georgits, halden, hansfriese, hashminer0725, immeas, lukris02, luxartvinsec, matrix_0wl, merlin, mookimgo, mrpathfindr, nadin, olegthegoat, pavankv, rbserver, rebase, savi0ur, sayan, scokaf, seeu, shark, simon135, tnevler, tsvetanovv, ulqiorra, ustas, waldenyan20, y1cunhui, yongskiws, yosuke
35.4779 USDC - $35.48
Before deploying the system, the following instances of TODO comments in the codebase should be noted in the project's problems backlog and eliminated.
Having clearly stated TODO notes throughout development will facilitate monitoring and resolving them. Without that knowledge, these remarks could become outdated and crucial details for the system's security might be lost by the time it is put into production.
Consider keeping track of all TODO comments in the backlog of issues and connecting each inline TODO to the related item. Before deploying to a production environment, all TODOs must be completed.
// TODO use deterministic fee recipient proxy
From the Solidity version 0.8.4
it was added the possibility to use bytes.concat
with variable number of bytes
and bytesNN
arguments. With a more evocative name, it functions as a restricted abi.encodePacked
.
pragma solidity ^0.8.15;
::104 => bytes32 id = keccak256(abi.encodePacked(token, account, amount, nonce));
pragma solidity ^0.8.15;
::49 => _name = string(abi.encodePacked("Staked ", IERC20Metadata(address(_stakingToken)).name())); ::50 => _symbol = string(abi.encodePacked("pst-", IERC20Metadata(address(_stakingToken)).symbol())); ::461 => abi.encodePacked(
pragma solidity ^0.8.15;
::94 => abi.encodePacked("Popcorn", name(), block.timestamp, "Vault") ::680 => abi.encodePacked(
pragma solidity ^0.8.15;
::648 => abi.encodePacked(
To increase explicitness and readability, take into account introducing and utilizing named return parameters.
::7 => function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {}
::38 => function getEscrowIdsByUser(address account) external view returns (bytes32[] memory) { ::42 => function getEscrowIdsByUserAndToken(address account, IERC20 token) external view returns (bytes32[] memory) { ::51 => function getEscrows(bytes32[] calldata escrowIds) external view returns (Escrow[] memory) { ::140 => function isClaimable(bytes32 escrowId) external view returns (bool) { ::144 => function getClaimableAmount(bytes32 escrowId) external view returns (uint256) { ::170 => function _getClaimableAmount(Escrow memory escrow) internal view returns (uint256) {
::59 => function name() public view override(ERC20Upgradeable, IERC20Metadata) returns (string memory) { ::63 => function symbol() public view override(ERC20Upgradeable, IERC20Metadata) returns (string memory) { ::67 => function decimals() public view override(ERC20Upgradeable, IERC20Metadata) returns (uint8) { ::75 => function deposit(uint256 _amount) external returns (uint256) { ::79 => function mint(uint256 _amount) external returns (uint256) { ::83 => function withdraw(uint256 _amount) external returns (uint256) { ::87 => function redeem(uint256 _amount) external returns (uint256) { ::98 => function _convertToShares(uint256 assets, Math.Rounding) internal pure override returns (uint256) { ::102 => function _convertToAssets(uint256 shares, Math.Rounding) internal pure override returns (uint256) { ::362 => function getAllRewardsTokens() external view returns (IERC20[] memory) { ::487 => function DOMAIN_SEPARATOR() public view returns (bytes32) { ::491 => function computeDomainSeparator() internal view virtual returns (bytes32) {
::278 => function deployStaking(IERC20 asset) external canCreate returns (address) {
::65 => function getAllClones() external view returns (address[] memory) {
::51 => function endorsed(address target) external view returns (bool) { ::55 => function rejected(address target) external view returns (bool) {
::115 => function getTemplateCategories() external view returns (bytes32[] memory) { ::119 => function getTemplateIds(bytes32 templateCategory) external view returns (bytes32[] memory) { ::123 => function getTemplate(bytes32 templateCategory, bytes32 templateId) external view returns (Template memory) {
::100 => function decimals() public view override returns (uint8) { ::124 => function deposit(uint256 assets) public returns (uint256) { ::160 => function mint(uint256 shares) external returns (uint256) { ::200 => function withdraw(uint256 assets) public returns (uint256) { ::242 => function redeem(uint256 shares) external returns (uint256) { ::285 => function totalAssets() public view returns (uint256) { ::294 => function convertToShares(uint256 assets) public view returns (uint256) { ::308 => function convertToAssets(uint256 shares) public view returns (uint256) { ::399 => function maxDeposit(address caller) public view returns (uint256) { ::404 => function maxMint(address caller) external view returns (uint256) { ::409 => function maxWithdraw(address caller) external view returns (uint256) { ::414 => function maxRedeem(address caller) external view returns (uint256) { ::429 => function accruedManagementFee() public view returns (uint256) { ::447 => function accruedPerformanceFee() public view returns (uint256) { ::709 => function DOMAIN_SEPARATOR() public view returns (bytes32) { ::716 => function computeDomainSeparator() internal view virtual returns (bytes32) {
::59 => function getVault(address vault) external view returns (VaultMetadata memory) { ::63 => function getVaultsByAsset(address asset) external view returns (address[] memory) { ::67 => function getTotalVaults() external view returns (uint256) { ::71 => function getRegisteredAddresses() external view returns (address[] memory) { ::75 => function getSubmitter(address vault) external view returns (VaultMetadata memory) {
::247 => function totalAssets() public view override returns (uint256) { ::258 => function _totalAssets() internal view virtual returns (uint256) {} ::265 => function _underlyingBalance() internal view virtual returns (uint256) {} ::419 => function maxMint(address) public view virtual override returns (uint256) { ::529 => function accruedPerformanceFee() public view returns (uint256) { ::677 => function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { ::684 => function computeDomainSeparator() internal view virtual returns (bytes32) {
::13 => function rewardTokens() external view virtual returns (address[] memory) {} ::21 => function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
::108 => function _totalAssets() internal view override returns (uint256) { ::117 => function _underlyingBalance() internal view override returns (uint256) { ::136 => function rewardTokens() external view override returns (address[] memory) {
::80 => function _totalAssets() internal view override returns (uint256) { ::84 => function _underlyingBalance() internal view override returns (uint256) { ::89 => function _shareValue(uint256 yShares) internal view returns (uint256) { ::101 => function _freeFunds() internal view returns (uint256) { ::109 => function _yTotalAssets() internal view returns (uint256) { ::114 => function _calculateLockedProfit() internal view returns (uint256) { ::144 => function maxDeposit(address) public view override returns (uint256) {
Since decimals()
is not a part of the official ERC20 standard, it could not work for some tokens.
::51 => _decimals = IERC20Metadata(address(_stakingToken)).decimals(); ::274 => uint64 ONE = (10**IERC20Metadata(address(rewardToken)).decimals()).safeCastTo64(); ```Solidity
_decimals = IERC20Metadata(address(asset_)).decimals();
_decimals = IERC20Metadata(asset).decimals();
Even if it's possible that certain contracts aren't already subclassifiedsub-classed, including the storage variable __gap[50]
now will prevent forgetting to do so in the future.
#0 - c4-judge
2023-02-28T14:54:01Z
dmvt marked the issue as grade-b