Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am birdca on github.
  • I am birdca (https://keybase.io/birdca) on keybase.
  • I have a public key ASD597sm62032dboN2KnIOhyvK3trlRKc0J5Ma7tfvXDXQo

To claim this, I am signing this object:

@birdca
birdca / app.js
Created November 28, 2018 12:12
for workshop
App = {
web3Provider: null,
contracts: {},
init: async function() {
// Load pets.
$.getJSON('../pets.json', function(data) {
var petsRow = $('#petsRow');
var petTemplate = $('#petTemplate');
@birdca
birdca / 2_deploy_contracts.js
Created November 28, 2018 12:03
for workshop
var Adoption = artifacts.require("Adoption");
module.exports = function(deployer) {
deployer.deploy(Adoption);
};
@birdca
birdca / Adoption.sol
Created November 28, 2018 11:09
for workshop slide
pragma solidity ^0.4.24;
contract Adoption {
address[16] public adopters;
// Adopting a pet
function adopt(uint petId) public returns (uint) {
require(petId >= 0 && petId <= 15);
adopters[petId] = msg.sender;
/**********************************************************************************/
/* Problem: a410 "解方程" from TYVJ */
/* Language: C (552 Bytes) */
/* Result: AC(0ms, 328KB) judge by this@ZeroJudge */
/* Author: birdca at 2014-04-24 14:12:05 */
/**********************************************************************************/
#include <stdio.h>