update userOriginalStake on buy sellStake
This commit is contained in:
@@ -96,7 +96,7 @@ contract CunaFinanceBsc is Initializable, ReentrancyGuardUpgradeable {
|
||||
// Epoch-based staking variables
|
||||
mapping(uint256 => Epoch) public epochs;
|
||||
mapping(address => uint256) public userBigStake; // User's main stake amount
|
||||
mapping(address => uint256) public userOriginalStake; // User's original stake amount (never changes)
|
||||
mapping(address => uint256) public userOriginalStake; // User's cumulative original stake (first stake + marketplace purchases)
|
||||
mapping(address => uint256) public userLastClaimedEpoch; // Last epoch user claimed from
|
||||
mapping(address => WithdrawStake[]) public withdrawStakes; // User's withdrawable stakes
|
||||
uint256 public currentEpochId;
|
||||
@@ -757,6 +757,10 @@ contract CunaFinanceBsc is Initializable, ReentrancyGuardUpgradeable {
|
||||
userBigStake[seller] -= value;
|
||||
userBigStake[msg.sender] += buyerStake;
|
||||
pendingSellStakes[seller] -= value;
|
||||
|
||||
// Increment buyer's original stake tracking (marketplace purchases count as original stake)
|
||||
userOriginalStake[msg.sender] += buyerStake;
|
||||
|
||||
// Note: totalBigStakes decreases by protocolShare
|
||||
totalBigStakes -= protocolShare;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user