IButtonswapFactory
Inherits: IButtonswapFactoryErrors, IButtonswapFactoryEvents
Functions
feeTo
Returns the current address for feeTo
.
The owner of this address receives the protocol fee as it is collected over time.
function feeTo() external view returns (address _feeTo);
Returns
Name | Type | Description |
---|---|---|
_feeTo | address | The feeTo address |
feeToSetter
Returns the current address for feeToSetter
.
The owner of this address has the power to update both feeToSetter
and feeTo
.
function feeToSetter() external view returns (address _feeToSetter);
Returns
Name | Type | Description |
---|---|---|
_feeToSetter | address | The feeToSetter address |
tokenName
The name of the ERC20 liquidity token.
function tokenName() external view returns (string memory _tokenName);
Returns
Name | Type | Description |
---|---|---|
_tokenName | string | The tokenName |
tokenSymbol
The symbol of the ERC20 liquidity token.
function tokenSymbol() external view returns (string memory _tokenSymbol);
Returns
Name | Type | Description |
---|---|---|
_tokenSymbol | string | The tokenSymbol |
isCreationRestricted
Returns the current state of restricted creation. If true, then no new pairs, only feeToSetter can create new pairs
function isCreationRestricted() external view returns (bool _isCreationRestricted);
Returns
Name | Type | Description |
---|---|---|
_isCreationRestricted | bool | The isCreationRestricted state |
isCreationRestrictedSetter
Returns the current address for isCreationRestrictedSetter
.
The owner of this address has the power to update both isCreationRestrictedSetter
and isCreationRestricted
.
function isCreationRestrictedSetter() external view returns (address _isCreationRestrictedSetter);
Returns
Name | Type | Description |
---|---|---|
_isCreationRestrictedSetter | address | The isCreationRestrictedSetter address |
getPair
Get the (unique) Pair address created for the given combination of tokenA
and tokenB
.
If the Pair does not exist then zero address is returned.
function getPair(address tokenA, address tokenB) external view returns (address pair);
Parameters
Name | Type | Description |
---|---|---|
tokenA | address | The first unsorted token |
tokenB | address | The second unsorted token |
Returns
Name | Type | Description |
---|---|---|
pair | address | The address of the Pair instance |
allPairs
Get the Pair address at the given index
, ordered chronologically.
function allPairs(uint256 index) external view returns (address pair);
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The index to query |
Returns
Name | Type | Description |
---|---|---|
pair | address | The address of the Pair created at the given index |
allPairsLength
Get the current total number of Pairs created
function allPairsLength() external view returns (uint256 count);
Returns
Name | Type | Description |
---|---|---|
count | uint256 | The total number of Pairs created |
createPair
Creates a new {ButtonswapPair} instance for the given unsorted tokens tokenA
and tokenB
.
The tokens are sorted later, but can be provided to this method in either order.
function createPair(address tokenA, address tokenB) external returns (address pair);
Parameters
Name | Type | Description |
---|---|---|
tokenA | address | The first unsorted token address |
tokenB | address | The second unsorted token address |
Returns
Name | Type | Description |
---|---|---|
pair | address | The address of the new {ButtonswapPair} instance |
setFeeTo
Updates the address that receives the protocol fee.
This can only be called by the feeToSetter
address.
function setFeeTo(address _feeTo) external;
Parameters
Name | Type | Description |
---|---|---|
_feeTo | address | The new address |
setFeeToSetter
Updates the address that has the power to set the feeToSetter
and feeTo
addresses.
This can only be called by the feeToSetter
address.
function setFeeToSetter(address _feeToSetter) external;
Parameters
Name | Type | Description |
---|---|---|
_feeToSetter | address | The new address |
setIsCreationRestricted
Updates the state of restricted creation.
This can only be called by the feeToSetter
address.
function setIsCreationRestricted(bool _isCreationRestricted) external;
Parameters
Name | Type | Description |
---|---|---|
_isCreationRestricted | bool | The new state |
setIsCreationRestrictedSetter
Updates the address that has the power to set the isCreationRestrictedSetter
and isCreationRestricted
.
This can only be called by the isCreationRestrictedSetter
address.
function setIsCreationRestrictedSetter(address _isCreationRestrictedSetter) external;
Parameters
Name | Type | Description |
---|---|---|
_isCreationRestrictedSetter | address | The new address |
isPausedSetter
Returns the current address for isPausedSetter
.
The owner of this address has the power to update both isPausedSetter
and call setIsPaused
.
function isPausedSetter() external view returns (address _isPausedSetter);
Returns
Name | Type | Description |
---|---|---|
_isPausedSetter | address | The isPausedSetter address |
setIsPausedSetter
Updates the address that has the power to set the isPausedSetter
and call setIsPaused
.
This can only be called by the isPausedSetter
address.
function setIsPausedSetter(address _isPausedSetter) external;
Parameters
Name | Type | Description |
---|---|---|
_isPausedSetter | address | The new address |
setIsPaused
Updates the pause state of given Pairs.
This can only be called by the feeToSetter
address.
function setIsPaused(address[] calldata pairs, bool isPausedNew) external;
Parameters
Name | Type | Description |
---|---|---|
pairs | address[] | A list of addresses for the pairs that should be updated |
isPausedNew | bool | The new pause state |
paramSetter
Returns the current address for paramSetter
.
The owner of this address has the power to update paramSetter
, default parameters, and current parameters on existing pairs
function paramSetter() external view returns (address _paramSetter);
Returns
Name | Type | Description |
---|---|---|
_paramSetter | address | The paramSetter address |
setParamSetter
Updates the address that has the power to set the paramSetter
and update the default params.
This can only be called by the paramSetter
address.
function setParamSetter(address _paramSetter) external;
Parameters
Name | Type | Description |
---|---|---|
_paramSetter | address | The new address |
defaultMovingAverageWindow
Returns the default value of movingAverageWindow
used for new pairs.
function defaultMovingAverageWindow() external view returns (uint32 _defaultMovingAverageWindow);
Returns
Name | Type | Description |
---|---|---|
_defaultMovingAverageWindow | uint32 | The defaultMovingAverageWindow value |
defaultMaxVolatilityBps
Returns the default value of maxVolatilityBps
used for new pairs.
function defaultMaxVolatilityBps() external view returns (uint16 _defaultMaxVolatilityBps);
Returns
Name | Type | Description |
---|---|---|
_defaultMaxVolatilityBps | uint16 | The defaultMaxVolatilityBps value |
defaultMinTimelockDuration
Returns the default value of minTimelockDuration
used for new pairs.
function defaultMinTimelockDuration() external view returns (uint32 _defaultMinTimelockDuration);
Returns
Name | Type | Description |
---|---|---|
_defaultMinTimelockDuration | uint32 | The defaultMinTimelockDuration value |
defaultMaxTimelockDuration
Returns the default value of maxTimelockDuration
used for new pairs.
function defaultMaxTimelockDuration() external view returns (uint32 _defaultMaxTimelockDuration);
Returns
Name | Type | Description |
---|---|---|
_defaultMaxTimelockDuration | uint32 | The defaultMaxTimelockDuration value |
defaultMaxSwappableReservoirLimitBps
Returns the default value of maxSwappableReservoirLimitBps
used for new pairs.
function defaultMaxSwappableReservoirLimitBps() external view returns (uint16 _defaultMaxSwappableReservoirLimitBps);
Returns
Name | Type | Description |
---|---|---|
_defaultMaxSwappableReservoirLimitBps | uint16 | The defaultMaxSwappableReservoirLimitBps value |
defaultSwappableReservoirGrowthWindow
Returns the default value of swappableReservoirGrowthWindow
used for new pairs.
function defaultSwappableReservoirGrowthWindow()
external
view
returns (uint32 _defaultSwappableReservoirGrowthWindow);
Returns
Name | Type | Description |
---|---|---|
_defaultSwappableReservoirGrowthWindow | uint32 | The defaultSwappableReservoirGrowthWindow value |
setDefaultParameters
Updates the default parameters used for new pairs.
This can only be called by the paramSetter
address.
function setDefaultParameters(
uint32 newDefaultMovingAverageWindow,
uint16 newDefaultMaxVolatilityBps,
uint32 newDefaultMinTimelockDuration,
uint32 newDefaultMaxTimelockDuration,
uint16 newDefaultMaxSwappableReservoirLimitBps,
uint32 newDefaultSwappableReservoirGrowthWindow
) external;
Parameters
Name | Type | Description |
---|---|---|
newDefaultMovingAverageWindow | uint32 | The new defaultMovingAverageWindow |
newDefaultMaxVolatilityBps | uint16 | The new defaultMaxVolatilityBps |
newDefaultMinTimelockDuration | uint32 | The new defaultMinTimelockDuration |
newDefaultMaxTimelockDuration | uint32 | The new defaultMaxTimelockDuration |
newDefaultMaxSwappableReservoirLimitBps | uint16 | The new defaultMaxSwappableReservoirLimitBps |
newDefaultSwappableReservoirGrowthWindow | uint32 | The new defaultSwappableReservoirGrowthWindow |
setMovingAverageWindow
Updates the movingAverageWindow
value of given Pairs.
This can only be called by the paramSetter
address.
function setMovingAverageWindow(address[] calldata pairs, uint32 newMovingAverageWindow) external;
Parameters
Name | Type | Description |
---|---|---|
pairs | address[] | A list of addresses for the pairs that should be updated |
newMovingAverageWindow | uint32 | The new movingAverageWindow value |
setMaxVolatilityBps
Updates the maxVolatilityBps
value of given Pairs.
This can only be called by the paramSetter
address.
function setMaxVolatilityBps(address[] calldata pairs, uint16 newMaxVolatilityBps) external;
Parameters
Name | Type | Description |
---|---|---|
pairs | address[] | A list of addresses for the pairs that should be updated |
newMaxVolatilityBps | uint16 | The new maxVolatilityBps value |
setMinTimelockDuration
Updates the minTimelockDuration
value of given Pairs.
This can only be called by the paramSetter
address.
function setMinTimelockDuration(address[] calldata pairs, uint32 newMinTimelockDuration) external;
Parameters
Name | Type | Description |
---|---|---|
pairs | address[] | A list of addresses for the pairs that should be updated |
newMinTimelockDuration | uint32 | The new minTimelockDuration value |
setMaxTimelockDuration
Updates the maxTimelockDuration
value of given Pairs.
This can only be called by the paramSetter
address.
function setMaxTimelockDuration(address[] calldata pairs, uint32 newMaxTimelockDuration) external;
Parameters
Name | Type | Description |
---|---|---|
pairs | address[] | A list of addresses for the pairs that should be updated |
newMaxTimelockDuration | uint32 | The new maxTimelockDuration value |
setMaxSwappableReservoirLimitBps
Updates the maxSwappableReservoirLimitBps
value of given Pairs.
This can only be called by the paramSetter
address.
function setMaxSwappableReservoirLimitBps(address[] calldata pairs, uint16 newMaxSwappableReservoirLimitBps) external;
Parameters
Name | Type | Description |
---|---|---|
pairs | address[] | A list of addresses for the pairs that should be updated |
newMaxSwappableReservoirLimitBps | uint16 | The new maxSwappableReservoirLimitBps value |
setSwappableReservoirGrowthWindow
Updates the swappableReservoirGrowthWindow
value of given Pairs.
This can only be called by the paramSetter
address.
function setSwappableReservoirGrowthWindow(address[] calldata pairs, uint32 newSwappableReservoirGrowthWindow)
external;
Parameters
Name | Type | Description |
---|---|---|
pairs | address[] | A list of addresses for the pairs that should be updated |
newSwappableReservoirGrowthWindow | uint32 | The new swappableReservoirGrowthWindow value |
lastCreatedTokensAndParameters
Returns the last token pair created and the parameters used.
function lastCreatedTokensAndParameters()
external
returns (
address token0,
address token1,
uint32 movingAverageWindow,
uint16 maxVolatilityBps,
uint32 minTimelockDuration,
uint32 maxTimelockDuration,
uint16 maxSwappableReservoirLimitBps,
uint32 swappableReservoirGrowthWindow
);
Returns
Name | Type | Description |
---|---|---|
token0 | address | The first token address |
token1 | address | The second token address |
movingAverageWindow | uint32 | The moving average window |
maxVolatilityBps | uint16 | The max volatility bps |
minTimelockDuration | uint32 | The minimum time lock duration |
maxTimelockDuration | uint32 | The maximum time lock duration |
maxSwappableReservoirLimitBps | uint16 | The max swappable reservoir limit bps |
swappableReservoirGrowthWindow | uint32 | The swappable reservoir growth window |