Skip to content

Commit

Permalink
Merge pull request #53 from oxoxDev/fix/omnichain-remove-transfer
Browse files Browse the repository at this point in the history
Fix/omnichain remove transfer calls
  • Loading branch information
deadshotryker authored Dec 13, 2024
2 parents 9af0d10 + ea58a0f commit 42e7480
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions contracts/interfaces/IOmnichainStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions contracts/locker/staking/OmnichainStakingBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 22 additions & 0 deletions scripts/upgrade-OmnichainStakingToken.ts
Original file line number Diff line number Diff line change
@@ -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;
});

0 comments on commit 42e7480

Please sign in to comment.