-
Notifications
You must be signed in to change notification settings - Fork 16
/
run_ponzi_gradual.rb
44 lines (30 loc) · 1.07 KB
/
run_ponzi_gradual.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# encoding: utf-8
require 'universum'
require_relative './ponzi_gradual'
###
# test contract
## setup test accounts with starter balance
Account[ '0x1111' ].balance = 0
Account[ '0xaaaa' ].balance = 1_000_000
Account[ '0xbbbb' ].balance = 1_000_000
Account[ '0xcccc' ].balance = 1_000_000
Account[ '0xdddd' ].balance = 1_000_000
## pretty print (pp) all known accounts with balance
pp Uni.accounts
## genesis - create contract
ponzi = Uni.send_transaction( from: '0x1111', data: GradualPonzi ).contract
pp ponzi
Uni.send_transaction( from: '0xaaaa', to: ponzi, value: 1_000_000 )
pp ponzi
Uni.send_transaction( from: '0xbbbb', to: ponzi, value: 1_000_000 )
pp ponzi
Uni.send_transaction( from: '0xcccc', to: ponzi, value: 1_000_000 )
pp ponzi
Uni.send_transaction( from: '0xdddd', to: ponzi, value: 1_000_000 )
pp ponzi
## pretty print (pp) all known accounts with balance
pp Uni.accounts
Uni.send_transaction( from: '0xaaaa', to: ponzi, data: [:withdraw] )
pp ponzi
## pretty print (pp) all known accounts with balance
pp Uni.accounts