Skip to content

Instantly share code, notes, and snippets.

View MatthewDLudwig's full-sized avatar

Matthew Ludwig MatthewDLudwig

View GitHub Profile
pragma solidity >0.4.99 <0.6.0;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
@MatthewDLudwig
MatthewDLudwig / explorerUtils.js
Created January 15, 2019 00:36
A set of two functions I used to make the experience on explorer.sushipool.com a bit better when looking at accounts with 1000+ connections.
//Addr defaults to the addr of smitop's faucet since that was what I used this for, but set it to whatever account you're looking at.
//If anyone knows if/where the input of the top left text box is stored you could replace addr with always using the current addr.
let eliminateClutter = (minimum = 0, direction = 0, addr = "NQ94 GSXP KNG0 K5YV HFJ1 PYAQ Y5D1 XTQ1 SLFP") => {
let saved = nimiqMap.edges.get();
let temp = nimiqMap.edges.get({
filter: function (item) {
if (minimum > 0 && item.value < minimum) {
return false;
}
function wrapJ(par) {
let foundObj = null;
if (!par) {
return {
isWrappedJ : true,
length : function() { return 0; },
get : function(i) { return this; },
parent : function() { return this; },