Skip to content

Instantly share code, notes, and snippets.

@D-Nice
D-Nice / api
Created June 1, 2017 00:29 — forked from anonymous/api
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.11+commit.68ef5810.js&optimize=false&gist=
// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
import { Architect, Config, Methods, Network, Neat } from 'neataptic'
import Parallel from 'paralleljs'
Config.warnings = false
const trainingSet = [
{ input: [0, 0], output: [0] },
{ input: [0, 1], output: [1] },
{ input: [1, 0], output: [1] },
{ input: [1, 1], output: [0] },

Keybase proof

I hereby claim:

  • I am d-nice on github.
  • I am dnice (https://keybase.io/dnice) on keybase.
  • I have a public key ASCtj_8nf-4wse-7bAJeiOcnm0ItHHH7sW-VW7VwWoS0awo

To claim this, I am signing this object:

contract Precompile {
function foo (bytes) returns (bytes32);
}
contract Testcontract {
bytes32 last;
event Debug(string message, bytes32 res);
Precompile prec = Precompile(0x0000000000000000000000000000000000000002);
@D-Nice
D-Nice / erc20.sol
Created July 6, 2017 16:12
underhanded ICO submission
pragma solidity ^0.4.0;
contract ERC20 {
function totalSupply() constant returns (uint totalSupply);
function balanceOf(address _owner) constant returns (uint balance);
function transfer(address _to, uint _value) returns (bool success);
function transferFrom(address _from, address _to, uint _value) returns (bool success);
function approve(address _spender, uint _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
/*
Kraken-based ETH/XBT price ticker
This contract keeps in storage an updated ETH/XBT price,
which is updated every ~60 seconds.
*/
pragma solidity ^0.4.0;
import "oraclizeLib.sol";
contract t {
function getFirstCsv() returns (string c) {
string memory _s = "1525452452,2,3,4,5";
//return 1;
assembly {
/*mstore(add(mload(0x40), 0x20), mload(_s))
mstore(add(mload(0x40), 0x40), mload(add(_s, 0x20)))
mstore(mload(0x40), 0x20)
return(mload(0x40), 0x60)*/
let x := 0
@D-Nice
D-Nice / init.vim
Last active December 10, 2019 03:23
just an example vimrc for neovim
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
contract ForkSplitterConduit {
//Tracks whether hard fork is effective on this chain. True means the fork is passed, false it hasn't.
bool forked = false;
//Identifies on which network fork this contract should do transfers. True transfers only on a hard-fork network, and false on the original network.
bool transferOnlyFork;
//Hard-fork DAO withdrawal contract
address constant C = 0xbf4ed7b27f1d666546e30d74d50d173d20bca754;
//In Constructor you set whether you want this contract to operate on hard fork or non-hard fork network
// Set to true for transfers to only complete on hard fork, and false for non-hard fork
@D-Nice
D-Nice / underhanded_solidity_storage_array.sol
Created June 15, 2018 19:19
storage array which refs to storage slot 0, overwrites whatever is in storage 0
pragma solidity ^0.4.0;
import "browser/oraclizeapi.sol";
contract brokenWOraclize is usingOraclize {
event DEBUG(uint[] a);
function brokenWOraclize() {
oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS);
}