Skip to main content

IAmmalgamFactory

Git Source

Inherits: IFactoryCallback, IBeaconCallback

Functions​

getPair​

Returns the pair address for two tokens.

function getPair(address tokenA, address tokenB) external view returns (address pair);

Parameters

NameTypeDescription
tokenAaddressThe first token.
tokenBaddressThe second token.

Returns

NameTypeDescription
pairaddressThe address of the pair for the two tokens.

allPairs​

Returns the pair address at a specific index.

function allPairs(
uint256 index
) external view returns (address pair);

Parameters

NameTypeDescription
indexuint256The index of the pair.

Returns

NameTypeDescription
pairaddressThe address of the pair at the given index.

allPairsLength​

Returns the total number of token pairs.

function allPairsLength() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The total number of token pairs.

createPair​

Creates a new pair for two tokens.

function createPair(address tokenA, address tokenB) external returns (address pair);

Parameters

NameTypeDescription
tokenAaddressThe first token.
tokenBaddressThe second token.

Returns

NameTypeDescription
pairaddressThe address of the new pair.

setFeeTo​

Changes the fee recipient address.

function setFeeTo(
address newFeeTo
) external;

Parameters

NameTypeDescription
newFeeToaddressThe new fee recipient address.

setFeeToSetter​

Changes the address that can change the fee recipient.

function setFeeToSetter(
address newFeeToSetter
) external;

Parameters

NameTypeDescription
newFeeToSetteraddressThe new fee setter address.

hookRegistry​

Returns the public immutable address of the hook registry contract.

function hookRegistry() external view returns (IHookRegistry);

Returns

NameTypeDescription
<none>IHookRegistryThe address of the hook registry.

Events​

PairCreated​

Emitted when a new pair is created.

event PairCreated(address indexed tokenX, address indexed tokenY, address pair, uint256 allPairsLength);

Parameters

NameTypeDescription
tokenXaddressThe first token in the pair.
tokenYaddressThe second token in the pair.
pairaddressThe address of the new pair.
allPairsLengthuint256The current total number of token pairs.

LendingTokensCreated​

Emitted when new lending tokens are created.

event LendingTokensCreated(
address indexed pair,
address depositL,
address depositX,
address depositY,
address borrowL,
address borrowX,
address borrowY
);

Parameters

NameTypeDescription
pairaddressThe address of the pair.
depositLaddressThe address of the DEPOSIT_L lending token.
depositXaddressThe address of the DEPOSIT_X lending token.
depositYaddressThe address of the DEPOSIT_Y lending token.
borrowLaddressThe address of the BORROW_L lending token.
borrowXaddressThe address of the BORROW_X lending token.
borrowYaddressThe address of the BORROW_Y lending token.