Skip to content

Instantly share code, notes, and snippets.

const Web3 = require('web3');
const web3 = new Web3('http://localhost');
const abi = [{"constant": true,"inputs": [],"name": "t","outputs": [{"name": "","type": "bool"}],"payable": false,"stateMutability": "pure","type": "function"}];
const addr = "0x9f1a96f41d3dcbc0a77a75af071f0cf8c046cac4";
contract = web3.eth.Contract(abi, addr);
contract.methods.t().call({from: web3.eth.getAccounts()[0]}).then(console.log);
//outputs: true
pragma solidity ^0.5.1;
contract Test {
function t() public pure returns (bool){
return true;
}
}
@dylan-lom
dylan-lom / geth_init.sh
Last active June 3, 2019 09:59
Initiate a Geth Instance
#!/bin/bash
#assumes geth is in path
mkdir /tmp/geth
geth account new --datadir /tmp/geth << EOF | grep ^Address | cut -d'{' -f2 | cut -d'}' -f1 > /tmp/geth/accounts.txt
EOF
@dylan-lom
dylan-lom / wordlist.asc
Created February 22, 2019 12:05
wordlist

a aahed aahing aardvark aardvarks aardwolf abaci aback abacus abacuses