From 751cafd79524061248078534c323d48ff7c84d47 Mon Sep 17 00:00:00 2001 From: aalavandhan1984 <6264334+aalavandhan@users.noreply.github.com> Date: Thu, 13 Mar 2025 13:55:17 -0400 Subject: [PATCH 1/4] allows owner to rescue reward tokens --- contracts/Geyser.sol | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/contracts/Geyser.sol b/contracts/Geyser.sol index 22df537b..a45d5241 100644 --- a/contracts/Geyser.sol +++ b/contracts/Geyser.sol @@ -737,8 +737,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 +756,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); } From b6994f92adf69d5d1b3c472bd218d6eba4d8fde6 Mon Sep 17 00:00:00 2001 From: aalavandhan1984 <6264334+aalavandhan@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:46:43 -0400 Subject: [PATCH 2/4] geyser upgrade script --- hardhat.config.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 9d1fe47d..deb6aa8f 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, }, From c671849b5ad8cc1adde9782d7d46e34d11affb67 Mon Sep 17 00:00:00 2001 From: aalavandhan1984 <6264334+aalavandhan@users.noreply.github.com> Date: Mon, 14 Apr 2025 20:39:29 -0400 Subject: [PATCH 3/4] early termination --- contracts/ExclusiveGeyser.sol | 3 +++ contracts/Geyser.sol | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/contracts/ExclusiveGeyser.sol b/contracts/ExclusiveGeyser.sol index fb4e086c..29b6c584 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 + require(false, "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 a45d5241..3dbad3fc 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 From b379d6fd4d5ddfe20abff38bc786acb489a53b11 Mon Sep 17 00:00:00 2001 From: Aalavandhan <6264334+aalavandhan@users.noreply.github.com> Date: Tue, 15 Apr 2025 13:34:20 -0400 Subject: [PATCH 4/4] Update contracts/ExclusiveGeyser.sol Co-authored-by: Brandon Iles --- contracts/ExclusiveGeyser.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/ExclusiveGeyser.sol b/contracts/ExclusiveGeyser.sol index 29b6c584..8aab4d4a 100644 --- a/contracts/ExclusiveGeyser.sol +++ b/contracts/ExclusiveGeyser.sol @@ -18,7 +18,7 @@ contract ExclusiveGeyser is Geyser { bytes calldata permission ) public override { // DISABLING STAKING - require(false, "Staking disabled"); + revert("Staking disabled"); // verify that vault isn't staking the same tokens in multiple programs _enforceExclusiveStake(IUniversalVault(vault), amount);