Skip to content

Instantly share code, notes, and snippets.

@kvakes
kvakes / TestERC20.sol
Last active February 4, 2022 09:43
Find bugs and vulnerabilities in this smart contract. The final result would be a repository that would contain the fixed smart contract, and tests for the parts that needed change
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
import random
def chase_rabbit():
# Setup
holes = 100
rabbit_in = random.randrange(0, holes)
checks = 0
# Jump
def jump(fromHole):
import numpy as np
import matplotlib.pyplot as plt
def getLogValues(logParam):
y = [0.5]
for i in range(1, 20):
v = logParam*y[i-1]*(1-y[i-1])
if v < 0:
break
y.append(v)
@kvakes
kvakes / orgid_ecosystem.md
Last active July 29, 2020 11:59
ORGiD Ecosystem

ORGiD Ecosystem

ORGiD Ecosystem

  • Winding Tree DAO (repo) controls ORGiD Registry smart contract and some Directories
  • ORGiD Website (repo)
  • ORGiD Registry (repo) is the main smart contract, a database of organizations and their business units
  • ORG.JSON Schema (repo) is a data format for describing organizations
  • ORGiD Resolver (repo) is an utility for fetching organization data in W3C DID format
  • Arbor (fe be) is the application behind **[Winding Tree Marketplace](https://marketpla
{
"@context": "https://windingtree.com/ns/did/v1",
"id": "did:orgid:0x02dfc438f307d823d23808a93dfcc469c6925e3bc0bbc22ddcf22073d7bcbbca",
"created": "2020-04-28T11:15:14.131Z",
"legalEntity": {
"contacts": [
{
"phone": "123456789",
"website": "microsoft.com",
"email": "bill@microsoft.com",
@kvakes
kvakes / glider.json
Last active February 10, 2020 23:09
Ropsten Simard
{
"@context": "https://windingtree.com/ns/did/v1",
"id": "did:orgid:0x99894FAb38E35b726ceb8345e74dDe6716E6bd51",
"created": "2019-01-01T13:10:02.251Z",
"updated": "2019-06-03T13:20:06.398Z",
"publicKey": [{
"id": "did:orgid:0x99894FAb38E35b726ceb8345e74dDe6716E6bd51#firstkey",
"type": "X25519",
"controller": "did:orgid:0x99894FAb38E35b726ceb8345e74dDe6716E6bd51",
"publicKeyPem": "MCowBQYDK2VuAyEAosPy/TSQ2PCqszOh/maErE6yztM8jwJ5JtypoatDaUM=",
{
"@context": "https://windingtree.com/ns/did/v1",
"id": "did:orgid:0x0000000000000000000000000000000000arbor",
"created": "2019-01-01T13:10:02.251Z",
"updated": "2019-06-03T13:20:06.398Z",
"publicKey": [],
"service": [
{
"id": "did:orgid:0x0000000000000000000000000000000000arbor#org-id-rest",
"type": "org-id-rest-0.7.1a",
@kvakes
kvakes / main.json
Last active February 3, 2020 20:47
ORG.ID Examples
{
"@context": "https://windingtree.com/ns/did/v1",
"id": "did:orgid:0xB4Caa470E33A4cE899C16e6C7E125eA03956e95D",
"created": "2019-01-01T13:10:02.251Z",
"updated": "2019-06-03T13:20:06.398Z",
"publicKey": [{
"id": "did:orgid:0xB4Caa470E33A4cE899C16e6C7E125eA03956e95D#keys-1",
"type": "RsaVerificationKey2018",
"controller": "did:orgid:0xB4Caa470E33A4cE899C16e6C7E125eA03956e95D",
"publicKeyPem": "-----BEGIN PUBLIC KEY...END PUBLIC KEY-----\r\n",
@kvakes
kvakes / README.md
Last active October 17, 2019 13:41
ORG.ID Authentication API Endpoint Example

ORG.ID Authentication API Endpoint Example

Install

  • Make sure you've set up your Go environment correctly, e.g. $ echo $GOPATH should work
  • Install
    • go-ethereum: $ go get -u github.com/ethereum/go-ethereum
    • mux: $ go get -u github.com/gorilla/mux
    • shortuuid: $ go get -u github.com/lithammer/shortuuid
{
"dataFormatVersion": "0.0.1",
"legalEntity": {
"name": "Speedy, Inc.",
"location": {
"gps": {
"latitude": 62.30563936,
"longitude": -10.62101225
},
"address": "",