Skip to content

Instantly share code, notes, and snippets.

View hgedia's full-sized avatar
🐢

Haresh Gedia hgedia

🐢
  • Mumbai,India
  • 23:44 (UTC +05:30)
  • X @h_gedia
View GitHub Profile
@hgedia
hgedia / demo
Last active February 28, 2023 22:38
# Prepare a circuit to push to proof market
python3 scripts/prepare_statement.py -c=/root/workshop/data/arithmetics_example.ll -o=arithmetic_stmt.json -n=arithmetic -t=placeholder-zkllvm
# Push to proof market
python3 scripts/statement_tools.py push --file arithmetic_stmt.json
const Isolated = artifacts.require("Isolated");
// const assert = require("chai").assert;
// const truffleAssert = require('truffle-assertions');
contract('Isolated', (accounts) => {
it('Configuration is setup', async () => {
let contractInstance = await Isolated.deployed();
await contractInstance.updateAdmin(accounts[0]);
/*
Ref : https://medium.com/metamask/eip712-is-coming-what-to-expect-and-how-to-use-it-bb92fd1a7a26
Signature was created using the API eth_signTypedData_v3
Address recovered via eth-sig-utils
*/
const sigUtil = require('eth-sig-util')
const MerkleTree = require('merkletreejs')
const crypto = require('crypto')
function sha256(data) {
// returns Buffer
return crypto.createHash('sha256').update(data).digest()
}
function buf2hex(buffer) { // buffer is an ArrayBuffer
return Array.prototype.map.call(new Uint8Array(buffer), x => ('00' + x.toString(16)).slice(-2)).join('');
diff --git a/cmd/livepeer_cli/livepeer_cli.go b/cmd/livepeer_cli/livepeer_cli.go
index 20059178..7d2f8fdd 100644
--- a/cmd/livepeer_cli/livepeer_cli.go
+++ b/cmd/livepeer_cli/livepeer_cli.go
@@ -109,6 +109,7 @@ func (w *wizard) initializeOptions() []wizardOpt {
fmt.Print("For Rinkeby Eth, go to the Rinkeby faucet (https://faucet.rinkeby.io/).")
w.read()
}, testnet: true},
+ {desc: "Register ENS subdomain", invoke: w.registerENSSubdomain},
}