Coder Social home page Coder Social logo

chainsafe / swap.kiwi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from niftyhorde/swap.kiwi

0.0 2.0 2.0 572 KB

Smart contracts repository for NFT swapping dapp -swap.kiwi

Home Page: https://swap.kiwi

License: GNU General Public License v3.0

Solidity 17.81% TypeScript 79.16% Shell 3.03%

swap.kiwi's Introduction

SWAP.KIWI

Simple. Safe. Reliable. Your NFT swapping platform.

Smart contract flow for swapping

  1. First user starts a swap by calling proposeSwap and providing the address of the second user he wants to trade with and arrays of NFT addresses and IDs he wants to trade -> NFTs transferred to SwapKiwi contract

  2. Second user can now progress the swap by calling initiateSwap with arrays of NFT addresses and IDs he wants to trade -> NFTs transferred to SwapKiwi contract OR cancel it by calling cancelSwap -> NFTs transferred back to swap initiator

  3. First user can now execute the swap by calling acceptSwap -> NFTs transferred from SwapKiwi to participants OR reject the swap entirely by calling rejectSwap -> NFTs transferred from SwapKiwi to their owners

Contribution

Requirements

Following software is required to be installed to use this repo:

This repo also uses dependencies that are associated with Hardhat but not built-in. Third -party plugins:

Usage

On first use of this repo, run yarn install to install all required dependencies. Then run yarn run build to set up the repo.

Run yarn run help to see all available commands:

  • build - Compiles the entire project and generates Typechain typings
  • lint - Runs solhint on current project
  • clean - Clears the cache and deletes all artifacts
  • compile - Compiles the entire project, building all artifacts
  • deploy:local - Run deploy script on localhost
  • console - Opens a buidler console
  • coverage - Generates a code coverage report for tests
  • flatten - Flattens and prints all contracts and their dependencies
  • help - Prints available commands
  • node - Starts a JSON-RPC server on top of Buidler EVM
  • script - Runs a user-defined script after compiling the project
  • test:localhost - Runs mocha tests
  • test:ci - Runs gas check and solidity coverage
  • test:gas - Runs gas check
  • test:coverage - Runs solidity coverage
  • typechain - Generate Typechain typings for compiled contracts

Deployment

Please check .env.sample and populate the required variables in the .env file.

  • CONTRACT_OWNER_ADDRESS
    • address of the contract owner on mainnet (for other networks contract owner is deployer)
    • on deployment, ownership is automatically transferred from deployer to this address

swap.kiwi's People

Contributors

andersonlee725 avatar lastperson avatar morrigan avatar mpetrunic avatar nmlinaric 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.