Contracts
Last updated
Was this helpful?
Last updated
Was this helpful?
Using Brownie you can interact with the Ooki contracts. Below is an explanation for using each function. See our github for additional references:
0x0De05F6447ab4D22c8827449EE4bA2D5C288379B
0xb72b31907c1c95f3650b64b2469e08edacee5e8f
0x93c608Dc45FcDd9e7c5457ce6fc7f4dDec235b68
BZX = Contract.from_abi("BZX", "0xfe4F0eb0A1Ad109185c9AaDE64C48ff8e928e54B", interface.IBZx.abi)
iUSDTAddress = BZX.underlyingToLoanPool(USDT.address)
iUSDT = Contract.from_abi("iUSDT", address=iUSDTAddress, abi=LoanTokenLogicStandard.abi)
WMATIC.approve(iUSDT, 2256-1, {'from': accounts[0]})
USDT.approve(BZX, 2256-1, {'from': accounts[0]})
WMATIC.approve(BZX, 2**256-1, {'from': accounts[0]})
BZX.depositCollateral(loan[0], 10e18, {'from': accounts[0]})
BZX.closeWithSwap(loan[0], accounts[0], loan[5], True, b'', {'from': accounts[0]})
BZX.closeWithDeposit(loan[0], accounts[0], loan[4], {'from': accounts[0]})
loans = BZX.getActiveLoansAdvanced(0,100,True,True)
loan = loans[0]
BZX.liquidate(loan[0], accounts[0], loan[13], {'from': accounts[0]})
BZX.rollover(loan[0], b'', {'from':accounts[0]})
Flashborrow has the following arguments:
flashBorrow(uint256 borrowAmount, address borrower, address target, string signature, bytes data), it should be call from contract layer.
Example can be found