Advertisement
Guest User

Untitled

a guest
Jun 18th, 2021
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.91 KB | None | 0 0
  1. /**
  2. *Submitted for verification at BscScan.com on 2021-06-08
  3. */
  4.  
  5. //SPDX-License-Identifier: UNLICENSED
  6.  
  7. /**
  8.  
  9. /$$ /$$ /$$$$$$$$ /$$$$$$$ /$$$$$$$ /$$$$$$$$ /$$$$$$
  10. | $$ | $$| $$_____/| $$__ $$| $$__ $$| $$_____/ /$$__ $$
  11. | $$ | $$| $$ | $$ \ $$| $$ \ $$| $$ | $$ \__/
  12. | $$$$$$$$| $$$$$ | $$$$$$$/| $$$$$$$/| $$$$$ | $$$$$$
  13. | $$__ $$| $$__/ | $$__ $$| $$____/ | $$__/ \____ $$
  14. | $$ | $$| $$ | $$ \ $$| $$ | $$ /$$ \ $$
  15. | $$ | $$| $$$$$$$$| $$ | $$| $$ | $$$$$$$$| $$$$$$/
  16. |__/ |__/|________/|__/ |__/|__/ |________/ \______/
  17.  
  18.  
  19. `` /h/
  20. sds :y`
  21. .` .s: s:
  22. .dy +y -d` ./:
  23. -hs` -s` `./d/--/+.`` -ss+
  24. `::++. -s-:/++omho++////:-``sss/
  25. .oho-.::+++oossssssssso++++s:
  26. `o+//+sssyyyyyyyyyyyyyyoo+-hho
  27. `/oosyhhdhdhddddhhhyyyoyyss++:
  28. `/oyddsyyyhhdddddhhyydNdysso/
  29. +h+:://oyyyyyyoymNmmmmmmmmhyhmhyyos-.....:/+.
  30. `` +syhhmdmdmNNmNNmmmmmmddddhyoyyo+///++/.
  31. /hs++oosyhysyhdmdmdmNNNmmNNmmmddmdhyoo.
  32. .o: .oshhhddmmmmmmmmmmdmddmmhhys+
  33. :syyhddddmdmddddsoshddhhdhys/. ``
  34. :syyhyhdhdddmddhsoyhhhyssoho++dh-
  35. `+ssydhhddhdddddhmmysso+o``:/+y+.
  36. :s/`:ddsosyyyyddysssoo/- .hy` `/y/
  37. -so` /h/ .-oo+ooshoos+.` `
  38. `.``-:+` -d` `y+`yo
  39. +dy ++ /o``h.
  40. ` od: -yhy .o.
  41. `.` `.` `ss
  42.  
  43.  
  44. HERPES - the token that spreads like a virus!
  45.  
  46. Features:
  47. |- 10% tax per transaction:
  48. |- 2% is auto-added to locked liquidity
  49. |- 8% is redistributed to holders
  50.  
  51. Current version: HERPES 2.0
  52. HERPES 1.0 contract: 0x8e8e935458cf7037bef33f0b31d92109e53611d2
  53.  
  54. Dedicated to Nick's cold sore.
  55.  
  56. **/
  57.  
  58. pragma solidity ^0.6.12;
  59.  
  60. interface IERC20 {
  61.  
  62. function totalSupply() external view returns (uint256);
  63.  
  64. /**
  65. * @dev Returns the amount of tokens owned by `account`.
  66. */
  67. function balanceOf(address account) external view returns (uint256);
  68.  
  69. /**
  70. * @dev Moves `amount` tokens from the caller's account to `recipient`.
  71. *
  72. * Returns a boolean value indicating whether the operation succeeded.
  73. *
  74. * Emits a {Transfer} event.
  75. */
  76. function transfer(address recipient, uint256 amount) external returns (bool);
  77.  
  78. /**
  79. * @dev Returns the remaining number of tokens that `spender` will be
  80. * allowed to spend on behalf of `owner` through {transferFrom}. This is
  81. * zero by default.
  82. *
  83. * This value changes when {approve} or {transferFrom} are called.
  84. */
  85. function allowance(address owner, address spender) external view returns (uint256);
  86.  
  87. /**
  88. * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
  89. *
  90. * Returns a boolean value indicating whether the operation succeeded.
  91. *
  92. * IMPORTANT: Beware that changing an allowance with this method brings the risk
  93. * that someone may use both the old and the new allowance by unfortunate
  94. * transaction ordering. One possible solution to mitigate this race
  95. * condition is to first reduce the spender's allowance to 0 and set the
  96. * desired value afterwards:
  97. * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
  98. *
  99. * Emits an {Approval} event.
  100. */
  101. function approve(address spender, uint256 amount) external returns (bool);
  102.  
  103. /**
  104. * @dev Moves `amount` tokens from `sender` to `recipient` using the
  105. * allowance mechanism. `amount` is then deducted from the caller's
  106. * allowance.
  107. *
  108. * Returns a boolean value indicating whether the operation succeeded.
  109. *
  110. * Emits a {Transfer} event.
  111. */
  112. function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
  113.  
  114. /**
  115. * @dev Emitted when `value` tokens are moved from one account (`from`) to
  116. * another (`to`).
  117. *
  118. * Note that `value` may be zero.
  119. */
  120. event Transfer(address indexed from, address indexed to, uint256 value);
  121.  
  122. /**
  123. * @dev Emitted when the allowance of a `spender` for an `owner` is set by
  124. * a call to {approve}. `value` is the new allowance.
  125. */
  126. event Approval(address indexed owner, address indexed spender, uint256 value);
  127. }
  128.  
  129.  
  130.  
  131. /**
  132. * @dev Wrappers over Solidity's arithmetic operations with added overflow
  133. * checks.
  134. *
  135. * Arithmetic operations in Solidity wrap on overflow. This can easily result
  136. * in bugs, because programmers usually assume that an overflow raises an
  137. * error, which is the standard behavior in high level programming languages.
  138. * `SafeMath` restores this intuition by reverting the transaction when an
  139. * operation overflows.
  140. *
  141. * Using this library instead of the unchecked operations eliminates an entire
  142. * class of bugs, so it's recommended to use it always.
  143. */
  144.  
  145. library SafeMath {
  146. /**
  147. * @dev Returns the addition of two unsigned integers, reverting on
  148. * overflow.
  149. *
  150. * Counterpart to Solidity's `+` operator.
  151. *
  152. * Requirements:
  153. *
  154. * - Addition cannot overflow.
  155. */
  156. function add(uint256 a, uint256 b) internal pure returns (uint256) {
  157. uint256 c = a + b;
  158. require(c >= a, "SafeMath: addition overflow");
  159.  
  160. return c;
  161. }
  162.  
  163. /**
  164. * @dev Returns the subtraction of two unsigned integers, reverting on
  165. * overflow (when the result is negative).
  166. *
  167. * Counterpart to Solidity's `-` operator.
  168. *
  169. * Requirements:
  170. *
  171. * - Subtraction cannot overflow.
  172. */
  173. function sub(uint256 a, uint256 b) internal pure returns (uint256) {
  174. return sub(a, b, "SafeMath: subtraction overflow");
  175. }
  176.  
  177. /**
  178. * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
  179. * overflow (when the result is negative).
  180. *
  181. * Counterpart to Solidity's `-` operator.
  182. *
  183. * Requirements:
  184. *
  185. * - Subtraction cannot overflow.
  186. */
  187. function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
  188. require(b <= a, errorMessage);
  189. uint256 c = a - b;
  190.  
  191. return c;
  192. }
  193.  
  194. /**
  195. * @dev Returns the multiplication of two unsigned integers, reverting on
  196. * overflow.
  197. *
  198. * Counterpart to Solidity's `*` operator.
  199. *
  200. * Requirements:
  201. *
  202. * - Multiplication cannot overflow.
  203. */
  204. function mul(uint256 a, uint256 b) internal pure returns (uint256) {
  205. // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
  206. // benefit is lost if 'b' is also tested.
  207. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
  208. if (a == 0) {
  209. return 0;
  210. }
  211.  
  212. uint256 c = a * b;
  213. require(c / a == b, "SafeMath: multiplication overflow");
  214.  
  215. return c;
  216. }
  217.  
  218. /**
  219. * @dev Returns the integer division of two unsigned integers. Reverts on
  220. * division by zero. The result is rounded towards zero.
  221. *
  222. * Counterpart to Solidity's `/` operator. Note: this function uses a
  223. * `revert` opcode (which leaves remaining gas untouched) while Solidity
  224. * uses an invalid opcode to revert (consuming all remaining gas).
  225. *
  226. * Requirements:
  227. *
  228. * - The divisor cannot be zero.
  229. */
  230. function div(uint256 a, uint256 b) internal pure returns (uint256) {
  231. return div(a, b, "SafeMath: division by zero");
  232. }
  233.  
  234. /**
  235. * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
  236. * division by zero. The result is rounded towards zero.
  237. *
  238. * Counterpart to Solidity's `/` operator. Note: this function uses a
  239. * `revert` opcode (which leaves remaining gas untouched) while Solidity
  240. * uses an invalid opcode to revert (consuming all remaining gas).
  241. *
  242. * Requirements:
  243. *
  244. * - The divisor cannot be zero.
  245. */
  246. function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
  247. require(b > 0, errorMessage);
  248. uint256 c = a / b;
  249. // assert(a == b * c + a % b); // There is no case in which this doesn't hold
  250.  
  251. return c;
  252. }
  253.  
  254. /**
  255. * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
  256. * Reverts when dividing by zero.
  257. *
  258. * Counterpart to Solidity's `%` operator. This function uses a `revert`
  259. * opcode (which leaves remaining gas untouched) while Solidity uses an
  260. * invalid opcode to revert (consuming all remaining gas).
  261. *
  262. * Requirements:
  263. *
  264. * - The divisor cannot be zero.
  265. */
  266. function mod(uint256 a, uint256 b) internal pure returns (uint256) {
  267. return mod(a, b, "SafeMath: modulo by zero");
  268. }
  269.  
  270. /**
  271. * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
  272. * Reverts with custom message when dividing by zero.
  273. *
  274. * Counterpart to Solidity's `%` operator. This function uses a `revert`
  275. * opcode (which leaves remaining gas untouched) while Solidity uses an
  276. * invalid opcode to revert (consuming all remaining gas).
  277. *
  278. * Requirements:
  279. *
  280. * - The divisor cannot be zero.
  281. */
  282. function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
  283. require(b != 0, errorMessage);
  284. return a % b;
  285. }
  286. }
  287.  
  288. abstract contract Context {
  289. function _msgSender() internal view virtual returns (address payable) {
  290. return msg.sender;
  291. }
  292.  
  293. function _msgData() internal view virtual returns (bytes memory) {
  294. this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  295. return msg.data;
  296. }
  297. }
  298.  
  299.  
  300. /**
  301. * @dev Collection of functions related to the address type
  302. */
  303. library Address {
  304. /**
  305. * @dev Returns true if `account` is a contract.
  306. *
  307. * [IMPORTANT]
  308. * ====
  309. * It is unsafe to assume that an address for which this function returns
  310. * false is an externally-owned account (EOA) and not a contract.
  311. *
  312. * Among others, `isContract` will return false for the following
  313. * types of addresses:
  314. *
  315. * - an externally-owned account
  316. * - a contract in construction
  317. * - an address where a contract will be created
  318. * - an address where a contract lived, but was destroyed
  319. * ====
  320. */
  321. function isContract(address account) internal view returns (bool) {
  322. // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
  323. // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
  324. // for accounts without code, i.e. `keccak256('')`
  325. bytes32 codehash;
  326. bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
  327. // solhint-disable-next-line no-inline-assembly
  328. assembly { codehash := extcodehash(account) }
  329. return (codehash != accountHash && codehash != 0x0);
  330. }
  331.  
  332. /**
  333. * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
  334. * `recipient`, forwarding all available gas and reverting on errors.
  335. *
  336. * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
  337. * of certain opcodes, possibly making contracts go over the 2300 gas limit
  338. * imposed by `transfer`, making them unable to receive funds via
  339. * `transfer`. {sendValue} removes this limitation.
  340. *
  341. * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
  342. *
  343. * IMPORTANT: because control is transferred to `recipient`, care must be
  344. * taken to not create reentrancy vulnerabilities. Consider using
  345. * {ReentrancyGuard} or the
  346. * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
  347. */
  348. function sendValue(address payable recipient, uint256 amount) internal {
  349. require(address(this).balance >= amount, "Address: insufficient balance");
  350.  
  351. // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
  352. (bool success, ) = recipient.call{ value: amount }("");
  353. require(success, "Address: unable to send value, recipient may have reverted");
  354. }
  355.  
  356. /**
  357. * @dev Performs a Solidity function call using a low level `call`. A
  358. * plain`call` is an unsafe replacement for a function call: use this
  359. * function instead.
  360. *
  361. * If `target` reverts with a revert reason, it is bubbled up by this
  362. * function (like regular Solidity function calls).
  363. *
  364. * Returns the raw returned data. To convert to the expected return value,
  365. * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
  366. *
  367. * Requirements:
  368. *
  369. * - `target` must be a contract.
  370. * - calling `target` with `data` must not revert.
  371. *
  372. * _Available since v3.1._
  373. */
  374. function functionCall(address target, bytes memory data) internal returns (bytes memory) {
  375. return functionCall(target, data, "Address: low-level call failed");
  376. }
  377.  
  378. /**
  379. * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
  380. * `errorMessage` as a fallback revert reason when `target` reverts.
  381. *
  382. * _Available since v3.1._
  383. */
  384. function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
  385. return _functionCallWithValue(target, data, 0, errorMessage);
  386. }
  387.  
  388. /**
  389. * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
  390. * but also transferring `value` wei to `target`.
  391. *
  392. * Requirements:
  393. *
  394. * - the calling contract must have an ETH balance of at least `value`.
  395. * - the called Solidity function must be `payable`.
  396. *
  397. * _Available since v3.1._
  398. */
  399. function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
  400. return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
  401. }
  402.  
  403. /**
  404. * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
  405. * with `errorMessage` as a fallback revert reason when `target` reverts.
  406. *
  407. * _Available since v3.1._
  408. */
  409. function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
  410. require(address(this).balance >= value, "Address: insufficient balance for call");
  411. return _functionCallWithValue(target, data, value, errorMessage);
  412. }
  413.  
  414. function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
  415. require(isContract(target), "Address: call to non-contract");
  416.  
  417. // solhint-disable-next-line avoid-low-level-calls
  418. (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
  419. if (success) {
  420. return returndata;
  421. } else {
  422. // Look for revert reason and bubble it up if present
  423. if (returndata.length > 0) {
  424. // The easiest way to bubble the revert reason is using memory via assembly
  425.  
  426. // solhint-disable-next-line no-inline-assembly
  427. assembly {
  428. let returndata_size := mload(returndata)
  429. revert(add(32, returndata), returndata_size)
  430. }
  431. } else {
  432. revert(errorMessage);
  433. }
  434. }
  435. }
  436. }
  437.  
  438. /**
  439. * @dev Contract module which provides a basic access control mechanism, where
  440. * there is an account (an owner) that can be granted exclusive access to
  441. * specific functions.
  442. *
  443. * By default, the owner account will be the one that deploys the contract. This
  444. * can later be changed with {transferOwnership}.
  445. *
  446. * This module is used through inheritance. It will make available the modifier
  447. * `onlyOwner`, which can be applied to your functions to restrict their use to
  448. * the owner.
  449. */
  450. contract Ownable is Context {
  451. address private _owner;
  452. address private _previousOwner;
  453. uint256 private _lockTime;
  454.  
  455. event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
  456.  
  457. /**
  458. * @dev Initializes the contract setting the deployer as the initial owner.
  459. */
  460. constructor () internal {
  461. address msgSender = _msgSender();
  462. _owner = msgSender;
  463. emit OwnershipTransferred(address(0), msgSender);
  464. }
  465.  
  466. /**
  467. * @dev Returns the address of the current owner.
  468. */
  469. function owner() public view returns (address) {
  470. return _owner;
  471. }
  472.  
  473. /**
  474. * @dev Throws if called by any account other than the owner.
  475. */
  476. modifier onlyOwner() {
  477. require(_owner == _msgSender(), "Ownable: caller is not the owner");
  478. _;
  479. }
  480.  
  481. /**
  482. * @dev Leaves the contract without owner. It will not be possible to call
  483. * `onlyOwner` functions anymore. Can only be called by the current owner.
  484. *
  485. * NOTE: Renouncing ownership will leave the contract without an owner,
  486. * thereby removing any functionality that is only available to the owner.
  487. */
  488. function renounceOwnership() public virtual onlyOwner {
  489. emit OwnershipTransferred(_owner, address(0));
  490. _owner = address(0);
  491. }
  492.  
  493. /**
  494. * @dev Transfers ownership of the contract to a new account (`newOwner`).
  495. * Can only be called by the current owner.
  496. */
  497. function transferOwnership(address newOwner) public virtual onlyOwner {
  498. require(newOwner != address(0), "Ownable: new owner is the zero address");
  499. emit OwnershipTransferred(_owner, newOwner);
  500. _owner = newOwner;
  501. }
  502.  
  503. function geUnlockTime() public view returns (uint256) {
  504. return _lockTime;
  505. }
  506.  
  507. //Locks the contract for owner for the amount of time provided
  508. function lock(uint256 time) public virtual onlyOwner {
  509. _previousOwner = _owner;
  510. _owner = address(0);
  511. _lockTime = now + time;
  512. emit OwnershipTransferred(_owner, address(0));
  513. }
  514.  
  515. //Unlocks the contract for owner when _lockTime is exceeds
  516. function unlock() public virtual {
  517. require(_previousOwner == msg.sender, "You don't have permission to unlock");
  518. require(now > _lockTime , "Contract is locked until 7 days");
  519. emit OwnershipTransferred(_owner, _previousOwner);
  520. _owner = _previousOwner;
  521. }
  522. }
  523.  
  524. // pragma solidity >=0.5.0;
  525.  
  526. interface IUniswapV2Factory {
  527. event PairCreated(address indexed token0, address indexed token1, address pair, uint);
  528.  
  529. function feeTo() external view returns (address);
  530. function feeToSetter() external view returns (address);
  531.  
  532. function getPair(address tokenA, address tokenB) external view returns (address pair);
  533. function allPairs(uint) external view returns (address pair);
  534. function allPairsLength() external view returns (uint);
  535.  
  536. function createPair(address tokenA, address tokenB) external returns (address pair);
  537.  
  538. function setFeeTo(address) external;
  539. function setFeeToSetter(address) external;
  540. }
  541.  
  542.  
  543. // pragma solidity >=0.5.0;
  544.  
  545. interface IUniswapV2Pair {
  546. event Approval(address indexed owner, address indexed spender, uint value);
  547. event Transfer(address indexed from, address indexed to, uint value);
  548.  
  549. function name() external pure returns (string memory);
  550. function symbol() external pure returns (string memory);
  551. function decimals() external pure returns (uint8);
  552. function totalSupply() external view returns (uint);
  553. function balanceOf(address owner) external view returns (uint);
  554. function allowance(address owner, address spender) external view returns (uint);
  555.  
  556. function approve(address spender, uint value) external returns (bool);
  557. function transfer(address to, uint value) external returns (bool);
  558. function transferFrom(address from, address to, uint value) external returns (bool);
  559.  
  560. function DOMAIN_SEPARATOR() external view returns (bytes32);
  561. function PERMIT_TYPEHASH() external pure returns (bytes32);
  562. function nonces(address owner) external view returns (uint);
  563.  
  564. function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
  565.  
  566. event Mint(address indexed sender, uint amount0, uint amount1);
  567. event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
  568. event Swap(
  569. address indexed sender,
  570. uint amount0In,
  571. uint amount1In,
  572. uint amount0Out,
  573. uint amount1Out,
  574. address indexed to
  575. );
  576. event Sync(uint112 reserve0, uint112 reserve1);
  577.  
  578. function MINIMUM_LIQUIDITY() external pure returns (uint);
  579. function factory() external view returns (address);
  580. function token0() external view returns (address);
  581. function token1() external view returns (address);
  582. function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
  583. function price0CumulativeLast() external view returns (uint);
  584. function price1CumulativeLast() external view returns (uint);
  585. function kLast() external view returns (uint);
  586.  
  587. function mint(address to) external returns (uint liquidity);
  588. function burn(address to) external returns (uint amount0, uint amount1);
  589. function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
  590. function skim(address to) external;
  591. function sync() external;
  592.  
  593. function initialize(address, address) external;
  594. }
  595.  
  596. // pragma solidity >=0.6.2;
  597.  
  598. interface IUniswapV2Router01 {
  599. function factory() external pure returns (address);
  600. function WETH() external pure returns (address);
  601.  
  602. function addLiquidity(
  603. address tokenA,
  604. address tokenB,
  605. uint amountADesired,
  606. uint amountBDesired,
  607. uint amountAMin,
  608. uint amountBMin,
  609. address to,
  610. uint deadline
  611. ) external returns (uint amountA, uint amountB, uint liquidity);
  612. function addLiquidityETH(
  613. address token,
  614. uint amountTokenDesired,
  615. uint amountTokenMin,
  616. uint amountETHMin,
  617. address to,
  618. uint deadline
  619. ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
  620. function removeLiquidity(
  621. address tokenA,
  622. address tokenB,
  623. uint liquidity,
  624. uint amountAMin,
  625. uint amountBMin,
  626. address to,
  627. uint deadline
  628. ) external returns (uint amountA, uint amountB);
  629. function removeLiquidityETH(
  630. address token,
  631. uint liquidity,
  632. uint amountTokenMin,
  633. uint amountETHMin,
  634. address to,
  635. uint deadline
  636. ) external returns (uint amountToken, uint amountETH);
  637. function removeLiquidityWithPermit(
  638. address tokenA,
  639. address tokenB,
  640. uint liquidity,
  641. uint amountAMin,
  642. uint amountBMin,
  643. address to,
  644. uint deadline,
  645. bool approveMax, uint8 v, bytes32 r, bytes32 s
  646. ) external returns (uint amountA, uint amountB);
  647. function removeLiquidityETHWithPermit(
  648. address token,
  649. uint liquidity,
  650. uint amountTokenMin,
  651. uint amountETHMin,
  652. address to,
  653. uint deadline,
  654. bool approveMax, uint8 v, bytes32 r, bytes32 s
  655. ) external returns (uint amountToken, uint amountETH);
  656. function swapExactTokensForTokens(
  657. uint amountIn,
  658. uint amountOutMin,
  659. address[] calldata path,
  660. address to,
  661. uint deadline
  662. ) external returns (uint[] memory amounts);
  663. function swapTokensForExactTokens(
  664. uint amountOut,
  665. uint amountInMax,
  666. address[] calldata path,
  667. address to,
  668. uint deadline
  669. ) external returns (uint[] memory amounts);
  670. function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
  671. external
  672. payable
  673. returns (uint[] memory amounts);
  674. function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
  675. external
  676. returns (uint[] memory amounts);
  677. function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
  678. external
  679. returns (uint[] memory amounts);
  680. function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
  681. external
  682. payable
  683. returns (uint[] memory amounts);
  684.  
  685. function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
  686. function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
  687. function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
  688. function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
  689. function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
  690. }
  691.  
  692.  
  693.  
  694. // pragma solidity >=0.6.2;
  695.  
  696. interface IUniswapV2Router02 is IUniswapV2Router01 {
  697. function removeLiquidityETHSupportingFeeOnTransferTokens(
  698. address token,
  699. uint liquidity,
  700. uint amountTokenMin,
  701. uint amountETHMin,
  702. address to,
  703. uint deadline
  704. ) external returns (uint amountETH);
  705. function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
  706. address token,
  707. uint liquidity,
  708. uint amountTokenMin,
  709. uint amountETHMin,
  710. address to,
  711. uint deadline,
  712. bool approveMax, uint8 v, bytes32 r, bytes32 s
  713. ) external returns (uint amountETH);
  714.  
  715. function swapExactTokensForTokensSupportingFeeOnTransferTokens(
  716. uint amountIn,
  717. uint amountOutMin,
  718. address[] calldata path,
  719. address to,
  720. uint deadline
  721. ) external;
  722. function swapExactETHForTokensSupportingFeeOnTransferTokens(
  723. uint amountOutMin,
  724. address[] calldata path,
  725. address to,
  726. uint deadline
  727. ) external payable;
  728. function swapExactTokensForETHSupportingFeeOnTransferTokens(
  729. uint amountIn,
  730. uint amountOutMin,
  731. address[] calldata path,
  732. address to,
  733. uint deadline
  734. ) external;
  735. }
  736.  
  737.  
  738. contract Herpes is Context, IERC20, Ownable {
  739. using SafeMath for uint256;
  740. using Address for address;
  741.  
  742. mapping (address => uint256) private _rOwned;
  743. mapping (address => uint256) private _tOwned;
  744. mapping (address => mapping (address => uint256)) private _allowances;
  745.  
  746. mapping (address => bool) private _isExcludedFromFee;
  747.  
  748. mapping (address => bool) private _isExcluded;
  749. address[] private _excluded;
  750.  
  751. uint256 private constant MAX = ~uint256(0);
  752. uint256 private _tTotal = 696969696969696969696969;
  753. uint256 private _rTotal = (MAX - (MAX % _tTotal));
  754. uint256 private _tFeeTotal;
  755.  
  756. string private _name = "Herpes";
  757. string private _symbol = "HERPES";
  758. uint8 private _decimals = 9;
  759.  
  760. uint256 public _taxFee = 8;
  761. uint256 private _previousTaxFee = _taxFee;
  762.  
  763. uint256 public _liquidityFee = 2;
  764. uint256 private _previousLiquidityFee = _liquidityFee;
  765.  
  766. IUniswapV2Router02 public uniswapV2Router;
  767. address public uniswapV2Pair;
  768.  
  769. bool inSwapAndLiquify;
  770. bool public swapAndLiquifyEnabled = true;
  771.  
  772. uint256 public _maxTxAmount = _tTotal;
  773. uint256 private numTokensSellToAddToLiquidity = _tTotal;
  774.  
  775. event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);
  776. event SwapAndLiquifyEnabledUpdated(bool enabled);
  777. event SwapAndLiquify(
  778. uint256 tokensSwapped,
  779. uint256 ethReceived,
  780. uint256 tokensIntoLiqudity
  781. );
  782.  
  783. modifier lockTheSwap {
  784. inSwapAndLiquify = true;
  785. _;
  786. inSwapAndLiquify = false;
  787. }
  788.  
  789. constructor () public {
  790. _rOwned[_msgSender()] = _rTotal;
  791.  
  792. // @ES: PancakeSwap V2 Router BSC mainnet address: 0x10ED43C718714eb63d5aA57B78B54704E256024E
  793. // @ES: PancakeSwap V2 Router BSC testnet address: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1
  794. IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);
  795.  
  796. // Create a uniswap pair for this new token
  797. uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
  798. .createPair(address(this), _uniswapV2Router.WETH());
  799.  
  800. // set the rest of the contract variables
  801. uniswapV2Router = _uniswapV2Router;
  802.  
  803. //exclude owner and this contract from fee
  804. _isExcludedFromFee[owner()] = true;
  805. _isExcludedFromFee[address(this)] = true;
  806.  
  807. // @ES: Exclude owner and specific burn wallets from the reward.
  808. excludeFromReward(owner());
  809. excludeFromReward(0x000000000000000000000000000000000000dEaD);
  810. excludeFromReward(0x0000000000000000000000000000000000000001);
  811.  
  812. emit Transfer(address(0), _msgSender(), _tTotal);
  813. }
  814.  
  815. /*
  816. * A method allow the contract owner to change the Uniswap router address.
  817. *
  818. * For use in the event of a new major version release of Uniswap.
  819. *
  820. * This patch is credited to user FreezyEx from forum.openzeppelin.com
  821. */
  822. function setRouterAddress(address newRouter) public onlyOwner() {
  823. IUniswapV2Router02 _newPancakeRouter = IUniswapV2Router02(newRouter);
  824. uniswapV2Pair = IUniswapV2Factory(_newPancakeRouter.factory()).createPair(address(this), _newPancakeRouter.WETH());
  825. uniswapV2Router = _newPancakeRouter;
  826. }
  827.  
  828. function name() public view returns (string memory) {
  829. return _name;
  830. }
  831.  
  832. function symbol() public view returns (string memory) {
  833. return _symbol;
  834. }
  835.  
  836. function decimals() public view returns (uint8) {
  837. return _decimals;
  838. }
  839.  
  840. function totalSupply() public view override returns (uint256) {
  841. return _tTotal;
  842. }
  843.  
  844. function balanceOf(address account) public view override returns (uint256) {
  845. if (_isExcluded[account]) return _tOwned[account];
  846. return tokenFromReflection(_rOwned[account]);
  847. }
  848.  
  849. function transfer(address recipient, uint256 amount) public override returns (bool) {
  850. _transfer(_msgSender(), recipient, amount);
  851. return true;
  852. }
  853.  
  854. function allowance(address owner, address spender) public view override returns (uint256) {
  855. return _allowances[owner][spender];
  856. }
  857.  
  858. function approve(address spender, uint256 amount) public override returns (bool) {
  859. _approve(_msgSender(), spender, amount);
  860. return true;
  861. }
  862.  
  863. function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
  864. _transfer(sender, recipient, amount);
  865. _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
  866. return true;
  867. }
  868.  
  869. function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
  870. _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
  871. return true;
  872. }
  873.  
  874. function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
  875. _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
  876. return true;
  877. }
  878.  
  879. function isExcludedFromReward(address account) public view returns (bool) {
  880. return _isExcluded[account];
  881. }
  882.  
  883. function totalFees() public view returns (uint256) {
  884. return _tFeeTotal;
  885. }
  886.  
  887. function deliver(uint256 tAmount) public {
  888. address sender = _msgSender();
  889. require(!_isExcluded[sender], "Excluded addresses cannot call this function");
  890. (uint256 rAmount,,,,,) = _getValues(tAmount);
  891. _rOwned[sender] = _rOwned[sender].sub(rAmount);
  892. _rTotal = _rTotal.sub(rAmount);
  893. _tFeeTotal = _tFeeTotal.add(tAmount);
  894. }
  895.  
  896. function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
  897. require(tAmount <= _tTotal, "Amount must be less than supply");
  898. if (!deductTransferFee) {
  899. (uint256 rAmount,,,,,) = _getValues(tAmount);
  900. return rAmount;
  901. } else {
  902. (,uint256 rTransferAmount,,,,) = _getValues(tAmount);
  903. return rTransferAmount;
  904. }
  905. }
  906.  
  907. function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
  908. require(rAmount <= _rTotal, "Amount must be less than total reflections");
  909. uint256 currentRate = _getRate();
  910. return rAmount.div(currentRate);
  911. }
  912.  
  913. function excludeFromReward(address account) public onlyOwner() {
  914. // require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not exclude Uniswap router.');
  915. require(!_isExcluded[account], "Account is already excluded");
  916. if(_rOwned[account] > 0) {
  917. _tOwned[account] = tokenFromReflection(_rOwned[account]);
  918. }
  919. _isExcluded[account] = true;
  920. _excluded.push(account);
  921. }
  922.  
  923. function includeInReward(address account) external onlyOwner() {
  924. require(_isExcluded[account], "Account is already excluded");
  925. for (uint256 i = 0; i < _excluded.length; i++) {
  926. if (_excluded[i] == account) {
  927. _excluded[i] = _excluded[_excluded.length - 1];
  928. _tOwned[account] = 0;
  929. _isExcluded[account] = false;
  930. _excluded.pop();
  931. break;
  932. }
  933. }
  934. }
  935. function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
  936. (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
  937. _tOwned[sender] = _tOwned[sender].sub(tAmount);
  938. _rOwned[sender] = _rOwned[sender].sub(rAmount);
  939. _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
  940. _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
  941. _takeLiquidity(tLiquidity);
  942. _reflectFee(rFee, tFee);
  943. emit Transfer(sender, recipient, tTransferAmount);
  944. }
  945.  
  946. function excludeFromFee(address account) public onlyOwner {
  947. _isExcludedFromFee[account] = true;
  948. }
  949.  
  950. function includeInFee(address account) public onlyOwner {
  951. _isExcludedFromFee[account] = false;
  952. }
  953.  
  954. function setTaxFeePercent(uint256 taxFee) external onlyOwner() {
  955. _taxFee = taxFee;
  956. }
  957.  
  958. function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() {
  959. _liquidityFee = liquidityFee;
  960. }
  961.  
  962. function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
  963. _maxTxAmount = _tTotal.mul(maxTxPercent).div(
  964. 10**2
  965. );
  966. }
  967.  
  968. function setMaxTxPermille(uint256 maxTxPermille) external onlyOwner() {
  969. _maxTxAmount = _tTotal.mul(maxTxPermille).div(
  970. 10**3
  971. );
  972. }
  973.  
  974. function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {
  975. swapAndLiquifyEnabled = _enabled;
  976. emit SwapAndLiquifyEnabledUpdated(_enabled);
  977. }
  978.  
  979. //to recieve ETH from uniswapV2Router when swaping
  980. receive() external payable {}
  981.  
  982. function _reflectFee(uint256 rFee, uint256 tFee) private {
  983. _rTotal = _rTotal.sub(rFee);
  984. _tFeeTotal = _tFeeTotal.add(tFee);
  985. }
  986.  
  987. function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
  988. (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount);
  989. (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate());
  990. return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity);
  991. }
  992.  
  993. function _getTValues(uint256 tAmount) private view returns (uint256, uint256, uint256) {
  994. uint256 tFee = calculateTaxFee(tAmount);
  995. uint256 tLiquidity = calculateLiquidityFee(tAmount);
  996. uint256 tTransferAmount = tAmount.sub(tFee).sub(tLiquidity);
  997. return (tTransferAmount, tFee, tLiquidity);
  998. }
  999.  
  1000. function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
  1001. uint256 rAmount = tAmount.mul(currentRate);
  1002. uint256 rFee = tFee.mul(currentRate);
  1003. uint256 rLiquidity = tLiquidity.mul(currentRate);
  1004. uint256 rTransferAmount = rAmount.sub(rFee).sub(rLiquidity);
  1005. return (rAmount, rTransferAmount, rFee);
  1006. }
  1007.  
  1008. function _getRate() private view returns(uint256) {
  1009. (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
  1010. return rSupply.div(tSupply);
  1011. }
  1012.  
  1013. function _getCurrentSupply() private view returns(uint256, uint256) {
  1014. uint256 rSupply = _rTotal;
  1015. uint256 tSupply = _tTotal;
  1016. for (uint256 i = 0; i < _excluded.length; i++) {
  1017. if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
  1018. rSupply = rSupply.sub(_rOwned[_excluded[i]]);
  1019. tSupply = tSupply.sub(_tOwned[_excluded[i]]);
  1020. }
  1021. if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
  1022. return (rSupply, tSupply);
  1023. }
  1024.  
  1025. function _takeLiquidity(uint256 tLiquidity) private {
  1026. uint256 currentRate = _getRate();
  1027. uint256 rLiquidity = tLiquidity.mul(currentRate);
  1028. _rOwned[address(this)] = _rOwned[address(this)].add(rLiquidity);
  1029. if(_isExcluded[address(this)])
  1030. _tOwned[address(this)] = _tOwned[address(this)].add(tLiquidity);
  1031. }
  1032.  
  1033. function calculateTaxFee(uint256 _amount) private view returns (uint256) {
  1034. return _amount.mul(_taxFee).div(
  1035. 10**2
  1036. );
  1037. }
  1038.  
  1039. function calculateLiquidityFee(uint256 _amount) private view returns (uint256) {
  1040. return _amount.mul(_liquidityFee).div(
  1041. 10**2
  1042. );
  1043. }
  1044.  
  1045. function removeAllFee() private {
  1046. if(_taxFee == 0 && _liquidityFee == 0) return;
  1047.  
  1048. _previousTaxFee = _taxFee;
  1049. _previousLiquidityFee = _liquidityFee;
  1050.  
  1051. _taxFee = 0;
  1052. _liquidityFee = 0;
  1053. }
  1054.  
  1055. function restoreAllFee() private {
  1056. _taxFee = _previousTaxFee;
  1057. _liquidityFee = _previousLiquidityFee;
  1058. }
  1059.  
  1060. function isExcludedFromFee(address account) public view returns(bool) {
  1061. return _isExcludedFromFee[account];
  1062. }
  1063.  
  1064. function _approve(address owner, address spender, uint256 amount) private {
  1065. require(owner != address(0), "ERC20: approve from the zero address");
  1066. require(spender != address(0), "ERC20: approve to the zero address");
  1067.  
  1068. _allowances[owner][spender] = amount;
  1069. emit Approval(owner, spender, amount);
  1070. }
  1071.  
  1072. function _transfer(
  1073. address from,
  1074. address to,
  1075. uint256 amount
  1076. ) private {
  1077. require(from != address(0), "ERC20: transfer from the zero address");
  1078. require(to != address(0), "ERC20: transfer to the zero address");
  1079. require(amount > 0, "Transfer amount must be greater than zero");
  1080. if(from != owner() && to != owner())
  1081. require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
  1082.  
  1083. // is the token balance of this contract address over the min number of
  1084. // tokens that we need to initiate a swap + liquidity lock?
  1085. // also, don't get caught in a circular liquidity event.
  1086. // also, don't swap & liquify if sender is uniswap pair.
  1087. uint256 contractTokenBalance = balanceOf(address(this));
  1088.  
  1089. if(contractTokenBalance >= _maxTxAmount)
  1090. {
  1091. contractTokenBalance = _maxTxAmount;
  1092. }
  1093.  
  1094. bool overMinTokenBalance = contractTokenBalance >= numTokensSellToAddToLiquidity;
  1095. if (
  1096. overMinTokenBalance &&
  1097. !inSwapAndLiquify &&
  1098. from != uniswapV2Pair &&
  1099. swapAndLiquifyEnabled
  1100. ) {
  1101. contractTokenBalance = numTokensSellToAddToLiquidity;
  1102. //add liquidity
  1103. swapAndLiquify(contractTokenBalance);
  1104. }
  1105.  
  1106. //indicates if fee should be deducted from transfer
  1107. bool takeFee = true;
  1108.  
  1109. //if any account belongs to _isExcludedFromFee account then remove the fee
  1110. if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
  1111. takeFee = false;
  1112. }
  1113.  
  1114. //transfer amount, it will take tax, burn, liquidity fee
  1115. _tokenTransfer(from,to,amount,takeFee);
  1116. }
  1117.  
  1118. function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
  1119. // split the contract balance into halves
  1120. uint256 half = contractTokenBalance.div(2);
  1121. uint256 otherHalf = contractTokenBalance.sub(half);
  1122.  
  1123. // capture the contract's current ETH balance.
  1124. // this is so that we can capture exactly the amount of ETH that the
  1125. // swap creates, and not make the liquidity event include any ETH that
  1126. // has been manually sent to the contract
  1127. uint256 initialBalance = address(this).balance;
  1128.  
  1129. // swap tokens for ETH
  1130. swapTokensForEth(half); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered
  1131.  
  1132. // how much ETH did we just swap into?
  1133. uint256 newBalance = address(this).balance.sub(initialBalance);
  1134.  
  1135. // add liquidity to uniswap
  1136. addLiquidity(otherHalf, newBalance);
  1137.  
  1138. emit SwapAndLiquify(half, newBalance, otherHalf);
  1139. }
  1140.  
  1141. function swapTokensForEth(uint256 tokenAmount) private {
  1142. // generate the uniswap pair path of token -> weth
  1143. address[] memory path = new address[](2);
  1144. path[0] = address(this);
  1145. path[1] = uniswapV2Router.WETH();
  1146.  
  1147. _approve(address(this), address(uniswapV2Router), tokenAmount);
  1148.  
  1149. // make the swap
  1150. uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
  1151. tokenAmount,
  1152. 0, // accept any amount of ETH
  1153. path,
  1154. address(this),
  1155. block.timestamp
  1156. );
  1157. }
  1158.  
  1159. function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
  1160. // approve token transfer to cover all possible scenarios
  1161. _approve(address(this), address(uniswapV2Router), tokenAmount);
  1162.  
  1163. // add the liquidity
  1164. uniswapV2Router.addLiquidityETH{value: ethAmount}(
  1165. address(this),
  1166. tokenAmount,
  1167. 0, // slippage is unavoidable
  1168. 0, // slippage is unavoidable
  1169. owner(),
  1170. block.timestamp
  1171. );
  1172. }
  1173.  
  1174. //this method is responsible for taking all fee, if takeFee is true
  1175. function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private {
  1176. if(!takeFee)
  1177. removeAllFee();
  1178.  
  1179. if (_isExcluded[sender] && !_isExcluded[recipient]) {
  1180. _transferFromExcluded(sender, recipient, amount);
  1181. } else if (!_isExcluded[sender] && _isExcluded[recipient]) {
  1182. _transferToExcluded(sender, recipient, amount);
  1183. } else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
  1184. _transferStandard(sender, recipient, amount);
  1185. } else if (_isExcluded[sender] && _isExcluded[recipient]) {
  1186. _transferBothExcluded(sender, recipient, amount);
  1187. } else {
  1188. _transferStandard(sender, recipient, amount);
  1189. }
  1190.  
  1191. if(!takeFee)
  1192. restoreAllFee();
  1193. }
  1194.  
  1195. function _transferStandard(address sender, address recipient, uint256 tAmount) private {
  1196. (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
  1197. _rOwned[sender] = _rOwned[sender].sub(rAmount);
  1198. _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
  1199. _takeLiquidity(tLiquidity);
  1200. _reflectFee(rFee, tFee);
  1201. emit Transfer(sender, recipient, tTransferAmount);
  1202. }
  1203.  
  1204. function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
  1205. (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
  1206. _rOwned[sender] = _rOwned[sender].sub(rAmount);
  1207. _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
  1208. _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
  1209. _takeLiquidity(tLiquidity);
  1210. _reflectFee(rFee, tFee);
  1211. emit Transfer(sender, recipient, tTransferAmount);
  1212. }
  1213.  
  1214. function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
  1215. (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
  1216. _tOwned[sender] = _tOwned[sender].sub(tAmount);
  1217. _rOwned[sender] = _rOwned[sender].sub(rAmount);
  1218. _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
  1219. _takeLiquidity(tLiquidity);
  1220. _reflectFee(rFee, tFee);
  1221. emit Transfer(sender, recipient, tTransferAmount);
  1222. }
  1223. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement