From b70666c26dd8fee105cf2c9775f044c67e18101c Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Wed, 21 Jun 2023 10:59:30 -0300 Subject: [PATCH] reward emissions --- contracts/StakeManager.sol | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contracts/StakeManager.sol b/contracts/StakeManager.sol index 4694a0f..b254175 100644 --- a/contracts/StakeManager.sol +++ b/contracts/StakeManager.sol @@ -8,7 +8,7 @@ contract StakeManager is ERC20 { ERC20 stakedToken; - uint256 public constant MP_APY = 1; + uint256 public constant MP_APY = 1; uint256 public constant STAKE_APY = 1; uint256 public constant MAX_BOOST = 1; uint256 public constant MAX_MP = 1; @@ -69,9 +69,10 @@ contract StakeManager is ERC20 { } - function getRewardsEmissions() public view returns(uint256){ - uint256 totalStaked = this.totalSupply; - uint256 share = this.multiplierSupply +totalSupply; + function getRewardsEmissions(address _vault, uint256 _totalReward) public view returns(uint256){ + uint256 totalShare = this.totalSupply + this.multiplierSupply; + uint256 userShare = accounts[_vault].balance + accounts[_vault].multiplier; + return (userShare / totalShare) * _totalReward; }