Contract responsible for initializing AMM Pairs. Any Router that points to this factory will consider the pairs on this contract to be verified.
Name | Type | Description | Optional |
---|---|---|---|
pair_contract | ContractInstantiationInfo | Stored contract information used to initialize new instances of the Pair Contract | no |
amm_settings | AMMSettings | Settings used for the AMM Pairs regarding the lp_fee, the shade_dao_fee and the shade_dao_address. This is queried real-time on every trade directly on the factory address | no |
lp_token_contract | ContractInstantiationInfo | Stored contract information used to initialize new instances of the Pair Contract | |
prng_seed | Binary | This seed is passed to all the pair contracts instantiated from the factory | no |
api_key | String | Stores the API key that will be used for authentication | no |
authenticator | Contract | Set the default authenticator for all permits on the contracts | no |
admin_auth | Contract | Set the admin | no |
Sets the configuration of the Factory Contract
Name | Type | Description | Optional |
---|---|---|---|
pair_contract | ContractInstantiationInfo | If value is present, update the stored contract reference used to initialize new pair contracts | yes |
lp_token_contract | ContractInstantiationInfo | If value is present, update the stored contract reference used to initialize new lp tokens during pair contract intialization | yes |
amm_settings | AMMSettings | If value is present, update the amm settings in the system | yes |
api_key | String | Updates the API key that will be used for authentication | yes |
admin_auth | Contract | Set the admin | yes |
{
"complete_task": {
"status": "success"
}
}
Uses the factory to initialize a new AMM Pair Contract
Name | Type | Description | Optional |
---|---|---|---|
pair | TokenPair | TokenPair used for the initialized pair contract | no |
entropy | Binary | Entropy passed to the initialized pair contract | no |
staking_contract | StakingContractInit | The staking contract and its configuration | yes |
router_contract | Contract | This is used to optionally register the token | yes |
{
"complete_task": {
"status": "success"
}
}
Adds an existing AMM Pair Contract to the Factory
Name | Type | Description | Optional |
---|---|---|---|
amm_pair | Vec | Vector of AMM Pairs to register against the Factory | no |
{
"complete_task": {
"status": "success"
}
}
Gets the config of the factory contract
Name | Type | Description | Optional |
---|---|---|---|
{
"pair_contract": "ContractInstantiationInfo",
"amm_settings": "AMMSettings",
" lp_token_contract: lp_token_contract,
": "ContractInstantiationInfo",
"authenticator": "Option<Contract>",
"admin_auth": "Contract",
}
Gets the AMM Pair Address
Name | Type | Description | Optional |
---|---|---|---|
pair | TokenPair | Token Pair to look up in the registered pair in the factory | No |
{
"address": "String",
}
Lists the AMM Pair Contracts registered with the Factory
Name | Type | Description | Optional |
---|---|---|---|
pagination | Pagination | The start and limit | no |
{
"amm_pairs": "[array of AMMPair]",
}
Gets the current AMM Settings registered with the factory
Name | Type | Descriptiofn | Optional |
---|---|---|---|
api_key | String | The API key to check | no |
{
"authorized": "bool",
}
Callback used by factory initialized contract addresses to register against the factory.
Name | Type | Description | Optional |
---|---|---|---|
pair | TokenPair | Token Pair being registered | no |
Signature | Binary | The signature used to verify the callback | no |