Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/code documentation #50

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open

Conversation

ayodeko
Copy link
Contributor

@ayodeko ayodeko commented Jul 16, 2024

No description provided.

Comment on lines 216 to 222
function claimFee() external nonReentrant onlyAdmin {
uint256 penaltyAmount = pool.totalPenalties;
if (penaltyAmount == 0) revert NothingToClaim();
pool.totalPenalties = 0;
IERC20(pool.rewardToken).safeTransfer(pool.adminWallet, penaltyAmount);
emit FeeClaim(penaltyAmount);
}

Check warning

Code scanning / Slither

Dangerous strict equalities Medium

ERC721PenaltyFeePool.claimFee() uses a dangerous strict equality:
- penaltyAmount == 0
Comment on lines 216 to 222
function claimFee() external nonReentrant onlyAdmin {
uint256 penaltyAmount = pool.totalPenalties;
if (penaltyAmount == 0) revert NothingToClaim();
pool.totalPenalties = 0;
IERC20(pool.rewardToken).safeTransfer(pool.adminWallet, penaltyAmount);
emit FeeClaim(penaltyAmount);
}

Check notice

Code scanning / Slither

Block timestamp Low

ERC721PenaltyFeePool.claimFee() uses timestamp for comparisons
Dangerous comparisons:
- penaltyAmount == 0
Comment on lines 41 to 54
function deploy(uint256 id) external {
if (requests.length <= id) revert InvalidId();
Request memory req = requests[id];
if (req.requestStatus != Status.APPROVED) revert InvalidRequestStatus();
if (msg.sender != req.data.deployer) revert InvalidDeployer();
requests[id].requestStatus = Status.DEPLOYED;
address newPoolAddress = IGenericFactory(req.data.factory).deploy(
req.data.deployer,
req.data.stakingData
);
stakingPools.push(newPoolAddress);
poolById[id] = newPoolAddress;
emit RequestFullfilled(id, newPoolAddress);
}

Check notice

Code scanning / Slither

Reentrancy vulnerabilities Low

@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.81%. Comparing base (d5e5f19) to head (41c3055).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #50   +/-   ##
========================================
  Coverage    86.81%   86.81%           
========================================
  Files           12       12           
  Lines          546      546           
  Branches       142      142           
========================================
  Hits           474      474           
  Misses          70       70           
  Partials         2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SergeyPoslavskiy SergeyPoslavskiy changed the base branch from master to develop July 19, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants