diff --git a/contracts/ExclusiveGeyser.sol b/contracts/ExclusiveGeyser.sol index fb4e086..8aab4d4 100644 --- a/contracts/ExclusiveGeyser.sol +++ b/contracts/ExclusiveGeyser.sol @@ -17,6 +17,9 @@ contract ExclusiveGeyser is Geyser { uint256 amount, bytes calldata permission ) public override { + // DISABLING STAKING + revert("Staking disabled"); + // verify that vault isn't staking the same tokens in multiple programs _enforceExclusiveStake(IUniversalVault(vault), amount); diff --git a/contracts/Geyser.sol b/contracts/Geyser.sol index 22df537..3dbad3f 100644 --- a/contracts/Geyser.sol +++ b/contracts/Geyser.sol @@ -673,6 +673,14 @@ contract Geyser is IGeyser, Powered, OwnableUpgradeable { emit GeyserFunded(amount, duration); } + /// @notice Allows owner to terminate an existing reward schedule. + /// @param index The index of the reward schedule to terminate. + function terminateRewardSchedule(uint256 index) external onlyOwner { + RewardSchedule storage reward = _geyser.rewardSchedules[index]; + require(reward.start + reward.duration > block.timestamp, "Reward schedule ended"); + reward.duration = (block.timestamp - reward.start); + } + /// @notice Add vault factory to whitelist /// @dev use this function to enable stakes to vaults coming from the specified /// factory contract @@ -737,8 +745,8 @@ contract Geyser is IGeyser, Powered, OwnableUpgradeable { } /// @notice Rescue tokens from RewardPool - /// @dev use this function to rescue tokens from RewardPool contract - /// without distributing to stakers or triggering emergency shutdown + /// @dev Use this function to rescue tokens from RewardPool contract + /// without distributing to stakers or triggering emergency shutdown. /// access control: only admin /// state machine: /// - can be called multiple times @@ -756,12 +764,6 @@ contract Geyser is IGeyser, Powered, OwnableUpgradeable { // verify recipient _validateAddress(recipient); - // check not attempting to unstake reward token - require(token != _geyser.rewardToken, "Geyser: invalid address"); - - // check not attempting to wthdraw bonus token - require(!_bonusTokenSet.contains(token), "Geyser: invalid address"); - // transfer tokens to recipient IRewardPool(_geyser.rewardPool).sendERC20(token, recipient, amount); } diff --git a/hardhat.config.ts b/hardhat.config.ts index 9d1fe47..deb6aa8 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -194,6 +194,15 @@ task('create-vault', 'deploy an instance of UniversalVault') await createInstance('UniversalVault', vaultFactory, ethers.getContractAt, signer) }) +task('deploy-geyser-template', 'deploys the current geyser template') + .addOptionalParam('instanceType', 'the type of geyser to be deployed', 'Geyser') + .setAction(async ({ instanceType }, { ethers, run, network, upgrades }) => { + await run('compile') + const signer = (await ethers.getSigners())[0] + console.log('Signer', signer.address) + await deployContract(instanceType, ethers.getContractFactory, signer) + }) + task('create-geyser', 'deploy an instance of Geyser') .addParam('stakingToken', 'the staking token') .addParam('rewardToken', 'the reward token') @@ -357,7 +366,7 @@ export default { allowUnlimitedContractSize: true, }, mainnet: { - url: `https://mainnet.infura.io/v3/${process.env.INFURA_SECRET}`, + url: `https://eth-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_SECRET}`, accounts: { mnemonic: process.env.PROD_MNEMONIC || Wallet.createRandom().mnemonic.phrase, },