Skip to content

Instantly share code, notes, and snippets.


Nick Shoup shoupn

View GitHub Profile
shoupn / compileDeployer.js
Created Jul 12, 2018
Web3 Solidity Contract Deployment Script
View compileDeployer.js
const solc = require("solc");
const fs = require("fs");
const Web3 = require('web3');
const password = "test";
//web3 provider. can also use ws if started node as websocket
var web3 = new Web3(
new Web3.providers.HttpProvider('http://localhost:8545'));
//Read solidity contract file
View mapping.sol
pragma solidity ^0.4.0;
contract MappyingContract{
mapping(uint => uint[])luckyNumbers;
mapping(address => uint [])addNumbers;
uint[] numbers;
constructor() public{
luckyNumbers[0] = [1,2,3,4];
luckyNumbers[1] = [1,2,3,5];

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


View GenericExamples.cs
//This is how you declare a class signature which uses a Generic Type
public class GenericList<Type>
public void Add(Type input)
//logic for adding to list..
View GenericMethod.cs
public T Add<T> (T num1, T num2)
dynamic a = num1;
dynamic b = num2;
return a + b;
View generics.cs
class GenericClass<T> where T
private T _genericField;
public T genericProperty { get; set; }
public GenericClass(T value)
_genericField = value;
View constraints.cs
class GenericClass<T> where T : class
private T _genericField;
public T genericProperty { get; set; }
public GenericClass(T value)
_genericField = value;
View OpenClosedPrincipleExample.cs
using System;
using System.Collections.Generic;
namespace OpenClosedPrincipleExample
class Program
static void Main(string[] args)
var customerMessages = new List<Message>
View EthChatter.sol
pragma solidity ^0.5.0;
contract EthChatter {
struct Message{
address sender;
bytes32 message;
bool encrypted;

Keybase proof

I hereby claim:

  • I am shoupn on github.
  • I am shoupnb ( on keybase.
  • I have a public key ASAiObVY54dctYeU9xb7N7dkdudB39A5yNsHHT0yfQjZ5Ao

To claim this, I am signing this object: