Code Monkey home page Code Monkey logo

erc7399-wrappers's Issues

callBackResult = ""

_callbackResult = ""; // TODO: Confirm that this deletes the storage variable
return result;

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.

sequence diagram

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)

Loading

Outdated `env.example` file?

It seem that the env.example file is a bit outdated since when running forge test I encountered the following:

image

Resolved only by setting this specific environment variable in my .env file. Am I missing something?

Unused argument incorrectly passed in Dolomite wrapper

This does not appear to present any security risk currently.

actions[0].otherAddress = abi.decode(data, (Data)).loanReceiver;

actions[2].otherAddress = address(this);

For the Withdraw and Deposit actions created in the Dolomite wrapper, the otherAddress member of the ActionArgs struct is set and passed as an argument to Dolomite.operate().

However, according to the documentation, this field is not used for Withdraw and Deposit and therefore may be removed.

Also note, in this same contract this otherAddress field is correctly being used for Call along with the data field.

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.