System Information

This section covers the view functions for querying system-wide information and constants.

owner

Gets the contract owner address.

function owner() external view returns (address)

Returns

  • owner (address): The contract owner's address

Description

Returns the address of the contract owner who has administrative privileges.

Example

// Get contract owner
const owner = await papayaContract.owner();
console.log("Contract owner:", owner);

TOKEN

Gets the token address used by the contract.

function TOKEN() external view returns (contract IERC20)

Returns

  • token (address): The ERC20 token address

Description

Returns the address of the ERC20 token used by the Papaya protocol.

Example

TOKEN_PRICE_FEED

Gets the token price feed address.

Returns

  • priceFeed (address): The token price feed address

Description

Returns the address of the Chainlink price feed for the token.

Example

COIN_PRICE_FEED

Gets the native coin price feed address.

Returns

  • priceFeed (address): The native coin price feed address

Description

Returns the address of the Chainlink price feed for the native coin (ETH).

Example

MAX_PROTOCOL_FEE

Gets the maximum protocol fee.

Returns

  • maxFee (uint256): The maximum protocol fee

Description

Returns the maximum protocol fee that can be set.

Example

REFILL_DAYS

Gets the refill days constant.

Returns

  • refillDays (uint32): The refill days value

Description

Returns the number of days for refill operations.

Example

REFILL_GAS_COST

Gets the refill gas cost constant.

Returns

  • gasCost (uint32): The refill gas cost

Description

Returns the gas cost for refill operations.

Example

APPROX_LIQUIDATE_GAS

Gets the approximate gas cost for liquidation.

Returns

  • gasCost (uint256): The approximate liquidation gas cost

Description

Returns the approximate gas cost for liquidation operations.

Example

APPROX_SUBSCRIPTION_GAS

Gets the approximate gas cost for subscription operations.

Returns

  • gasCost (uint256): The approximate subscription gas cost

Description

Returns the approximate gas cost for subscription operations.

Example

SUBSCRIPTION_THRESHOLD

Gets the subscription threshold.

Returns

  • threshold (uint8): The subscription threshold

Description

Returns the threshold value for subscription operations.

Example

DECIMALS_SCALE

Gets the decimals scale constant.

Returns

  • scale (uint256): The decimals scale

Description

Returns the scale factor used for decimal calculations.

Example

FLOOR

Gets the floor value constant.

Returns

  • floor (uint256): The floor value

Description

Returns the floor value used in calculations.

Example

SIGNED_CALL_TYPEHASH

Gets the signed call typehash.

Returns

  • typehash (bytes32): The signed call typehash

Description

Returns the typehash used for EIP-712 signed calls.

Example

eip712Domain

Gets the EIP-712 domain information.

Returns

  • fields (bytes1): The domain fields

  • name (string): The domain name

  • version (string): The domain version

  • chainId (uint256): The chain ID

  • verifyingContract (address): The verifying contract address

  • salt (bytes32): The domain salt

  • extensions (uint256[]): The domain extensions

Description

Returns the EIP-712 domain information used for signature verification.

Example

Last updated