Coder Social home page Coder Social logo

pox-lite's Introduction

Node.js CI

PoX Lite

A PoX Lite Smart Contract in Clarity which simulates PoX.

Running the code

npm i --force
 
npm test

Challenge

Challenge Type: Solo/Team

Expiration Date: April 31, 2021

Goal: Create a PoX Lite Smart Contract

Write a Smart Contract that has:

  1. A fungible token
  2. Can only be minted when other people send to the contract their Stacks (STX) tokens.

The way in which this happens is every Stacks block a fixed amount of the token would be minted, and the person who can receive that block's tokens must have sent STX to the contract and must be chosen at random based on how much they spent relative to everyone else in the same block.

For example, if Alice sends 3 STX, and Bob sends 2 STX to the contract, Alice has a 60% chance of winning that block's tokens and Bob has a 40% of winning that block's tokens.

  1. In addition to sending the STX a person can write a short message (say 80 bytes of data) that is paired with their commitment. The act of putting your STX in is the act of writing a message, which must be stored in a data-map ordered by block height and submission order.

Hint 1: The tokens don't need to be minted right away, they only need to be minted when Alice (if she is the winner) goes to withdrawal them.

Hint 2: There is at most one winner per block, and only that person may withdrawal.

Bonus: Stacks are forwarded into a treasury that token holders have a right to withdraw from, but would have 401k-style early withdrawal penalty for withdrawing early, and subsequently leaving a larger pot for the remaining holders.

pox-lite's People

Contributors

unclemantis avatar

Watchers

James Cloos 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.