Created
April 26, 2019 02:27
-
-
Save sajclarke/a916dc797e7633a8a38bdfd378c58fc7 to your computer and use it in GitHub Desktop.
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; | |
import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; | |
contract DAOToken is ERC20 { | |
/// The event emitted (useable by web3) when a token is purchased | |
event LogFunding(address indexed sender, uint256 tokens); | |
/// The title of the token | |
mapping(address => string) fundTransfers; | |
mapping(address => uint256) fundAmounts; | |
string public name = "DAOToken"; | |
string public symbol = 'CuraDAO'; | |
uint public decimals = 18; | |
uint public INITIAL_SUPPLY = 10000 * (10 ** decimals); | |
constructor() public { | |
_mint(msg.sender, INITIAL_SUPPLY); | |
} | |
function sendTokens(address _receiver, string memory _title, uint256 _amount) public { | |
if(balanceOf(msg.sender) <= _amount) return; | |
fundTransfers[_receiver] = _title; | |
fundAmounts[_receiver] = _amount; | |
transfer(_receiver, _amount); | |
} | |
function getTransfers(address _receiver) | |
external | |
view | |
returns ( | |
uint256 transferAmount_, | |
string memory transferAgency_ | |
) { | |
transferAmount_ = fundAmounts[_receiver]; | |
transferAgency_ = fundTransfers[_receiver]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment