Deploying Contracts

In order to deploy this contract, you will first need to compile the source code. To do this, you will need to open the compiler tab and then select a compiler version from the drop down box. As you can see from the screenshot, we are using version 0.6.6.

When you click the compile button you should get a number of yellow cautions, but no warning messages. 

compile

Once you have successfully compiled the contract, you can begin to deploy the contracts.

To do this, you can click on the deploy and run transactions tab. There is a dropdown menu here called ‘contract’ which has all the different contracts within the source code. The important contract here is the LsLMSR contract which you can select.

deploy

You will notice when you select the LsLMSR that a text box appears. You can click the down arrow and it will expand to show you some more information. When deploying the LsLMSR contract, you are required to provide two addresses. The first address is for the conditional tokens contract, and the second address is for the token that you are using for the base currency.

We will be testing the contract locally first, so we will need to create our own copy of the conditional tokens contract. To do this, we need to select the conditional tokens contract from the drop down box. There will be a text field asking you for the gas limit. You need to set this to 7000000 otherwise you will get an error message.

error_msg

Once you have deployed the contract, you should see the following:

after_deploy

You can click on the clipboard to copy the address for this contract.

You will need to repeat the same process with the FakeDai contract. If you have done this successfully it should look like:

fake_dai

Please note that the addresses are determined randomly, so your addresses should look different to mine.

Now that you have the addresses for the conditional tokens contract and your ERC20 currency contract, you will be able to deploy your prediction market contract!

To do this, go back to the LsLMSR contract and then input the addresses into the textfield before you deploy. It should look something like this:

lsLMSR

Once you submit this transaction, you will have successfully deployed the necessary contracts! You can now move onto the next page to interact with the contracts.