AmmalgamFactory
Inherits: IAmmalgamFactory
State Variables
pairBeacon
IBeacon public immutable override pairBeacon;
hookRegistry
IHookRegistry public immutable hookRegistry;
feeTo
address public feeTo;
feeToSetter
address public feeToSetter;
saturationAndGeometricTWAPState
ISaturationAndGeometricTWAPState public immutable saturationAndGeometricTWAPState;
liquidityTokenFactory
ITokenFactory private immutable liquidityTokenFactory;
depositTokenFactory
ITokenFactory private immutable depositTokenFactory;
debtTokenFactory
ITokenFactory private immutable debtTokenFactory;
liquidityDebtTokenFactory
ITokenFactory private immutable liquidityDebtTokenFactory;
config
IFactoryCallback.TokenFactoryConfig private config;
getPair
mapping(address => mapping(address => address)) public getPair;
allPairs
address[] public allPairs;
Functions
onlyFeeToSetter
modifier onlyFeeToSetter();
constructor
constructor(
address _feeToSetter,
IBeacon _pairBeacon,
IHookRegistry _hookRegistry,
ISaturationAndGeometricTWAPState _saturationAndGeometricTWAPState,
ITokenFactory _liquidityTokenFactory,
ITokenFactory _depositTokenFactory,
ITokenFactory _borrowTokenFactory,
ITokenFactory _liquidityDebtTokenFactory
);
allPairsLength
function allPairsLength() external view returns (uint256);
createPair
function createPair(address tokenA, address tokenB) external returns (address pair);
getConfig
function getConfig() private view returns (IFactoryCallback.TokenFactoryConfig memory);
generateTokensWithinFactory
function generateTokensWithinFactory() external returns (IERC20, IERC20, IAmmalgamERC20[6] memory);
createAllTokens
function createAllTokens(
address pair,
address tokenX,
address tokenY
) private returns (IAmmalgamERC20[6] memory tokens);
setFeeTo
function setFeeTo(
address newFeeTo
) external onlyFeeToSetter;
setFeeToSetter
function setFeeToSetter(
address newFeeToSetter
) external onlyFeeToSetter;
createPairFromSalt
function createPairFromSalt(
bytes32 salt
) private returns (address pair);
createToken
function createToken(
address tokenFactory,
address asset,
ERC20BaseConfig memory _config
) private returns (IAmmalgamERC20);
Events
NewFeeTo
event NewFeeTo(address indexed feeTo);
NewFeeToSetter
event NewFeeToSetter(address indexed feeToSetter);
Errors
IdenticalAddresses
error IdenticalAddresses();
ZeroAddress
error ZeroAddress();
FeeToIsZeroAddress
error FeeToIsZeroAddress();
FeeToSetterIsZeroAddress
error FeeToSetterIsZeroAddress();
PairExists
error PairExists();
BytecodeLengthZero
error BytecodeLengthZero();
FailedOnDeploy
error FailedOnDeploy();
Forbidden
error Forbidden();
NewTokensFailed
error NewTokensFailed();
ERC20TokenFactoryFailed
error ERC20TokenFactoryFailed();