Skip to content

v0.1.4

Choose a tag to compare

@ehsan6sha ehsan6sha released this 27 Jan 23:57
· 218 commits to main since this release

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 cleanupExpiredProposals to clean expired proposals if needed

[H-02] StorageToken#_setPlatformFee

Status: Fixed

How

  • Corrected the corresponding line in _update to uint256 fee = (amount * platformFeeBps) / 10000 instead 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: proposalIndex and a gas limit GAS_BUFFER
  • Knowing the proposalIndex for 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 _adminCount and custom grantRole and revokeRole to not allow removing last admin

[L-01] Lock#Constructor

Status: Fixed

How

  • prevented receive in the Lock contract

[L-02] TokenDistributionEngine#_removeWallet

Status: Fixed

How

  • Removed unused _removeWallet from TokendistributionEngine.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 pendingOwner and hasProposalApproval from public to external