Skip to content

Instantly share code, notes, and snippets.

View jklepatch's full-sized avatar

Julien Klepatch jklepatch

View GitHub Profile
//Speed optimizations for Truffle deployment on public testnets / mainnet
/*
* Optimization 1: Don't use Truffle deploy system, as for each deployment we have an extra transaction
* for updating `Migrations.sol`
*/
//Before
await deployer.deploy(MyContract);
const myContract = await MyContract.deployed();

Easy:

  • syntax is like Javascript

Hard:

  • learning all the types
  • lack of Javascript-like arrays and objects
pragma solidity ^0.5.0;
contract Split {
struct Proposal {
uint id;
string description;
uint voteYes;
uint voteNo;
uint initialTotalBalance;
bool _sealed; //sealed is a reserved keyword
pragma solidity ^0.5.0;
contract Race {
struct Proposal {
uint id;
string description;
uint voteYes;
uint voteNo;
uint initialTotalBalance;
bool _sealed; //sealed is a reserved keyword
pragma solidity ^0.5.0;
contract DAO {
struct Proposal {
uint id;
string description;
uint voteYes;
uint voteNo;
uint initialTotalBalance;
bool _sealed; //sealed is a reserved keyword
pragma solidity ^0.5.0;
contract DAO {
struct Proposal {
uint id;
string description;
uint voteYes;
uint voteNo;
uint initialTotalBalance;
bool _sealed; //sealed is a reserved keyword
const flatten = array => array.reduce((a, b) => {
if(Array.isArray(b)) {
return a.concat(flatten(b))
} else {
return a.concat(b)
}}, []);
const inputArray = [[1,2,[3]],4]
const flattenedArray = flatten(inputArray)
@jklepatch
jklepatch / docker_cheatsheet.md
Last active October 18, 2017 08:09
Docker Cheatsheet

List all containers

Adding the flag -a will list all containers, running or not.

docker ps

Inspect container log

Adding the flag -f will make the log live

docker logs {name_of_container|id_of_container}
0x9359f2842dfB515c4Eb27A39955f0647875D58BC

Setup a development environment for merge mining of Superior Coin

Summary

  1. Setup Directories
  2. Start Monero daemons
  3. Start Superior coins daemons
  4. Generate Wallets
  5. Start pool wallet
  6. Start pool
  7. Start miner