alcueca / erc7399-wrappers Goto Github PK
View Code? Open in Web Editor NEWWrappers for existing Flash Lenders to be accessible as ERC7399 Flash Lenders
License: MIT License
Wrappers for existing Flash Lenders to be accessible as ERC7399 Flash Lenders
License: MIT License
HEre's a diagram i made while researching the basic lending workflow
sequenceDiagram
Borrower->>Wrapper: flash(to,token,amt,data,callBack)
Wrapper->>Lender: flashLoan(this,asset,amount,data)
Lender-->>Wrapper: transfer loan amount
Lender->>Wrapper: lender specific callback()
Wrapper -->>Wrapper: bridgeToCallback()
Wrapper-->>Borrower: transfer loan amount
Wrapper->>Borrower: callback()
Borrower -> Borrower: Borrower does stuff
Borrower -->> Wrapper: transfer loan amount + fee
Borrower ->> Wrapper: callback return
Wrapper --> Wrapper: approves token repayment to lender
Wrapper -->> Lender: lender calls transferFrom(wrapper, amount + fee)
erc7399-wrappers/src/erc3156/ERC3156Wrapper.sol
Lines 91 to 92 in acfe8b4
Confirm that this deletes the storage variable
It does. You could also do delete _callbackResult
which is more readable and should save 150 runtime gas. Additionally, if you wanted to save more gas you could have a non-zero value represent empty similar to how 1 and 2 are used in the re-entrancy guard instead of 1 and 0.
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.