Skip to content

Instantly share code, notes, and snippets.

View lychees's full-sized avatar
🌴
People, Fund, Strategy ...

minakokojima lychees

🌴
People, Fund, Strategy ...
View GitHub Profile
@lychees
lychees / sponsorTokenV0.03.sol
Last active April 11, 2018 17:47
sponsorTokenV0.03
pragma solidity ^0.4.21;
/// @author MinakoKojima (https://github.com/lychees)
contract SponsorToken{
address public owner;
mapping (address => bool) public admins;
struct Order {
address issuer;
@lychees
lychees / sponsorToken.sol
Last active April 11, 2018 17:09
Sponsor Token V0.01
pragma solidity ^0.4.21;
/// @author MinakoKojima (https://github.com/lychees)
contract SponsorToken{
address public owner;
mapping (address => bool) public admins;
struct Order {
address[] sponsors;
@lychees
lychees / 钱袋合约
Last active March 29, 2018 09:11
钱袋合约
pragma solidity ^0.4.21;
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author MinakoKojima (https://github.com/lychees)
contract ERC721 {
// Required methods
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) public view returns (address owner);
function approve(address _to, uint256 _tokenId) public;
@lychees
lychees / luckydraw.sol
Last active September 8, 2020 06:06
去中心化抽奖合约
pragma solidity ^0.4.21;
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author MinakoKojima (https://github.com/lychees)
contract ERC721 {
// Required methods
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) public view returns (address owner);
function approve(address _to, uint256 _tokenId) public;
@lychees
lychees / DecentralizedExchangeHotPotato.sol
Last active April 10, 2018 09:26
去中心化交易所,击鼓传花
pragma solidity ^0.4.21;
/// @author MinakoKojima (https://github.com/lychees)
contract DecentralizedExchangeHotPotato {
address private owner;
mapping (address => bool) private admins;
struct Order {
address creator;
address owner;
@lychees
lychees / DecentralizedExchange.sol
Last active April 10, 2018 09:24
去中心化交易所,挂单
pragma solidity ^0.4.21;
/// @author MinakoKojima (https://github.com/lychees)
contract DecentralizedExchange{
address public owner;
mapping (address => bool) public admins;
struct Order {
address owner;
@lychees
lychees / cryptosanguo.sol
Last active March 29, 2018 06:12
新三国。只管发行。
pragma solidity ^0.4.21;
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author MinakoKojima (https://github.com/lychees)
contract ERC721 {
// Required methods
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) public view returns (address owner);
function approve(address _to, uint256 _tokenId) public;
pragma solidity ^0.4.20;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
@lychees
lychees / sponsorToken.sol
Last active March 22, 2018 12:05 — forked from sherlock-shi-x/sponsorToken.sol
sponsorToken.sol
/// Smart Signature Beta v0.1
pragma solidity ^0.4.20;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
pragma solidity ^0.4.20;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;