Skip to content

closes #164: fix: implement missing event emissions and resolve contract compilation issues#208

Merged
dDevAhmed merged 2 commits into
DigiNodes:mainfrom
mansur-codes:main
May 31, 2026
Merged

closes #164: fix: implement missing event emissions and resolve contract compilation issues#208
dDevAhmed merged 2 commits into
DigiNodes:mainfrom
mansur-codes:main

Conversation

@mansur-codes
Copy link
Copy Markdown
Contributor

Summary

This PR resolves audit issue #164 by ensuring the StakeWithdrawn event is systematically emitted during all partial (loser) and full (winner) stake return flows. Additionally, it resolves outstanding repository compilation issues, UUPS authorization abstractions, and test suite TypeScript type alignment errors.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • ⚡ Performance optimization
  • 🧪 Test coverage improvement

Related Issue

Closes #164

Changes Made

1. Staking Event Coverage & Variable Cleanup

  • TruthBountyWeighted.sol: Integrated the missing StakeWithdrawn event emissions inside both withdrawSettledStake and claimSettlementRewards to guarantee complete ledger visibility for off-chain indexers.
  • Shadow Elimination: Refactored a shadowed instance of slashAmount inside withdrawSettledStake to clear compiler warnings.

2. Core Compilation & Governance Alignment

  • TruthBounty.sol: Implemented the missing internal _authorizeUpgrade sequence for TruthBountyToken to satisfy abstract UUPS interfaces.
  • GovernorAccess.sol & GovernanceController.sol: Adjusted modifier mappings (virtual / override) and unified custom error matching to clean up inheritance faults.

3. Test Suite Modernization

  • Fixed compiler type assertions (converting strict types to flexible types where TypeChain index signatures clashed with ethers.js).
  • Addressed BigInt calculation errors (BigInt type-casting) and dynamic block-timestamp drift handling.
  • Added comprehensive unit tests specifically targeting the new StakeWithdrawn partial and full event emissions.

Testing

How has this been tested?

  • Ran full Hardhat local testing infrastructure. All 168 unit tests passed with zero compilation errors or regressions.

@dDevAhmed
Copy link
Copy Markdown
Contributor

@mansur-codes resolve conflicts

@dDevAhmed dDevAhmed merged commit 88c2c6c into DigiNodes:main May 31, 2026
1 of 4 checks passed
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.

Missing emit in withdrawStake edge case

2 participants