Skip to content

Instantly share code, notes, and snippets.

@maraoz
maraoz / deploy.ts
Created July 11, 2022 20:14
Using WalletConnect from a hardhat script example
import { ethers } from "hardhat";
import { Signer } from "ethers";
import WalletConnectProvider from "@walletconnect/web3-provider";
async function deploy(deployer: Signer) {
const address = await deployer.getAddress();
console.log("Deploying contracts with the account:", address);
console.log("Account balance:", (await deployer.getBalance()).toString());
0xb0145Ae156D201d6E371d07265FE3C045071c967
// Proof of Existence contract, version 1
contract ProofOfExistence {
// state
bytes32 proof;
// constructor
function ProofOfExistence() {
}
# First, let's install truffle
$ sudo npm install -g truffle
# let's setup our project
$ mkdir solidity-experiments
$ cd solidity-experiments/
$ truffle init
$ ls
app contracts migrations test truffle.js
> eth.getBalance(eth.accounts[0])
0
> personal.newAccount()
Passphrase:
Repeat passphrase:
"0xa88614166227d83c93f4c50be37150b9500d51fc"
geth --testnet --rpc console 2>> geth.log
var clientID = "oC8AfNfY3JTOV5PIFkqKbIgLgzFqc0By";
var domain = "bitcorps.auth0.com";
var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '');
var dict = {
title: "BitCorps",
}
var options = {
"responseType":"token",
@maraoz
maraoz / gist:388eddec39d60c6d52d4
Created February 20, 2016 22:03
Imagenet output tensor index to label mapping
{
0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
@maraoz
maraoz / paychan.bit
Last active August 29, 2015 14:25
Bitcoin Payment Channel Script template
OP_IF
<expiry time> OP_CHECKLOCKTIMEVERIFY OP_DROP
<consumer pubkey> OP_CHECKSIG
OP_ELSE
OP_0 2 <consumer pubkey> <provider pubkey> 2 OP_CHECKMULTISIG
OP_END