Skip to content

Instantly share code, notes, and snippets.

View molekilla's full-sized avatar

Rogelio Morrell molekilla

  • Panama
View GitHub Profile
@molekilla
molekilla / mdv.md
Created April 23, 2020 11:34
MDV Docs Draft

MDV - Mensajeria de Documentos Verificables

WF API v1.0.0-rc.0

Autor: Rogelio Morrell C. , 2020

Introduccion

MDV es una solucion descentralizada de solicitudes de documentos que permite crear workflows de tramites por medio de Solidity y Javascript.

Adicionalmente incluye soporte para PKCS#7 para documentos PDF e integracion de identidad digital por medio de ethr-did.

Contratos

@molekilla
molekilla / WSecureMessaging.md
Last active April 11, 2020 14:10
A secure messaging workflow specification

A secure messaging workflow specification

This document describes how to implement a DSL workflow using smart contracts for a secure messaging smart control protocol.

It contains building blocks that can be apply to other domains (DeFi, supply chain, flash loans, and others)

Define states

After your discovery phase and business requirements, create the different states that will define the workflow.

@molekilla
molekilla / WalletConnectDappUtils.ts
Created March 24, 2020 19:21
Wait for WalletConnect Transaction by looking up tx
import { from } from 'rxjs';
import { mergeMap, filter } from 'rxjs/operators';
export class WalletConnectDappUtils {
public static async waitFor(methodResponse: any) {
let result: any = {};
// CANNOT BE executed with the plugin due to next tick issues with Javascript
let exit = 5;
let n = methodResponse.beforeBlock - 2;
// eslint-disable-next-line no-constant-condition
@molekilla
molekilla / gist:fbb9e1770dccb68f4e035c9514c98ed0
Created February 13, 2020 15:07
solido-walletconnect-vechain

solido-provider-wallet

Solido Wallet Provider

Implementing WalletConnect Protocol for a VeChain Dapp

solido-provider-wallet is a wrapper for solido-provider-connex which injects a SolidoSigner interface that sends signing requests to WalletConnect.

Additionally, a Dapp needs to instantiate a self hosted connex. To create a new connex instance, add @vechain/connex-framework and @vechain/connex.driver-nodejs. The latter only works with server side applications but is enough to let us create a connex object.

import { Markets } from './tradingview/Markets';
import { MarginBot } from './binance/MarginBot';
import { BookTicker } from "./binance/BookTicker";
import { BinanceOrder } from "./binance/BinanceOrder";
import { forkJoin } from 'rxjs';
import { MMMBotDB } from './MMMBotDB';
import { Position } from './binance/Position';
import { Dashboard } from './dashboard';
import BigNumber from 'bignumber.js';
CREATE DEFINER=`root`@`localhost` PROCEDURE `calc_depreciacion_2`()
BEGIN
DECLARE finished INTEGER DEFAULT 0;
DECLARE depre INTEGER DEFAULT 0;
DECLARE valor_original DECIMAL(10,2);
DECLARE porc_depreciacion DECIMAL(10,2);
DECLARE codigo_cuenta VARCHAR(25);
DECLARE estado INTEGER DEFAULT 0;
DECLARE id_activo INTEGER DEFAULT 0;
DECLARE fecha_compra DATE;
@molekilla
molekilla / solido-contract-store.ts
Last active November 5, 2019 21:10
tracking contract state
import { validate } from './Utils';
import { IMethodOrEventCall } from '../types';
import { SolidoContract } from '../core/SolidoContract';
export type TrackStateBy = 'polling' | 'storeUpdates' | 'push';
// TODO: Add to SolidoContract
// subjects - RxJS subjects for methods
@molekilla
molekilla / gist:1e949cccc36685fabc510905a6c66c7d
Created July 8, 2019 19:54
svelte server render example
<!-- Main -->
<script lang="ts">
import Table from "./AccountingTable.svelte";
export let accountingGroupByPairs = {};
</script>
<svelte:head>
<link
rel="stylesheet"
@molekilla
molekilla / buyorder.sol
Created June 13, 2019 19:23
better course material
uint buyBookOffersCount;
uint pairsAmountBuyPrices;
// Contains a buy book order offers
// dict[pairIndex, price, offerIndex]
mapping (uint => mapping(uint => mapping(uint => Offer))) buyBookOffers;
// TokenPairInfo eg ETH/PAX, ETH/PAX
mapping (uint => TokenPairInfo) pairs;
@molekilla
molekilla / App.tsx
Last active June 5, 2019 19:49
Odenplan with WC mock wallet
public initWallet = async () => {
const local = localStorage ? localStorage.getItem("walletconnect") : null;
if (local) {
let session;
try {
session = JSON.parse(local);
} catch (error) {
throw error;