Also, the modifiers declared in GlobalAccessControlManaged.sol should be placed before any function declaration, specifically, __GlobalAccessControlManaged_init(). This will aid contract readability.
Tools Used
Manual review
Recommendation
Declare modifiers together. Group events together. Follow the recommended contract layout. Inside each contract, library or interface, use the following order:
Missing or incomplete natspec comments in contracts
Proof of Concept
These functions do not have a comment or partially commented:
CitadelMinter.getFundingPoolWeights()
CitadelMinter.initializeLastMintTimestamp()
CitadelMinter._transferToFundingPools()
CitadelMinter._removeFundingPool()
CitadelMinter._addFundingPool()
Funding.clearCitadelPriceFlag()
Funding.setSaleRecipient()
Funding.setCitadelAssetPriceBounds()
GlobalAccessControl.pause()
GlobalAccessControl.unpause()
KnightingRound.claim() - no @return tag
StakedCitadel.depositFor() - no @param tag for third parameter i.e proof
StakedCitadel._depositWithAuthorization() - no @param tags
StakedCitadel._depositForWithAuthorization() - no @param tags
StakedCitadelVester.initialize()
SupplySchedule.sol
Tools Used
Manual review
Recommendation
Include comments in contracts where there is none. Update contracts which are partially commented
Handle
tchkvsky
Scope
SettAccessControl.sol#L37-L54
Vulnerability details
Missing zero address validation in permissioned actors
Impact
Alice calls setGovernance without specifying the _governance, so Alice loses ownership of the contract.
Proof of Concept
SettAccessControl.setStrategist
SettAccessControl.setKeeper
SettAccessControl.setGovernance
Tools Used
Manual review
Recommendation
Check that the address is not zero.
Complex pragma versions used in interfaces
Handle
tchkvsky
Vulnerability details
Complex pragma versions is used in interfaces:
pragma solidity >=0.5.0<=0.9.0 is too complex
Impact
Different versions of solidity might have different bugs that might cause unwanted behavior in contracts. It is recommended to use a single pragma version.
Declare modifiers together
Handle
tchkvsky
Scope
Funding.sol
GlobalAccessControlManaged.sol
Vulnerability details
onlyCitadelPriceInAssetOracle()
modifier inFunding.sol
should be declared after the events.Also, the modifiers declared in
GlobalAccessControlManaged.sol
should be placed before any function declaration, specifically,__GlobalAccessControlManaged_init()
. This will aid contract readability.Tools Used
Manual review
Recommendation
Declare modifiers together. Group events together. Follow the recommended contract layout. Inside each contract, library or interface, use the following order:
Type declarations
State variables
Events
Modifiers
Functions
Useful link:
Order Of Layout | Style Guide ! Solidity 0.8.14 documentation
Missing or incomplete natspec comments
Scope
CitadelMinter.sol
Funding.sol
GlobalAccessControl.sol
KnigthingRound.sol
StakedCitadel.sol
StakedCitadelVester.sol
SupplySchedule.sol
Vulnerability details
Missing or incomplete natspec comments in contracts
Proof of Concept
These functions do not have a comment or partially commented:
CitadelMinter.getFundingPoolWeights()
CitadelMinter.initializeLastMintTimestamp()
CitadelMinter._transferToFundingPools()
CitadelMinter._removeFundingPool()
CitadelMinter._addFundingPool()
Funding.clearCitadelPriceFlag()
Funding.setSaleRecipient()
Funding.setCitadelAssetPriceBounds()
GlobalAccessControl.pause()
GlobalAccessControl.unpause()
KnightingRound.claim()
- no @return tagStakedCitadel.depositFor()
- no @param tag for third parameter i.eproof
StakedCitadel._depositWithAuthorization()
- no @param tagsStakedCitadel._depositForWithAuthorization()
- no @param tagsStakedCitadelVester.initialize()
SupplySchedule.sol
Tools Used
Manual review
Recommendation
Include comments in contracts where there is none. Update contracts which are partially commented
Handle
tchkvsky
Scope
SettAccessControl.sol#L37-L54
Vulnerability details
Missing zero address validation in permissioned actors
Impact
Alice calls
setGovernance
without specifying the_governance
, so Alice loses ownership of the contract.Proof of Concept
SettAccessControl.setStrategist
SettAccessControl.setKeeper
SettAccessControl.setGovernance
Tools Used
Manual review
Recommendation
Check that the address is not zero.
Complex pragma versions used in interfaces
Handle
tchkvsky
Vulnerability details
Complex pragma versions is used in interfaces:
pragma solidity >=0.5.0<=0.9.0
is too complexImpact
Different versions of solidity might have different bugs that might cause unwanted behavior in contracts. It is recommended to use a single pragma version.
Proof of Concept
Tools Used
Static analyzer
Recommendation
Consider modifying contracts to use a single pragma version. Alternatively, use a modern interface with a stable, yet single solidity version.