Submit a solution
The challenge is finished.

Challenge Overview

ConsenSys Diligence is committed to improving the Ethereum ecosystem by promoting technical excellence, security best practices, legal precautions, and ethical business practices. 
Currently we are working with specific high-impact projects as they prepare to deploy their contract systems. We encourage projects to launch when ready, rather than trying to time markets. Our criteria for readiness extends beyond a basic code review, to include requirements for specifications, test drivers, static analysis, and staged roll outs. 
This approach is informed by our experience working with clients like Gnosis, WeiFund, SingularDTV, uPort, and adChain. ConsenSys Diligence is also actively involved in writing and reviewing code deployed in production systems on private chains at some of the largest Fortune 500 companies in the world. 
Through this starter challenge, we hope to build developer talent around smart contract development, testing, and bug discovery to serve the betterment of the Ethereum development community. There will be additional challenges that test your growing capabilities and further opportunities to potentially join the ConsenSys Diligence team. 

The nature of this first challenge is rather simple, and is comprised of the following parts:
  1. Finish the bank.sol smart contract based on our prompt (provided below) and pass all the tests
  2. Identify bugs/exploits in the amazon.sol smart contract and then develop a test script for the contract to run (and prove that it is ready for ‘deployment’)
  3. Submit both smart contract bundles for review 

Bank.sol Smart Contract Prompt: Create a smart contract in the Simple Bank Problem Set’s contracts subfolder that emulates the simple functions of a bank. The smart contract should safely commit who has an account and how much they have in their account. In addition, users should be able to do the following: 
  • Enroll and create a bank account, in which they will start with 1000 tokens 
  • Deposit an amount into their account
  • Withdraw an amount into their account equal to or less than their current account balance 
  • Check their current balance 
Amazon.sol Smart Contract Instructions: Open the Amazon Problem Set and look in the contracts subfolder for the amazon.sol smart contract. Go through the smart contract and determine where the bugs are, and how they should be fixed. These bugs are both functional and potential exploit bugs. After fixing them, create a amazon test script (or smart contract) within the ‘test’ subfolder to test the following functionalities: 
  • Tests to see if the “addItem” function works
  • Tests to see if the “buyItem” function works
  • Tests to see if the “shipItem” function works
  • Tests to see if the “receiveItem” function works 
The “amazon.test.js” file has been created for you to develop this script, but you do not have to use it if you decided to create a test smart contract instead. Of course, you need to note that you will need to make necessary changes referencing the test file in the test subfolder if you do chose to create another test script/smart contract and delete the template file we provided. 

Scoring and Prizes

This is a fun, practice challenge. To make participation a little bit more fun, we'll randomly distribute five $100 prizes among competitors who submit correct Amazon.sol and Bank.sol contracts, and correctly identify at least 2/3 or issues with the provided Amazon.sol contract.

Final Submission Guidelines

Submit the list of found bugs, created smart contracts, and a brief verification video showing those contracts in action.


2018 Topcoder(R) Open

Review style

Final Review

Community Review Board


User Sign-Off

ID: 30065885