Repository navigation
v0.1.4
Addressed the audit issues
Full Changelog: v0.1.3...v0.1.4
Audit Findings
[H-01] GovernanceModule#_checkExpiredProposal
Status: Fixed
How
- removed revert ProposalErr(2); and replaced with return false and true in the _checkExpiredProposal
- Added revert in approveProposal, _executeProposal, and _checkUpgrade
- Also crated a method
cleanupExpiredProposalsto clean expired proposals if needed
[H-02] StorageToken#_setPlatformFee
Status: Fixed
How
- Corrected the corresponding line in
_updatetouint256 fee = (amount * platformFeeBps) / 10000instead of/MAX_BPS - Kept the MAX_BPS to 500
[M-01] GovernanceModule#_executeProposal: Fixed
How
- Added proper cleanup to
_executeProposal
// Added cleanup
delete pendingProposals[proposal.target];
delete proposals[proposalId];
if (proposalCount > 0) proposalCount -= 1;
_removeFromRegistry(proposalId);
emit ProposalExecuted(proposalId, proposal.proposalType, proposal.target);
[M-02] GovernanceModule#_removeFromRegistry
Status: Fixed
How
- Added a storage variable for the index which gets updated:
proposalIndexand a gas limitGAS_BUFFER - Knowing the
proposalIndexfor hte one we remove, there is no need t oitterate through all proposals now in the_removeFromRegistry
[M-03] Treasury
Status: Fixed
How
- added a counter for admins
_adminCountand customgrantRoleandrevokeRoleto not allow removing last admin
[L-01] Lock#Constructor
Status: Fixed
How
- prevented
receivein the Lock contract
[L-02] TokenDistributionEngine#_removeWallet
Status: Fixed
How
- Removed unused
_removeWalletfromTokendistributionEngine.sol
[L-03] GovernanceModule#_checkUpgrade
Status: Fixed
How
- corrected the assignment to
currentProposal.config.status = 1;
Additional Fixes
Status: Fixed
How
- There was a double reducing of proposalCount which was corrected
- Added a view method
getWalletsInCap - changed
pendingOwnerandhasProposalApprovalfrompublictoexternal