Inspiration

I like the idea of joining forces collectively to solve a problem, such as a code exercise or any other task that requires code to perform as planned.

What it does

It rewards code that successfully passes a test. Someone uploads a test along with some reward ETH. Someone submits a solutions and gets the reward.

In more detail: The funding body, say Charlie, uploads a testscript together with some ETH to the TestOracle smart contract (0xb110E6ae20D74E3555fD82497411a6A0dc96EfBF rinkeby). The sha256-version of the testscript is stored in the smart contract and the script itself is sent to a remote server. Charlie may also specify a required score, e.g. the fraction of tests have ought to be passed. People (Alice and Bob) can then submit their code, again a sha256-version to the smart contract and the script to the remote server. Hashing prevents tampering and facilitates double-checking. The server runs the script and exposes a restAPI to the chainlink oracle network (so far only one test oracle). After a few submissions or at any moment of choice Charlie may call the requestScore method on the smart contract. It requests the score value and compares it to the required score. At this point a submission_id has to be supplied to the request, say that of Bob. If the request returns a successful result the reward is released to Bob.

How we built it

hardhat and sweat. The smart contract is a modified version of the chainlink boilerplate api request contract. The remote server is a dockerized nodejs server running on an ec2-instance on AWS.

Challenges we ran into

lots. Lack of gas funds, lack of LINK funds, funded the wrong contracts with LINK. Casting uint to String was trick, and with hindsight I should replace the submission_ids with submission_hash to get around this problem. Lots of docker issues and AWS issues.

Accomplishments that we're proud of

Dockerization and spinning up servers here and there and getting familiar with mocha!

What we learned

Dockerization and spinning up servers here and there and getting familiar with mocha!

What's next for TestOracle

Frontend, Frontend, Frontend. Mainnet, Mainnet, Mainnet.

Participants

Leonhard Horstmeyer - leonhard.horstmeyer@googlemail.com

Share this project:

Updates