Skip to content

Commit

Permalink
fix: VestUiHelper lock power logic fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
oxoxDev committed Nov 21, 2024
1 parent c7b7887 commit 99ca94f
Show file tree
Hide file tree
Showing 3 changed files with 426 additions and 5 deletions.
7 changes: 3 additions & 4 deletions contracts/ui-helpers/VestUiHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ import {VestedZeroNFT} from "../vesting/VestedZeroNFT.sol";
import {OmnichainStakingToken} from "../locker/staking/OmnichainStakingToken.sol";
import {OmnichainStakingLP} from "../locker/staking/OmnichainStakingLP.sol";
import {ILocker} from "../interfaces/ILocker.sol";
import { ILPOracle } from "contracts/interfaces/ILPOracle.sol";
import {ILPOracle} from "contracts/interfaces/ILPOracle.sol";

interface IOracle {
function latestAnswer() external view returns (int256);
}
/// @title VestedZeroNFT is a NFT based contract to hold all the user vests

contract VestUiHelper {
VestedZeroNFT public vestedZero;
OmnichainStakingToken public omnichainStaking;
Expand Down Expand Up @@ -113,8 +114,6 @@ contract VestUiHelper {
LockedBalanceWithApr memory lock;
ILocker.LockedBalance memory lockedBalance = lockedBalances[i];

uint256 vePower = omnichainStaking.getTokenPower(lockedBalance.amount);

uint256 scale = (lockedBalance.power != 0 && lockedBalance.amount != 0)
? (lockedBalance.power * 1e18) / lockedBalance.amount
: 1e18;
Expand All @@ -127,7 +126,7 @@ contract VestUiHelper {
lock.amount = lockedBalance.amount;
lock.start = lockedBalance.start;
lock.end = lockedBalance.end;
lock.power = vePower;
lock.power = lockedBalance.power;
lock.apr = aprScaled;

lockDetails[i] = lock;
Expand Down
2 changes: 1 addition & 1 deletion deploy/deploy-VestUiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const deployAirdropRewarder = async function (hre: HardhatRuntimeEnvironment) {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();

const vestui = await deploy("VestUiHelperV4", {
const vestui = await deploy("VestUiHelperZerolend", {
from: deployer,
contract: "VestUiHelper",
args: [VESTED_NFT_ADDRESS, OMNICHAIN_STAKING_TOKEN, OMNICHAIN_STAKING_LP, LP_ORACLE, ZERO_ORACLE],
Expand Down
422 changes: 422 additions & 0 deletions deployments/linea/VestUiHelperZerolend.json

Large diffs are not rendered by default.

0 comments on commit 99ca94f

Please sign in to comment.