Skip to content

Instantly share code, notes, and snippets.

@hanssv
hanssv / multi_sig.ml
Created November 21, 2017 10:50
Multi-sig wallet in Ring
(* Multi-signature wallet from
https://github.com/ethereum/dapp-bin/blob/master/wallet/wallet.sol
*)
contract multi_sig
type PendingState = { .yetNeeded : UInt, .ownersDone : UInt, .index : UInt }
type Event =
@hanssv
hanssv / voting.ml
Created November 21, 2017 08:01
Voting example from Solidity by Example
(* Example from Solidity by Example
http://solidity.readthedocs.io/en/develop/solidity-by-example.html
Solidity code:
/// Voting with delegation.
contract Ballot {
// This declares a new complex type which will
// be used for variables later.
// It will represent a single voter.
struct Voter {
@hanssv
hanssv / simple_storage.ml
Last active November 21, 2017 07:59
Very basic example of Solidity -> "Ring" translation
(* Example from Solidity by Example
http://solidity.readthedocs.io/en/develop/introduction-to-smart-contracts.html
The Solidity code:
contract SimpleStorage {
uint storedData;
function set(uint x) {
storedData = x;