Skip to content

TokenQuote

TokenQuote

TokenQuoteInitParams

struct TokenQuoteInitParams {
  contract IACL acl;
  contract IMetahub metahub;
}

_TOKEN_QUOTE_TYPEHASH

bytes32 _TOKEN_QUOTE_TYPEHASH

Token quote hashed data signature.

onlyMetahub

modifier onlyMetahub()

Modifier to make sure the function is called by the Metahub.

initialize

function initialize(struct TokenQuote.TokenQuoteInitParams params) external

Contract initializer.

Name Type Description
params struct TokenQuote.TokenQuoteInitParams Initialization params.

useTokenQuote

function useTokenQuote(struct Rentings.Params rentingParams, struct Rentings.RentalFees baseTokenFees, bytes tokenQuote, bytes tokenQuoteSignature) external returns (struct Rentings.RentalFees, struct ITokenQuote.PaymentTokenData)

Using and verification of the price quote for universe-specific token in relation to base token.

Name Type Description
rentingParams struct Rentings.Params Renting params.
baseTokenFees struct Rentings.RentalFees Base fees in equivalent of base token.
tokenQuote bytes Encoded token quote.
tokenQuoteSignature bytes Token Quote ECDSA signature ABI encoded (v,r,s)(uint8, bytes32, bytes32).
Name Type Description
[0] struct Rentings.RentalFees
[1] struct ITokenQuote.PaymentTokenData

getTokenQuoteNonces

function getTokenQuoteNonces(address renter) external view returns (uint256)

Getting the nonce for token quote. This 'nonce' should be included in the signature of TokenQuote

Name Type Description
renter address Address of the renter.

DOMAIN_SEPARATOR

function DOMAIN_SEPARATOR() external view returns (bytes32)

Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.

getChainId

function getChainId() external view returns (uint256)

Getting the Chain ID

contractKey

function contractKey() external pure returns (bytes4)

Returns implemented contract key.

Name Type Description
[0] bytes4 Contract key;

supportsInterface

function supportsInterface(bytes4 interfaceId) public view returns (bool)

_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._

_useNonce

function _useNonce(address renter) internal returns (uint256 current)

_"Consume a nonce": return the current value and increment.

_Available since v4.1.__

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

_Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by {upgradeTo} and {upgradeToAndCall}.

Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.

```solidity function authorizeUpgrade(address) internal override onlyOwner {} ```

_acl

function _acl() internal view returns (contract IACL)

return the IACL address

_validateSigner

function _validateSigner(bytes32 tokenQuoteHash, bytes tokenQuoteSignature) internal view

_calculatePaymentFeesAndData

function _calculatePaymentFeesAndData(struct Rentings.RentalFees baseTokenFees, struct ITokenQuote.TokenQuote quote) internal view returns (struct Rentings.RentalFees paymentTokenFees, struct ITokenQuote.PaymentTokenData paymentTokenData)

_decodeQuote

function _decodeQuote(bytes encodedQuote) internal pure returns (struct ITokenQuote.TokenQuote quote)

_"Consume a nonce": return the current value and increment.

_Available since v4.1.__