Git Product home page Git Product logo

yvault's Introduction

yVault

环境... solc 0.5.15

brew install solidity@5

python 3

pip install web3

ganache-cli

目前生产合约都在 contracts/standard下面

机器池介绍

机枪池由3部分组成

Controller、vault、Strategy

Controller的作用是设置某个代币对应的vault以及Strategy

vault的作用是 用户充值,提现,领取奖励

Strategy的作用是 把用户充值的币接入各种收益率高的地方挖矿(Strategy是可以切换的)

生产用的合约在 合约配置

abi文件参考 vault abi文件参考 Strategy

abi

操作

function deposit(uint amount) 用户入金 需要先对vault合约进行代币授权

function withdraw(uint amount) 用户提现

function balanceOf(address user) public view returns (uint256) 查看用户有的iToken数量

function getPricePerFullShare() public view returns (uint) 查看每个iToken换回原来token的比例

这边返回的值需要 除以1e18

可以换回原来代币的数量为: 用户持有的iToken数量*getPricePerFullShare/1e18

yvault's People

Contributors

howardpen9 avatar jin10086 avatar lychees avatar ryankung avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.