StarportLib

Git Source

State Variables

_INVALID_SALT

uint256 internal constant _INVALID_SALT = 0x81e69d9b00000000000000000000000000000000000000000000000000000000;

Functions

calculateSimpleInterest

function calculateSimpleInterest(uint256 delta_t, uint256 amount, uint256 rate, uint256 decimals)
    public
    pure
    returns (uint256);

getId

function getId(Starport.Loan memory loan) internal pure returns (uint256 loanId);

validateSalt

function validateSalt(mapping(address => mapping(bytes32 => bool)) storage usedSalts, address validator, bytes32 salt)
    internal;

mergeSpentItemsToReceivedItems

Merges an array of SpentItems into ReceivedItems

function mergeSpentItemsToReceivedItems(
    SpentItem[] memory payment,
    address paymentRecipient,
    SpentItem[] memory carry,
    address carryRecipient
) internal pure returns (ReceivedItem[] memory consideration);

Parameters

NameTypeDescription
paymentSpentItem[]The SpentItem[] for payment
paymentRecipientaddressThe recipient address of the payment
carrySpentItem[]The SpentItem[] for carry
carryRecipientaddressThe recipient address of the carry

Returns

NameTypeDescription
considerationReceivedItem[]An array of ReceivedItems

removeZeroAmountItems

Removes ReceivedItems with zero amounts

function removeZeroAmountItems(ReceivedItem[] memory consideration)
    internal
    pure
    returns (ReceivedItem[] memory newConsideration);

Parameters

NameTypeDescription
considerationReceivedItem[]The ReceivedItem[] for payment

Returns

NameTypeDescription
newConsiderationReceivedItem[]An array of ReceivedItems with zero amounts removed

transferAdditionalTransfersCalldata

function transferAdditionalTransfersCalldata(AdditionalTransfer[] calldata transfers) internal;

transferAdditionalTransfers

function transferAdditionalTransfers(AdditionalTransfer[] memory transfers) internal;

transferSpentItems

function transferSpentItems(SpentItem[] memory transfers, address from, address to, bool safe) internal;

transferSpentItemsSelf

function transferSpentItemsSelf(SpentItem[] memory transfers, address to) internal;

_transferItem

function _transferItem(
    ItemType itemType,
    address token,
    uint256 identifier,
    uint256 amount,
    address from,
    address to,
    bool safe
) internal;

_transferItem

function _transferItem(ItemType itemType, address token, uint256 identifier, uint256 amount, address from, address to)
    internal;

Errors

InvalidSalt

error InvalidSalt();

InvalidItemAmount

error InvalidItemAmount();

NativeAssetsNotSupported

error NativeAssetsNotSupported();

InvalidItemTokenNoCode

error InvalidItemTokenNoCode();

InvalidItemIdentifier

error InvalidItemIdentifier();

InvalidItemType

error InvalidItemType();

InvalidTransferLength

error InvalidTransferLength();