Digitizer
Mints NFTs that represent off-chain loans
Functions#
constructor#
function constructor( string name, string symbol, address stablecoinAddress_ ) publicThe digitizer contract's constructor function
Parameters:#
| Name | Type | Description |
|---|---|---|
name | string | The ERC721 name; not explicitly used in other PandiFi contracts |
symbol | string | The ERC721 symbol; not explicitly used in other PandiFi contracts |
stablecoinAddress_ | address | The address of the stablecoin used to distribute cash flows and enable homogenization |
getTokenData#
function getTokenData( ) public returns (struct LoanSchema.TokenData)Returns all contract storage associated with a given loan token
tokenURI#
function tokenURI( ) public returns (string)See {IERC721Metadata-tokenURI}.
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
_transfer#
function _transfer( ) internalTransfers tokenId from from to to.
As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
Requirements:
tocannot be the zero address.tokenIdtoken must be owned byfrom. Emits a {Transfer} event.
mint#
function mint( address to, struct LoanSchema.Original[] originalTokenDatas, struct LoanSchema.Current[] currentTokenDatas, string[] offChainDataURIs ) public 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) |
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 |
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 |
supportsInterface#
function supportsInterface( bytes4 interfaceId ) public returns (bool)This function is required to override a name clash between ERC721.sol and AccessControlEnumerable.sol (which are inherited from the Open Zeppelin library)
Parameters:#
| Name | Type | Description |
|---|---|---|
interfaceId | bytes4 | interface identifier, as specified in ERC-165 |