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. 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; +});