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 ) externalAllows SERVICER_ROLE or DEFAULT_ADMIN_ROLE to set a new URI
Parameters:#
| Name | Type | Description |
|---|---|---|
URI | uint256 | New URI for accessing loan data stored off-chain |
setReservation#
function setReservation( uint256[] tokenIds, address owner ) externalAllows TRADER_ROLE or DEFAULT_ADMIN_ROLE to set a reservation (even before they are minted) on a batch of loan tokens
Parameters:#
| Name | Type | Description |
|---|---|---|
tokenIds | uint256[] | A array of ERC721 loan token IDs |
owner | address | The new reservation owner; A reservation owner has no dehomogenization restrictions |
setStablecoinAddress#
function setStablecoinAddress( ) externalAllows 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:#
| Name | Type | Description |
|---|---|---|
to | address | The recepient address of the new loan tokens |
originalTokenDatas | struct LoanSchema.Original[] | An array of data that's associated with a loan's origination; see LoanSchema.sol |
currentTokenDatas | struct LoanSchema.Current[] | An array of data that represents the a loan's current state; see LoanSchema.sol |
offChainDataURIs | string[] | 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 ) externalAllows SERVICER_ROLE or DEFAULT_ADMIN_ROLE to distribute cash flows and update storage data for a batch of loan tokens
Parameters:#
| Name | Type | Description |
|---|---|---|
tokenIds | uint256[] | An array of loan token ERC721 IDs |
newTokenDatas | struct LoanSchema.Current[] | An array of current loan token data; see LoanSchema.sol |
cashFlows | struct LoanSchema.CashFlow[] | An array of cash flow data associated with the servicing event; see LoanSchema.sol |
collectionWallet | address | The wallet that contains the stablecoin funds to distribute cash flow |
lockLoanTokens#
function lockLoanTokens( uint256[] tokenIds ) externalAllows SERVICER_ROLE or DEFAULT_ADMIN_ROLE to lock a set of loans prior to a servicing event
Parameters:#
| Name | Type | Description |
|---|---|---|
tokenIds | uint256[] | 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:#
| Name | Type | Description |
|---|---|---|
digitizerAddress | address | The 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:#
| Name | Type | Description |
|---|---|---|
tokenId | uint256 | The ERC721 ID associated with the new loan token |
originalTokenData | struct LoanSchema.Original | At-origination loan token data |
currentTokenData | struct LoanSchema.Current | Current 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:#
| Name | Type | Description |
|---|---|---|
tokenId | uint256 | The ERC721 ID associated with the new loan token |
newTokenData | struct LoanSchema.Current | Current loan token data |
cashFlowData | struct LoanSchema.CashFlow | Cash flow data associated with the servicing event |