if_borrow

package
v0.0.0-...-09f7846 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountSnapshot

type AccountSnapshot struct {
	Collateral *big.Int
	// 借款
	Principal *big.Int
	// 用户当前未还的总利息
	Interest *big.Int
	// 用户负债时的正常利息
	FormalInterest       *big.Int
	OScoreLevel          uint8
	BorrowTime           uint64
	AccrueInterestDayNum uint64
}

func DeserializeAccountSnapshot

func DeserializeAccountSnapshot(data []byte) (*AccountSnapshot, error)

type DayDebtInfo

type DayDebtInfo struct {
	Data             []*DebtInfo
	AccruedDayNumber uint64 // 上一次计息的日期
	TotalInterest    string
}

func (*DayDebtInfo) Deserialize

func (this *DayDebtInfo) Deserialize(source *common.ZeroCopySource) error

type DebtInfo

type DebtInfo struct {
	OScoreLevel byte
	Debt        string // 负债
	Interest    string // 这些负债产生的利息
	BorrowIndex string
}

func (*DebtInfo) Deserialize

func (this *DebtInfo) Deserialize(source *common.ZeroCopySource) error

type IfBorrowPool

type IfBorrowPool struct {
	Sdk      *ontSDK.OntologySdk
	Signer   *ontSDK.Account
	Addr     common.Address
	GasPrice uint64
	GasLimit uint64
}

func NewIfBorrowPool

func NewIfBorrowPool(nodeRPCAddr string, contractAddr string, signer *ontSDK.Account, gasPrice,
	gasLimit uint64) (*IfBorrowPool, error)

func (*IfBorrowPool) AcceptAdmin

func (this *IfBorrowPool) AcceptAdmin() (string, error)

func (*IfBorrowPool) AccountSnapshot

func (this *IfBorrowPool) AccountSnapshot(owner common.Address) (*AccountSnapshot, error)

func (*IfBorrowPool) AccrueAccountInterest

func (this *IfBorrowPool) AccrueAccountInterest(addr common.Address) (string, error)

func (*IfBorrowPool) AccrueInterest

func (this *IfBorrowPool) AccrueInterest() (string, error)

func (*IfBorrowPool) AccruedDayNumber

func (this *IfBorrowPool) AccruedDayNumber() (uint64, error)

func (*IfBorrowPool) Admin

func (this *IfBorrowPool) Admin() (common.Address, error)

func (*IfBorrowPool) Allowance

func (this *IfBorrowPool) Allowance(owner, spender common.Address) (*big.Int, error)

func (*IfBorrowPool) Approve

func (this *IfBorrowPool) Approve(owner, spender common.Address, amount *big.Int) (string, error)

func (*IfBorrowPool) BalanceOf

func (this *IfBorrowPool) BalanceOf(owner common.Address) (*big.Int, error)

func (*IfBorrowPool) BalanceOfUnderlying

func (this *IfBorrowPool) BalanceOfUnderlying(owner common.Address) (*big.Int, error)

func (*IfBorrowPool) Borrow

func (this *IfBorrowPool) Borrow(borrower common.Address, borrowAmount *big.Int) (string, error)

func (*IfBorrowPool) BorrowBalanceStored

func (this *IfBorrowPool) BorrowBalanceStored(account common.Address) (*big.Int, error)

func (*IfBorrowPool) BorrowRatePerBlock

func (this *IfBorrowPool) BorrowRatePerBlock() (*big.Int, error)

func (*IfBorrowPool) Comptroller

func (this *IfBorrowPool) Comptroller() (common.Address, error)

func (*IfBorrowPool) Decimals

func (this *IfBorrowPool) Decimals() (string, error)

func (*IfBorrowPool) ExchangeRateStored

func (this *IfBorrowPool) ExchangeRateStored() (*big.Int, error)

func (*IfBorrowPool) FormalBorrowDays

func (this *IfBorrowPool) FormalBorrowDays() (uint64, error)

func (*IfBorrowPool) FormalInterest

func (this *IfBorrowPool) FormalInterest() (common.I128, error)

func (*IfBorrowPool) FormalPrincipal

func (this *IfBorrowPool) FormalPrincipal() (common.I128, error)

func (*IfBorrowPool) GetAddr

func (this *IfBorrowPool) GetAddr() common.Address

func (*IfBorrowPool) GetCash

func (this *IfBorrowPool) GetCash() (*big.Int, error)

func (*IfBorrowPool) GetDayDebtInfo

func (this *IfBorrowPool) GetDayDebtInfo(dayNumber uint64) (*DayDebtInfo, error)

func (*IfBorrowPool) GetOscoreInfoByLevel

func (this *IfBorrowPool) GetOscoreInfoByLevel(level byte) (*OscoreInfo, error)

pre execute

func (*IfBorrowPool) GlobalParam

func (this *IfBorrowPool) GlobalParam() (common.Address, error)

func (*IfBorrowPool) IncreaseCollateral

func (this *IfBorrowPool) IncreaseCollateral(from common.Address, addAmount *big.Int) (string, error)

func (*IfBorrowPool) Init

func (this *IfBorrowPool) Init(admin common.Address, marketName string, oracle, comptroller common.Address, accruedDayNumber,
	formalDays, interimDays,
	interimInterestRate,
	punishInterestRate,
	reservesFactor,
	insuranceInterestFactor uint64,
) (string, error)

func (*IfBorrowPool) InsuranceInterestFactor

func (this *IfBorrowPool) InsuranceInterestFactor() (*big.Int, error)

func (*IfBorrowPool) InterimBorrowDays

func (this *IfBorrowPool) InterimBorrowDays() (uint64, error)

func (*IfBorrowPool) InterimInterestRate

func (this *IfBorrowPool) InterimInterestRate() (bool, error)

func (*IfBorrowPool) IsBorrow

func (this *IfBorrowPool) IsBorrow() (bool, error)

func (*IfBorrowPool) Liquidate

func (this *IfBorrowPool) Liquidate(liquidator, borrower common.Address) (string, error)

func (*IfBorrowPool) MarketName

func (this *IfBorrowPool) MarketName() (string, error)

func (*IfBorrowPool) Mint

func (this *IfBorrowPool) Mint(minter common.Address, mintAmount *big.Int) (string, error)

func (*IfBorrowPool) NeoVMApprove

func (this *IfBorrowPool) NeoVMApprove(owner, spender common.Address, amount *big.Int) (string, error)

func (*IfBorrowPool) NeoVMBalanceOf

func (this *IfBorrowPool) NeoVMBalanceOf(owner common.Address) (*big.Int, error)

func (*IfBorrowPool) OScoreOracle

func (this *IfBorrowPool) OScoreOracle() (common.Address, error)

func (*IfBorrowPool) PendingAdmin

func (this *IfBorrowPool) PendingAdmin() (common.Address, error)

func (*IfBorrowPool) PunishInterestRate

func (this *IfBorrowPool) PunishInterestRate() (bool, error)

func (*IfBorrowPool) Redeem

func (this *IfBorrowPool) Redeem(redeemer common.Address, redeemTokens *big.Int) (string, error)

func (*IfBorrowPool) RedeemUnderlying

func (this *IfBorrowPool) RedeemUnderlying(redeemer common.Address, redeemAmount *big.Int) (string, error)

func (*IfBorrowPool) ReduceCollateral

func (this *IfBorrowPool) ReduceCollateral(from common.Address, addAmount *big.Int) (string, error)

func (*IfBorrowPool) ReduceReserves

func (this *IfBorrowPool) ReduceReserves(reduceAmount *big.Int) (string, error)

func (*IfBorrowPool) RepayBorrow

func (this *IfBorrowPool) RepayBorrow(borrower common.Address, repayAmount *big.Int) (string, error)

func (*IfBorrowPool) RepayBorrowBehalf

func (this *IfBorrowPool) RepayBorrowBehalf(payer, borrower common.Address, repayAmount *big.Int) (string, error)

func (*IfBorrowPool) ReserveFactor

func (this *IfBorrowPool) ReserveFactor() (*big.Int, error)

func (*IfBorrowPool) SetComptroller

func (this *IfBorrowPool) SetComptroller(comptroller common.Address) (string, error)

func (*IfBorrowPool) SetFormalBorrowDays

func (this *IfBorrowPool) SetFormalBorrowDays(days uint64) (string, error)

func (*IfBorrowPool) SetInsuranceAddr

func (this *IfBorrowPool) SetInsuranceAddr(insurance common.Address) (string, error)

func (*IfBorrowPool) SetInsuranceFactor

func (this *IfBorrowPool) SetInsuranceFactor(factor *big.Int) (string, error)

func (*IfBorrowPool) SetInsuranceInterestFactor

func (this *IfBorrowPool) SetInsuranceInterestFactor(factor *big.Int) (string, error)

func (*IfBorrowPool) SetInterimBorrowDays

func (this *IfBorrowPool) SetInterimBorrowDays(days uint64) (string, error)

func (*IfBorrowPool) SetInterimInterestRate

func (this *IfBorrowPool) SetInterimInterestRate(factor *big.Int) (string, error)

func (*IfBorrowPool) SetMarketAddr

func (this *IfBorrowPool) SetMarketAddr(market common.Address) (string, error)

func (*IfBorrowPool) SetMarketName

func (this *IfBorrowPool) SetMarketName(marketName string) (string, error)

func (*IfBorrowPool) SetOracle

func (this *IfBorrowPool) SetOracle(oracle common.Address) (string, error)

func (*IfBorrowPool) SetOscoreInfo

func (this *IfBorrowPool) SetOscoreInfo(param []*OscoreInfo) (string, error)

level: u8, pub interest_rate: U128, pub collateral_factor: U128,

func (*IfBorrowPool) SetPendingAdmin

func (this *IfBorrowPool) SetPendingAdmin(pendingAdmin common.Address) (string, error)

func (*IfBorrowPool) SetPriceOracle

func (this *IfBorrowPool) SetPriceOracle(oracle common.Address) (string, error)

func (*IfBorrowPool) SetPunishInterestRate

func (this *IfBorrowPool) SetPunishInterestRate(factor *big.Int) (string, error)

func (*IfBorrowPool) SetReserveFactor

func (this *IfBorrowPool) SetReserveFactor(factor *big.Int) (string, error)

func (*IfBorrowPool) SupplyRatePerBlock

func (this *IfBorrowPool) SupplyRatePerBlock() (*big.Int, error)

func (*IfBorrowPool) TotalInsuranceInterest

func (this *IfBorrowPool) TotalInsuranceInterest() (common.I128, error)

func (*IfBorrowPool) TotalInterest

func (this *IfBorrowPool) TotalInterest() (common.I128, error)

func (*IfBorrowPool) TotalReserves

func (this *IfBorrowPool) TotalReserves() (*big.Int, error)

func (*IfBorrowPool) Transfer

func (this *IfBorrowPool) Transfer(from, to common.Address, amount *big.Int) (string, error)

func (*IfBorrowPool) TransferFrom

func (this *IfBorrowPool) TransferFrom(from, src, to common.Address, amount *big.Int) (string, error)

func (*IfBorrowPool) UpdateSigner

func (this *IfBorrowPool) UpdateSigner(newSigner *ontSDK.Account)

type OscoreInfo

type OscoreInfo struct {
	Level            byte
	InterestRate     uint64
	CollateralFactor uint64
	MaxValue         uint64
}

func (*OscoreInfo) Deserialize

func (this *OscoreInfo) Deserialize(source *common.ZeroCopySource) error

func (*OscoreInfo) Serialize

func (this *OscoreInfo) Serialize(sink *common.ZeroCopySink)
type DebtInfo struct {
	OscoreLevl        uint8
	Debt     		  uint64	 // 负债
	Interest          uint64	// 这些负债产生的利息
	BorrowIndex      *big.Int  // 当前的借贷指数
}
type  DayDebtInfo struct {
	Data []*DebtInfo
	AccruedDayNumber uint64 // 上一次计息的日期
	TotalInterest   uint64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL