vlAlluo Architecture
vlAlluo is the contract that brings voting power to whole Alluo ecosystem. Every $ALLUO holder in order to cast votes in Alluo Snapshot space has to lock their tokens in vlAlluo contract.
Another benefit of locking $ALLUO is passive income - all unrealized APY is distributed between lockers, proportionally their locking amount and time. This motivates lockers to participate in Alluo DAO votes, specifically for Liquidity Direction proposals.
Depending on results of the votes that happens every 2 weeks, $ALLUO token can be also minted and distributed between lockers.
Unrealized APY is distributed in $CVX tokens. When claiming rewards, both $ALLUO and $CVX are transferred -
AlluoLockedV4
is responsible for $ALLUO distribution and CvxDistributor
is responsible for $CVX distribution.As user locks his tokens, he will be able to submit withdraw request only in 7 days. When user submits withdraw request, user will be able to receive $ALLUO only in 5 days. All rewards are distributed on every Ethereum Mainnet block and available to claim immediately.
AlluoLockedV4
is main contract that frontend interacts with. It communicates with CvxDistributor
delivering info info about lock/unlock amounts and requesting to deliver rewards, if user is requests to claim his rewards.// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IAlluoLockedV4 {
function alluoToken() external view returns (address);
function balanceOf(address _address) external view returns (uint256 amount);
function changeUpgradeStatus(bool _status) external;
function claim() external;
function cvxDistributor() external view returns (address);
function decimals() external view returns (uint8);
function depositLockDuration() external view returns (uint256);
function distributionTime() external view returns (uint256);
function exchange() external view returns (address);
function getClaim(address _locker) external view returns (uint256 reward);
function getClaimCvx(address locker) external view returns (uint256 reward);
function getInfoByAddress(address _address)
external
view
returns (
uint256 locked_,
uint256 unlockAmount_,
uint256 claim_,
uint256 claimCvx_,
uint256 depositUnlockTime_,
uint256 withdrawUnlockTime_
);
function lock(uint256 _amount) external;
function migrateWithdrawOrClaimValues(
address[] memory _users,
bool _withdraw
) external;
function migrationLock(address[] memory _users, uint256[] memory _amounts)
external;
function name() external view returns (string memory);
function oldClaim(address) external view returns (uint256);
function oldWithdraw(address) external view returns (uint256);
function pause() external;
function paused() external view returns (bool);
function rewardPerDistribution() external view returns (uint256);
function setCvxDistributor(address cvxDistributorAddress) external;
function setReward(uint256 _amount) external;
function symbol() external view returns (string memory);
function totalDistributed() external view returns (uint256);
function totalLocked() external view returns (uint256);
function totalSupply() external view returns (uint256 amount);
function unlock(uint256 _amount) external;
function unlockAll() external;
function unlockedBalanceOf(address _address)
external
view
returns (uint256 amount);
function unpause() external;
function update() external;
function updateDepositLockDuration(uint256 _depositLockDuration) external;
function updateWithdrawLockDuration(uint256 _withdrawLockDuration) external;
function upgradeStatus() external view returns (bool);
function waitingForWithdrawal() external view returns (uint256);
function withdraw() external;
function withdrawLockDuration() external view returns (uint256);
function withdrawTokens(
address withdrawToken,
address to,
uint256 amount
) external;
}
View function. Constant. Always returns address of $ALLUO token: 0x1E5193ccC53f25638Aa22a940af899B692e10B09
View function. Returns amount of vlAlluo that
_address
has. This function shows voting power of specific address.Can be only called by member of
DEFAULT_ADMIN_ROLE
. This function is setting upgrade status of the contract, that is false
by default. If set to true
, anyone with UPGRADER_ROLE
is allowed to execute upgrade of the contract. After upgrade execution, upgrade status is reset to false
.Claims all available rewards (both $CVX and $ALLUO) for
msg.sender
. All rewards are immediately transferred to msg.sender
. Reverts if no rewards are available for the user. View function. Returns
CvxDistributor
contract address that is responsible for $CVX distribution calculations and rewards View functon. Constant. Always returns 18, representing the decimals places of vlAlluo.
View functon. Returns time duration after $ALLUO locking in seconds required to wait before submitting withdraw request.
View functon. Returns time duration in seconds, represents within what amount of time specified amount of tokens is distributed among lockers. Amount of tokens can be seen in
rewardPerDistribution()
view function and can be changed by DEFAULT_ADMIN_ROLE
in setReward(uint256 _amount)
View function. Constant. Always returns address of Alluo protocol Exchange contract: 0x29c66CF57a03d41Cfe6d9ecB6883aa0E2AbA21Ec
View function. Returns amount of $ALLUO available for immediate claim for
_locker
.View function. Returns amount of $CVX available for immediate claim for
_locker
.View function. Returns set of information about locker
_address
:locked_
- amount of $ALLUO locked, represents vlAlluo balanceunlockAmount_
- amount of $ALLUO pending for withdrawal. Withrawal will be available afterwithdrawUnlockTime_
claim_
- amount of $ALLUO available for immediate claimclaimCvx_
- amount of $CVX available for immediate claimdepositUnlockTime_
- UNIX timestamp, when user will be able to request withdraw after $ALLUO depositwithdrawUnlockTime_
- UNIX timestamp, when user will be able to withdraw $ALLUO after requesting to withdraw. Amount available for withdraw is shown inunlockAmount_
.
Transfers
_amount
of $ALLUO from user and locks them in the contract. Requires approve
to be called on $ALLUO token to vlAlluo proxy address before locking.As user locks his tokens, he will be able to submit withdraw request only in 7 days. When user submits withdraw request, user will be able to receive $ALLUO only in 5 days.
Can be only called by members of
DEFAULT_ADMIN_ROLE
. Function copies information about all users in _users
array from old contract. If _withdraw
is true
, pending withdrawals information is copied, otherwise available $ALLUO rewards are copied.Can be only called by members of
DEFAULT_ADMIN_ROLE
. Function creates locking position for every user _users[i]
with amount _amounts[i]
of vlAlluo. Used only for migration to the current version of vlAlluo contract.View function. Constant. Always returns string "Vote Locked Alluo Token"
View function. Returns claim amount migrated from previous vlAlluo contract. This amount will be distributed right when users calls
claim()
, after that migrated claim amount will be reset to 0.View function. Returns available $ALLUO withdraw amount migrated from previous vlAlluo contract. This amount will be distributed right when users calls
withdraw()
, after that migrated withdraw amount will be reset to 0.Can be only called by members of
DEFAULT_ADMIN_ROLE
. Function pauses all locking, claiming, withdraw operations on the contract.View function. Returns
true
if all locking, claiming, withdraw operations on the contract are paused. false
otherwise.View function. Shows amount of $ALLUO token to be distributed among all lockers within time period in seconds returned by function
distributionTime()
.Can be only called by members of
DEFAULT_ADMIN_ROLE
. Function sets the new address of CvxDistributor
contract, responsible for $CVX rewards distribution.Can be only called by members of
DEFAULT_ADMIN_ROLE
. Function sets amount of $ALLUO tokens to be distributed among lockers within time period in seconds returned by function distributionTime()
.View function. Constant. Always returns string "vlAlluo".
View function. Shows amount of $ALLUO totally distributed by current version of the contract.
View function. Shows total amount of $ALLUO totally locked. Represents total voting power of the protocol.
View function. Returns same value as function
totalLocked()
Submits request from user to withdraw locked $ALLUO tokens. Voting power and vlAlluo balance of the user is reduced instantly upon successful unlock. Reverts if user is sending request to unlock earlier than
getInfoByAddress(msg.sender).depositUnlockTime_
, or if user attempts to unlock amount of tokens exceeding his vlAlluo balance.Submits request from user to withdraw all locked $ALLUO tokens. Voting power and vlAlluo balance of the user will be set to 0 upon successful unlock. Reverts if user is sending request to unlock earlier than
getInfoByAddress(msg.sender).depositUnlockTime_
, or if user has nothing to unlock.View function. Shows amount of $ALLUO pending for withdraw. Withdraw of tokens will be available after
getInfoByAddress(_address).withdrawUnlockTime_
Can be only called by members of
DEFAULT_ADMIN_ROLE
. Function resumes all locking, claiming, withdraw operations on the contract.This function recalculates all variables regarding $ALLUO distribution.
Can be only called by members of
DEFAULT_ADMIN_ROLE
. Updates amount of time required to pass after user locks $ALLUO before he can submit withdraw request.Can be only called by members of
DEFAULT_ADMIN_ROLE
. Updates amount of time required to pass after user unlocks $ALLUO before he can receive unlocked $ALLUO.View function. Returns
true
if contract upgrade is available for members of UPGRADER_ROLE
, false
otherwise.View functions. Returns total amount of $ALLUO pending for withdraw.
Transfers all user unlocked $ALLUO tokens to the user. Reverts if user did not unlock any tokens, or if user is sending request to withdraw earlier than
getInfoByAddress(msg.sender).withdrawUnlockTime_
View functon. Returns time duration after $ALLUO unlocking in seconds required to wait before executing withdraw.
Can be only called by members of
DEFAULT_ADMIN_ROLE
. Transfers specified token and amount from contract balance to specified address.Last modified 10mo ago