Created
November 7, 2017 22:09
-
-
Save skilesare/fec1454a657c4913292efa31b5c46438 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.4.15; | |
contract Dan { | |
address public owner; | |
uint256 public donated; | |
string public phone; | |
string public my_address; | |
string public my_name; | |
/** | |
* @dev Throws if called by any account other than the owner. | |
*/ | |
modifier onlyOwner() { | |
require(owner == msg.sender); | |
_; | |
} | |
function () public payable{ | |
require(1==0); | |
} | |
function Dan(string _name, string _phone, string _address) public{ | |
//the owner will start as the address creating the contract | |
owner = msg.sender; | |
phone = _phone; | |
my_address = _address; | |
my_name = _name; | |
} | |
function donate() public payable returns (bool){ | |
donated = donated + msg.value; | |
return true; | |
} | |
function withdraw(uint256 amount) onlyOwner public returns(bool){ | |
require(address(this).balance >= amount); | |
address(owner).transfer(amount); | |
} | |
function safetyTransferToken(address Token, address _to, uint _value) onlyOwner public returns (bool ok){ | |
bytes4 sig = bytes4(keccak256("transfer(address,uint256)")); | |
return Token.call(sig, _to, _value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment