From 49fb3758352d354f2d5b2b18bca016df28c99fde Mon Sep 17 00:00:00 2001 From: oxoxDev Date: Thu, 28 Nov 2024 15:17:30 +0530 Subject: [PATCH 1/2] fix: remove transfer calls from OmnichainStaking tokens --- contracts/interfaces/IOmnichainStaking.sol | 1 + contracts/locker/staking/OmnichainStakingBase.sol | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/contracts/interfaces/IOmnichainStaking.sol b/contracts/interfaces/IOmnichainStaking.sol index 285e703..4fff6f5 100644 --- a/contracts/interfaces/IOmnichainStaking.sol +++ b/contracts/interfaces/IOmnichainStaking.sol @@ -35,6 +35,7 @@ interface IOmnichainStaking is IVotes { function getTokenPower(uint256 amount) external view returns (uint256 power); error InvalidUnstaker(address, address); + error VeTokenTransferDisabled(); event LpOracleSet(address indexed oldLpOracle, address indexed newLpOracle); event ZeroAggregatorSet(address indexed oldZeroAggregator, address indexed newZeroAggregator); diff --git a/contracts/locker/staking/OmnichainStakingBase.sol b/contracts/locker/staking/OmnichainStakingBase.sol index c54c1e8..30be537 100644 --- a/contracts/locker/staking/OmnichainStakingBase.sol +++ b/contracts/locker/staking/OmnichainStakingBase.sol @@ -231,6 +231,14 @@ abstract contract OmnichainStakingBase is } } + function transfer(address to, uint256 value) public virtual override returns (bool) { + revert VeTokenTransferDisabled(); + } + + function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) { + revert VeTokenTransferDisabled(); + } + /** * @dev Updates the reward for a given account. * @param account The address of the account. From ea58a0f2ef87bf9407adb918672651db976e3f69 Mon Sep 17 00:00:00 2001 From: oxoxDev Date: Thu, 28 Nov 2024 15:17:58 +0530 Subject: [PATCH 2/2] feat: add upgrade script for OmnichainStakingToken --- scripts/upgrade-OmnichainStakingToken.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scripts/upgrade-OmnichainStakingToken.ts diff --git a/scripts/upgrade-OmnichainStakingToken.ts b/scripts/upgrade-OmnichainStakingToken.ts new file mode 100644 index 0000000..720045c --- /dev/null +++ b/scripts/upgrade-OmnichainStakingToken.ts @@ -0,0 +1,22 @@ +import hre from "hardhat"; + +async function main() { + + const omnichainStakingTokenProxy = "0xf374229a18ff691406f99CCBD93e8a3f16B68888"; + const omnichainStakingTokenFactory = await hre.ethers.getContractFactory("OmnichainStakingToken"); + const omnichainStakingToken = await hre.upgrades.upgradeProxy(omnichainStakingTokenProxy, omnichainStakingTokenFactory); + + console.log(`---- Your proxy upgrade is done ----${await omnichainStakingToken.getAddress()}`); + + if (hre.network.name != "hardhat") { + // Verify contract programmatically + await hre.run("verify:verify", { + address: hre.upgrades.erc1967.getImplementationAddress(omnichainStakingTokenProxy) + }); + } +} + +main().catch((error) => { + console.error(error); + process.exitCode = 1; +});