Getting Set Up
Getting Started
Install Keplr
Add
pulsar-2
to KeplrCreate an account and send funds using the faucet
Add custom SNIP-20 tokens to Keplr
Install
secretcli
and connect it topulsar-2
Instantiate the
auction-factory
contractCreate auctions
Install Keplr
Check out this video to set up you Keplr wallet.
Keep your mnemonic at hand, you will need it later on in this guide.
Connect to pulsar-2
pulsar-2
In order to connect to the
pulsar-2
chain, go to https://connect.pulsar.griptapejs.com and click on the "pulsar-2" buttonThen a Keplr window will pop up, click on the "approve" button
Create an account and send funds using the faucet
Once you have Keplr installed and an account created, you con now send test tokens to your account. In order to send these tokens you will need to go the the faucet and paste your account address there. (There are reports that the faucet may be down, lets us know if you need test SCRT and we will send)
Add custom SNIP-20 tokens to your wallet
To see all the balances for the custom tokens we have provided you, do the following:
Open the Keplr extension
Click on the hamburger menu
Click on add token
Paste the contract address of the token you want to add and click the "Submit" button
(All the tokens, and their addresses, are listed in the Glossary)
Click the "approve" button
Check that your tokens was added
Install secretcli
and connect it to pulsar-2
secretcli
and connect it to pulsar-2
Go to the Releases Page of Secret Network Github and download the latest version:
Once you have downloaded the binary, save it into a known location for executables. For Linux and Mac users, open a terminal emulator, go to the directory you saved the binary and run the following command:
The next step is to rename the binary:
In order to finish the installation, let's add the binary to our PATH, so we can call it whenever we want. Here are some good resources that tells you how to add it to your path:
After the installation is complete and you are now able to execute the secretcli
from your terminal, is time to configure it. Run the following commands to connect it to the pulsar-2
chain:
Finally, let's add our account to the secretcli
command. To do that, you will need your mnemonic. Copy you mnemonic and go to a terminal and run the following command:
Where:
<a-name>
is the name you want you use for your key
You will be asked to paste your mnemonic, then do so.
Instantiate the auction-factory
contract
auction-factory
contractThe objective of the instantiation of the factory contract is to get the contract address that we are going to use to create auctions.
To instantiate the auction-factory
contract, run the following command:
Where:
<your-key>
is the key assigned to you account in thesecretcli
<your-label>
a unique identifier for your instantiated contract. Use whatever it makes sense for you.
The encoded JSON of the init message looks like this:
In this case, there's no need for you to edit the values of the JSON.
After you run the command, you will get a response like this:
Take the value of the txhash
property of the JSON and run the following command, replacing <my-txhash>
with the value copied before:
Finally, we have the contract address of the auction-factory
at $.output_logs[0].attributes[0].value
:
Create auctions
To create auctions you need to do a two step process.
First, you need to run the following transaction:
Where:
<sell-token-address>
an address of a SNIP-20 token that you want to sell. You can use any token in the Glossary.<your-key-name>
is the key assigned to you account in thesecretcli
Now, the second step is to create the auction itself. The encoded JSON looks like this:
Getting the code_hash
for your tokens is pretty simple:
Where:
<token-address>
the contract address of the token you want to get the hash of
And finally, to create a new auction, run the following command for as many tokens you want to:
Where:
<auction-factory-contract>
theauction-factory
contract address obtained in this step<your-key-name>
is the key assigned to you account in thesecretcli
Lastly you can test that everything is working by querying the auction-factory-contract asking for a list of active auctions
secretcli q compute query <auction-factory-contract> '{"list_active_auctions":{}}'
AND QUERY THE AUCTION DIRECTION WITH
secretcli q compute query <auction-contract> '{"auction_info":{}}'
Last updated