We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Proof of Concept: https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L152
Recommended Mitigation Steps: change to prefix increment and unchecked
========================================================================
+=
Proof of Concept: https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L279 https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/KnightingRound.sol#L196-L199
Recommended Mitigation Steps: Change to:
_newTotalWeight += _weight;
!=
>
Proof of Concept: https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L343 https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L170 https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L452
require(length != 0, "CitadelMinter: no funding pools");
Proof of Concept: https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L152 https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L180-L182 https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/SupplySchedule.sol#L192
Recommended Mitigation Steps: remove 0
Proof of Concept: https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L366 https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/StakedCitadel.sol#L416
delete fundingPoolWeights[_pool];
Proof of Concept: https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L236 https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/KnightingRound.sol#L250
Recommended Mitigation Steps:
Unchecked{ limitLeft_ = assetCap - assetCumulativeFunded; }
>=
Proof of Concept: https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L270-L271 https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L361
Recommended Mitigation Steps: 1 second difference can be ignored to validate Change from: >= or <= to: > or <
<=
<
calldata
Proof of Concept: https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L244
Recommended Mitigation Steps: Change memory to calldata
memory
Proof of Concept: https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/StakedCitadel.sol#L859
Recommended Mitigation Steps: declare governancePerformanceFee, strategistPerformanceFee in function returns and delete #L874 can save gas
returns
function _calculatePerformanceFee(uint256 _amount) internal view returns (uint256 governancePerformanceFee, uint256 strategistPerformanceFee) //@audit-info return here { uint256 governancePerformanceFee = _calculateFee( _amount, performanceFeeGovernance ); uint256 strategistPerformanceFee = _calculateFee( _amount, performanceFeeStrategist ); }
citadelAmountWithoutDiscount
Proof of Concept: https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L207
Recommended Mitigation Steps: citadelAmountWithoutDiscount only called once. just calculated directly to citadelAmount_ #L211
citadelAmount_
if (funding.discount > 0) { citadelAmount_ = ((_assetAmountIn * citadelPriceInAsset)* MAX_BPS) / (MAX_BPS - funding.discount); }
The text was updated successfully, but these errors were encountered:
Tomio issue #230
433b73f
No branches or pull requests
Proof of Concept:
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L152
Recommended Mitigation Steps:
change to prefix increment and unchecked
========================================================================
+=
to increase value on varProof of Concept:
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L279
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/KnightingRound.sol#L196-L199
Recommended Mitigation Steps:
Change to:
========================================================================
!=
instead of>
is more gas efficientProof of Concept:
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L343
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L170
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L452
Recommended Mitigation Steps:
Change to:
========================================================================
Proof of Concept:
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L152
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L180-L182
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/SupplySchedule.sol#L192
Recommended Mitigation Steps:
remove 0
========================================================================
Proof of Concept:
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/CitadelMinter.sol#L366
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/StakedCitadel.sol#L416
Recommended Mitigation Steps:
Change to:
========================================================================
Proof of Concept:
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L236
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/KnightingRound.sol#L250
Recommended Mitigation Steps:
========================================================================
>
is cheaper than>=
Proof of Concept:
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L270-L271
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L361
Recommended Mitigation Steps:
1 second difference can be ignored to validate
Change from:
>=
or<=
to:
>
or<
========================================================================
calldata
to store struct data type can save gasProof of Concept:
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L244
Recommended Mitigation Steps:
Change
memory
tocalldata
========================================================================
Proof of Concept:
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/StakedCitadel.sol#L859
Recommended Mitigation Steps:
declare governancePerformanceFee, strategistPerformanceFee in function
returns
and delete #L874 can save gas========================================================================
citadelAmountWithoutDiscount
MSTOREProof of Concept:
https://github.com/code-423n4/2022-04-badger-citadel/blob/main/src/Funding.sol#L207
Recommended Mitigation Steps:
citadelAmountWithoutDiscount
only called once. just calculated directly tocitadelAmount_
#L211========================================================================
The text was updated successfully, but these errors were encountered: