Skip to content

Instantly share code, notes, and snippets.

@frozeman frozeman/test.js
Created Jun 13, 2019

Embed
What would you like to do?
RICO test
Refundable ICO
Test 1
allocation phase
--------
blockNumber: 0
Current Flow: 0.1
investorETH: 100
projectETH: 0
available for project: 0
ETH in RICO: 100
ETH space left in RICO: 9900
Adds up? true
--------
--------
blockNumber: 0
Current Flow: 0.2
investorETH: 200
projectETH: 0
available for project: 0
ETH in RICO: 200
ETH space left in RICO: 9800
Adds up? true
--------
--------
blockNumber: 0
Current Flow: 0.7
investorETH: 700
projectETH: 0
available for project: 0
ETH in RICO: 700
ETH space left in RICO: 9300
Adds up? true
--------
--------
blockNumber: 0
Current Flow: 0.65
investorETH: 650
projectETH: 0
available for project: 0
ETH in RICO: 650
ETH space left in RICO: 9350
Adds up? true
--------
--------
blockNumber: 0
Current Flow: 0.15
investorETH: 150
projectETH: 0
available for project: 0
ETH in RICO: 150
ETH space left in RICO: 9850
Adds up? true
--------
--------
blockNumber: 0
Current Flow: 0.25
investorETH: 250
projectETH: 0
available for project: 0
ETH in RICO: 250
ETH space left in RICO: 9750
Adds up? true
--------
--------
blockNumber: 0
Current Flow: 0.35
investorETH: 350
projectETH: 0
available for project: 0
ETH in RICO: 350
ETH space left in RICO: 9650
Adds up? true
--------
--------
blockNumber: 0
Current Flow: 5.35
investorETH: 5350
projectETH: 0
available for project: 0
ETH in RICO: 5350
ETH space left in RICO: 4650
Adds up? true
--------
--------
blockNumber: 0
Current Flow: 5.3
investorETH: 5300
projectETH: 0
available for project: 0
ETH in RICO: 5300
ETH space left in RICO: 4700
Adds up? true
--------
✓ commit and refund
distribution phase
--------
blockNumber: 250
Current Flow: 5.3
investorETH: 3975
projectETH: 1325
available for project: 1325
ETH in RICO: 5300
ETH space left in RICO: 4700
Adds up? true
--------
✓ check at 25%
--------
blockNumber: 500
Current Flow: 5.3
investorETH: 2650
projectETH: 2650
available for project: 2650
ETH in RICO: 5300
ETH space left in RICO: 4700
Adds up? true
--------
✓ check at 50%
--------
blockNumber: 750
Current Flow: 5.3
investorETH: 1325
projectETH: 3975
available for project: 3975
ETH in RICO: 5300
ETH space left in RICO: 4700
Adds up? true
--------
✓ check at 75%
--------
blockNumber: 1000
Current Flow: 5.3
investorETH: 0
projectETH: 5300
available for project: 5300
ETH in RICO: 5300
ETH space left in RICO: 4700
Adds up? true
--------
✓ check at 100%
Test 2
allocation phase
--------
blockNumber: 0
Current Flow: 0.1
investorETH: 100
projectETH: 0
available for project: 0
ETH in RICO: 100
ETH space left in RICO: 9900
Adds up? true
--------
--------
blockNumber: 0
Current Flow: 0.2
investorETH: 200
projectETH: 0
available for project: 0
ETH in RICO: 200
ETH space left in RICO: 9800
Adds up? true
--------
--------
blockNumber: 0
Current Flow: 2.2
investorETH: 2200
projectETH: 0
available for project: 0
ETH in RICO: 2200
ETH space left in RICO: 7800
Adds up? true
--------
--------
blockNumber: 0
Current Flow: 10
investorETH: 10000
projectETH: 0
available for project: 0
ETH in RICO: 10000
ETH space left in RICO: 0
Adds up? true
--------
✓ commit
distribution phase
--------
blockNumber: 250
Current Flow: 10
investorETH: 7500
projectETH: 2500
available for project: 2500
ETH in RICO: 10000
ETH space left in RICO: 0
Adds up? true
--------
✓ time passes
--------
blockNumber: 250
Current Flow: 9.9
investorETH: 7425
projectETH: 2500
available for project: 2500
ETH in RICO: 9925
ETH space left in RICO: 75
Adds up? true
--------
✓ refund
--------
blockNumber: 300
Current Flow: 9.971428571428572
investorETH: 6980
projectETH: 2995
available for project: 2995
ETH in RICO: 9975
ETH space left in RICO: 25
Adds up? true
--------
--------
blockNumber: 300
Current Flow: 9.92142857142857
investorETH: 6945
projectETH: 2995
available for project: 2995
ETH in RICO: 9940
ETH space left in RICO: 60
Adds up? true
--------
✓ mid-term immediate loss
--------
blockNumber: 500
Current Flow: 7.922
investorETH: 3961
projectETH: 4979
available for project: 4979
ETH in RICO: 8940
ETH space left in RICO: 1060
Adds up? true
--------
✓ check at 50%
--------
blockNumber: 1000
Current Flow: 7.922
investorETH: 0
projectETH: 8940
available for project: 8940
ETH in RICO: 8940
ETH space left in RICO: 1060
Adds up? true
--------
✓ over
11 passing (19ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.