BaseToken
Functions
initialize
function initialize(
) externalpause
function pause(
) externalclose
function close(
) externalclose
function close(
) externalsetPriceFeed
function setPriceFeed(
) externalpriceFeed is now priceFeedDispatcher, which dispatches either Chainlink or UniswapV3 price
cacheTwap
function cacheTwap(
) externalgetPriceFeed
function getPriceFeed(
) external returns (address)Get the price feed address
priceFeed is now priceFeedDispatcher, which dispatches either Chainlink or UniswapV3 price
Return Values:
Name
Type
Description
priceFeed
address
the 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 pausedParameters:
Name
Type
Description
interval
uint256
The interval represents twap interval.
Return Values:
Name
Type
Description
indexPrice
uint256
Twap price with interval
Last updated
Was this helpful?