@@ -46,13 +46,15 @@ abstract contract TimelockUtils is ClaimUtils, ITimelockUtils {
4646 msg .sender == timelockManager,
4747 "Pool: Caller not TimelockManager "
4848 );
49- users[userAddress].unstaked += amount;
49+ uint256 unstakedUpdate = users[userAddress].unstaked + amount;
50+ users[userAddress].unstaked = unstakedUpdate;
5051 // Should never return false because the API3 token uses the
5152 // OpenZeppelin implementation
5253 assert (api3Token.transferFrom (source, address (this ), amount));
5354 emit DepositedByTimelockManager (
5455 userAddress,
55- amount
56+ amount,
57+ unstakedUpdate
5658 );
5759 }
5860
@@ -103,8 +105,10 @@ abstract contract TimelockUtils is ClaimUtils, ITimelockUtils {
103105 amount != 0 ,
104106 "Pool: Timelock amount zero "
105107 );
106- users[userAddress].unstaked += amount;
107- users[userAddress].vesting += amount;
108+ uint256 unstakedUpdate = users[userAddress].unstaked + amount;
109+ users[userAddress].unstaked = unstakedUpdate;
110+ uint256 vestingUpdate = users[userAddress].vesting + amount;
111+ users[userAddress].vesting = vestingUpdate;
108112 userToTimelock[userAddress] = Timelock ({
109113 totalAmount: amount,
110114 remainingAmount: amount,
@@ -118,7 +122,9 @@ abstract contract TimelockUtils is ClaimUtils, ITimelockUtils {
118122 userAddress,
119123 amount,
120124 releaseStart,
121- releaseEnd
125+ releaseEnd,
126+ unstakedUpdate,
127+ vestingUpdate
122128 );
123129 }
124130
@@ -152,11 +158,13 @@ abstract contract TimelockUtils is ClaimUtils, ITimelockUtils {
152158 uint256 previouslyUnlocked = timelock.totalAmount - timelock.remainingAmount;
153159 uint256 newlyUnlocked = totalUnlocked - previouslyUnlocked;
154160 User storage user = users[userAddress];
155- user.vesting -= newlyUnlocked;
161+ uint256 vestingUpdate = user.vesting - newlyUnlocked;
162+ user.vesting = vestingUpdate;
156163 timelock.remainingAmount -= newlyUnlocked;
157164 emit VestedTimelock (
158165 userAddress,
159- newlyUnlocked
166+ newlyUnlocked,
167+ vestingUpdate
160168 );
161169 }
162170}
0 commit comments