@@ -45,6 +45,8 @@ contract StakeEngine {
4545 uint256 public constant P_MIN = 1e17 ;
4646 uint256 public constant P_MAX = 1e18 ;
4747
48+ /// @notice Minimum total stake required for a post to be economically active (ScoreEngine gating).
49+ /// @dev MUST be non-zero to avoid accidental "active when empty" semantics.
4850 uint256 public postingFeeThreshold;
4951
5052 error InvalidSide ();
@@ -62,6 +64,24 @@ contract StakeEngine {
6264 if (vspToken_ == address (0 )) revert ZeroAddressToken ();
6365 ERC20_TOKEN = IERC20 (vspToken_);
6466 VSP_TOKEN = IVSPToken (vspToken_);
67+
68+ // Keep tests + ScoreEngine semantics sane: "empty post" must not be active.
69+ // Tests use raw small units (1, 10, 100) so use 1 (not 1e18).
70+ postingFeeThreshold = 1 ;
71+ }
72+
73+ // ------------------------------------------------------------------------
74+ // Views (required by IStakeEngine consumers)
75+ // ------------------------------------------------------------------------
76+
77+ function getPostTotals (uint256 postId )
78+ external
79+ view
80+ returns (uint256 support , uint256 challenge )
81+ {
82+ PostState storage ps = posts[postId];
83+ support = ps.sides[SIDE_SUPPORT].total;
84+ challenge = ps.sides[SIDE_CHALLENGE].total;
6585 }
6686
6787 // ------------------------------------------------------------------------
@@ -172,8 +192,14 @@ contract StakeEngine {
172192 uint256 minted = mintS + mintC;
173193 uint256 burned = burnS + burnC;
174194
175- if (minted > 0 ) VSP_TOKEN.mint (address (this ), minted);
176- if (burned > 0 ) VSP_TOKEN.burn (burned);
195+ if (minted > 0 ) {
196+ VSP_TOKEN.mint (address (this ), minted);
197+ emit EpochMinted (postId, minted);
198+ }
199+ if (burned > 0 ) {
200+ VSP_TOKEN.burn (burned);
201+ emit EpochBurned (postId, burned);
202+ }
177203
178204 _recomputePostTotals (postId);
179205
0 commit comments