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.21; | |
contract GCDLCMCache { | |
mapping (bytes32 => uint256) public cache; | |
enum CacheType { GCD, LCM } | |
function gcd(uint256[] input) |
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.24; | |
/** | |
* @title MerkleProof | |
* @dev Merkle proof verification based on | |
* https://github.com/ameensol/merkle-tree-solidity/blob/master/src/MerkleProof.sol | |
*/ | |
library MerkleProof { | |
/** |
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 Bar { | |
event FooChanged(uint8 num); | |
uint256 public foo; | |
constructor() public { | |
reset(); | |
} | |
function testAssert(bool _fail) external { |
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
import "LIBSNARK/sha256packed" | |
def hash(field[16] deck) -> (field[2]): | |
field res = 0 | |
for field i in 0..16 do | |
res = res + deck[i] * (2**(4*i)) | |
endfor | |
h0, h1 = sha256packed(0, 0, 0, res) | |
return [h0, h1] |
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.5.0 <0.6.0; | |
interface Token { | |
function approve(address _spender, uint256 _value) external returns (bool success); | |
function allowance(address _owner, address _spender) external view returns (uint256 remaining); | |
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); | |
} | |
interface PaymentChannel {} |
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
#!/usr/bin/env bash | |
NVM_LINK="https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh" | |
GETH_LINK="https://gethstore.blob.core.windows.net/builds/geth-alltools-linux-amd64-1.8.20-24d727b6.tar.gz" | |
IPFS_LINK="https://dist.ipfs.io/go-ipfs/v0.4.18/go-ipfs_v0.4.18_linux-amd64.tar.gz" | |
# Install NVM | |
wget -qO- $NVM_LINK | bash | |
source ~/.bashrc |
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
.eth-address { | |
padding: 3px; | |
border-radius: 8px; | |
position: relative; | |
display: inline-grid; | |
box-shadow: 1px 1px 1px 1px #CCCC; | |
border-top: solid 1px #FFFC; | |
border-left: solid 1px #FFFC; | |
} |
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
{ | |
"Rendezvous": true, | |
"ListenAddr": "0.0.0.0:30304", | |
"AdvertiseAddr": "<your-ip>", | |
"APIModules": "eth,net,web3,admin", | |
"NoDiscovery": false, | |
"WhisperConfig": { | |
"Enabled": true, | |
"EnableMailServer": true, | |
"LightClient": false, |
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.5.0 <0.6.0; | |
/** | |
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. | |
* | |
* These functions can be used to verify that a message was signed by the holder | |
* of the private keys of a given address. | |
*/ | |
library ECDSA { | |
/** |
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.5.0 <0.7.0; | |
/** | |
* @author Ricardo Guilherme Schmidt (Status Research & Development GmbH) | |
* @notice simplified multi proofs | |
*/ | |
library MerkleMultiProof { | |
/** | |
* @notice Calculates a merkle root using multiple leafs at same time | |
* @param leafs out of order sequence of leafs and it's siblings |