Skip to main content

Digitizer

Mints NFTs that represent off-chain loans

Functions#

constructor#

  function constructor(    string name,    string symbol,    address stablecoinAddress_  ) public

The digitizer contract's constructor function

Parameters:#

NameTypeDescription
namestringThe ERC721 name; not explicitly used in other PandiFi contracts
symbolstringThe ERC721 symbol; not explicitly used in other PandiFi contracts
stablecoinAddress_addressThe 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  ) 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

_transfer#

  function _transfer(  ) internal

Transfers tokenId from from to to. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements:

  • to cannot be the zero address.
  • tokenId token must be owned by from. 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:#

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)

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

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

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:#

NameTypeDescription
interfaceIdbytes4interface identifier, as specified in ERC-165