Skip to content

Instantly share code, notes, and snippets.

View tina1998612's full-sized avatar
:octocat:
DigitalNomad

李婷婷 Lee Ting Ting tina1998612

:octocat:
DigitalNomad
View GitHub Profile
[
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}
const uint64_t MAX_ROOM_WAIT_TIME = 2 * 60 * 1000; // 2 mins
const uint8_t MAX_PLAYERS = 5;
enum game_status : uint8_t { INIT = 0, ONGOING = 1, TIMEOUT = 2 };
enum card_type : uint8_t {
EMPTY = 0, // Represents empty slot in hand
SPADE = 1,
HEART = 2,
DIAMOND = 3,
0x4f50e53ce7e1c362deee60f73c5e72210016c809
pragma solidity ^0.4.24;
//// All Modules ////
contract Math {
// Module #0
function plus(uint _n1, uint _n2) public pure returns (uint) { return _n1 + _n2; }
// Module #1
function minus(uint _n1, uint _n2) public pure returns (uint ans) { return _n1 - _n2; }
// Module #2
pragma solidity ^0.4.24;
contract Math {
uint public ans;
function add(uint a,uint b) public {
ans = a + b;
}
}
@tina1998612
tina1998612 / C.sol
Created July 12, 2018 04:27
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.24;
// @title MAR mode: Module-Agnostic Rendering Mode (Core)
// @author Jeff Hu
// @dev This smart contract is modularized via a module agnostic execution scheme
function functionSignatureFromAbi(abiArray) {
let functionSignatures = [];
for (i in abiArray) {
let abi = abiArray[i];
let functionSignature = abi.name + '(' + abi.inputs.map((input) => input.type + ' ' + input.name).join(', ') + ')';
functionSignatures.push(functionSignature);
// console.log(functionSignature);
}
return functionSignatures;
}
pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
// FILE: link2.h
// PROVIDES: A toolkit of ten template functions for manipulating linked lists.
// Each node of the list contains a piece of data and a pointer to the next
// node, as shown in this template struct:
//
// template <class Item> Item may be any of the C++ built-in types
// struct Node (int, char, etc.), or a class with a default
// { constructor, an assignment operator,
// Item data; and a test for equality (x == y).
// Node *link;
// FILE: table2.h
// TEMPLATE CLASS PROVIDED: Table<RecordType>
// This class is a container template class for a Table of records.
// The template parameter, RecordType, is the data type of the records in the
// Table. It may any type with a default constructor, a copy constructor,
// an assignment operator, and an integer member variable called key.
#ifndef TABLE1_H
#define TABLE1_H