Skip to content

Commit

Permalink
feat: add rewards controller
Browse files Browse the repository at this point in the history
  • Loading branch information
royvardhan committed Apr 18, 2024
1 parent 39c0e3d commit e1130c3
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
6 changes: 6 additions & 0 deletions src/interfaces/IRewardsController.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

interface IRewardsController {
function tierOf(uint256 tokenId) external view returns (uint256);
}
2 changes: 0 additions & 2 deletions src/interfaces/IStratosphere.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ pragma solidity 0.8.18;

interface IStratosphere {
function tokenIdOf(address account) external view returns (uint256);

function tierOf(uint256 tokenId) external view returns (uint8);
}
4 changes: 4 additions & 0 deletions src/libraries/AppStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,8 @@ struct AppStorage {
//////////////////
address gelatoExecutor;
mapping(uint256 => bool) isSeasonClaimed;
//////////////////////////
/// REWARDS CONTROLLER ///
//////////////////////////
address rewardsControllerAddress;
}
4 changes: 3 additions & 1 deletion src/libraries/LStratosphere.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity 0.8.18;

import { AppStorage } from "./AppStorage.sol";
import { IStratosphere } from "../interfaces/IStratosphere.sol";
import { IRewardsController } from "../interfaces/IRewardsController.sol";

/// @title LStratosphere
/// @notice Library in charge of Stratosphere related logic
Expand All @@ -24,7 +25,8 @@ library LStratosphere {
uint256 _tokenId = _stratosphere.tokenIdOf(_address);
if (_tokenId > 0) {
isStratosphereMember = true;
tier = 0;
IRewardsController _rewardsController = IRewardsController(s.rewardsControllerAddress);
tier = _rewardsController.tierOf(_tokenId);
}
}
}
10 changes: 5 additions & 5 deletions src/upgradeInitializers/DiamondInit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ contract DiamondInit {
s.unlockFee = _args.unlockFee;

s.unlockTimestampDiscountForStratosphereMembers[0] = 500; // 5%
s.unlockTimestampDiscountForStratosphereMembers[1] = 550; // 5.5%
s.unlockTimestampDiscountForStratosphereMembers[2] = 650; // 6.5%
s.unlockTimestampDiscountForStratosphereMembers[3] = 800; // 8%
s.unlockTimestampDiscountForStratosphereMembers[4] = 1000; // 10%
s.unlockTimestampDiscountForStratosphereMembers[5] = 1500; // 15%
s.unlockTimestampDiscountForStratosphereMembers[1] = 650; // 6.5%
s.unlockTimestampDiscountForStratosphereMembers[2] = 900; // 9%
s.unlockTimestampDiscountForStratosphereMembers[3] = 1300; // 13%
s.unlockTimestampDiscountForStratosphereMembers[4] = 2000; // 20%
s.unlockTimestampDiscountForStratosphereMembers[5] = 3250; // 32.5%
s.unlockFeeReceivers.push(_args.replenishmentPool);
s.unlockFeeReceivers.push(_args.labsMultisig);
s.unlockFeeReceivers.push(_args.burnWallet);
Expand Down

0 comments on commit e1130c3

Please sign in to comment.