Skip to content

Commit

Permalink
reward
Browse files Browse the repository at this point in the history
  • Loading branch information
vm06007 committed Dec 15, 2023
1 parent d435535 commit 45f2b7d
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions contracts/ManagerSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,22 @@ interface ITimeLockFarmV2Dual {
external
view
returns (address);

function rewardTokenB()
external
view
returns (address);

function setRewardRates(
uint256 newRateA,
uint256 newRateB
)
external;
}

contract ManagerSetup {

IERC20 public immutable USDC;
IERC20 public immutable VERSE;

struct Allocation {
Expand Down Expand Up @@ -63,11 +75,20 @@ contract ManagerSetup {
TIME_LOCK_FARM.stakeToken()
);

USDC = IERC20(
TIME_LOCK_FARM.rewardTokenB()
);

VERSE.approve(
address(TIME_LOCK_FARM),
type(uint256).max
);

USDC.approve(
address(TIME_LOCK_FARM),
type(uint256).max
);

uint256 fourYears = 365 days * 4;

allocations.push(
Expand Down Expand Up @@ -127,6 +148,19 @@ contract ManagerSetup {
);
}

function setRewardRates(
uint256 _newRateA,
uint256 _newRateB
)
external
onlyWorker
{
TIME_LOCK_FARM.setRewardRates(
_newRateA,
_newRateB
);
}

/**
* @dev Allows to recover ANY tokens
* from the private farm contract.
Expand All @@ -145,20 +179,6 @@ contract ManagerSetup {
);
}

function tokenApprove(
IERC20 _token,
address _spender,
uint256 _amount
)
external
onlyOwner
{
_token.approve(
_spender,
_amount
);
}

function executeAllocations()
external
onlyOwner
Expand Down

0 comments on commit 45f2b7d

Please sign in to comment.