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
import math | |
import time | |
def f(x): | |
return x**2 + 1 | |
def pollard_rho(N): | |
xn = 2 | |
x2n = 2 | |
#print("xn: {}, x2n: {}".format(xn, x2n)) |
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
import math | |
import time | |
FACTOR = [10972771937, 1690899676867] | |
def f(x): | |
return x**2 + 1 | |
def pollard_rho(N): | |
xn = 2 |
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; | |
// RLP library moved below for readability | |
contract GasOracle { | |
using RLP for RLP.RLPItem; | |
using RLP for RLP.Iterator; | |
using RLP for bytes; | |
mapping (uint => BlockHeader) blocks; |
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.15; | |
import "./MembersOnly.sol"; | |
contract AndSomeNonMembers { | |
MembersOnly token; | |
mapping (address => uint256) balances; | |
mapping (address => mapping (address => uint256)) allowed; | |
function AndSomeNonMembers(address _tokenAdd) { |
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
// USING | |
// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/ownership/Ownable.sol | |
// https://github.com/ConsenSys/Tokens/blob/master/contracts/StandardToken.sol | |
pragma solidity ^0.4.15; | |
import "./Ownable.sol"; // left out for conciseness | |
contract MembersOnly is Ownable { | |
uint256 public totalSupply; |
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
//Tell the Solidity compiler what version to use | |
pragma solidity ^0.4.8; | |
//Declares a new contract | |
contract SimpleStorage { | |
//Storage. Persists in between transactions | |
uint x; | |
//Allows the unsigned integer stored to be changed | |
function set(uint newValue) { |
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; | |
//Allows for decentralized incentivization of initilizing storage | |
//to pay lower fees overall. | |
contract FuelEfficient { | |
uint maxGasPrice; | |
address contractAdd; | |
function FuelEfficient(uint _maxGasPrice, address add) { |
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.10; | |
import "ERCToken.sol"; //Assumes ERC Tokens standard | |
contract HoldTokens { | |
address owner = msg.sender; | |
ERCToken token; | |
function buyTokens(bytes data, address tokenAddress) payable { | |
if (msg.sender != owner) throw; | |
token = ERCToken(tokenAddress); |
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.10; | |
contract AcceptMyTx { | |
function forwardTransaction(address destination, bytes data, uint amountToMiner) payable { | |
block.coinbase.transfer(amountToMiner); | |
destination.call.value(msg.value - amountToMiner)(data); //even in case of failure, miner is paid | |
} | |
} |