gladiusio / gladius-hiring-challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gladius Coding Challenge

Welcome to the Gladius coding challenge. The challenge is pretty simple, create a dApp (Decentralized App) that submits your hiring information (encrypted against our public key) to the blockchain.

Overview

Blockchain development is relatively new, so we've created this challenge in a way that there are multiple levels of completion. We are looking for creativity and problem solving skills are more important than 100% completion.

This challenge asks that you write a server side application with a client facing blockchain interface, for instance Node.js with Express routing; an interface to input data to submit; and successfully submitting this data to our deployed contract. This can be done client sided where the user authorizes transactions through something like MetaMask.

Our contract has been deployed to the Ropsten Test Net. If you need the Application Contract address, email us at careers@gladius.io. We want to keep this secret to get an estimate of time to completion.

You will have approximately 2 days to complete and submit your application to the blockchain. We are not going to judge by time per se, e.g. a complete well-coded application that took 3 days is better than a rushed application that took a single day.

If anything comes up or you have questions, email us at careers@gladius.io.

Contract Structure

Our Contract: Applications.sol

Getters:

// Returns the PGP Public Key used to encrypt your submission data against
getPublicKey() -> String

// Returns the Unencrypted data payload with instructions on what to post in submitApplication()
getPublicData() -> String

// Same as getPublicData, but includes a secret key. This is encrypted against the Public Key below
getEncryptedData() -> String

// After successfully submitting your application, input your address here to view your submission
getApplication(Address applicant) -> String

Functions:

// Function to submit your application payload.
// Takes in a String.
// We are looking for a JSON payload from getPublicData() or getEncryptedData()
// Reminder, any unencrypted data is public for anyone on the Ropsten chain, encrypt before submitting here
submitApplication(String applicationData)

What We're Looking For

We will be judging submissions based on code quality, completeness, and time to completion within reason. The main qualities we look for are resourcefulness and the desire to learn / try new technology.

Levels of Completion and Tasks to Complete:

  • Level 1
    • Create a server side application to serve the webpage
    • This application or client is able to read getPublicData() from the Ropsten Network deployed contract, this is the specification of what should be sent later.
    • The client is able to show the above specification in the UI as a form.
  • Level 2
    • Same as above plus...
    • Submits the above form to the submitApplication(data) function in the contract
  • Level 3
    • Same as above plus...
    • Reads and decrypts the data specification from getEncryptedData() using your private key (at the bottom of this page)
    • Fill in the required fields in the UI.
    • Encrypt that data against the contract public key.
    • Submits this back to the contract through the submitApplication(data) function
  • Level 4
    • Same as above plus...
    • Adds some form of originality and creativity to the UI
    • Adds ease of use
    • Pulls in and displays extra data from the limited data given
    • Any other criteria that shows going above and beyond

Your final project should be uploaded to a GitHub repository publicly. This can be a different user name than your personal user name. If this is an issue, reach out to us and we can take submissions in a different manner.

General Steps

  • Build an dApp to read an Ethereum contract property
  • Decrypt or read the contract's data
    • The contract will contain two JSON payloads, one plain text and the other encrypted against the public key provided below
    • If encrypted, use the included private key to decrypt this message
    • The message will be a JSON specification with fields to include to submit to the contract
  • Create a way to submit the correct data requested by the property's data
    • Using a REST client, e.g. POSTman, Insomnia, or web form
    • Web UI
  • Submit the data encrypted against the contract's Public Key from getPublicKey()
  • Upload project to GitHub with this information in the README
    • Application Address or txHash of the transaction from submitting data in the submitApplication(data) method

If at any point something is unclear or information is not provided, reach out and we can help. We would rather spend some time helping someone over having them blocked for hours on end.

Good Luck!!

Resources

One of the most common wallet managers is MetaMask. Register and create a new account to get started. All of the transactions should take place on Ropsten Test Net. You will not need to put any real money into this. In MetaMask, switch to the Ropsten Test Net and hit the "Deposit" button. After, there is a button to access the faucet. This allows for free test ether deposits into your account. A direct link to the faucet is here.

For rapid development, we recommend using the web3 js framework to access the blockchain.

Truffle has a great tutorial to use Infura to connect to the Ropsten test network here

A great utility to check statuses, errors, and txHashes: etherscan

See the Application Contract ABI section of this gist for the Application Contract JSON Interface ABI.

To initialize the Contract in order to call methods, see the web3 docs.

A quick js example is below

let contract = new web3.eth.Contract(jsonInterface[, address][, options])

For encryption / decryption we are currently using Keybase's PGP library

Application Contract ABI

Use this in the web3.eth.Contract constructor

See Application-ABI.json for full JSON file.

Keys

Below are keys to use in your dApp, we've encrypted some data on the blockchain against the public key below:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: Keybase OpenPGP v1.0.0
Comment: https://keybase.io/crypto

xo0EWsZSvQEEAOSjrTJNTnJd/eg9dWTY3Mlo/0ZS/sniamQCeGtwqVGD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BBAC15JKl7Sc0O9WwcRe1tLe8sRul6O5pyGt0phSxZnWH
4iTCbSxjNvTPrPCxWr4a2yAajzxUojkvk9AfTiJ71Zr8WfCSHvYnBm5V3VVDnqh3
Rt5MnFk0S2G2CBgG78xXnQ4BfdXIJykJFEcWAxq9N/rxQDHfLsO91ejq0suY8E6O
AwARAQABwsCDBBgBCgAPBQJaxlK9BQkPCZwAAhsuAKgJEDiZEtmr5GtAnSAEGQEK
AAYFAlrGUr0ACgkQ3+HC5nwXrzZ2zQP/QJhBE/fwJysc8AY5RB9jB3/Pq8spipOZ
OML0DG9bklzhbYl/jK907ZMhpwYr8qXysh8nZBgnz6r+Lge7aIl3Y/RGLYNCwDoN
vyxy40EIN41zyN0nB06fP1tmJsPTHs7FCtuqXgKjFATz7AOHEnjSPoFx5DcReHEB
pZXbwDV8G/WUfgQA4opjbZ7SrbtHg07E8GZMtaiRjpME5ntsStSRbNVHYiPbPSjY
l3lYZ0mXVZqxRaWkfOwMp0t0xI4EuiUeHjRBvk6mEi1soAEwHfY1Qg2X2jvU+cAy
ZuVNo05CnxQyB5d7ylTbXrdqBu7/jrtyd9iZhNqS/Q2xG8UDLeDT4dXW8rU=
=63km
-----END PGP PUBLIC KEY BLOCK-----

And here is your private key, passphrase is password. Super secure :)

Please note, do not use this private key anywhere

-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: Keybase OpenPGP v1.0.0
Comment: https://keybase.io/crypto

xcFFBFrGUr0BBADko60yTU5yXf3oPXVk2NzJaP9GUv7J4mpkAnhrcKlRg/C0WkJS
un+szDe9YXLbQXiW2Xdx1DbRQK1NLQfJZMiiUEmoWvrllmMqn2bBf9xmmeiOFBU9
M8PyhDxL5d3T32ph9+BItyEL/jk4XxSRw7JYT/8MrAmgIm9dtUSRN905mQARAQAB
/gkDCA5X4Xgs1thBYB28qjkOkGnB1PajwpVbckK2nwVhVmmxqZnGxt6cdrkbjujm
Pel4x8ejsU98BGRy+A21Mi4UfDlIs7JvfkzFABadZxE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3CZ5Z0dzxHDkDri1
y90fDNcjmqy1i82EBvhaOPC5dOzNkJmWMzma0gk+OKbhZVswRHdl3lnNltxJEqcn
QzFDO/77/0mesmrGstFZoJMaBD1m0dzFqVz/FyEZYsB8LMiUUk+StlP4OP1SETVp
3qgpBQVSEAt9GF4HbOFtT7NZpzjqjLAq1dR+pME0RnsT8DZvkV1s9GdCTJWMfiVI
BkLGR8zFqgCuDJYS7FvyrrVRY4DopJMyPfzQdKFrP3ENVpfn7y2Xt1zxQ0OkX6FH
8IkSIlDJgA94JmFKoCW1TcBrWjQtA97A9UZMoXTPoDft6Ax1RP/5jZ7eyaGusIai
mGQy6wwhLYOCizWUTYzmJG9yxeVVy68AGkweUw71deCYJTDCwIMEGAEKAA8FAlrG
Ur0FCQ8JnAACGy4AqAkQOJkS2avka0CdIAQZAQoABgUCWsZSvQAKCRDf4cLmfBev
NnbNA/9AmEET9/AnKxzwBjlEH2MHf8+ryymKk5k4wvQMb1uSXOFtiX+Mr3TtkyGn
BivypfKyHydkGCfPqv4uB7toiXdj9EYtg0LAOg2/LHLjQQg3jXPI3ScHTp8/W2Ym
w9MezsUK26peAqMUBPPsA4cSeNI+gXHkNxF4cQGlldvANXwb9ZR+BADiimNtntKt
u0eDTsTwZky1qJGOkwTme2xK1JFs1UdiI9s9KNiXeVhnSZdVmrFFpaR87AynS3TE
jgS6JR4eNEG+TqYSLWygATAd9jVCDZfaO9T5wDJm5U2jTkKfFDIHl3vKVNtet2oG
7v+Ou3J32JmE2pL9DbEbxQMt4NPh1dbytQ==
=4GZS
-----END PGP PRIVATE KEY BLOCK-----

Please note, do not use this private key anywhere

About

License:The Unlicense