Skip to content

Instantly share code, notes, and snippets.

View caffeinum's full-sized avatar
🐶
Coffee Driven Development

Aleksey Bykhun caffeinum

🐶
Coffee Driven Development
View GitHub Profile
@caffeinum
caffeinum / AtomicSwap.sol
Created July 17, 2018 09:45
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.23;
contract AtomicSwap {
uint256 SafeTime = 3 hours; // atomic swap timeOut
struct Swap {
bytes32 secret;
bytes32 secretHash;
@caffeinum
caffeinum / EthToSmthSwaps.sol
Created July 13, 2018 18:55
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.23;
// ----------------------------------------------------------------------------
// Safe maths from OpenZeppelin
// ----------------------------------------------------------------------------
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns(uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
@caffeinum
caffeinum / EthToSmthSwaps.sol
Created July 13, 2018 18:47
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.23;
import './SafeMath.sol';
contract EthToSmthSwaps {
using SafeMath for uint;
address public owner;
address public ratingContractAddress;