ethresearch / Interactive-Coin-offerings

Python Interactive Coin offerings Simulation

Home Page:https://medium.com/taipei-ethereum-meetup/notes-on-interactive-coin-offerings-32cf58a28554

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Interactive Coin Offerings Simulation

Trying to simulate the contract described in this paper.

Require python 3.6

Example

$python main.py
Here born 😁 Alice
        πŸ‘› Alice_1       100.00 ETH
Here born 😁 Bobbb
        πŸ‘› Bobbb_1       200.00 ETH
Here born 😁 Whale 🐳
        πŸ‘› Whale 🐳_1     200.00 ETH
# 10: πŸ†™ mined 10 blocks!
➑️       πŸ‘› Alice_1       --->    πŸ‘› Contract      30.00 ETH
⏲️ 9     V: 30.00 ETH    p: 1.22 TKN/ETH
# 30: πŸ†™ mined 20 blocks!
➑️       πŸ‘› Bobbb_1       --->    πŸ‘› Contract      30.00 ETH
⏲️ 29    V: 60.00 ETH    p: 1.17 TKN/ETH
# 35: πŸ†™ mined 5 blocks!
➑️       πŸ‘› Whale 🐳_1     --->    πŸ‘› Contract      50.00 ETH
⏲️ 34    V: 110.00 ETH   p: 1.15 TKN/ETH
⚠️ V > somebody's cap
 110.00 ETH raised, but Alice_1, Bobbb_1 want capped at  79.00 ETH
⚠️ V - S < min_cap       Do a partial refund
➑️       πŸ‘› Contract      --->    πŸ‘› Alice_1       15.50 ETH
➑️       πŸ‘› Contract      --->    πŸ‘› Bobbb_1       15.50 ETH
⏲️ 34    V: 79.00 ETH    p: 1.15 TKN/ETH

!!!! u passed: token sales ended

Addresses       To Contract     Purchased       Personal Cap
---------       -----------     ---------       ------------
😁 Alice_1       14.50 ETH       17.73 TKN       79 ETH
😁 Bobbb_1       14.50 ETH       16.90 TKN       79 ETH
😁 Whale 🐳_1     50.00 ETH       57.60 TKN       200 ETH
⏲️ 100   V: 79.00 ETH    p: 1.00 TKN/ETH
# 135: πŸ†™ mined 100 blocks!
This case shows that a rich whale can't 'pushout' bids to lower the valuation.

About

Python Interactive Coin offerings Simulation

https://medium.com/taipei-ethereum-meetup/notes-on-interactive-coin-offerings-32cf58a28554


Languages

Language:Python 100.0%