This file contains 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
found=False | |
import random,math | |
def miller_rabin(n, k): | |
# Implementation uses the Miller-Rabin Primality Test | |
# The optimal number of rounds for this test is 40 | |
# See http://stackoverflow.com/questions/6325576/how-many-iterations-of-rabin-miller-should-i-use-for-cryptographic-safe-primes | |
# for justification |
This file contains 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.25; | |
/** | |
* | |
* ╔╗╔╗╔╗╔══╗╔╗──╔╗──╔══╗╔═══╗──╔╗──╔╗╔═══╗ | |
* ║║║║║║║╔╗║║║──║║──╚╗╔╝║╔══╝──║║──║║║╔══╝ | |
* ║║║║║║║╚╝║║║──║║───║║─║╚══╗──║╚╗╔╝║║╚══╗ | |
* ║║║║║║║╔╗║║║──║║───║║─║╔══╝──║╔╗╔╗║║╔══╝ | |
* ║╚╝╚╝║║║║║║╚═╗║╚═╗╔╝╚╗║╚══╗╔╗║║╚╝║║║╚══╗ | |
* ╚═╝╚═╝╚╝╚╝╚══╝╚══╝╚══╝╚═══╝╚╝╚╝──╚╝╚═══╝ |
This file contains 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.23; | |
// File: node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol | |
/** | |
* @title Ownable | |
* @dev The Ownable contract has an owner address, and provides basic authorization control | |
* functions, this simplifies the implementation of "user permissions". | |
*/ | |
contract Ownable { |
This file contains 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.17; | |
library SafeMath { | |
function mul(uint256 a, uint256 b) internal constant returns (uint256) { | |
uint256 c = a * b; | |
assert(a == 0 || c / a == b); | |
return c; | |
} | |
function div(uint256 a, uint256 b) internal constant returns (uint256) { |
This file contains 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.17; | |
library SafeMath { | |
function mul(uint256 a, uint256 b) internal constant returns (uint256) { | |
uint256 c = a * b; | |
assert(a == 0 || c / a == b); | |
return c; | |
} | |
function div(uint256 a, uint256 b) internal constant returns (uint256) { |
This file contains 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
#include <inttypes.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#include "argon2.h" | |
#include "\Dima\Old Projects and Texts\Argon2\phc\src\core.h" |
This file contains 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
contract AmIOnTheFork { | |
bool public forked = false; | |
address constant darkDAO = 0x304a554a310c7e546dfe434669c62820b7d83490; | |
// Check the fork condition during creation of the contract. | |
// This function should be called between block 1920000 and 1921200. | |
// Approximately between 2016-07-20 12:00:00 UTC and 2016-07-20 17:00:00 UTC. | |
// After that the status will be locked in. | |
function update() { | |
if (block.number >= 1920000 && block.number <= 1921200) { | |
forked = darkDAO.balance < 3600000 ether; |
This file contains 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
contract HFConditionalTransfer { | |
function transferIfHF(address to) { | |
if (address(0xbf4ed7b27f1d666546e30d74d50d173d20bca754).balance > 2000000 ether) | |
to.send(msg.value); | |
else | |
msg.sender.send(msg.value); | |
} | |
function transferIfNoHF(address to) { | |
if (address(0xbf4ed7b27f1d666546e30d74d50d173d20bca754).balance <= 2000000 ether) |
This file contains 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
// Simple smart contract that allows anyone to send ether from one address to | |
// another in certain branch of the blockchain only. This contract is supposed | |
// to be used after hard forks to clearly separate "classic" ether from "new" | |
// ether. | |
contract BranchSender { | |
// Is set to true if and only if we are currently in the "right" branch of | |
// the blockchain, i.e. the branch this contract allows sending money in. | |
bool public isRightBranch; | |
// Instantiate the contract. |
This file contains 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
personal.unlockAccount (web3.eth.accounts[0], “****”); // ← REPLACE **** WITH YOUR ACCOUNT PASSWORD | |
var fromAddr = web3.eth.accounts[0]; | |
var toAddr = web3.eth.accounts[1]; | |
var valueWei = web3.toWei (1.3, 'ether'); // Send 1.3 ETH | |
var senderABI = web3.eth.contract([{“constant”:false,”inputs”:[{“name”:”recipient”,”type”:”address”}],”name”:”send”, | |
”outputs”:[],”type”:”function”},{“constant”:true,”inputs”:[],”name”:”isRightBranch”,”outputs”:[{“name”:””,”type”:”bool”}], |