Skip to content

Instantly share code, notes, and snippets.

View lingqingmeng's full-sized avatar
😀
Hi

Ling Qing Meng lingqingmeng

😀
Hi
View GitHub Profile
@lingqingmeng
lingqingmeng / ShipmentContract.sol
Created May 14, 2018 15:52
ShipmentContract HOT-11 Branch
```
pragma solidity ^0.4.18;
/**
3500,12000,6,18504502,49504020,400
*/
/**
* @title Ownable
@lingqingmeng
lingqingmeng / ShipmentContractFactory.sol
Created May 30, 2018 21:57
Shipment Contract Factory Solidity File
pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
@lingqingmeng
lingqingmeng / BancorConverter.sol
Created June 8, 2018 13:34
Bancor Converter for Peg Token
pragma solidity ^0.4.18;
/*
Utilities & Common Modifiers
*/
contract Utils {
// verifies that an amount is greater than zero
@lingqingmeng
lingqingmeng / Extensions.sol
Created June 9, 2018 07:46
Extension for Bancor Converter
pragma solidity ^0.4.18;
/*
ERC20 Standard Token interface
*/
contract IERC20Token {
// these functions aren't abstract since the compiler emits automatically generated getter functions as external
function name() public view returns (string) {}
function symbol() public view returns (string) {}
function decimals() public view returns (uint8) {}
pragma solidity ^0.4.18;
/*
ERC20 Standard Token interface
*/
contract IERC20Token {
// these functions aren't abstract since the compiler emits automatically generated getter functions as external
function name() public view returns (string) {}
function symbol() public view returns (string) {}
function decimals() public view returns (uint8) {}
@lingqingmeng
lingqingmeng / soliditytips.md
Last active July 5, 2018 08:10
Solidity tips

How to do well in the Hackathon

Message lingqingmeng in Slack or on telegram https://t.me/lingqingmeng

Get code to work in pieces everything

  • Break down functionality in small modular chunks, this way you are able to know exactly where the bug arises. Verify the success case works (positive test)
  • Ask questions early and often. It takes 10x longer to google something than it takes to ask one of us the question in Slack and get the answer - or any other student can also answer.
  • Make sure your version is up to date. I would recommend 4.18 or 4.24 for Solidity.
@lingqingmeng
lingqingmeng / agenda09072018.md
Created September 7, 2018 23:28
All hands Agenda - Sep 7th 2018

All hands Agenda

Sep 7th 2018

Contents Materials will be shared via Zoom on video

  1. Go over core company values
  2. Go over summarized company timeline - deta
  3. Quick (5 min) discussion on our transition to delaware corporation structure
  4. Travel schedules for conference (google forms for everyone to fill out)
  5. Client updates
@lingqingmeng
lingqingmeng / keybase.md
Created October 27, 2018 06:03
Keybase Proof

Keybase proof

I hereby claim:

  • I am lingqingmeng on github.
  • I am decentralinc (https://keybase.io/decentralinc) on keybase.
  • I have a public key ASAincL5wyqwbFMOl3v957tQmkFU1DoJS62JwCjpZw7dfQo

To claim this, I am signing this object:

@lingqingmeng
lingqingmeng / NYC_BC_Handout.md
Created February 16, 2019 20:09
NYC Blockchain Center Materials

NYC BLOCKCHAIN CENTER WORKSHOP

Workshop files used for Blockchain Developer Seminar: Applied Rust for Protocol Development

We will send out finished projects after each tutorial. Code demonstration will be given live. If you prefer following along more than welcome to. We will release a video and a finalized codebase later this week.

Overview

To run this project, make sure we have the latest rustc version, which is the official compiler for Rust.

Keybase Cryptography

This is a construction for encrypting and signing a message, using a symmetric encryption key and a signing keypair, in a way that supports safe streaming decryption. We need this for chat attachments because we've chosen to use signing keys for authenticity in chat, and we don't want one participant to be able to modify another's attachment, even with an evil server's help. It's almost enough that we record the hash of the attachment along with the symmetric key used to encrypt it, but that by