Created
October 6, 2018 05:13
-
-
Save shanev/0e639b34783d84122bac9c3f3573b0d5 to your computer and use it in GitHub Desktop.
An ERC20 token that can only be transferred to the address which created it
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 "./ERC20.sol"; | |
/** | |
* @title One-way Fungible Token | |
*/ | |
contract ERC20Unidirectional is ERC20 { | |
address private _parent; | |
constructor(address parent) { | |
_parent = parent; | |
} | |
function transfer(address to, uint256 value) public returns (bool) { | |
require(to == _parent, "must transfer to parent"); | |
_transfer(msg.sender, to, value); | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment