Skip to content

Instantly share code, notes, and snippets.

View dmdque's full-sized avatar

Daniel Que dmdque

View GitHub Profile
var node = {
value: 0,
left: null,
right: null
}
var create_node = function(val, l, r) {
return {value: val, left: l, right: r}
}

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

pragma solidity ^0.4.18;
/**
* @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;
@dmdque
dmdque / Token.sol
Last active January 22, 2019 18:16
pragma solidity 0.5.0;
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);

Run the following:

ganache-cli  # In its own terminal
# mkdir && cd into a new directory
truffle unbox
npm install openzeppelin-solidity@2.1

Paste into contracts/BsktToken.sol:

const explorer = require('sol-explore');
const SolidityParser = require('solparse');
const _ = require('underscore');
const soltar = require('soltar');
const Web3 = require('web3');
const web3 = new Web3();
const {ethers} = require('ethers')
let node = ethers.utils.HDNode.fromExtendedKey('<xpub...>')
// looks like it already uses "m/44'/60'/0'"
// "account/chain/address"
console.log('node', node)
let found = false;
for (let account = 0; account < 10; account++) {