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.8; | |
| import "../lib/Owned.sol"; | |
| import "../lib/SafeMath.sol"; | |
| // This contract can be used when a smart contract has a | |
| // role that can be fullfilled by one account, but you would | |
| // like several accounts to fullfill the role. | |
| contract Multiplexer is Owned { |
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
| // Async FizzBuzz -- implemented using only callbacks | |
| // | |
| // node --stack-size=100000 ./async-fizzbuzz.js | |
| // | |
| // Wrap process.stdout.write | |
| const print = (message, callback) =>{ | |
| process.stdout.write(message, callback) | |
| } |
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 HexEncoding { | |
| function hexEncodeTest(address addr) returns (bytes32 ret) { | |
| uint x = uint(addr) / 2**32; | |
| // Nibble interleave | |
| x = x & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff; | |
| x = (x | (x * 2**64)) & 0x0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff; |
NewerOlder