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; | |
library ECDSA { | |
/** | |
* @dev Recover signer address from a message by using their signature | |
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. | |
* @param signature bytes signature, the signature is generated using web3.eth.sign() | |
*/ | |
function recover(bytes32 hash, bytes signature) internal pure returns (address) { | |
bytes32 r; |
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
interface Oracle { | |
function isResultSetFor(uint256 id) external view returns (bool isSet); | |
function resultFor(uint256 id) external view returns (bytes32 result); | |
} | |
// Optional, OraclePrimary must implement Oracle | |
interface OraclePrimary { | |
event ResultSet(bytes32 _result, uint256 _id); | |
} |
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; | |
library ECDSA { | |
/** | |
* @dev Recover signer address from a message by using their signature | |
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. | |
* @param signature bytes signature, the signature is generated using web3.eth.sign() | |
*/ | |
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { | |
bytes32 r; |
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.2; | |
contract Create2FactoryBase { | |
bytes private contractCode; | |
constructor(bytes memory _contractCode) public { | |
contractCode = _contractCode; | |
} |
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.5; | |
// Libs | |
library FooLib { | |
struct Foo { | |
uint a; | |
uint b; | |
uint c; | |
} |
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 ContractSignerVerifier { | |
// returns keccak256("isValidSigner") if signer is valid | |
function isValidSigner(address _signer, bytes memory data) public view returns (bytes32); | |
} | |
interface IChannelArbiter { | |
function channelValueForUpdate(address sender, address receiver, uint256 nonce) external view returns (uint256 value); | |
} | |
contract ChannelIdentifier { |
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.8; | |
contract Channels { | |
function deposit(address _participant) public payable; | |
} | |
contract Bouncer { | |
Channels channelContract; | |
address participant; | |
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
/** | |
* @title Create2 | |
* | |
* @dev Utility library for deploying contracts with the CREATE2 EVM opcode and | |
* computing the contract address of CREATE2 deployments | |
*/ | |
library Create2 { | |
/** | |
* @dev Function to compute the address of a contract created with CREATE2. | |
* @param _salt The salt used to the contract address computation |
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; | |
contract BasicProxy { | |
address public implementation = 0xB6Eb4245eF5626E3505c6223D3157FCE3CE8d0AE; | |
function () external payable { | |
address target = implementation; | |
assembly { |
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.10; | |
// V1 | |
contract AccountV1Storage { | |
uint lastInitializedVersion; | |
uint a; | |
} | |
contract AccountV1 is AccountV1Storage { |