Code Monkey home page Code Monkey logo

exchange-of-tokens-in-etherium's Introduction

Домашнее задание №4 К занятию “Solidity + EVM, low-level patterns”

В рамках тестирования деплоятся GoldCoin и SilverCoin, создается Uniswap пара для них, посредством использования Uniswap Factory из форка Mainnet. Затем производится обмен токенов с использованием этой пары.

Перед запуском тестов запустите форк Mainnet'а используя ключ с Alchemy.

$ npx hardhat node --fork https://eth-mainnet.g.alchemy.com/v2/<API KEY>

Пример запуска тестов:

$ npx hardhat test --network localhost


  Echange coins with Uniswap
    Deployment
      - Deploy GoldCoin
      - Deploy SilverCoin
      ✔ Should set the right owner (934ms)
      ✔ Should assign the total supply of tokens to the owner (44ms)
    Swap gold and silver coins
      - Creating uniswap factory contract: adress = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f
      - Creating uniswap pair...
      - Pair created: address = 0xc0dE107eC52bc729d9F8D540b1abB1B889661094
      - Creating liquidity...
      - Liquidity created: reserves of pair equals 10000 and 100000000
      - Transferring 1000 token0 to pair...
      - Getting 1000 token1 from pair...
      - Checking balances...
      ✔ Just true (1697ms)


  3 passing (3s)

exchange-of-tokens-in-etherium's People

Contributors

ipodtsepko avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.