Advertisement
Iammrjude

send

Jul 7th, 2021
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.36 KB | None | 0 0
  1. // SPDX-License-Identifier: MIT
  2.  
  3. pragma solidity >=0.4.22 <0.8.0;
  4.  
  5. contract Context {
  6. constructor () internal { }
  7. // solhint-disable-previous-line no-empty-blocks
  8.  
  9. function _msgSender() internal view returns (address payable) {
  10. return msg.sender;
  11. }
  12.  
  13. function _msgData() internal view returns (bytes memory) {
  14. this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  15. return msg.data;
  16. }
  17. }
  18.  
  19. interface IERC20 {
  20. function totalSupply() external view returns (uint);
  21. function balanceOf(address account) external view returns (uint);
  22. function transfer(address recipient, uint amount) external returns (bool);
  23. function allowance(address owner, address spender) external view returns (uint);
  24. function approve(address spender, uint amount) external returns (bool);
  25. function transferFrom(address sender, address recipient, uint amount) external returns (bool);
  26. event Transfer(address indexed from, address indexed to, uint value);
  27. event Approval(address indexed owner, address indexed spender, uint value);
  28. function TokensPurchased(address buyer, uint256 amount) external returns (bool success);
  29. function burn(uint256 _value) external returns (bool success);
  30. }
  31.  
  32. library SafeMath {
  33. function add(uint a, uint b) internal pure returns (uint) {
  34. uint c = a + b;
  35. require(c >= a, "SafeMath: addition overflow");
  36.  
  37. return c;
  38. }
  39. function sub(uint a, uint b) internal pure returns (uint) {
  40. return sub(a, b, "SafeMath: subtraction overflow");
  41. }
  42. function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
  43. require(b <= a, errorMessage);
  44. uint c = a - b;
  45.  
  46. return c;
  47. }
  48. function mul(uint a, uint b) internal pure returns (uint) {
  49. if (a == 0) {
  50. return 0;
  51. }
  52.  
  53. uint c = a * b;
  54. require(c / a == b, "SafeMath: multiplication overflow");
  55.  
  56. return c;
  57. }
  58. function div(uint a, uint b) internal pure returns (uint) {
  59. return div(a, b, "SafeMath: division by zero");
  60. }
  61. function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
  62. // Solidity only automatically asserts when dividing by 0
  63. require(b > 0, errorMessage);
  64. uint c = a / b;
  65.  
  66. return c;
  67. }
  68. function mod(uint256 a, uint256 b) internal pure returns (uint256) {
  69. return mod(a, b, "SafeMath: modulo by zero");
  70. }
  71.  
  72.  
  73. function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
  74. require(b != 0, errorMessage);
  75. return a % b;
  76. }
  77. }
  78.  
  79. library Address {
  80. function isContract(address account) internal view returns (bool) {
  81. bytes32 codehash;
  82. bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
  83. // solhint-disable-next-line no-inline-assembly
  84. assembly { codehash := extcodehash(account) }
  85. return (codehash != 0x0 && codehash != accountHash);
  86. }
  87. }
  88.  
  89. library SafeERC20 {
  90. using SafeMath for uint;
  91. using Address for address;
  92.  
  93. function safeTransfer(IERC20 token, address to, uint value) internal {
  94. callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
  95. }
  96.  
  97. function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
  98. callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
  99. }
  100.  
  101. function safeApprove(IERC20 token, address spender, uint value) internal {
  102. require((value == 0) || (token.allowance(address(this), spender) == 0),
  103. "SafeERC20: approve from non-zero to non-zero allowance"
  104. );
  105. callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
  106. }
  107. function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
  108. uint256 newAllowance = token.allowance(address(this), spender).add(value);
  109. callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
  110. }
  111.  
  112. function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
  113. uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
  114. callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
  115. }
  116. function callOptionalReturn(IERC20 token, bytes memory data) private {
  117. require(address(token).isContract(), "SafeERC20: call to non-contract");
  118.  
  119. // solhint-disable-next-line avoid-low-level-calls
  120. (bool success, bytes memory returndata) = address(token).call(data);
  121. require(success, "SafeERC20: low-level call failed");
  122.  
  123. if (returndata.length > 0) { // Return data is optional
  124. // solhint-disable-next-line max-line-length
  125. require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
  126. }
  127. }
  128. }
  129.  
  130. contract ReentrancyGuard {
  131. bool private _notEntered;
  132.  
  133. constructor () internal {
  134.  
  135. _notEntered = true;
  136. }
  137.  
  138.  
  139. modifier nonReentrant() {
  140. // On the first call to nonReentrant, _notEntered will be true
  141. require(_notEntered, "ReentrancyGuard: reentrant call");
  142.  
  143. // Any calls to nonReentrant after this point will fail
  144. _notEntered = false;
  145.  
  146. _;
  147.  
  148.  
  149. _notEntered = true;
  150. }
  151. }
  152.  
  153. contract MultiSender is Context, ReentrancyGuard{
  154.  
  155. using SafeMath for uint256;
  156. using SafeERC20 for IERC20;
  157. address public governance;
  158.  
  159. IERC20 public tokenAddress;
  160. address payable public walletAddress1;
  161. address payable public walletAddress2;
  162. address payable public walletAddress3;
  163. address payable public walletAddress4;
  164. address payable public walletAddress5;
  165.  
  166. event TokenSent(address indexed to, uint256 amount);
  167.  
  168. constructor () public {
  169. governance = tx.origin;
  170. //rate = uint256(500); //50
  171. //walletAddress = 0x30D095D6f0043C9030a545A3B7cFAAE738F44de5; //TEAM
  172. walletAddress1 = 0x64C2E9eB5456c3038B3C0828488b3cB1eD3e1a85; //TEAM
  173. walletAddress2 = 0xB3fA96b68A4e0C4AC358FE6BeE3620C787651256; //TEAM
  174. walletAddress3 = 0x850BeFBEe0Bb8f8938cc1F8f8A6E48456e83000c; //TEAM
  175. walletAddress4 = 0x0466900C1Df128344Cd0e667706C54736CBE6993; //TEAM
  176. walletAddress5 = 0x24464EBA55A0be23e6dB741E21c74217530C6dF6; //TEAM
  177. //tokenAddress = IERC20(0x0);
  178. }
  179.  
  180. function () external payable {
  181. buy();
  182. }
  183.  
  184. function changeWallet (address payable _walletAddress) public {
  185. require(msg.sender == governance, "!governance");
  186. walletAddress1 = _walletAddress;
  187. }
  188.  
  189.  
  190.  
  191. function buy() public payable {
  192.  
  193. uint256 weiValue = msg.value;
  194.  
  195. uint256 amount = weiValue.div(5);
  196.  
  197. walletAddress1.transfer(amount);
  198. walletAddress2.transfer(amount);
  199. walletAddress3.transfer(amount);
  200. walletAddress4.transfer(amount);
  201. walletAddress5.transfer(amount);
  202.  
  203. emit TokenSent(msg.sender, amount);
  204. }
  205.  
  206.  
  207. }
  208.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement