Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jleeh on github.
  • I am jonnyhux (https://keybase.io/jonnyhux) on keybase.
  • I have a public key ASAVm1Mry0eh3A2JPEuz4WfHy4EyEeFfAmH8ZXjJog8eYgo

To claim this, I am signing this object:

variable "mapList" { type = "list" }
data "template_file" "test" {
count = "${length(var.mapList)}"
template = "${lookup(var.mapList[count.index], "key")}=${lookup(var.mapList[count.index], "value")}"
}
output "rendered" {
value = "${data.template_file.test.*.rendered}"
pragma solidity ^0.4.23;
import "./interface/PoolOwnersInterface.sol";
import "./std/ERC20.sol";
import "./std/SafeMath.sol";
import "./std/Ownable.sol";
import "./lib/ItMap.sol";
@jleeh
jleeh / main.md
Created October 26, 2018 11:16
Terraform Snippet our Main Cluster
variable "main_node_count" {
    default = 1
    type    = "string"
}

module "main_nodes" {
    source = "git::ssh://<redacted>/terraform-modules/node.git"

    vpc_id              = "${aws_vpc.poolnodes.id}"
@jleeh
jleeh / PoolOwners.md
Created October 26, 2018 10:41
New PoolOwners Claiming Process
/**
  @dev Batch claiming of tokens for owners
  @param _count The amount of owners to claim tokens for
*/
function batchClaim(uint256 _count) public onlyPoolOwner() {
    uint claimed = distribution << 128 >> 128;
    uint to = _count.add(claimed);

    require(_count.add(claimed) <= ownerMap.size(), "To value is greater than the amount of owners");
@jleeh
jleeh / itmap.sol
Last active August 21, 2018 17:20 — forked from ethers/itmap.sol
Solidity iterable map (Removes only and last entries)
library itmap {
struct entry {
// Equal to the index of the key of this item in keys, plus 1.
uint keyIndex;
uint value;
}
struct itmap {
mapping(uint => entry) data;
uint[] keys;
pragma solidity ^0.4.23;
import "../Chainlinked.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
contract SpecAndRunRequester is Chainlinked, Ownable {
event RequestFulfilled(
bytes32 indexed requestId,
bytes32 indexed price