Skip to content

Commit f018c95

Browse files
Update DevTesting with new testRewardCycles function and adjust testDistro block number
- Added testRewardCycles function to log reward cycles and balances for specified markets. - Updated testDistro function to use a new block number for testing on the BASE_MAINNET.
1 parent 26c4370 commit f018c95

2 files changed

Lines changed: 274 additions & 1 deletion

File tree

packages/contracts/contracts/test/DevTesting.t.sol

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ contract DevTesting is BaseTest {
535535
}
536536
}
537537

538-
function testDistro() public debuggingOnly forkAtBlock(BASE_MAINNET, 32000000) {
538+
function testDistro() public debuggingOnly forkAtBlock(BASE_MAINNET, 32349499) {
539539
Voter voter = Voter(0x669A6F5421dA53696fa06f1043CF127d380f6EB9);
540540

541541
vm.prank(0x584942689042EF8703d3172e0BdcF34964dB1F4c);
@@ -580,6 +580,33 @@ contract DevTesting is BaseTest {
580580
}
581581
}
582582

583+
function testRewardCycles() public debuggingOnly fork(BASE_MAINNET) {
584+
ERC20 token = ERC20(0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5);
585+
586+
// uint256 currentTimestamp = block.timestamp;
587+
// console.log("Current Timestamp: %s", currentTimestamp);
588+
589+
// vm.prank(0xabE9ae9cDB87771C2a3fC43311e46309FC684Fd6);
590+
// IonicFlywheelLensRouter(0xB1402333b12fc066C3D7F55d37944D5e281a3e8B).claimRewardsOfRewardToken(
591+
// 0xabE9ae9cDB87771C2a3fC43311e46309FC684Fd6,
592+
// 0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5
593+
// );
594+
595+
ICErc20[] memory markets = ComptrollerFirstExtension(0x05c9C6417F246600f8f5f49fcA9Ee991bfF73D13).getAllMarkets();
596+
for (uint256 i = 0; i < markets.length; i++) {
597+
(uint32 cycleStart, uint32 cycleEnd, uint192 cycleReward) = IonicFlywheelDynamicRewards(
598+
0xf871E19bf6B7E905B3994E1dF68521BafF636440
599+
).rewardsCycle(ERC20(address(markets[i])));
600+
console.log("Market: %s", address(markets[i]));
601+
console.log("Cycle Start: %s", cycleStart);
602+
console.log("Cycle End: %s", cycleEnd);
603+
console.log("Cycle Reward: %s", cycleReward);
604+
console.log("--------------------------------------");
605+
}
606+
uint256 balance = token.balanceOf(0xD4c9420a9e67E78CbFa1CD75E63f1048cB77BC18);
607+
console.log("Balance: %s", balance);
608+
}
609+
583610
function testVoteUser() public debuggingOnly fork(BASE_MAINNET) {
584611
address[] memory markets = new address[](1);
585612
IVoter.MarketSide[] memory marketSides = new IVoter.MarketSide[](1);

0 commit comments

Comments
 (0)