Skip to content

Commit

Permalink
test new epoch vl
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelBits committed Dec 28, 2022
1 parent 4e53987 commit 7ba7d0b
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions test/LockTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,32 @@ contract LockTest is Test {
//******************************************************************************/
/* EPOCHS
////////// ///////////////////////////////////////////////////////////////////*/
function testRealEpoch() public {
address _lock = 0xbDAA858Fd7b0DC05F8256330fAcB35de86283cA0;
//address _y2k = 0x65c936f008BC34fE819bce9Fa5afD9dc2d49977f;
address _weth = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1;
uint _rewardAmount = 14100000000000000000;
uint _days = 7;

vm.prank(0x5c84CF4d91Dc0acDe638363ec804792bB2108258); // treasury
ERC20(_weth).transfer(address(_lock), _rewardAmount);

vm.prank(0x16cBaDA408F7523452fF91c8387b1784d00d10D8); // y2k ops
LockRewards(_lock).setNextEpoch(0, _rewardAmount, _days);

(uint256 _start, uint256 _finish, uint256 _locked, uint256 _rewards1, uint256 _rewards2, bool _isSet) = LockRewards(_lock).getCurrentEpoch();
emit log_named_uint("start", _start);
emit log_named_uint("finish", _finish);
emit log_named_uint("locked", _locked);
emit log_named_uint("rewards1", _rewards1);
emit log_named_uint("rewards2", _rewards2);
if(_isSet) {
emit log_named_string("isSet", "true");
} else {
emit log_named_string("isSet", "false");
}
}

function startNextEpoch(uint warpTime) public {
vm.warp(warpTime);
console2.log("block.timestamp", block.timestamp);
Expand All @@ -188,7 +214,7 @@ contract LockTest is Test {
lockRewards16.setNextEpoch(rewardsY2k, rewardsWeth, epochDurationInDays);
vm.stopPrank();

(uint start, uint finish, uint locked, uint rewards1, uint rewards2, ) = lockRewards16.getNextEpoch();
(uint start, uint finish, uint locked, , , ) = lockRewards16.getNextEpoch();
emit log_named_uint("start", start);
emit log_named_uint("finish", finish);
emit log_named_uint("locked", locked);
Expand Down Expand Up @@ -235,8 +261,8 @@ contract LockTest is Test {
(uint256 start,
uint256 finish,
uint256 locked,
uint256 rewards1,
uint256 rewards2,
,
,
bool isSet) = lockRewards16.getCurrentEpoch();
emit log_named_uint("start", start);
emit log_named_uint("finish", finish);
Expand All @@ -252,8 +278,8 @@ contract LockTest is Test {
(uint256 start_2,
uint256 finish_2,
uint256 locked_2,
uint256 rewards1_2,
uint256 rewards2_2,
,
,
bool isSet_2) = lockRewards16.getNextEpoch();
emit log_named_uint("start_2", start_2);
emit log_named_uint("finish_2", finish_2);
Expand Down

0 comments on commit 7ba7d0b

Please sign in to comment.