Blueshift Docs
  • Introduction
    • What is Blueshift?
    • Blueshift token (BLUES)
    • Blueshiftโ€™s audit
    • Fees
  • Getting started
    • How do I connect wallet?
      • Configuring MetaMask
    • How to transfer ADA from Cardano to Milkomeda network?
    • How to transfer Cardano Native Tokens (CNTs) to Milkomeda network?
    • How to transfer ALGO from Algorand to Milkomeda A1 network?
    • How do I trade on Blueshift?
      • ๐ŸŽ“ Swap tutorial
    • How do I provide liquidity (get LP tokens)?
      • ๐ŸŽ“ Add liquidity tutorial
    • How do I withdraw liquidity?
      • ๐ŸŽ“ Withdraw tutorial
    • How do I use farms ?
  • Product concept
    • ๐Ÿ”ฅ Swap Cross-Chain/Local
    • Portfolios
      • Single token invest
    • Farming
    • Yield pools
      • Auto HODL BLUES Pool
    • Smart minting system
    • Referral program ๐Ÿ”ฅ
    • Cardano Wrapped Smart Contracts
  • TECHNICAL REFERENCE
    • Smart contracts overview
    • Blueshift contracts addresses
    • Interface specifications
      • IBlueshiftRouter
      • IBlueshiftArbitrageRouter
      • IOracle
      • IPortfolio
      • IMinterV3
      • IEarningV2
      • IStakingV2
      • IAutoStakingV3
  • Community
    • Telegram (Off. group)
    • Telegram (Chat)
    • Twitter
Powered by GitBook
On this page
  • Events
  • Deposit
  • Withdraw
  • Reward
  • Functions
  • updateState
  • getLastAccumulatedReward
  • getAccDeposit
  • deposited
  • pendingReward
  • getRewardAccounts
  • deposit
  • withdraw
  • getReward
  • getToken

Was this helpful?

  1. TECHNICAL REFERENCE
  2. Interface specifications

IEarningV2

Events

Deposit

Withdraw

Reward

Functions

updateState

getLastAccumulatedReward

getAccDeposit

deposited

pendingReward

getRewardAccounts

deposit

withdraw

getReward

getToken

Events

Deposit

event Deposit(address indexed user, uint256 amount)

Emits after the user deposits some amount of token.

Withdraw

event Withdraw(address indexed user, uint256 amount)

Emits after the user withdraws some amount of token.

Reward

event Reward(address indexed user, uint256 amount)

Emits after the user claims some amount of BLUES.

Functions

updateState

function updateState() external

Updates earning`s state according to current block`s number.

getLastAccumulatedReward

function getLastAccumulatedReward() external view returns (uint256)

Returns earning`s BLUES reward at block when IEarningV2.updateState() was called.

getAccDeposit

function getAccDeposit() external view returns (uint256)

Returns a summarized amount of tokens that all the users have deposited to earning.

deposited

function deposited(address _user) external view returns (uint256)

Returns an amount of tokens that the _user has deposited to earning.

pendingReward

function pendingReward(address _user, uint256 _timestamp) external view returns (uint256 earned, uint256 totalReward)

Returns the amount of BLUES that the user has earned since the last deposit/withdrawal/claim operation.

Parameters

Name

Type

Description

_user

address

Address of user

_timestamp

uint256

Timestamp to get info for

Return values

Name

Type

Description

earned

uint256

Amount of BLUES that _user can claim

totalReward

uint256

Summarized amounts of BLUES that _user can claim and locked reward

getRewardAccounts

function getRewardAccounts(address _user) external view returns (uint256[] memory rewardAccounts)

Returns _user`s reward accounts.

deposit

function deposit(uint256 _amount) external

Performs some _amount of earning`s token deposit from msg.sender.

withdraw

function withdraw(uint256 _amount) external

Performs some _amount of earning`s token withdrawal to msg.sender.

getReward

function getReward() external

Claims msg.sender`s pending reward and sends BLUES to his address.

getToken

function getToken() external view returns (address)

Returns earnings`s token.

PreviousIMinterV3NextIStakingV2

Last updated 2 years ago

Was this helpful?