Skip to main content

Dione

The Dione contract plays the same role as the Enceladus contract does, with the main exception being that they are deployed across L2's, whereas Enceladus is deployed on the Ethereum mainnet.

The full contract can be found here.

Functions

poolLength

function poolLength() public view returns (uint256 pools)

View function that returns the number of Dione pools.

add

function add(uint256 allocPoint, IERC20 _lpToken, IRewarder _rewarder) public onlyOwner

Adds a new LP to the pool. Can only be called by the owner of the contract.

Note: Do NOT add the same LP token more than once. Rewards will be messed up if you do!

Parameters

NameTypeDescription
_allocPointuint256number of allocation points assigned to pool
_lpTokenIERC20address of ERC20 token that will be staked
_rewarderIRewarderimplementation of rewarder contract

set

function set(uint256 _pid, uint256 _allocPoint, IRewarder _rewarder, bool overwrite) public onlyOwner

Updates the given pool's NVLS allocation point and IRewarder contract. Can only be called by the owner of the contract.

Parameters

NameTypeDescription
_piduint256pool ID of pool to update
_allocPointuint256number of allocation points assigned to pool
_rewarderIRewarderimplementation of rewarder contract
overwritebooltrue if _rewarder should be set, otherwise false

setNvlsPerSecond

function setNvlsPerSecond(uint256 _nvlsPerSecond) public onlyOwner

Sets the NVLS per second to be distributed. Can only be called by the owner of the contract.

Parameters

NameTypeDescription
_nvlsPerSeconduint256amount of NVLS to distribute per second

setMigrator

function setMigrator(ILiquidityMigrator _migrator) public onlyOwner

Sets the migrator contract. Can only be called by the owner of the contract.

Parameters

NameTypeDescription
_migratorILiquidityMigratorcontract address of migrator to set

migrate

function migrate(uint256 _pid) public

Migrates an LP token to another LP contract through the migrator contract.

Parameters

NameTypeDescription
_piduint256pool ID to migrate an LP to

pendingNvls

function pendingNvls(uint256 _pid, address _user) external view returns (uint256 pending)

View function to see pending NVLS on the frontend and returns the pending NVLS rewards for a given user.

Parameters

NameTypeDescription
_piduint256pool ID of pool to check
_useraddressaddress of user to check pending rewards for

Returns

NameTypeDescription
pendinguint256amount of pending NVLS rewards the given user has

massUpdatePools

function massUpdatePools(uint256[] calldata pids) external

Updates the reward variables for all of the pools. Be careful of gas spending!

Parameters

NameTypeDescription
pidsuint256[]pool IDs of pools to update

updatePool

function updatePool(uint256 pid) public returns (PoolInfo memory pool)

Updates rewards variables for the given pool and returns the pool that was updated.

Parameters

NameTypeDescription
piduint256pool ID of pool to update

Returns

NameTypeDescription
poolPoolInfopool that was updated

deposit

function deposit(uint256 pid, uint256 amount, address to) public

Deposits LP tokens to the Dione for NVLS allocation. !!!

Parameters

NameTypeDescription
piduint256pool ID of pool to deposit LP tokens from
amountuint256amount of LP tokens to deposit
toaddressaddress of the receiver of the LP tokens

withdraw

function withdraw(uint256 pid, uint256 amount, address to) public

Withdraws LP tokens from the Dione. !!!

Parameters

NameTypeDescription
piduint256pool ID of pool to withdraw LP tokens from
amountuint256amount of LP tokens to withdraw
toaddressaddress of the receiver of the LP tokens

harvest

function harvest(uint256 pid, address to) public

Harvests NVLS rewards for transaction sender to to.

Parameters

NameTypeDescription
piduint256pool ID of pool to harvest from
toaddressaddress of the receiver of the harvested NVLS rewards

withdrawAndHarvest

function withdrawAndHarvest(uint256 pid, uint256 amount, address to) public

Withdraws LP tokens from the Dione and harvests NVLS rewards for transaction sender to to.

Parameters

NameTypeDescription
piduint256pool ID of pool to withdraw LP tokens from
amountuint256amount of LP tokens to withdraw
toaddressaddress of the receiver of the LP tokens and NVLS rewards

emergencyWithdraw

function emergencyWithdraw(uint256 pid, address to) public

Withdraws LP tokens without caring about rewards. To be used in emergencies only.

Parameters

NameTypeDescription
piduint256pool ID of pool to withdraw LP tokens from
toaddressaddress of the receiver of the LP tokens