Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions scripts/dao-proposals/OOIP-20-crvusd/proposal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from brownie import *

exec(open("./scripts/env/set-eth.py").read())

description = "OOIP-20-crvusd"

targets = []
values = []
calldatas = []


exec(open("./scripts/env/set-eth.py").read())
MINIMAL_RATES = {
"icrvUSD": 0.1e18
}

loanTokenLogicStandard = Contract.from_abi("loanTokenLogicStandard", address="0x624f7f89414011b276c60ea2337bfba936d1cbbe", abi=LoanTokenLogicStandard.abi)
loanTokenAddress = "TBU"

priceFeedAddress = "TBU"
calldatas.append(PRICE_FEED.setPriceFeed.encode_input([loanTokenAddress], [priceFeedAddress]))
calldatas.append(PRICE_FEED.setDecimals.encode_input([loanTokenAddress]))

iToken = Contract.from_abi("iToken", "TBU", LoanTokenLogicStandard.abi)

calldatas.append(CUI.updateParams.encode_input((120e18, 80e18, 100e18, 100e18, 110e18, MINIMAL_RATES.get(iToken.symbol()), MINIMAL_RATES.get(iToken.symbol()))))
calldatas.append(iToken.setDemandCurve.encode_input(CUI))

calldatas.append(BZX.setApprovals.encode_input([loanTokenAddress], [1,2]))
calldatas.append(BZX.setupLoanPoolTWAI.encode_input(iProxy))

calldatas.append(BZX.setLoanPool.encode_input([iToken], [loanTokenAddress]))
calldatas.append(BZX.setSupportedTokens.encode_input([loanTokenAddress, iToken], [True, True], True))


values = [0] * len(targets) # empty array
signatures = [""] * len(targets) # empty signatures array

# Make proposal
call = DAO.propose(targets, values, signatures, calldatas, description, {'from': TEAM_VOTING_MULTISIG, "required_confs": 1})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to include flash loan fix

print("call", call)
35 changes: 35 additions & 0 deletions scripts/deployment/mainnet/deploy_icrvusd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

exec(open("./scripts/env/set-eth.py").read())
MINIMAL_RATES = {
"icrvUSD": 0.1e18
}

loanTokenLogicStandard = Contract.from_abi("loanTokenLogicStandard", address="0x624f7f89414011b276c60ea2337bfba936d1cbbe", abi=LoanTokenLogicStandard.abi)
loanTokenAddress = TestToken.deploy("crvusd", "crvusd", 18, 1000e18,{"from": deployer}).address

priceFeedAddress = FixedPriceFeed.deploy({"from": deployer}).address
PRICE_FEED.setPriceFeed([loanTokenAddress], [priceFeedAddress], {"from": TIMELOCK})
PRICE_FEED.setDecimals([loanTokenAddress], {"from": TIMELOCK})

iProxy = LoanToken.deploy(deployer, loanTokenLogicStandard, {"from": deployer})
#iProxy = Contract.from_abi("iToken", address="0x08bd8Dc0721eF4898537a5FBE1981333D430F50f", abi=LoanToken.abi)
iToken = Contract.from_abi("iToken", iProxy, LoanTokenLogicStandard.abi)
underlyingSymbol = "crvUSD"
iTokenSymbol = "i{}".format(underlyingSymbol)
iTokenName = "Ooki {} iToken ({})".format(underlyingSymbol, iTokenSymbol)
iToken.initialize(loanTokenAddress, iTokenName, iTokenSymbol, {'from': deployer})
iToken.initializeDomainSeparator({"from": deployer})
iProxy.transferOwnership(TIMELOCK, {'from': deployer})

CUI.updateParams((120e18, 80e18, 100e18, 100e18, 110e18, MINIMAL_RATES.get(iToken.symbol()), MINIMAL_RATES.get(iToken.symbol())), iToken, {"from": TIMELOCK})
iToken.setDemandCurve(CUI,{"from": deployer})

BZX.setApprovals([loanTokenAddress], [1,2], {'from': TIMELOCK})
BZX.setupLoanPoolTWAI(iProxy, {"from": TIMELOCK})

BZX.setLoanPool([iToken], [loanTokenAddress], {"from": TIMELOCK})
BZX.setSupportedTokens([loanTokenAddress, iToken], [True, True], True, {"from": TIMELOCK})


exec(open("./scripts/env/set-eth.py").read())
crvUSD = TestToken.at(loanTokenAddress)