Skip to content

Instantly share code, notes, and snippets.

View Evalir's full-sized avatar
🎴

evalir Evalir

🎴
View GitHub Profile
@Evalir
Evalir / asciiputsonglasses
Created December 10, 2020 14:53 — forked from staringispolite/asciiputsonglasses
Ascii art sunglasses meme
Puts on glasses:
(•_•)
( •_•)>⌐■-■
(⌐■_■)
Takes off glasses ("mother of god..."):
(⌐■_■)
( •_•)>⌐■-■
@Evalir
Evalir / GovernQueue.js
Last active October 22, 2020 22:54
GovernQueue contract interaction
import BN from 'bn.js'
import { toHex } from 'web3-utils'
// ... any other ethers imports
// governQueueAddress should be the space queue address.
const GQL_QUERY = `
governQueue(id: "governQueueAddress") {
config {
executionDelay
scheduleDeposit {
@Evalir
Evalir / Govern.json
Created October 22, 2020 13:47
Govern ABI
[
{
"inputs": [
{
"internalType": "contract IERC3000",
"name": "_initialExecutor",
"type": "address"
}
],
"stateMutability": "nonpayable",
@Evalir
Evalir / callscript.js
Created September 16, 2020 16:34
Creating a callscript for the Agent function.
/* These are all the imports / functions needed to encode an agent call into a callscript
* that we can send to disputable delay. The process is as follows
* 1 - The user enters the target address for the agent, and the calldata on the snapshot interface
* for each choice. This corresponds to the (targetAddress, calldata) params on the
* encodeAgentExecute function.
* 2 - The vote goes on, and let's assume it passes.
* 3 - When the vote has passed, and the user clicks on "submit on chain", assuming they've done all
* the necessary steps to submit disputable actions, we only need to:
* - Directly instanciate the disputableDelay contract
* - Call `delayExecution(bytes _evmScript, bytes _context)` with the encoded agent callscrip as
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreia5erbzrrzf2evoisryzwnixvswck45nblbhnc462ywhkvs5inw3q ✅
Create your profile today to start building social connection and trust online at https://3Box.io/

Keybase proof

I hereby claim:

  • I am evalir on github.
  • I am evalir (https://keybase.io/evalir) on keybase.
  • I have a public key ASCd58XAvQskHNIBkUsxuoFUPDMPnXegwHQF3gN1IW7fHwo

To claim this, I am signing this object:

@Evalir
Evalir / usetimer.js
Created September 8, 2019 19:19
Countdown hook
import { useEffect, useState } from "react";
function parseMS(miliseconds) {
var minutes = Math.floor(miliseconds / 60000);
var seconds = ((miliseconds % 60000) / 1000).toFixed(0);
return `${minutes}:${seconds < 10 ? "0" : ""}${seconds}`;
}
function useTimer(seconds, options = {}) {
const { intervalTime = 1000 } = options;
@Evalir
Evalir / mongo-docker.bash
Created July 6, 2019 16:42 — forked from davideicardi/mongo-docker.bash
Running mongodb inside a docker container (with mongodb authentication)
# Create a container from the mongo image,
# run is as a daemon (-d), expose the port 27017 (-p),
# set it to auto start (--restart)
# and with mongo authentication (--auth)
# Image used is https://hub.docker.com/_/mongo/
docker pull mongo
docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth
# Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception)
# add a root user
@Evalir
Evalir / vssettings.json
Last active April 7, 2019 04:55
Vscode config & .eslintrc react setup.
// vscode
{
"workbench.colorTheme": "Level Up",
"window.zoomLevel": -1,
"editor.fontFamily": "Dank Mono, Operator Mono, Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 16,
"editor.formatOnSave": true,
"[javascript]": {
"editor.formatOnSave": false
},
@Evalir
Evalir / Packages.md
Created March 15, 2019 21:01
Cool packages I find.