This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set up web server | |
const express = require('express'); | |
const helmet = require('helmet'); | |
const app = express(); | |
const port = process.env.PORT || 8801; | |
app.use(helmet()); | |
app.use(express.json()); | |
app.use(express.urlencoded({ extended: true })); | |
const express_enforces_ssl = require('express-enforces-ssl'); | |
// TODO: uncomment in production! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const helmet = require('helmet'); | |
const Web3 = require('web3'); | |
const contractAddress = undefined; // TODO | |
const abi = [{"constant":false,"inputs":[{"name":"prizeId","type":"uint256"},{"name":"geohash","type":"bytes10"},{"name":"_metadata","type":"string"}],"name":"placePrize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"prizeId","type":"uint256"},{"name":"geohash","type":"bytes10"}],"name":"claimPrize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"prizes","outputs":[{"name":"id","type":"uint256"},{"name":"owner","type":"address"},{"name":"geohash","type":"bytes10"},{"name":"metadata","type":"string"},{"name":"placedAt","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]; | |
const app = express(); | |
co |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Web3 = require('web3'); | |
var solc = require('solc'); | |
var fs = require('fs'); | |
var tx = require('ethereumjs-tx'); | |
const web3 = new Web3(new Web3.providers.HttpProvider("https://rinkeby.infura.io/")); | |
deployContract(); | |
// showABI(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
import "truffle/Assert.sol"; | |
import "../contracts/MyPrize.sol"; | |
contract TestMyPrize { | |
MyPrize mp = new MyPrize(); | |
function testMyPrize() public { | |
mp.placePrize(1, bytes10("abcdefghij"), "http://test.example.com/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
contract MyPrize { | |
struct Prize { | |
uint id; | |
address owner; // current owner | |
bytes10 geohash; // current unclaimed location | |
string metadata; // probably a URL pointing to the full metadata | |
uint placedAt; // block count when it was placed | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am rezendi on github. | |
* I am rezendi (https://keybase.io/rezendi) on keybase. | |
* I have a public key whose fingerprint is 7D2C 1F61 851F 96F9 F538 C410 0A33 9B57 C096 57CF | |
To claim this, I am signing this object: |