• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

societymediagroup Mar 29th, 2018 13 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. pragma solidity ^0.4.19;
2.
3. /**
4.  * @title SafeMath
5.  * @dev Math operations with safety checks that throw on error
6.  */
7. library SafeMath {
8.
9.   function mul(uint256 a, uint256 b) internal constant returns (uint256) {
10.     uint256 c = a * b;
11.     assert(a == 0 || c / a == b);
12.     return c;
13.   }
14.
15.   function div(uint256 a, uint256 b) internal constant returns (uint256) {
16.     // assert(b > 0); // Solidity automatically throws when dividing by 0
17.     uint256 c = a / b;
18.     // assert(a == b * c + a % b); // There is no case in which this doesn't hold
19.     return c;
20.   }
21.
22.   function sub(uint256 a, uint256 b) internal constant returns (uint256) {
23.     assert(b <= a);
24.     return a - b;
25.   }
26.
27.   function add(uint256 a, uint256 b) internal constant returns (uint256) {
28.     uint256 c = a + b;
29.     assert(c >= a);
30.     return c;
31.   }
32.
33. }
34.
35. contract Token {
37.   function totalSupply() constant returns (uint256 supply) {}
38.
39.   /// @param _owner The address from which the balance will be retrieved
40.   /// @return The balance
41.   function balanceOf(address _owner) constant returns (uint256 balance) {}
42.
43.   /// @notice send `_value` token to `_to` from `msg.sender`
44.   /// @param _to The address of the recipient
45.   /// @param _value The amount of token to be transferred
46.   /// @return Whether the transfer was successful or not
47.   function transfer(address _to, uint256 _value) returns (bool success) {}
48.
49.   /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
50.   /// @param _from The address of the sender
51.   /// @param _to The address of the recipient
52.   /// @param _value The amount of token to be transferred
53.   /// @return Whether the transfer was successful or not
54.   function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
55.
56.   /// @notice `msg.sender` approves `_addr` to spend `_value` tokens
57.   /// @param _spender The address of the account able to transfer the tokens
58.   /// @param _value The amount of wei to be approved for transfer
59.   /// @return Whether the approval was successful or not
60.   function approve(address _spender, uint256 _value) returns (bool success) {}
61.
62.   /// @param _owner The address of the account owning tokens
63.   /// @param _spender The address of the account able to transfer the tokens
64.   /// @return Amount of remaining tokens allowed to spent
66.
69.
70.   uint public decimals;
71.   string public name;
72. }
73. /**
74.  * @title Ownable
75.  * @dev The Ownable contract has an owner address, and provides basic authorization control
76.  * functions, this simplifies the implementation of "user permissions".
77.  */
78. contract Ownable {
79.
81.
82.   /**
83.    * @dev The Ownable constructor sets the original `owner` of the contract to the sender
84.    * account.
85.    */
86.   function Ownable() public {
87.     owner = msg.sender;
88.   }
89.
90.   /**
91.    * @dev Throws if called by any account other than the owner.
92.    */
93.   modifier onlyOwner() {
94.     require(msg.sender == owner);
95.     _;
96.   }
97.
98.   /**
99.    * @dev Allows the current owner to transfer control of the contract to a newOwner.
100.    * @param newOwner The address to transfer ownership to.
101.    */
102.   function transferOwnership(address newOwner) onlyOwner public {
104.     owner = newOwner;
105.   }
106.
107. }
108. contract AirDrop is Ownable {
110.   Token public token;
111.   uint256 public valueAirDrop;
113.   function AirDrop() public{
116.     valueAirDrop = 100;
117.   }
121.   }
122.   function refund() onlyOwner public{
123.     token.transfer(owner, token.balanceOf(this));
124.   }
125.   function () external payable {
126.     require(msg.value == 0);