GithubHelp home page GithubHelp logo

cairo-dutch's Introduction

cairo-dutch

Dutch Auctions implementation on StarkNet.

Overview

Dutch auctions are a way to conduct discrete sales of multiple homogeneous units of a good. Here is an implementation of Dutch Auctions that allows for a large sale of a token on StarkNet. Specifically, we enable the following behavior:

  • A public read price() function that allows anyone to see the current price
  • A public write bid(num_tokens) function that allows buyers to place an order for num_tokens of the base asset at the current price. It checks that the buyer has an adequate amount of the quote asset (e.g. USDC) to place the order, and if they do, then it transfers their token into the auction pool.
  • A private read locked_buying_power(address) that allows an account owner to view their account value. In the initial version, we can make this publicly available.
  • A public read done() function / boolean storage variable that reports True if the auction is done, and False otherwise.
  • A public allocate() function that can be invoked by anyone in order to allocate the sale proceeds and pay back all excess capital that was over-locked (does this by calling locked_buying_power(address) for each address).

Milestones

[x] Set up dev environment / project skeleton with Nile.

[ ] Implement + briefly test token helper contract

[ ] Figure out how to run and read/write to contracts locally to perform basic contract prodding.

[ ] Find basic token contracts that allow incrementing of account value through public function call. Copy/paste into here, and make two tokens.

[ ] Test out messing around with both tokens, increasing and decreasing token balance.

[ ] Implement + briefly test dutch auction contract

[ ] Implement token that can be bridged L1 <-> L2

[ ] Implement an L1 contract that issues a wrapped token. This will be an ERC20 with the added functionality that our L2 contract is the only entity that can modify how much is owned by each account. This will be used to wrap the base and quote assets.

[ ] Integrate the L2 Dutch auction contract to deposit / withdraw to/from the L1 contract.

[ ] Integrate the L1 contract to withraw / deposit from/to the L2 contract.

cairo-dutch's People

Contributors

maxholloway avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Forkers

lymanzerga11

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.