Skip to content

Instantly share code, notes, and snippets.

View austintgriffith's full-sized avatar
💭
:bowtie:

Austin Griffith austintgriffith

💭
:bowtie:
View GitHub Profile
pragma solidity ^0.4.11;
contract Store is Ownable, Predecessor {
//string to hold source url of price information for reference
string public source;
//prices mapped by SYMBOL => price in USD
mapping (bytes32 => uint) price;
pragma solidity ^0.4.11;
/*
A simple 'request oracle client' that needs to know the price of Eth and Bch
*/
contract EthVsBch {
//string to hold source address of oracle
address public source;
pragma solidity ^0.4.11;
contract LinkedList {
event AddEntry(bytes32 head,uint number,bytes32 name,bytes32 next);
uint public length = 0;//also used as nonce
struct Object{
bytes32 next;
pragma solidity ^0.4.11;
contract Teller {
uint16 public quorum = 400;
bytes32 public winningName;
uint public winningVotes;
enum States {
WaitingForQuorum,
function genRandom() private view returns (uint) {
uint rand = uint(keccak256(block.blockhash(block.number-1)));
return uint(rand % (10 ** 20));
}
function getRandom(uint8 maxRan, uint8 index, address priAddress) constant public returns(uint8) {
uint256 genNum = uint256(block.blockhash(block.number-1)) + uint256(priAddress);
for (uint8 i = 0; i < index && i < 6; i ++) {
genNum /= 256;
}
return uint8(genNum % maxRan);
}
uint256 hash = uint256(keccak256(block.blockhash(_targetBlock), _heroIdentity, block.coinbase, block.difficulty));
function getRandomNumber(uint16 maxRandom, uint8 min, address privateAddress) constant public returns(uint8) {
uint256 genNum = uint256(block.blockhash(block.number-1)) + uint256(privateAddress);
return uint8(genNum % (maxRandom - min + 1)+min);
}
function randMod(uint256 _randCounter, uint _modulus) internal view returns (uint256) {
return uint(keccak256(now, msg.sender, _randCounter)) % _modulus;
}
{
"commit":"0x9344e814382212342769ffe574ed54d98b1222044d0c79fa5150ad7974a6c6ef",
"counterStacks":[
{
"_counterStack":"bfd903ef7fb93868213616599c97d2b5818ad5431aa793ac9d54ea74",
"block":-1,
"commit":"0x9344e814382212342769ffe574ed54d98b1222044d0c79fa5150ad7974a6c6ef",
"owner":"0x218F22381B20b0E1d462A6236878b4C794a26262",
"token1":"711",
"token2":"712",