Ricochet Super SLP tokens (SLPx) – 跳弹超级SLP代币(SLPx)区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Ricochet Super SLP tokens (SLPx) – 跳弹超级SLP代币(SLPx)区块链毕设代写 是一篇很好的国外资料

Ricochet Super SLP tokens (SLPx)

This project creates streamable SushiSwap LP tokens. These tokens can be used in Ricochet Exchange’s DCA system and they support earning SUSHI and MATIC subsidies.

Contract Architecture

Ricochet Super SLP tokens (SLPx) - 跳弹超级SLP代币(SLPx)

Overview

  • SLPx tokens are wrapped SushiSwap LP tokens
  • Upgrade: SLP tokens are deposited into the MiniChef contract to earn SUSHI and MATIC
  • Harvest: SLPx tokens have a harvest function that harvests the SUSHI/MATIC subsidies from MiniChef and wraps them as SUSHIx/MATICx
  • Downgrade: SLPx tokens are burned, SLP tokens are returned to the user, and any accumulated SUSHIx/MATICx is distributed using Superfluid’s InstantDistributionAgreement

Inheritance

  • SLPx inherits from Superfluid’s SuperToken
  • SLPx overrides the functionality of upgrade and downgrade methods on SuperToken

Data Structures

  • address lpTokenAddress – The address of the LP token to use
  • address maticxAddress – The address of the MATICx contract
  • address sushixAddress – The address of the SUSHIx contract
  • address miniChefAddress – The address of the MiniChef contract
  • uint256 pid – The pool ID to use for MiniChef deposit and harvest function calls

Methods

Overrides

upgrade(uint256 amount)

  • Parameters
    • amount – the amount of SLP tokens to upgrade
  • Pre-conditions
    • msg.sender has approved SLPx contract to spend their SLP
    • SLPx contract has approved MiniChef to transfer SLP tokens
  • Post-conditions
    • SLP tokens are transferred to SLPx contract
    • Transferred SLP tokens are deposited into MiniChef
    • SLPx tokens are minted to msg.sender
  • ℹ️ Also need to override upgradeTo method

downgrade(uint256 amount)

  • Parameters
    • amount – the amount of SLP tokens to downgrade
  • Pre-conditions
    • SLPx contract has approved MiniChef to transfer SLP tokens
  • Post-conditions
    • Call harvest method (not shown in arch. diagram)
    • SLPx tokens are burned
    • SLP tokens are transfered to msg.sender
    • SUSHIx is distributed using an IDA to the SLPx holders
    • MATICx is distributed using an IDA to the SLPx holders

harvest()

  • Parameters
    • None
  • Pre-conditions
    • None
  • Post-conditions
    • Calls harvest on Minichef
    • Upgrade MATIC and SUSHI received from MiniChef

end


反弹超级SLP令牌(SLPx)

此项目创建可流化的交换LP令牌。这些代币可以在跳弹交易所的DCA系统中使用,它们支持赚取寿司和补贴

合同架构

<Ricochet Super SLP tokens (SLPx)><Ricochet Super SLP tokens (SLPx)>

升级(uint256金额)

降级(uint256金额)

收获()

结束

反弹超级SLP令牌(SLPx)

合同架构

概述

继承

数据结构

方法

覆盖

  • SLPx代币包装为交换LP代币
  • 升级:SLP代币存放在MiniChef合同中以获得寿司和MATIC
  • 收获:SLPx代币具有收获功能,从MiniChef收获寿司/MATIC补贴,并将其包装为SUSHIx/MATICx降级:SLPx代币被烧掉,SLP代币返回给用户,并且任何累积的SUSHIx/MATICx都是使用Superfluid的InstantDistributionAgreement进行分发的
  • SLPx继承自Superfluid的SuperToken
  • SLPx覆盖SuperToken上升级和降级方法的功能
  • 地址lpTokenAddress-要使用的LP令牌的地址maticxAddress-MATICx合同的地址-sushixAddress-SUSHIx合同的地址-miniChefAddress-miniChefAddress-miniChefAddress-miniChefAddress-miniChefAddress合同的地址-uint256 pid-用于MiniChef存款和收获函数调用的池ID
  • 参数金额-SLP代币的金额升级
  • 金额-升级SLP代币的金额
  • 先决条件msg.sender已批准SLPx合同以使用其SLP SLPx合同已批准MiniChef转让SLP代币
  • msg.sender已批准SLPx合同以使用其SLP
  • SLPx合同已批准MiniChef转让SLP代币

  • 后条件SLP代币转让给SLPx合同转让的SLP代币存入MiniChef SLPx代币铸造给msg。发送方
  • SLP代币转让给SLPx合同
  • 转让的SLP代币存入MiniChef
  • SLPx代币铸造给msg。发送方
  • ℹ️ 还需要覆盖upgradeTo方法
  • 参数金额-要降级的SLP代币金额-要降级的SLP代币金额前提条件SLPx合同已批准MiniChef转让SLP代币
  • SLPx合同已批准MiniChef转让SLP代币
  • Post条件调用收获方法(未在arch.diagram中显示)SLPx令牌被烧掉。SLP令牌被传输到msg。sender SUSHIx使用IDA分配给SLPx持有者。MATICx使用IDA分配给SLPx持有者。
  • 调用收获方法(未在arch.diagram中显示)
  • SLPx代币被烧掉
  • SLP代币被传送到msg。发送方
  • 使用IDA将SUSHIx分发给SLPx持有者
  • MATICx使用IDA分发给SLPx持有者
  • 参数无

    先决条件无

  • 后决条件调用Minichef上的harvest升级从Minichef收到的MATIC和SUSHI

  • 调用Minichef上的harvest
  • 升级从Minichef收到的MATIC和SUSHI
  • 概述

    • SLPx代币包装为交换LP代币
    • 升级:SLP代币存放在MiniChef合同中以获得寿司和MATIC
    • 收获:SLPx代币具有收获功能,从MiniChef收获寿司/MATIC补贴,并将其包装为SUSHIx/MATICx降级:SLPx代币被烧掉,SLP代币返回给用户,并且任何累积的SUSHIx/MATICx都是使用Superfluid的InstantDistributionAgreement进行分发的
    • SLPx继承自Superfluid的SuperToken

    继承

    • SLPx覆盖SuperToken上升级和降级方法的功能
    • 地址lpTokenAddress-要使用的LP令牌的地址maticxAddress-MATICx合同的地址-sushixAddress-SUSHIx合同的地址-miniChefAddress-miniChefAddress-miniChefAddress-miniChefAddress-miniChefAddress合同的地址-uint256 pid-用于MiniChef存款和收获函数调用的池ID

    数据结构

    • 参数金额-SLP代币的金额升级
    • 金额-升级SLP代币的金额
    • 先决条件msg.sender已批准SLPx合同以使用其SLP SLPx合同已批准MiniChef转让SLP代币
    • msg.sender已批准SLPx合同以使用其SLP
    • 后条件SLP代币转让给SLPx合同转让的SLP代币存入MiniChef SLPx代币铸造给msg。发送方

    方法

    覆盖

    升级(uint256金额)

    • SLP代币转让给SLPx合同
    • SLPx代币铸造给msg。发送方
    • SLPx合同已批准MiniChef转让SLP代币
    • SLP代币被传送到msg。发送方

    降级(uint256金额)

    • 使用IDA将SUSHIx分发给SLPx持有者
    • 升级从Minichef收到的MATIC和SUSHI

    收获()

    • Parameters
      • None
    • Pre-conditions
      • None
    • Post-conditions
      • Calls harvest on Minichef
      • Upgrade MATIC and SUSHI received from MiniChef

    end

    部分转自网络,侵权联系删除区块链源码网

    www.interchains.cc

    https://www.interchains.cc/25126.html

    区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
    区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » Ricochet Super SLP tokens (SLPx) – 跳弹超级SLP代币(SLPx)区块链毕设代写

    提供最优质的资源集合

    立即查看 了解详情