Contract Integration
Interfaces
Staking Examples
Setup
import { IComponentSelector } from "path/to/staking/IComponentSelector.sol";
import { IStakePool } from "path/to/staking/IStakePool.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// ...
address private constant VERIO_IP_COMPONENT_SELECTOR = address(0); // fill me in
// ...
IComponentSelector componentSelector = IComponentSelector(VERIO_IP_COMPONENT_SELECTOR);Calculating vIP : IP Ratio
function _calculateVIPMintForStakeAmount(uint256 _ip) internal returns (uint256) {
// calculate the amount of vIP to mint given an amount of IP
return componentSelector.stakePool().calculateVIPMint(_ip);
}Check vIP balance
Staking
Last updated