massun-onibakuchi / alphahomora-pooltogether Goto Github PK
View Code? Open in Web Editor NEWAlpha Homora and poolTogether integration
Alpha Homora and poolTogether integration
レビューをお願いします.
説明が長くなってしまうのですが何をしたいのかを説明します
ユーザーがpooltogetherにトークンを預けると,compoundに貸し出されるということを以前話しましたが,compoundの代わりに別のDeFiコントラクトを用いるということを行います.そこで,AlphaHomoraV1ETHLenderYieldSourceコントラクトはpoolTogetherで要求されるインターフェースを実装しています.(READMEとdoc/overview.mdに概要をつけました.)
Compoundの代わりとなる外部の DeFiコントラクトbank
でETHを貸し出すと,利子をもらえます.
bank#deposit
を呼び出すことでETHを預けると,代わりにibETHというERC20トークンがbank
コントラクト側で付与されます.
AlphaHomoraV1ETHLenderYieldSourceコントラクトは
bank
に預けてibETH
を受け取る.bank
にユーザーのibETHを返してETHを引き出す.supplyTokenTo
この関数で行いたいことは前者の方で,
supplyTokenTo
が呼ばれて,msg.sender
からamount
だけWrapped ETHを受け取るwithdraw
で引き出す.bank.deposit
で預けて,代わりにibETH
を受け取る.ibETH
を預ける前との差分で計算するibETH
をto
に加算する.redeemToken
この関数で行いたいことは後者の方で,
msg.sender
からredeemAmount
で与えられたWrapped ETHから計算でibETHの量に換算する.withdraw
でETHを引き出す.ibETH
を減算する.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.