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:
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 paused
Parameters:
Name | Type | Description |
---|---|---|
interval | uint256 | The interval represents twap interval. |
Return Values:
Name | Type | Description |
---|---|---|
indexPrice | uint256 | Twap price with interval |