Ropsten Test QSP Network Instructions
Thanks for coming! We’re very glad you’re going to try out our proof-of-concept, smart contract security auditing node, on the Ropsten test network.
We have the instructions in three parts: first, you’ll give permission allowing our auditing node to withrdraw QSP tokens from your wallet to pay for one or more audits. Second, we’ll walk you through requesting an automated audit and triggering the actual payment associated with the audit. Finally, we’ll tell you where you can find and view your audit report.
Note: Due to the nature of blockchain transactions, you’ll want to avoid long delays between taking the steps below. Waiting too long between starting and finishing a section of the instructions could cause the process to time out. If that happens, simply return to the start and begin again.
Part 0: Get Ready..
Begin by navigating to the Contracts section of MyEtherWallet.
- Set your network to the Ropsten Test Network by opening the Network dropdown menu in the top-right corner and choose
- Check that your preferred method of accessing your wallet (e.g., MEW, MetaMask) is also set to Ropsten.
- Make sure your wallet holds enough of both Ropsten ETH and Ropsten QSP to cover your transactions. If needed, get Ropsten ETH from a Ropsten Faucet.
- Have a URI ready for each smart contract you wish to audit. This URI must not be a link to Etherscan, Etherchain, etc. It must be a web address which returns only plain Solidity source code, like this URI example. Do not enter a URL to a Github repo like this example. We need the URI to the raw code, directly. Note that our test network currently supports Solidity up to version 0.4.21, and that the version must be prefixed with the caret character (^).
Part 1: Authorize Quantstamp to collect your QSP as payment
- In the Contract Address field of MyEtherWallet, enter the Quantstamp Token Smart Contract Address:
- In a different browser window, open the Quantstamp Token Contract ABI and copy all the text on the page.
- Paste the ABI into the
ABI/JSON Interfacefield on the MyEtherWallet and then click the Access button.
- Below the Access button you will now see a field called
Read/Write Contractand a dropdown that says
Select a function.
- Select the
- Two new fields will appear:
_spenderis the entity to which you are giving permission to withdraw Ropsten QSP from your wallet later. Add the Quantstamp Audit Smart Contract address
_valueis the total amount of Ropsten QSP which you are giving permission to withdraw. If you want to do three audits and each audit costs 5000 QSP then you would set
_valueto 75 (as an example). You can keep running audits until the audit node has withdrawn the full amount of QSP you set here.
- Further down the page you’ll see a section labeled How would you like to access your wallet? Select your preferred method of accessing the wallet.
- Now a large blue button will appear labeled Write. Click it to open a modal labeled Warning! You are about to execute a function on contract.
- You will see a box within the modal labeled Amount to Send, In most cases you should leave this as 0. Leave it at zero!
- There is also a box labeled Gas Limit. Usually this number will be precalculated for you and in that case, you should leave the number in that box alone. If it’s not precalculated for you, however, put in a nice large number like 250,000.
- Click Generate the transaction and then Yes I am sure! Make transaction.
Complete this transaction using your preferred method of accessing the wallet. When your payment succeeds, you are ready to request a security audit.
Part 2: Request a security audit from Quantstamp
Return to MyEtherWallet and reload the page. (MyEtherWallet requires a refresh before beginning a new transaction.)
Enter the contract address for Quantstamp’s Audit Contract:
In the field for ABI/JSON Interface, enter the contents of the Quantstamp Audit Contract Use the option to Copy in favor of select-all, if available.
Enter Access and select the function
requestAuditin the Read/Write Contract section.
Enter the URI for the smart contract you wish to audit along with
25for the price. (This is the amount of QSP which the audit node will withdraw from your wallet because you granted it permission to do so in Part 1).
Re-connect MyEtherWallet to your preferred method for accessing your wallet by clicking Write. Once successful, click Write a second time to continue.
In the modal, enter
0.003into this field labeled Amount to Sent, In most cases you should leave this is as 0. Why? The audit node needs both Ropsten QSP to run the audit and a little bit of Ropsten ETH to pay miners to put the audit report onto the blockchain when it finishes.
There is also a box labeled Gas Limit. Usually this number will be precalculated for you and in that case, you should leave the number in that box alone. If it’s not precalculated for you, however, put in a nice large number like 500,000.
Generate and make the transaction as before.
Part 3: View your security report
In Etherscan, open your successful transaction to request an audit which you just created in Part 2.
On the Etherscan page, click the tab for Event Logs. You’ll see a section titled Transaction Receipt Event Logs, followed by one or more blocks of text that start with something like
[x] Address 0xc1.....where
[x]is some single-digit number. You need to find the block that starts with this address:
[x] Address 0x80c4cc0c2290bab5939d2c71184e415d9dcd2f9b
In that block, find the section labeled Data. That will be a column of several rows of numbers with a small dropdown at the start of each line. Find the first line in this section and change the dropdown to to Number. You should now see an integer in standard base-10 notation, like
Copy down the number. This is the
requestIDof your audit request, and you’ll use it to retrieve your audit report.
Open the Quantstamp Audit Contract on Etherscan.
Under Read Smart Contract, you can enter your
requestIDwhich you saved in Part 3, Step 4, into line 1:
isAuditFinished, click Query, and Etherscan will return
On line 5:
audits, enter your
requestIDand click Query. It may take several minutes to see the result of the audit.
reportURIinto a browser address bar to view the report as JSON.