Skip to content

Instantly share code, notes, and snippets.

Avatar
🦅
Fighting for freedom

Luis Iván Cuende luisivan

🦅
Fighting for freedom
View GitHub Profile
View Loan.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.8.10;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {SafeTransferLib} from "@rari-capital/solmate/src/utils/SafeTransferLib.sol";
import {ERC20} from "@rari-capital/solmate/src/tokens/ERC20.sol";
contract Loan is Initializable, Ownable {
using SafeTransferLib for ERC20;
View Passes.js
import passkit from "passkit-generator";
import fs from 'fs'
try {
/** Each, but last, can be either a string or a Buffer. See API Documentation for more */
const wwdr = fs.readFileSync('./cert/AppleWWDRCAG4.pem')
const signerCert = fs.readFileSync('./cert/passes.pem')
const signerKey = fs.readFileSync('./cert/passes.key')
const pass = await passkit.PKPass.from({
@luisivan
luisivan / Connect.js
Created June 17, 2020 07:58
Aragon Connect examples
View Connect.js
// 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
@luisivan
luisivan / AragonERC20Wrapper.sol
Last active May 29, 2019 16:11
Aragon wrapper for ERC20 tokens
View AragonERC20Wrapper.sol
/* 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";
View gist:9dc29f83083e37fe44a3042fb214a587
did:muport:QmTAtPgkEN9Y6z7p6dMeXgKVkc37DqaU8QSXGG97Qoj4fY
@luisivan
luisivan / CounterApp.sol
Created May 21, 2018 12:02
Example counter app using aragonOS
View CounterApp.sol
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 / script.js
Created May 21, 2018 12:00
aragon.js example
View script.js
// 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 / Aragon Contributor License Agreement.md
Last active July 30, 2018 06:41
Aragon Contributor License Agreement
View Aragon Contributor License Agreement.md

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

@luisivan
luisivan / DevOps contractor.md
Last active February 15, 2018 14:04
DevOps contractor offer for Aragon
View DevOps contractor.md

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 / Counter.sol
Created January 30, 2018 16:45
Example aragonOS-powered app
View Counter.sol
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