Skip to main content

BaseToken

Functions

initialize

  function initialize(
) external

pause

  function pause(
) external

close

  function close(
) external

close

  function close(
) external

setPriceFeed

  function setPriceFeed(
) external

priceFeed is now priceFeedDispatcher, which dispatches either Chainlink or UniswapV3 price

cacheTwap

  function cacheTwap(
) external

getPriceFeed

  function getPriceFeed(
) external returns (address)

Get the price feed address

priceFeed is now priceFeedDispatcher, which dispatches either Chainlink or UniswapV3 price

Return Values:

NameTypeDescription
priceFeedaddressthe current price feed

isOpen

  function isOpen(
) external returns (bool)

isPaused

  function isPaused(
) external returns (bool)

isClosed

  function isClosed(
) external returns (bool)

getPausedTimestamp

  function getPausedTimestamp(
) external returns (uint256)

getPausedIndexPrice

  function getPausedIndexPrice(
) external returns (uint256)

getClosedPrice

  function getClosedPrice(
) external returns (uint256)

getIndexPrice

  function getIndexPrice(
uint256 interval
) public returns (uint256)

Returns the index price of the token.

we overwrite the index price in BaseToken depending on the status

 1. Open: the price is from the price feed
2. Paused or Closed: the price is twap when the token was paused

Parameters:

NameTypeDescription
intervaluint256The interval represents twap interval.

Return Values:

NameTypeDescription
indexPriceuint256Twap price with interval