generated from Badger-Finance/badger-strategy-mix-v1
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_remBadger_lifecycle.py
57 lines (41 loc) · 1.39 KB
/
test_remBadger_lifecycle.py
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
45
46
47
48
49
50
51
52
53
54
55
56
57
import brownie
from brownie import *
from helpers.constants import MaxUint256
from helpers.SnapshotManager import SnapshotManager
from helpers.time import days
"""
remBadger Lifecycle test
-> Deploy
-> Issue 2k shares
-> Make a seeding deposit
-> Check ppfs
-> Do more deposits
"""
def test_lifecycle_for_rem_badger(deployer, sett, strategy, controller, want, governance):
# Setup
startingBalance = want.balanceOf(deployer)
depositAmount = 600_000e18 ## 600k BADGER
restOfTokens = 600_000e18 ## 600k BADGER
assert startingBalance >= depositAmount + restOfTokens
# End Setup
assert want.balanceOf(sett) == 0
assert sett.getPricePerFullShare() == 1e18
assert sett.totalSupply() == 0
print("Initial ppfs")
print(1e18)
## Mint 2k more shares
sett.mintExtra(2000e18, {"from": governance})
assert sett.totalSupply() == 2000e18
last_ppfs = sett.getPricePerFullShare()
assert last_ppfs < 1e18 ## We diluted
print("Diluted PPFS")
print(last_ppfs)
want.transfer(sett, depositAmount, {"from": deployer})
assert sett.getPricePerFullShare() > last_ppfs
last_ppfs = sett.getPricePerFullShare()
print("New ppfs 1")
print(sett.getPricePerFullShare())
want.transfer(sett, restOfTokens, {"from": deployer})
assert sett.getPricePerFullShare() > last_ppfs
print("New ppfs 2")
print(sett.getPricePerFullShare())