Skip to content

Commit

Permalink
Merge pull request #21 from persistenceOne/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
RohitAudit authored May 19, 2022
2 parents f8a25b9 + e25b3a4 commit 8395d1b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions contracts/Oracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ contract Oracle is IOracle, CoreRef {
// pricePerShare = (pricePerShare * (1e18 - percentChange)) / 1e18;
// }
pricePerShare = price;
emit Slash(deltaEth);
emit Slash(deltaEth,pricePerShare,block.timestamp);
}

/// @notice function to distribute rewards by setting price per share
Expand All @@ -344,7 +344,7 @@ contract Oracle is IOracle, CoreRef {
IStakingPool(core().validatorPool()).updateRewardPerValidator(stkEthMinted);
mintStkEthForEth(protocolEthShare, core().pstakeTreasury(), price);
pricePerShare = price;
emit Distribute(deltaEth);
emit Distribute(deltaEth,pricePerShare,block.timestamp);
}


Expand Down
2 changes: 2 additions & 0 deletions contracts/StakingPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ contract StakingPool is IStakingPool, OwnableUpgradeable{

uint256 public DEVIATION; // 5% deviation is acceptable
uint256 public constant BASIS_POINT = 10000;
event RewardRedeemed(uint256 amount, uint256 time, address node_operator);

mapping(address => UserInfo) public userInfos;

Expand Down Expand Up @@ -78,6 +79,7 @@ contract StakingPool is IStakingPool, OwnableUpgradeable{

if(pending > 0){
stkEth.transfer(usr, pending);
emit RewardRedeemed(pending,block.timestamp,usr);
}

user.rewardDebt = accRewardPerValidator*userValidators/1e12;
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IIssuer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface IIssuer {
event SetMinActivationDeposit(uint256 _minActivatingDeposit);
event SetPendingValidatorsLimit(uint256 _pendingValidatorsLimit);
event UpdatePendingValidators(uint256 _pendingValidators);
event Stake(address indexed user,uint256 amount,uint256 block_time);
event Stake(address indexed_user,uint256 amount,uint256 block_time);
function updatePendingValidator(uint256 newActiveValidators) external;

function pendingValidators() external view returns (uint256);
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/IOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ pragma solidity ^0.8.0;
/// @author Ankit Parashar
interface IOracle {

event Distribute(uint256 amount);
event Slash(uint256 amount);
event Distribute(uint256 amount,uint256 pricePerShare,uint256 timestamp);
event Slash(uint256 amount,uint256 pricePerShare,uint256 timestamp);

function pricePerShare() external view returns (uint256);

Expand Down

0 comments on commit 8395d1b

Please sign in to comment.