Skip to content
This repository was archived by the owner on May 22, 2023. It is now read-only.

Commit 375a5bf

Browse files
authored
Merge pull request #587 from keep-network/rewards-cap-tests
Rewards cap tests Adding tests around the maximum cap rewards per ECDSA keep operator.
2 parents 7827b53 + d3623cd commit 375a5bf

3 files changed

Lines changed: 264 additions & 31 deletions

File tree

solidity/contracts/ECDSARewards.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ contract ECDSARewards is Rewards {
9090
// The amount of tokens each individual beneficiary address
9191
// can receive in a single interval is capped.
9292
// TODO: set actual value
93-
uint256 internal constant beneficiaryRewardCap = 400000 * 10**18;
93+
uint256 internal beneficiaryRewardCap = 400000 * 10**18;
9494
// The total amount of rewards allocated to the given beneficiary address,
9595
// in the given interval.
9696
// `allocatedRewards[beneficiary][interval] -> amount`
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
pragma solidity 0.5.17;
2+
3+
import "../../contracts/ECDSARewards.sol";
4+
5+
/// @title ECDSA Rewards Stub for ecdsa rewards testing
6+
/// @dev This contract is for testing purposes only.
7+
contract ECDSARewardsStub is ECDSARewards {
8+
9+
uint256 internal tokenDecimalMultiplier = 10**18;
10+
11+
constructor(
12+
address _token,
13+
address payable _factoryAddress,
14+
address _tokenStakingAddress
15+
)
16+
public
17+
ECDSARewards(
18+
_token,
19+
_factoryAddress,
20+
_tokenStakingAddress
21+
)
22+
{}
23+
24+
function setBeneficiaryRewardCap(uint256 _beneficiaryRewardCap) public {
25+
beneficiaryRewardCap = _beneficiaryRewardCap.mul(tokenDecimalMultiplier);
26+
}
27+
}

0 commit comments

Comments
 (0)