Skip to content

Instantly share code, notes, and snippets.

View luisivan's full-sized avatar
🦅
Fighting for freedom

Luis Cuende luisivan

🦅
Fighting for freedom
View GitHub Profile
@luisivan
luisivan / metamask-init.js
Created March 14, 2017 09:30
Injecting our MetaMask fork into an Electron dapp
const injectMetaMask = async () => {
const contentScriptReq = await fetch('metamask://app/scripts/contentscript.js')
const blob = await contentScriptReq.blob()
const s = document.createElement('script')
s.type = 'text/javascript'
s.src = URL.createObjectURL(blob)
document.getElementsByTagName('head')[0].appendChild(s)
return true
}
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
d5a097877b835c71581d1af86b333ffc5a207923bc2047c417e7af0c3d89dea5
-----BEGIN PGP SIGNATURE-----
wsFcBAEBCAAQBQJZ8KPiCRDcWc9p8ZgB9QAANMQQAMNel3pJWZZcPDafUBsBdVcs
Q6q2thgK7cZoFdfqVg+6D+o7Cv7BvwaG8FDjlo4OO+Up+yzwzwFVnJ0daE6qsGoc
hx2gteNNX3S6qOY/muNcAviAb0UXqVFS034GLIM1WlFOILkvPVj8Ujpc16Zl/+1Y
ith2OfD/pwQcOCSeotF2BhjzTPyox+pbvun/veH7xfLE4Cwo8hFJWY5VUt9wI9Uf
@luisivan
luisivan / Counter.sol
Created January 30, 2018 16:45
Example aragonOS-powered app
pragma solidity ^0.4.0;
import "@aragon/core/contracts/apps/App.sol";
contract Counter is App {
/// Events
event Increment(uint indexed blockNumber);
event Decrement(uint indexed blockNumber);
/// State
@luisivan
luisivan / DevOps contractor.md
Last active February 15, 2018 14:04
DevOps contractor offer for Aragon

DevOps contractor

Although the Aragon app is truly decentralized, we have multiple servers for our community chat (Rocket Chat) and for internal collaboration tools.

We are looking for a contractor that can help:

  • Orchestrate those servers
  • Automate the future update processes
  • Automate encrypted backups of the data
@luisivan
luisivan / script.js
Created May 21, 2018 12:00
aragon.js example
// Listen for events and reduce them to a state
const state$ = app.store((state, event) => {
// Initial state
if (state === null) state = 0
// Build state
switch (event.event) {
case 'Decrement':
state--
break
@luisivan
luisivan / CounterApp.sol
Created May 21, 2018 12:02
Example counter app using aragonOS
import "@aragon/os/contracts/apps/AragonApp.sol";
contract Counter is AragonApp {
// ...
function increment() auth(INCREMENT_ROLE) external {
value += 1;
Increment(msg.sender);
}
function decrement() auth(DECREMENT_ROLE) external {
@luisivan
luisivan / Aragon Contributor License Agreement.md
Last active July 30, 2018 06:41
Aragon Contributor License Agreement

Aragon Contributor License Agreement (CLA)

By Submitting any Contribution (all as defined below), You agree to the terms and conditions set forth in this contributor license agreement (hereinafter the "Agreement").

We are very grateful for your interest in contributing to Aragon (hereinafter, "Aragon", "We" or "Us"). As you know, Aragon is an whose purpose is the developing, disseminating, editing, managing and running of the Project (as defined below).

To this effect, Aragon must have a contributor license agreement accepted by each Contributor, indicating agreement to the license terms below. As such, this Agreement is a legally binding document, so please read it carefully before agreeing to it.

1. Definitions

did:muport:QmTAtPgkEN9Y6z7p6dMeXgKVkc37DqaU8QSXGG97Qoj4fY
@luisivan
luisivan / AragonERC20Wrapper.sol
Last active May 29, 2019 16:11
Aragon wrapper for ERC20 tokens
/* Based on https://github.com/MyBitFoundation/MyBit-DAO.tech/blob/master/apps/MyTokens/contracts/MyTokens.sol */
/* solium-disable function-order */
pragma solidity 0.4.24;
import "@aragon/os/contracts/apps/AragonApp.sol";
import "@aragon/os/contracts/common/IForwarder.sol";
import "@aragon/os/contracts/lib/token/ERC20.sol";
@luisivan
luisivan / Connect.js
Created June 17, 2020 07:58
Aragon Connect examples
// Aragon DAOs are like LEGOs, and apps are their pieces
// Let's get apps for a DAO!
const apps = await org.apps()
// Let's find the Tokens app, for example
const { address: tokenManagerAddress } = apps.find(
({ appName }) => appName && appName.startsWith("token-manager")
)
// Initialize the TheGraph connector for Tokens