Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
LoanChecksAndCalculations
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 100 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; import "./IDirectLoanBase.sol"; import "./LoanData.sol"; import "../../../interfaces/IDirectLoanCoordinator.sol"; import "../../../utils/ContractKeys.sol"; import "../../../interfaces/INftfiHub.sol"; import "../../../interfaces/IPermittedPartners.sol"; import "../../../interfaces/IPermittedERC20s.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; /** * @title LoanChecksAndCalculations * @author NFTfi * @notice Helper library for LoanBase */ library LoanChecksAndCalculations { uint16 private constant HUNDRED_PERCENT = 10000; /** * @dev Function that performs some validation checks before trying to repay a loan * * @param _loanId - The id of the loan being repaid */ function payBackChecks(uint32 _loanId, INftfiHub _hub) external view { checkLoanIdValidity(_loanId, _hub); // Sanity check that payBackLoan() and liquidateOverdueLoan() have never been called on this loanId. // Depending on how the rest of the code turns out, this check may be unnecessary. require(!IDirectLoanBase(address(this)).loanRepaidOrLiquidated(_loanId), "Loan already repaid/liquidated"); // Fetch loan details from storage, but store them in memory for the sake of saving gas. (, , , , uint32 loanDuration, , , , uint64 loanStartTime, , ) = IDirectLoanBase(address(this)).loanIdToLoan( _loanId ); // When a loan exceeds the loan term, it is expired. At this stage the Lender can call Liquidate Loan to resolve // the loan. require(block.timestamp <= (uint256(loanStartTime) + uint256(loanDuration)), "Loan is expired"); } function checkLoanIdValidity(uint32 _loanId, INftfiHub _hub) public view { require( IDirectLoanCoordinator(_hub.getContract(IDirectLoanBase(address(this)).LOAN_COORDINATOR())).isValidLoanId( _loanId, address(this) ), "invalid loanId" ); } /** * @dev Function that the partner is permitted and returns its shared percent. * * @param _revenueSharePartner - Partner's address * * @return The revenue share percent for the partner. */ function getRevenueSharePercent(address _revenueSharePartner, INftfiHub _hub) external view returns (uint16) { // return soon if no partner is set to avoid a public call if (_revenueSharePartner == address(0)) { return 0; } uint16 revenueSharePercent = IPermittedPartners(_hub.getContract(ContractKeys.PERMITTED_PARTNERS)) .getPartnerPermit(_revenueSharePartner); return revenueSharePercent; } /** * @dev Performs some validation checks before trying to renegotiate a loan. * Needed to avoid stack too deep. * * @param _loan - The main Loan Terms struct. * @param _loanId - The unique identifier for the loan to be renegotiated * @param _newLoanDuration - The new amount of time (measured in seconds) that can elapse before the lender can * liquidate the loan and seize the underlying collateral NFT. * @param _newMaximumRepaymentAmount - The new maximum amount of money that the borrower would be required to * retrieve their collateral, measured in the smallest units of the ERC20 currency used for the loan. The * borrower will always have to pay this amount to retrieve their collateral, regardless of whether they repay * early. * @param _lenderNonce - The nonce referred to here is not the same as an Ethereum account's nonce. We are * referring instead to nonces that are used by both the lender and the borrower when they are first signing * off-chain NFTfi orders. These nonces can be any uint256 value that the user has not previously used to sign an * off-chain order. Each nonce can be used at most once per user within NFTfi, regardless of whether they are the * lender or the borrower in that situation. This serves two purposes: * - First, it prevents replay attacks where an attacker would submit a user's off-chain order more than once. * - Second, it allows a user to cancel an off-chain order by calling NFTfi.cancelLoanCommitmentBeforeLoanHasBegun() , which marks the nonce as used and prevents any future loan from using the user's off-chain order that contains * that nonce. * @return Borrower and Lender addresses */ function renegotiationChecks( LoanData.LoanTerms memory _loan, uint32 _loanId, uint32 _newLoanDuration, uint256 _newMaximumRepaymentAmount, uint256 _lenderNonce, INftfiHub _hub ) external view returns (address, address) { checkLoanIdValidity(_loanId, _hub); IDirectLoanCoordinator loanCoordinator = IDirectLoanCoordinator( _hub.getContract(IDirectLoanBase(address(this)).LOAN_COORDINATOR()) ); uint256 smartNftId = loanCoordinator.getLoanData(_loanId).smartNftId; address borrower; if (_loan.borrower != address(0)) { borrower = _loan.borrower; } else { borrower = IERC721(loanCoordinator.obligationReceiptToken()).ownerOf(smartNftId); } require(msg.sender == borrower, "Only borrower can initiate"); require(block.timestamp <= (uint256(_loan.loanStartTime) + _newLoanDuration), "New duration already expired"); require( uint256(_newLoanDuration) <= IDirectLoanBase(address(this)).maximumLoanDuration(), "New duration exceeds maximum loan duration" ); require(!IDirectLoanBase(address(this)).loanRepaidOrLiquidated(_loanId), "Loan already repaid/liquidated"); require( _newMaximumRepaymentAmount >= _loan.loanPrincipalAmount, "Negative interest rate loans are not allowed." ); // Fetch current owner of loan promissory note. address lender = IERC721(loanCoordinator.promissoryNoteToken()).ownerOf(smartNftId); require( !IDirectLoanBase(address(this)).getWhetherNonceHasBeenUsedForUser(lender, _lenderNonce), "Lender nonce invalid" ); return (borrower, lender); } /** * @notice A convenience function computing the revenue share taken from the admin fee to transferr to the permitted * partner. * * @param _adminFee - The quantity of ERC20 currency (measured in smalled units of that ERC20 currency) that is due * as an admin fee. * @param _revenueShareInBasisPoints - The percent (measured in basis points) of the admin fee amount that will be * taken as a revenue share for a the partner, at the moment the loan is begun. * * @return The quantity of ERC20 currency (measured in smalled units of that ERC20 currency) that should be sent to * the `revenueSharePartner`. */ function computeRevenueShare(uint256 _adminFee, uint256 _revenueShareInBasisPoints) external pure returns (uint256) { return (_adminFee * _revenueShareInBasisPoints) / HUNDRED_PERCENT; } /** * @notice A convenience function computing the adminFee taken from a specified quantity of interest. * * @param _interestDue - The amount of interest due, measured in the smallest quantity of the ERC20 currency being * used to pay the interest. * @param _adminFeeInBasisPoints - The percent (measured in basis points) of the interest earned that will be taken * as a fee by the contract admins when the loan is repaid. The fee is stored in the loan struct to prevent an * attack where the contract admins could adjust the fee right before a loan is repaid, and take all of the interest * earned. * * @return The quantity of ERC20 currency (measured in smalled units of that ERC20 currency) that is due as an admin * fee. */ function computeAdminFee(uint256 _interestDue, uint256 _adminFeeInBasisPoints) external pure returns (uint256) { return (_interestDue * _adminFeeInBasisPoints) / HUNDRED_PERCENT; } /** * @notice A convenience function computing the referral fee taken from the loan principal amount to transferr to * the referrer. * * @param _loanPrincipalAmount - The original sum of money transferred from lender to borrower at the beginning of * the loan, measured in loanERC20Denomination's smallest units. * @param _referralFeeInBasisPoints - The percent (measured in basis points) of the loan principal amount that will * be taken as a fee to pay to the referrer, 0 if the lender is not paying referral fee. * @param _referrer - The address of the referrer who found the lender matching the listing, Zero address to signal * that there is no referrer. * * @return The quantity of ERC20 currency (measured in smalled units of that ERC20 currency) that should be sent to * the referrer. */ function computeReferralFee( uint256 _loanPrincipalAmount, uint256 _referralFeeInBasisPoints, address _referrer ) external pure returns (uint256) { if (_referralFeeInBasisPoints == 0 || _referrer == address(0)) { return 0; } return (_loanPrincipalAmount * _referralFeeInBasisPoints) / HUNDRED_PERCENT; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; /** * @title IDirectLoanCoordinator * @author NFTfi * @dev DirectLoanCoordinator interface. */ interface IDirectLoanCoordinator { enum StatusType { NOT_EXISTS, NEW, REPAID, LIQUIDATED } /** * @notice This struct contains data related to a loan * * @param smartNftId - The id of both the promissory note and obligation receipt. * @param status - The status in which the loan currently is. * @param loanContract - Address of the LoanType contract that created the loan. */ struct Loan { address loanContract; uint64 smartNftId; StatusType status; } function registerLoan(address _lender, bytes32 _loanType) external returns (uint32); function resetSmartNfts(uint32 _loanId, address _borrower) external; function mintObligationReceipt(uint32 _loanId, address _borrower) external; function resolveLoan(uint32 _loanId, bool liquidated) external; function promissoryNoteToken() external view returns (address); function obligationReceiptToken() external view returns (address); function getLoanData(uint32 _loanId) external view returns (Loan memory); function isValidLoanId(uint32 _loanId, address _loanContract) external view returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; /** * @title INftfiHub * @author NFTfi * @dev NftfiHub interface */ interface INftfiHub { function setContract(string calldata _contractKey, address _contractAddress) external; function getContract(bytes32 _contractKey) external view returns (address); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; interface IPermittedERC20s { function getERC20Permit(address _erc20) external view returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; interface IPermittedPartners { function getPartnerPermit(address _partner) external view returns (uint16); }
// SPDX-License-Identifier: BUSL-1.1 import "./LoanData.sol"; pragma solidity 0.8.19; interface IDirectLoanBase { function maximumLoanDuration() external view returns (uint256); function adminFeeInBasisPoints() external view returns (uint16); // solhint-disable-next-line func-name-mixedcase function LOAN_COORDINATOR() external view returns (bytes32); function loanIdToLoan(uint32) external view returns ( uint256, uint256, uint256, address, uint32, uint16, uint16, address, uint64, address, address ); function loanRepaidOrLiquidated(uint32) external view returns (bool); function getWhetherNonceHasBeenUsedForUser(address _user, uint256 _nonce) external view returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; /** * @title LoanData * @author NFTfi * @notice An interface containg the main Loan struct shared by Direct Loans types. */ interface LoanData { /* ********** */ /* DATA TYPES */ /* ********** */ /** * @notice The main Loan Terms struct. This data is saved upon loan creation. * * @param loanERC20Denomination - The address of the ERC20 contract of the currency being used as principal/interest * for this loan. * @param loanPrincipalAmount - The original sum of money transferred from lender to borrower at the beginning of * the loan, measured in loanERC20Denomination's smallest units. * @param maximumRepaymentAmount - The maximum amount of money that the borrower would be required to retrieve their * collateral, measured in the smallest units of the ERC20 currency used for the loan. The borrower will always have * to pay this amount to retrieve their collateral, regardless of whether they repay early. * @param nftCollateralContract - The address of the the NFT collateral contract. * @param nftCollateralWrapper - The NFTfi wrapper of the NFT collateral contract. * @param nftCollateralId - The ID within the NFTCollateralContract for the NFT being used as collateral for this * loan. The NFT is stored within this contract during the duration of the loan. * @param loanStartTime - The block.timestamp when the loan first began (measured in seconds). * @param loanDuration - The amount of time (measured in seconds) that can elapse before the lender can liquidate * the loan and seize the underlying collateral NFT. * @param loanInterestRateForDurationInBasisPoints - This is the interest rate (measured in basis points, e.g. * hundreths of a percent) for the loan, that must be repaid pro-rata by the borrower at the conclusion of the loan * or risk seizure of their nft collateral. Note if the type of the loan is fixed then this value is not used and * is irrelevant so it should be set to 0. * @param loanAdminFeeInBasisPoints - The percent (measured in basis points) of the interest earned that will be * taken as a fee by the contract admins when the loan is repaid. The fee is stored in the loan struct to prevent an * attack where the contract admins could adjust the fee right before a loan is repaid, and take all of the interest * earned. * @param borrower */ struct LoanTerms { uint256 loanPrincipalAmount; uint256 maximumRepaymentAmount; uint256 nftCollateralId; address loanERC20Denomination; uint32 loanDuration; uint16 loanInterestRateForDurationInBasisPoints; uint16 loanAdminFeeInBasisPoints; address nftCollateralWrapper; uint64 loanStartTime; address nftCollateralContract; address borrower; } /** * @notice Some extra Loan's settings struct. This data is saved upon loan creation. * We need this to avoid stack too deep errors. * * @param revenueSharePartner - The address of the partner that will receive the revenue share. * @param revenueShareInBasisPoints - The percent (measured in basis points) of the admin fee amount that will be * taken as a revenue share for a t * @param referralFeeInBasisPoints - The percent (measured in basis points) of the loan principal amount that will * be taken as a fee to pay to the referrer, 0 if the lender is not paying referral fee.he partner, at the moment * the loan is begun. */ struct LoanExtras { address revenueSharePartner; uint16 revenueShareInBasisPoints; uint16 referralFeeInBasisPoints; } /** * @notice The offer made by the lender. Used as parameter on both acceptOffer (initiated by the borrower) * * @param loanERC20Denomination - The address of the ERC20 contract of the currency being used as principal/interest * for this loan. * @param loanPrincipalAmount - The original sum of money transferred from lender to borrower at the beginning of * the loan, measured in loanERC20Denomination's smallest units. * @param maximumRepaymentAmount - The maximum amount of money that the borrower would be required to retrieve their * collateral, measured in the smallest units of the ERC20 currency used for the loan. The borrower will always * have to pay this amount to retrieve their collateral, regardless of whether they repay early. * @param nftCollateralContract - The address of the ERC721 contract of the NFT collateral. * @param nftCollateralId - The ID within the NFTCollateralContract for the NFT being used as collateral for this * loan. The NFT is stored within this contract during the duration of the loan. * @param referrer - The address of the referrer who found the lender matching the listing, Zero address to signal * this there is no referrer. * @param loanDuration - The amount of time (measured in seconds) that can elapse before the lender can liquidate * the loan and seize the underlying collateral NFT. * @param loanAdminFeeInBasisPoints - The percent (measured in basis points) of the interest earned that will be * taken as a fee by the contract admins when the loan is repaid. The fee is stored in the loan struct to prevent an * attack where the contract admins could adjust the fee right before a loan is repaid, and take all of the interest * earned. */ struct Offer { uint256 loanPrincipalAmount; uint256 maximumRepaymentAmount; uint256 nftCollateralId; address nftCollateralContract; uint32 loanDuration; uint16 loanAdminFeeInBasisPoints; address loanERC20Denomination; address referrer; } /** * @notice Signature related params. Used as parameter on both acceptOffer (containing borrower signature) * * @param signer - The address of the signer. The borrower for `acceptOffer` * @param nonce - The nonce referred here is not the same as an Ethereum account's nonce. * We are referring instead to a nonce that is used by the lender or the borrower when they are first signing * off-chain NFTfi orders. These nonce can be any uint256 value that the user has not previously used to sign an * off-chain order. Each nonce can be used at most once per user within NFTfi, regardless of whether they are the * lender or the borrower in that situation. This serves two purposes: * - First, it prevents replay attacks where an attacker would submit a user's off-chain order more than once. * - Second, it allows a user to cancel an off-chain order by calling NFTfi.cancelLoanCommitmentBeforeLoanHasBegun() * , which marks the nonce as used and prevents any future loan from using the user's off-chain order that contains * that nonce. * @param expiry - Date when the signature expires * @param signature - The ECDSA signature of the borrower or the lender, obtained off-chain ahead of time, signing * the following combination of parameters: * - Lender: * - Offer.loanERC20Denomination * - Offer.loanPrincipalAmount * - Offer.maximumRepaymentAmount * - Offer.nftCollateralContract * - Offer.nftCollateralId * - Offer.referrer * - Offer.loanDuration * - Offer.loanAdminFeeInBasisPoints * - Signature.signer, * - Signature.nonce, * - Signature.expiry, * - address of the loan type contract * - chainId */ struct Signature { uint256 nonce; uint256 expiry; address signer; bytes signature; } /** * inclusive min and max Id ranges for collection offers on collections, * like ArtBlocks, where multiple collections are defined on one contract differentiated by id-ranges */ struct CollectionIdRange { uint256 minId; uint256 maxId; } /** * @notice Some extra parameters that the borrower needs to set when accepting an offer. * * @param revenueSharePartner - The address of the partner that will receive the revenue share. * @param referralFeeInBasisPoints - The percent (measured in basis points) of the loan principal amount that will * be taken as a fee to pay to the referrer, 0 if the lender is not paying referral fee. */ struct BorrowerSettings { address revenueSharePartner; uint16 referralFeeInBasisPoints; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; /** * @title ContractKeys * @author NFTfi * @dev Common library for contract keys */ library ContractKeys { bytes32 public constant PERMITTED_ERC20S = bytes32("PERMITTED_ERC20S"); bytes32 public constant PERMITTED_NFTS = bytes32("PERMITTED_NFTS"); bytes32 public constant PERMITTED_PARTNERS = bytes32("PERMITTED_PARTNERS"); bytes32 public constant NFT_TYPE_REGISTRY = bytes32("NFT_TYPE_REGISTRY"); bytes32 public constant LOAN_REGISTRY = bytes32("LOAN_REGISTRY"); bytes32 public constant PERMITTED_SNFT_RECEIVER = bytes32("PERMITTED_SNFT_RECEIVER"); /** * @notice Returns the bytes32 representation of a string * @param _key the string key * @return id bytes32 representation */ function getIdFromStringKey(string memory _key) external pure returns (bytes32 id) { require(bytes(_key).length <= 32, "invalid key"); // solhint-disable-next-line no-inline-assembly assembly { id := mload(add(_key, 32)) } } }
{ "metadata": { "bytecodeHash": "none", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 100 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint32","name":"_loanId","type":"uint32"},{"internalType":"contract INftfiHub","name":"_hub","type":"INftfiHub"}],"name":"checkLoanIdValidity","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_interestDue","type":"uint256"},{"internalType":"uint256","name":"_adminFeeInBasisPoints","type":"uint256"}],"name":"computeAdminFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_loanPrincipalAmount","type":"uint256"},{"internalType":"uint256","name":"_referralFeeInBasisPoints","type":"uint256"},{"internalType":"address","name":"_referrer","type":"address"}],"name":"computeReferralFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_adminFee","type":"uint256"},{"internalType":"uint256","name":"_revenueShareInBasisPoints","type":"uint256"}],"name":"computeRevenueShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_revenueSharePartner","type":"address"},{"internalType":"contract INftfiHub","name":"_hub","type":"INftfiHub"}],"name":"getRevenueSharePercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_loanId","type":"uint32"},{"internalType":"contract INftfiHub","name":"_hub","type":"INftfiHub"}],"name":"payBackChecks","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"loanPrincipalAmount","type":"uint256"},{"internalType":"uint256","name":"maximumRepaymentAmount","type":"uint256"},{"internalType":"uint256","name":"nftCollateralId","type":"uint256"},{"internalType":"address","name":"loanERC20Denomination","type":"address"},{"internalType":"uint32","name":"loanDuration","type":"uint32"},{"internalType":"uint16","name":"loanInterestRateForDurationInBasisPoints","type":"uint16"},{"internalType":"uint16","name":"loanAdminFeeInBasisPoints","type":"uint16"},{"internalType":"address","name":"nftCollateralWrapper","type":"address"},{"internalType":"uint64","name":"loanStartTime","type":"uint64"},{"internalType":"address","name":"nftCollateralContract","type":"address"},{"internalType":"address","name":"borrower","type":"address"}],"internalType":"struct LoanData.LoanTerms","name":"_loan","type":"tuple"},{"internalType":"uint32","name":"_loanId","type":"uint32"},{"internalType":"uint32","name":"_newLoanDuration","type":"uint32"},{"internalType":"uint256","name":"_newMaximumRepaymentAmount","type":"uint256"},{"internalType":"uint256","name":"_lenderNonce","type":"uint256"},{"internalType":"contract INftfiHub","name":"_hub","type":"INftfiHub"}],"name":"renegotiationChecks","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
61111261003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100775760003560e01c80632ad659af1461007c5780636c9a1576146100a25780637b2392f1146100b75780637f5e0ed31461007c5780638fc665be146100ca578063b5ec5263146100f0578063b7fa1f6214610123575b600080fd5b61008f61008a366004610c15565b610136565b6040519081526020015b60405180910390f35b6100b56100b0366004610c7c565b610158565b005b61008f6100c5366004610cb5565b6102c8565b6100dd6100d8366004610cee565b61030c565b60405161ffff9091168152602001610099565b6101036100fe366004610d80565b610418565b604080516001600160a01b03938416815292909116602083015201610099565b6100b5610131366004610c7c565b610a8e565b60006127106101458385610eb9565b61014f9190610ed0565b90505b92915050565b6101628282610a8e565b60405163038bf9d560e11b815263ffffffff831660048201523090630717f3aa90602401602060405180830381865afa1580156101a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c79190610ef2565b156101ed5760405162461bcd60e51b81526004016101e490610f14565b60405180910390fd5b60405163044f9b4360e31b815263ffffffff831660048201526000908190309063227cda189060240161016060405180830381865afa158015610234573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102589190610f4b565b505098505050509550505050508163ffffffff168167ffffffffffffffff16610281919061101b565b4211156102c25760405162461bcd60e51b815260206004820152600f60248201526e131bd85b881a5cc8195e1c1a5c9959608a1b60448201526064016101e4565b50505050565b60008215806102de57506001600160a01b038216155b156102eb57506000610305565b6127106102f88486610eb9565b6103029190610ed0565b90505b9392505050565b60006001600160a01b03831661032457506000610152565b604051631c2d8fb360e31b8152715045524d49545445445f504152544e45525360701b60048201526000906001600160a01b0384169063e16c7d9890602401602060405180830381865afa158015610380573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a4919061102e565b60405163410ed2e560e01b81526001600160a01b038681166004830152919091169063410ed2e590602401602060405180830381865afa1580156103ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610410919061104b565b949350505050565b6000806104258784610a8e565b6000836001600160a01b031663e16c7d98306001600160a01b03166377cfa9916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610474573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104989190611068565b6040518263ffffffff1660e01b81526004016104b691815260200190565b602060405180830381865afa1580156104d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f7919061102e565b60405163e6c5a54160e01b815263ffffffff8a1660048201529091506000906001600160a01b0383169063e6c5a54190602401606060405180830381865afa158015610547573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056b9190611081565b6020015167ffffffffffffffff1690506000806001600160a01b03168b61014001516001600160a01b0316146105a757506101408a015161067a565b826001600160a01b0316638208e76c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610609919061102e565b6001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161063691815260200190565b602060405180830381865afa158015610653573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610677919061102e565b90505b336001600160a01b038216146106d25760405162461bcd60e51b815260206004820152601a60248201527f4f6e6c7920626f72726f7765722063616e20696e69746961746500000000000060448201526064016101e4565b8863ffffffff168b610100015167ffffffffffffffff166106f3919061101b565b4211156107425760405162461bcd60e51b815260206004820152601c60248201527f4e6577206475726174696f6e20616c726561647920657870697265640000000060448201526064016101e4565b306001600160a01b031663192b355d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a49190611068565b8963ffffffff16111561080c5760405162461bcd60e51b815260206004820152602a60248201527f4e6577206475726174696f6e2065786365656473206d6178696d756d206c6f616044820152693710323ab930ba34b7b760b11b60648201526084016101e4565b60405163038bf9d560e11b815263ffffffff8b1660048201523090630717f3aa90602401602060405180830381865afa15801561084d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108719190610ef2565b1561088e5760405162461bcd60e51b81526004016101e490610f14565b8a518810156108f55760405162461bcd60e51b815260206004820152602d60248201527f4e6567617469766520696e7465726573742072617465206c6f616e732061726560448201526c103737ba1030b63637bbb2b21760991b60648201526084016101e4565b6000836001600160a01b0316634fbe68a06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610935573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610959919061102e565b6001600160a01b0316636352211e846040518263ffffffff1660e01b815260040161098691815260200190565b602060405180830381865afa1580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c7919061102e565b604051630328404b60e41b81526001600160a01b0382166004820152602481018a9052909150309063328404b090604401602060405180830381865afa158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190610ef2565b15610a7d5760405162461bcd60e51b815260206004820152601460248201527313195b99195c881b9bdb98d9481a5b9d985b1a5960621b60448201526064016101e4565b909b909a5098505050505050505050565b806001600160a01b031663e16c7d98306001600160a01b03166377cfa9916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610adb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aff9190611068565b6040518263ffffffff1660e01b8152600401610b1d91815260200190565b602060405180830381865afa158015610b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5e919061102e565b6040516352a067e560e01b815263ffffffff841660048201523060248201526001600160a01b0391909116906352a067e590604401602060405180830381865afa158015610bb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd49190610ef2565b610c115760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a59081b1bd85b925960921b60448201526064016101e4565b5050565b60008060408385031215610c2857600080fd5b50508035926020909101359150565b63ffffffff81168114610c4957600080fd5b50565b8035610c5781610c37565b919050565b6001600160a01b0381168114610c4957600080fd5b8035610c5781610c5c565b60008060408385031215610c8f57600080fd5b8235610c9a81610c37565b91506020830135610caa81610c5c565b809150509250929050565b600080600060608486031215610cca57600080fd5b83359250602084013591506040840135610ce381610c5c565b809150509250925092565b60008060408385031215610d0157600080fd5b8235610c9a81610c5c565b604051610160810167ffffffffffffffff81118282101715610d3e57634e487b7160e01b600052604160045260246000fd5b60405290565b61ffff81168114610c4957600080fd5b8035610c5781610d44565b67ffffffffffffffff81168114610c4957600080fd5b8035610c5781610d5f565b600080600080600080868803610200811215610d9b57600080fd5b61016080821215610dab57600080fd5b610db3610d0c565b9150883582526020890135602083015260408901356040830152610dd960608a01610c71565b6060830152610dea60808a01610c4c565b6080830152610dfb60a08a01610d54565b60a0830152610e0c60c08a01610d54565b60c0830152610e1d60e08a01610c71565b60e0830152610100610e30818b01610d75565b90830152610120610e428a8201610c71565b90830152610140610e548a8201610c71565b8184015250819750610e67818a01610c4c565b96505050610e786101808801610c4c565b93506101a087013592506101c08701359150610e976101e08801610c71565b90509295509295509295565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761015257610152610ea3565b600082610eed57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215610f0457600080fd5b8151801515811461030557600080fd5b6020808252601e908201527f4c6f616e20616c7265616479207265706169642f6c6971756964617465640000604082015260600190565b60008060008060008060008060008060006101608c8e031215610f6d57600080fd5b8b519a5060208c0151995060408c0151985060608c0151610f8d81610c5c565b60808d0151909850610f9e81610c37565b60a08d0151909750610faf81610d44565b60c08d0151909650610fc081610d44565b60e08d0151909550610fd181610c5c565b6101008d0151909450610fe381610d5f565b6101208d0151909350610ff581610c5c565b6101408d015190925061100781610c5c565b809150509295989b509295989b9093969950565b8082018082111561015257610152610ea3565b60006020828403121561104057600080fd5b815161030581610c5c565b60006020828403121561105d57600080fd5b815161030581610d44565b60006020828403121561107a57600080fd5b5051919050565b60006060828403121561109357600080fd5b6040516060810181811067ffffffffffffffff821117156110c457634e487b7160e01b600052604160045260246000fd5b60405282516110d281610c5c565b815260208301516110e281610d5f565b60208201526040830151600481106110f957600080fd5b6040820152939250505056fea164736f6c6343000813000a
Deployed Bytecode
0x73c955962611226cd2ae467a097aec900e4b72229430146080604052600436106100775760003560e01c80632ad659af1461007c5780636c9a1576146100a25780637b2392f1146100b75780637f5e0ed31461007c5780638fc665be146100ca578063b5ec5263146100f0578063b7fa1f6214610123575b600080fd5b61008f61008a366004610c15565b610136565b6040519081526020015b60405180910390f35b6100b56100b0366004610c7c565b610158565b005b61008f6100c5366004610cb5565b6102c8565b6100dd6100d8366004610cee565b61030c565b60405161ffff9091168152602001610099565b6101036100fe366004610d80565b610418565b604080516001600160a01b03938416815292909116602083015201610099565b6100b5610131366004610c7c565b610a8e565b60006127106101458385610eb9565b61014f9190610ed0565b90505b92915050565b6101628282610a8e565b60405163038bf9d560e11b815263ffffffff831660048201523090630717f3aa90602401602060405180830381865afa1580156101a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c79190610ef2565b156101ed5760405162461bcd60e51b81526004016101e490610f14565b60405180910390fd5b60405163044f9b4360e31b815263ffffffff831660048201526000908190309063227cda189060240161016060405180830381865afa158015610234573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102589190610f4b565b505098505050509550505050508163ffffffff168167ffffffffffffffff16610281919061101b565b4211156102c25760405162461bcd60e51b815260206004820152600f60248201526e131bd85b881a5cc8195e1c1a5c9959608a1b60448201526064016101e4565b50505050565b60008215806102de57506001600160a01b038216155b156102eb57506000610305565b6127106102f88486610eb9565b6103029190610ed0565b90505b9392505050565b60006001600160a01b03831661032457506000610152565b604051631c2d8fb360e31b8152715045524d49545445445f504152544e45525360701b60048201526000906001600160a01b0384169063e16c7d9890602401602060405180830381865afa158015610380573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a4919061102e565b60405163410ed2e560e01b81526001600160a01b038681166004830152919091169063410ed2e590602401602060405180830381865afa1580156103ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610410919061104b565b949350505050565b6000806104258784610a8e565b6000836001600160a01b031663e16c7d98306001600160a01b03166377cfa9916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610474573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104989190611068565b6040518263ffffffff1660e01b81526004016104b691815260200190565b602060405180830381865afa1580156104d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f7919061102e565b60405163e6c5a54160e01b815263ffffffff8a1660048201529091506000906001600160a01b0383169063e6c5a54190602401606060405180830381865afa158015610547573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056b9190611081565b6020015167ffffffffffffffff1690506000806001600160a01b03168b61014001516001600160a01b0316146105a757506101408a015161067a565b826001600160a01b0316638208e76c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610609919061102e565b6001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161063691815260200190565b602060405180830381865afa158015610653573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610677919061102e565b90505b336001600160a01b038216146106d25760405162461bcd60e51b815260206004820152601a60248201527f4f6e6c7920626f72726f7765722063616e20696e69746961746500000000000060448201526064016101e4565b8863ffffffff168b610100015167ffffffffffffffff166106f3919061101b565b4211156107425760405162461bcd60e51b815260206004820152601c60248201527f4e6577206475726174696f6e20616c726561647920657870697265640000000060448201526064016101e4565b306001600160a01b031663192b355d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a49190611068565b8963ffffffff16111561080c5760405162461bcd60e51b815260206004820152602a60248201527f4e6577206475726174696f6e2065786365656473206d6178696d756d206c6f616044820152693710323ab930ba34b7b760b11b60648201526084016101e4565b60405163038bf9d560e11b815263ffffffff8b1660048201523090630717f3aa90602401602060405180830381865afa15801561084d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108719190610ef2565b1561088e5760405162461bcd60e51b81526004016101e490610f14565b8a518810156108f55760405162461bcd60e51b815260206004820152602d60248201527f4e6567617469766520696e7465726573742072617465206c6f616e732061726560448201526c103737ba1030b63637bbb2b21760991b60648201526084016101e4565b6000836001600160a01b0316634fbe68a06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610935573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610959919061102e565b6001600160a01b0316636352211e846040518263ffffffff1660e01b815260040161098691815260200190565b602060405180830381865afa1580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c7919061102e565b604051630328404b60e41b81526001600160a01b0382166004820152602481018a9052909150309063328404b090604401602060405180830381865afa158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190610ef2565b15610a7d5760405162461bcd60e51b815260206004820152601460248201527313195b99195c881b9bdb98d9481a5b9d985b1a5960621b60448201526064016101e4565b909b909a5098505050505050505050565b806001600160a01b031663e16c7d98306001600160a01b03166377cfa9916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610adb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aff9190611068565b6040518263ffffffff1660e01b8152600401610b1d91815260200190565b602060405180830381865afa158015610b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5e919061102e565b6040516352a067e560e01b815263ffffffff841660048201523060248201526001600160a01b0391909116906352a067e590604401602060405180830381865afa158015610bb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd49190610ef2565b610c115760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a59081b1bd85b925960921b60448201526064016101e4565b5050565b60008060408385031215610c2857600080fd5b50508035926020909101359150565b63ffffffff81168114610c4957600080fd5b50565b8035610c5781610c37565b919050565b6001600160a01b0381168114610c4957600080fd5b8035610c5781610c5c565b60008060408385031215610c8f57600080fd5b8235610c9a81610c37565b91506020830135610caa81610c5c565b809150509250929050565b600080600060608486031215610cca57600080fd5b83359250602084013591506040840135610ce381610c5c565b809150509250925092565b60008060408385031215610d0157600080fd5b8235610c9a81610c5c565b604051610160810167ffffffffffffffff81118282101715610d3e57634e487b7160e01b600052604160045260246000fd5b60405290565b61ffff81168114610c4957600080fd5b8035610c5781610d44565b67ffffffffffffffff81168114610c4957600080fd5b8035610c5781610d5f565b600080600080600080868803610200811215610d9b57600080fd5b61016080821215610dab57600080fd5b610db3610d0c565b9150883582526020890135602083015260408901356040830152610dd960608a01610c71565b6060830152610dea60808a01610c4c565b6080830152610dfb60a08a01610d54565b60a0830152610e0c60c08a01610d54565b60c0830152610e1d60e08a01610c71565b60e0830152610100610e30818b01610d75565b90830152610120610e428a8201610c71565b90830152610140610e548a8201610c71565b8184015250819750610e67818a01610c4c565b96505050610e786101808801610c4c565b93506101a087013592506101c08701359150610e976101e08801610c71565b90509295509295509295565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761015257610152610ea3565b600082610eed57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215610f0457600080fd5b8151801515811461030557600080fd5b6020808252601e908201527f4c6f616e20616c7265616479207265706169642f6c6971756964617465640000604082015260600190565b60008060008060008060008060008060006101608c8e031215610f6d57600080fd5b8b519a5060208c0151995060408c0151985060608c0151610f8d81610c5c565b60808d0151909850610f9e81610c37565b60a08d0151909750610faf81610d44565b60c08d0151909650610fc081610d44565b60e08d0151909550610fd181610c5c565b6101008d0151909450610fe381610d5f565b6101208d0151909350610ff581610c5c565b6101408d015190925061100781610c5c565b809150509295989b509295989b9093969950565b8082018082111561015257610152610ea3565b60006020828403121561104057600080fd5b815161030581610c5c565b60006020828403121561105d57600080fd5b815161030581610d44565b60006020828403121561107a57600080fd5b5051919050565b60006060828403121561109357600080fd5b6040516060810181811067ffffffffffffffff821117156110c457634e487b7160e01b600052604160045260246000fd5b60405282516110d281610c5c565b815260208301516110e281610d5f565b60208201526040830151600481106110f957600080fd5b6040820152939250505056fea164736f6c6343000813000a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.