launch_exchange
An entrypoint that launches a new exchanges. Next types of exchanges are supported:
FA1.2/FA1.2;
FA1.2/FA2;
FA1.2/TEZ;
FA2/FA1.2;
FA2/FA2;
FA2/TEZ;
TEZ/FA1.2;
TEZ/FA2.
In case of TOK/TEZ exchange launch voting in appropriative Bucket contract is executed. Also all TEZ tokens is transferred to the same Bucket contract before voting.
In time of first exchange launch, this contract calls launch_callback entrypoint. This is done in order to vote on a Bucket contract that has just been deployed and cannot be accessed until the launch exchange transaction completes. Therefore, voting takes place in the next transaction, sent from launch_callback.
Call parameters
tokens_t
Field | Type | Description |
---|---|---|
token_a | token_t | FA1.2/FA2/TEZ token |
token_b | token_t | FA1.2/FA2/TEZ token |
launch_exchange_t
Field | Type | Description |
---|---|---|
pair | Tokens to launch exchange with | |
token_a_in | nat | Amount of token A for investment |
token_b_in | nat | Amount of token B for investment |
shares_receiver | address | Receiver of LP tokens |
candidate | key_hash | Baker for voting (is used only in case of TOK/TEZ exchanges launch). Ignored otherwise |
deadline | timestamp | The time until which the transaction remains valid and will not be rejected |
Usage
Note: you need to pass positive TEZ/mutez amount to the send() method in case of FA1.2/TEZ or FA2/TEZ exchanges launch (see example below).
Also don't forget to add the DexCore contract as the operator for your FA2 tokens or make an approve for spending of FA1.2 tokens in time of exchange launch.
Pass candidate: "tz1ZZZZZZZZZZZZZZZZZZZZZZZZZZZZNkiRg"
in case of launching TOK/TOK exchange
Errors
104
- wrong order of a tokens from parameters.105
- zero token A amount in.106
- zero token B amount in.107
- pair (pool) with the specifiedtoken_id
already listed.120
- wrong TEZ amount were passed to the transaction.136
- reentrancy.144
- action outdated (the time until which the transaction remained valid was passed).412
- non payable entrypoint (can't accept TEZ tokens during call of an entrypoint). Only in case of launching of TOK/TOK liquidity pools (pairs).
Last updated