Skip to main content

IDigitizer

An ERC721 contract that creates NFTs representing off-chain mortgages and consumer loans

Functions#

totalUPB#

  function totalUPB(  ) external returns (uint256)

Returns the combined current UPB of all PandiFi V1 digitized loans

totalSupply#

  function totalSupply(  ) external returns (uint256)

Returns the total number of PandiFi V1 digitized loans

A light weight alternative to ERC721Enumerable

stablecoinAddress#

  function stablecoinAddress(  ) external returns (address)

Returns the address of the current stablecoin being used to distribute cash flow

reservationOwner#

  function reservationOwner(  ) external returns (address)

Returns the address of the wallet that has a reservation or 0 if there is no reservation

upbOfOwner#

  function upbOfOwner(  ) external returns (uint256)

Returns the combined current UPB of all PandiFi V1 digitized loans owned by owner

isLocked#

  function isLocked(  ) external returns (bool)

Returns true if the loan is locked i.e., a servicing event is pending and (de)homogenization should be blocked

lockedTokenCount#

  function lockedTokenCount(  ) external returns (uint256)

Returns the total number of loan tokens that are current locked

MINTER_ROLE#

  function MINTER_ROLE(  ) external returns (bytes32)

Identifies a role that has authorization to mint new loan tokens

TRADER_ROLE#

  function TRADER_ROLE(  ) external returns (bytes32)

Identifies a role that has authorization to set reservations

SERVICER_ROLE#

  function SERVICER_ROLE(  ) external returns (bytes32)

Identifies a role that has authorization to distribute cash flow and modify loan state

SWEEPER_ROLE#

  function SWEEPER_ROLE(  ) external returns (bytes32)

Identifies a role that has authorization to receive cash flow distributions made to homogenized loans

KEEPER_ROLE#

  function KEEPER_ROLE(  ) external returns (bytes32)

Identifies a role that has authorization to run various keeper functions to ensure that API data is current

getTokenData#

  function getTokenData(  ) external returns (struct LoanSchema.TokenData)

Returns all contract storage associated with a given loan token

setTokenURI#

  function setTokenURI(    uint256 URI  ) external

Allows SERVICER_ROLE or DEFAULT_ADMIN_ROLE to set a new URI

Parameters:#

NameTypeDescription
URIuint256New URI for accessing loan data stored off-chain

setReservation#

  function setReservation(    uint256[] tokenIds,    address owner  ) external

Allows TRADER_ROLE or DEFAULT_ADMIN_ROLE to set a reservation (even before they are minted) on a batch of loan tokens

Parameters:#

NameTypeDescription
tokenIdsuint256[]A array of ERC721 loan token IDs
owneraddressThe new reservation owner; A reservation owner has no dehomogenization restrictions

setStablecoinAddress#

  function setStablecoinAddress(  ) external

Allows SERVICER_ROLE or DEFAULT_ADMIN_ROLE to set a new stablecoin if the current stablecoin is compromised

This only sets the stablecoin for cash flows and NEW homogenizers i.e., homogenizer stablecoins are immutable

mint#

  function mint(    address to,    struct LoanSchema.Original[] originalTokenDatas,    struct LoanSchema.Current[] currentTokenDatas,    string[] offChainDataURIs  ) external returns (uint256[])

Allows MINTER_ROLE or DEFAULT_ADMIN_ROLE to mint a batch of new loan token; returns an array of the new loan tokens' ERC721 IDs

Parameters:#

NameTypeDescription
toaddressThe recepient address of the new loan tokens
originalTokenDatasstruct LoanSchema.Original[]An array of data that's associated with a loan's origination; see LoanSchema.sol
currentTokenDatasstruct LoanSchema.Current[]An array of data that represents the a loan's current state; see LoanSchema.sol
offChainDataURIsstring[]An array of URIs that allow users to access off-chain data (if available)

receiveCashFlow#

  function receiveCashFlow(    uint256[] tokenIds,    struct LoanSchema.Current[] newTokenDatas,    struct LoanSchema.CashFlow[] cashFlows,    address collectionWallet  ) external

Allows SERVICER_ROLE or DEFAULT_ADMIN_ROLE to distribute cash flows and update storage data for a batch of loan tokens

Parameters:#

NameTypeDescription
tokenIdsuint256[]An array of loan token ERC721 IDs
newTokenDatasstruct LoanSchema.Current[]An array of current loan token data; see LoanSchema.sol
cashFlowsstruct LoanSchema.CashFlow[]An array of cash flow data associated with the servicing event; see LoanSchema.sol
collectionWalletaddressThe wallet that contains the stablecoin funds to distribute cash flow

lockLoanTokens#

  function lockLoanTokens(    uint256[] tokenIds  ) external

Allows SERVICER_ROLE or DEFAULT_ADMIN_ROLE to lock a set of loans prior to a servicing event

Parameters:#

NameTypeDescription
tokenIdsuint256[]The array of ERC721 IDs representing loan tokens that should be locked

Events#

NewDigitizer#

  event NewDigitizer(    address digitizerAddress  )

Event emitted when PandiFi V1 digitizer is first created

Parameters:#

NameTypeDescription
digitizerAddressaddressThe digitizer's Ethereum address

NewLoanToken#

  event NewLoanToken(    uint256 tokenId,    struct LoanSchema.Original originalTokenData,    struct LoanSchema.Current currentTokenData  )

Event emitted when a new loan token is created

Parameters:#

NameTypeDescription
tokenIduint256The ERC721 ID associated with the new loan token
originalTokenDatastruct LoanSchema.OriginalAt-origination loan token data
currentTokenDatastruct LoanSchema.CurrentCurrent loan token data

UpdateLoanToken#

  event UpdateLoanToken(    uint256 tokenId,    struct LoanSchema.Current newTokenData,    struct LoanSchema.CashFlow cashFlowData  )

Event emitted when there is a servicing event i.e., receiveCashFlow is called successfully

Parameters:#

NameTypeDescription
tokenIduint256The ERC721 ID associated with the new loan token
newTokenDatastruct LoanSchema.CurrentCurrent loan token data
cashFlowDatastruct LoanSchema.CashFlowCash flow data associated with the servicing event