jediswap_v2_factory
Deploys JediSwap V2 pools and manages ownership and control over protocol fees
Functions
create_pool
Creates a pool for the given two tokens and fee
token_a and token_b may be passed in either order: token0/token1 or token1/token0. tick_spacing is retrieved from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments are invalid.
Emits PoolCreated.
Parameters:
Name | Type | Description |
---|---|---|
| ContractAddress | One of the two tokens in the desired pool |
| ContractAddress | The other of the two tokens in the desired pool |
| u32 | The desired fee for the pool |
Return Values:
Type | Description |
---|---|
ContractAddress | The address of the newly created pool |
enable_fee_amount
Enables a fee amount with the given tick_spacing
Fee amounts may never be removed once enabled
Caller is the owner
Emits FeeAmountEnabled.
Parameters:
Name | Type | Description |
---|---|---|
| u32 | The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6) |
| u32 | The spacing between ticks to be enforced for all pools created with the given fee amount |
set_fee_protocol
Sets the denominator of the protocol's share of the fees
Caller is the owner
Emits SetFeeProtocol.
Parameters:
Name | Type | Description |
---|---|---|
| u8 | New protocol fee |
transfer_ownership
Transfers ownership of the contract to a new address
Caller it the owner
Emits OwnershipTransferred.
Parameters:
Name | Type | Description |
---|---|---|
new_owner | ContractAddress | The new owner of the contract |
renounce_ownership
Leaves the contract without the owner. It will not be possible to call the owner only functions anymore. It can only be called by the current owner.
Emits OwnershipTransferred.
Parameters:
Name | Type | Description |
---|---|---|
| u8 | New protocol fee |
Events
PoolCreated
Parameters:
Name | Type | Description |
---|---|---|
| ContractAddress | The first token of the pool by address sort order |
| ContractAddress | The second token of the pool by address sort order |
| u32 | The fee collected upon every swap in the pool, denominated in hundredths of a bip |
tick_spacing | u32 | The minimum number of ticks between initialized ticks |
pool | ContractAddress | The address of the created pool |
FeeAmountEnabled
Parameters:
Name | Type | Description |
---|---|---|
| u32 | The enabled fee, denominated in hundredths of a bip |
| u32 | The minimum number of ticks between initialized ticks for pools created with the given fee |
SetFeeProtocol
Parameters:
Name | Type | Description |
---|---|---|
| u8 | The previous value of the protocol fee |
new | u8 | The updated value of the protocol fee |
OwnershipTransferred
Parameters:
Name | Type | Description |
---|---|---|
| ContractAddress | The previous owner of the contract |
| ContractAddress | The new owner of the contract. Can be 0 while renouncing. |
ABI
Last updated