test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.0; | |
| // This contract is used for making a new opcode via a softfork. | |
| // It works for opcodes that just evaluate an arbitrary function, | |
| // returning y = f(x). | |
| // | |
| // The idea is to create a contract that implements an arbitrary key-value | |
| // mapping, but miners (after the softfork) enforce that the only updates to the | |
| // contract respect the correct function. | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.0; | |
| contract TestContract { | |
| struct Proposal { | |
| uint voteCount; | |
| string description; | |
| } | |
| address public owner; | |
| Proposal[] public proposals; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! python2.7 | |
| # | |
| # tinybitcoinpeer.py | |
| # A toy bitcoin node in Python. Connects to a random testnet | |
| # node, shakes hands, reacts to pings, and asks for pongs. | |
| # - Andrew Miller https://soc1024.com/ | |
| # | |
| # Dependencies: | |
| # - gevent | |
| # - https://github.com/petertodd/python-bitcoinlib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| amiller@amiller-lenovo ~/installing/parity $ target/debug/parity --testnet --nodiscover --bootnodes "" -l network=trace --log-file parity.log | |
| Adding ver.lock | |
| Executed 1 upgrade scripts - ok | |
| 2016-07-15 18:24:30 INFO:parity: Starting Parity/v1.3.0-unstable-d14b687-20160715/x86_64-linux-gnu/rustc1.10.0 | |
| 2016-07-15 18:24:30 INFO:parity: Using state DB journalling strategy fast | |
| 2016-07-15 18:24:30 INFO:ethcore::service: Configured for Morden using Ethash engine | |
| enode://c9b35f1370d9d5b36d6d2a5c78192d3c46d0ccae0f5cad37209f1b366de3585ea59a81e69250eaaebd951e206522877f639d8354c7c82865a328ba7b0c359c8f@0.0.0.0:30303 | |
| 2016-07-15 18:24:31 INFO:mode: Public node URL: enode://c9b35f1370d9d5b36d6d2a5c78192d3c46d0ccae0f5cad37209f1b366de3585ea59a81e69250eaaebd951e206522877f639d8354c7c82865a328ba7b0c359c8f@0.0.0.0:30303 | |
| 2016-07-15 18:24:32 DEBUG:network: Connecting peers: 0 sessions, 0 pending, 0 started | |
| 2016-07-15 18:24:33 DEBUG:network: Connecting peers: 0 sessions, 0 pending, 0 started |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| What’s the price per kilobyte of Ethereum transaction data? | |
| ************************************************************* | |
| As of October 2016, it's about $0.023 USD per kilobyte (2.3 cents per kilobyte) | |
| Step 1: Gas price: | |
| ================= | |
| = 25gigawei per gas (As of October 2016) https://etherscan.io/charts/gasprice | |
| Ether unit conversion: | |
| 25 Gwei = 0.000000025 Ether http://ether.fund/tool/converter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Call stack hazards in Solidity!! | |
| // | |
| // This file is *slightly* modified relative to | |
| // https://github.com/etherpot/contract/blob/f87501ddf319559346b2983b27770ace22771ad0/app/contracts/lotto.sol | |
| // in order to demonstrate a flaw: | |
| // Changes: | |
| // - function () changed to function send() | |
| // - function trigger() added | |
| // - blocksPerRound changed from 6800 to 6 | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type 'a once = 'a option ref;; | |
| let notyet : unit -> 'a once = fun () -> ref None;; | |
| let write : 'a once -> 'a -> unit = | |
| fun o a -> match !o with | |
| | None -> o := Some a | |
| | _ -> failwith "can't overwrite" | |
| let read : 'a once -> 'a option = fun o -> !o;; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Andrew Miller - monoid.fst | |
| // compiles under the school14.1 release of F* | |
| // https://github.com/FStarLang/FStar/releases/tag/school14.1 | |
| // This is an example of constructive algebra in F*. We're going to define the | |
| // class of mathematical objects called "monoids", and give several constructions, | |
| // using F* to prove the constructions are sound. | |
| // For similar developments in other languages, see: | |
| // [Agda] http://people.inf.elte.hu/divip/AgdaTutorial/Application.Algebra.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| amiller@dreyfus:~/projects/netmine$ make | |
| ./autogen.pl | |
| perl: warning: Setting locale failed. | |
| perl: warning: Please check that your locale settings: | |
| LANGUAGE = (unset), | |
| LC_ALL = (unset), | |
| LANG = "en_US.UTF-8" | |
| are supported and installed on your system. | |
| perl: warning: Falling back to the standard locale ("C"). | |
| make all -C logserver |