contracts/
escrow/
ConditionalEscrow.sol
Escrow.sol
RefundEscrow.sol
payment/
PullPayment.sol
SplitPayment.sol
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.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
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.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
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.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
contract MemoryAndStorageViewer { | |
uint256 storageVar1 = 23; | |
bytes32 storageVar2 = 0x12345; | |
uint8 storageVar3 = 55; | |
uint8 storageVar4 = 123; | |
function printStorage() | |
public | |
view |
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; | |
import "./IERC721.sol"; | |
import "./IERC721Receiver.sol"; | |
import "../../math/SafeMath.sol"; | |
import "../../utils/Address.sol"; | |
import "../../introspection/ERC165.sol"; | |
/** |
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 SafeMath | |
* @dev Math operations with safety checks that revert on error | |
*/ | |
library SafeMath { | |
/** | |
* @dev Multiplies two numbers, reverts on overflow. |