Giter Site home page Giter Site logo

multitoken-swapper's Introduction

multitoken-swapper's People

Contributors

khawlahssn avatar

Watchers

 avatar

multitoken-swapper's Issues

Feedback received on the task

Feedback received via email from the team after submitting the contract code:

  1. The contract uses a mapping to store the liquidity of each token, but it does not appear to be used in any of the functions.
  2. The swap function does not check if the contract has enough liquidity to make the swap.
  3. The unswap function does not check if the contract has enough of the output token to make the swap.
  4. The unswap function returns three values, but only two of them appear to be used in the function. The third value is not used and could be removed.
  5. The swap and unswap functions should only allow three tokens A, B, or C (here Euler, Fermat, and Gauss) tokens to be exchanged. Currently, the swap and unswap functions allow any token that implements the IERC20 interface to be exchanged. This means that any token that implements the IERC20 interface, including tokens that are not A, B or C can be exchanged using these functions.
  6. The swap and unswap functions in the contract are not working as intended. The swap function is supposed to mint tokens to the user, but it is actually using the transfer function. The unswap function is supposed to burn tokens, but it is using the transfer function
  7. The amount in the function argument should be expressed in Wei. In Ethereum, the smallest unit of a token is called a Wei, and it is equivalent to 10^-18 of the token. For example, if a token has 18 decimal places, one Wei is equal to 0.000000000000000001 of the token. It is generally best to handle the conversion from decimals to Wei off-chain, as this allows the contract to accept and return the amount in Wei directly. For example, if the user wants to transfer 1.234 tokens, it can convert off-chain to the equivalent number of Wei (12340000000000000000) and pass it to the contract's transfer function. This allows the contract to handle the transfer without having to worry about the conversion from decimals to Wei.
  8. You did not make any transactions On-chain on your smart contracts. It is important to test your contracts by making transactions to ensure that they work as intended and do not have any issues.

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.