Pepega
Search
K
👨💻

Contract

pepega.sol
1
/*
2
██████╗ ███████╗ ██████╗ ███████╗ ██████╗ █████╗
3
██╔══██╗ ██╔════╝ ██╔══██╗ ██╔════╝ ██╔════╝ ██╔══██╗
4
██████╔╝ █████╗ ██████╔╝ █████╗ ██║ ███╗ ███████║
5
██╔═══╝ ██╔══╝ ██╔═══╝ ██╔══╝ ██║ ██║ ██╔══██║
6
██║ ███████╗ ██║ ███████╗ ╚██████╔╝ ██║ ██║
7
╚═╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝
8
'
9
10
https://www.pepega.app/
11
https://twitter.com/PEPEGAtoken
12
https://discord.com/invite/3jxRdcgrRK
13
https://t.me/Pepega_Token
14
*/
15
// SPDX-License-Identifier: MIT
16
pragma solidity ^0.8.15;
17
pragma experimental ABIEncoderV2;
18
19
abstract contract Context {
20
function _msgSender() internal view virtual returns (address) {
21
return msg.sender;
22
}
23
24
function _msgData() internal view virtual returns (bytes calldata) {
25
return msg.data;
26
}
27
}
28
29
contract Ownable is Context {
30
address private _owner;
31
32
event OwnershipTransferred(
33
address indexed previousOwner,
34
address indexed newOwner
35
);
36
37
/**
38
* @dev Initializes the contract setting the deployer as the initial owner.
39
*/
40
constructor() {
41
_transferOwnership(_msgSender());
42
}
43
44
/**
45
* @dev Returns the address of the current owner.
46
*/
47
function owner() public view virtual returns (address) {
48
return _owner;
49
}
50
51
/**
52
* @dev Throws if called by any account other than the owner.
53
*/
54
modifier onlyOwner() {
55
require(owner() == _msgSender(), "Ownable: caller is not the owner");
56
_;
57
}
58
59
function renounceOwnership() public virtual onlyOwner {
60
_transferOwnership(address(0));
61
}
62
63
/**
64
* @dev Transfers ownership of the contract to a new account (`newOwner`).
65
* Can only be called by the current owner.
66
*/
67
function transferOwnership(address newOwner) public virtual onlyOwner {
68
require(
69
newOwner != address(0),
70
"Ownable: new owner is the zero address"
71
);
72
_transferOwnership(newOwner);
73
}
74
75
/**
76
* @dev Transfers ownership of the contract to a new account (`newOwner`).
77
* Internal function without access restriction.
78
*/
79
function _transferOwnership(address newOwner) internal virtual {
80
address oldOwner = _owner;
81
_owner = newOwner;
82
emit OwnershipTransferred(oldOwner, newOwner);
83
}
84
}
85
86
interface IERC20 {
87
/**
88
* @dev Returns the amount of tokens in existence.
89
*/
90
function totalSupply() external view returns (uint256);
91
92
/**
93
* @dev Returns the amount of tokens owned by `account`.
94
*/
95
function balanceOf(address account) external view returns (uint256);
96
97
/**
98
* @dev Moves `amount` tokens from the caller's account to `recipient`.
99
*
100
* Returns a boolean value indicating whbnber the operation succeeded.
101
*
102
* Emits a {Transfer} event.
103
*/
104
function transfer(
105
address recipient,
106
uint256 amount
107
) external returns (bool);
108
109
function allowance(
110
address owner,
111
address spender
112
) external view returns (uint256);
113
114
function approve(address spender, uint256 amount) external returns (bool);
115
116
function transferFrom(
117
address sender,
118
address recipient,
119
uint256 amount
120
) external returns (bool);
121
122
/**
123
* @dev Emitted when `value` tokens are moved from one account (`from`) to
124
* another (`to`).
125
*
126
* Note that `value` may be zero.
127
*/
128
event Transfer(address indexed from, address indexed to, uint256 value);
129
130
/**
131
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
132
* a call to {approve}. `value` is the new allowance.
133
*/
134
event Approval(
135
address indexed owner,
136
address indexed spender,
137
uint256 value
138
);
139
}
140
141
interface IERC20Metadata is IERC20 {
142
/**
143
* @dev Returns the name of the token.
144
*/
145
function name() external view returns (string memory);
146
147
/**
148
* @dev Returns the symbol of the token.
149
*/
150
function symbol() external view returns (string memory);
151
152
/**
153
* @dev Returns the decimals places of the token.
154
*/
155
function decimals() external view returns (uint8);
156
}
157
158
contract ERC20 is Context, IERC20, IERC20Metadata {
159
mapping(address => uint256) private _balances;
160
161
mapping(address => mapping(address => uint256)) private _allowances;
162
163
uint256 private _totalSupply;
164
165
string private _name;
166
string private _symbol;
167
168
/**
169
* @dev Sets the values for {name} and {symbol}.
170
*
171
* The default value of {decimals} is 18. To select a different value for
172
* {decimals} you should overload it.
173
*
174
* All two of these values are immutable: they can only be set once during
175
* construction.
176
*/
177
constructor(string memory name_, string memory symbol_) {
178
_name = name_;
179
_symbol = symbol_;
180
}
181
182
/**
183
* @dev Returns the name of the token.
184
*/
185
function name() public view virtual override returns (string memory) {
186
return _name;
187
}
188
189
/**
190
* @dev Returns the symbol of the token, usually a shorter version of the
191
* name.
192
*/
193
function symbol() public view virtual override returns (string memory) {
194
return _symbol;
195
}
196
197
function decimals() public view virtual override returns (uint8) {
198
return 18;
199
}
200
201
/**
202
* @dev See {IERC20-totalSupply}.
203
*/
204
function totalSupply() public view virtual override returns (uint256) {
205
return _totalSupply;
206
}
207
208
/**
209
* @dev See {IERC20-balanceOf}.
210
*/
211
function balanceOf(
212
address account
213
) public view virtual override returns (uint256) {
214
return _balances[account];
215
}
216
217
function transfer(
218
address recipient,
219
uint256 amount
220
) public virtual override returns (bool) {
221
_transfer(_msgSender(), recipient, amount);
222
return true;
223
}
224
225
/**
226
* @dev See {IERC20-allowance}.
227
*/
228
function allowance(
229
address owner,
230
address spender
231
) public view virtual override returns (uint256) {
232
return _allowances[owner][spender];
233
}
234
235
/**
236
* @dev See {IERC20-approve}.
237
*
238
* Requirements:
239
*
240
* - `spender` cannot be the zero address.
241
*/
242
function approve(
243
address spender,
244
uint256 amount
245
) public virtual override returns (bool) {
246
_approve(_msgSender(), spender, amount);
247
return true;
248
}
249
250
function transferFrom(
251
address sender,
252
address recipient,
253
uint256 amount
254
) public virtual override returns (bool) {
255
_transfer(sender, recipient, amount);
256
257
uint256 currentAllowance = _allowances[sender][_msgSender()];
258
require(
259
currentAllowance >= amount,
260
"ERC20: transfer amount exceeds allowance"
261
);
262
unchecked {
263
_approve(sender, _msgSender(), currentAllowance - amount);
264
}
265
266
return true;
267
}
268
269
function increaseAllowance(
270
address spender,
271
uint256 addedValue
272
) public virtual returns (bool) {
273
_approve(
274
_msgSender(),
275
spender,
276
_allowances[_msgSender()][spender] + addedValue
277
);
278
return true;
279
}
280
281
function decreaseAllowance(
282
address spender,
283
uint256 subtractedValue
284
) public virtual returns (bool) {
285
uint256 currentAllowance = _allowances[_msgSender()][spender];
286
require(
287
currentAllowance >= subtractedValue,
288
"ERC20: decreased allowance below zero"
289
);
290
unchecked {
291
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
292
}
293
294
return true;
295
}
296
297
function _transfer(
298
address sender,
299
address recipient,
300
uint256 amount
301
) internal virtual {
302
require(sender != address(0), "ERC20: transfer from the zero address");
303
require(recipient != address(0), "ERC20: transfer to the zero address");
304
305
_beforeTokenTransfer(sender, recipient, amount);
306
307
uint256 senderBalance = _balances[sender];
308
require(
309
senderBalance >= amount,
310
"ERC20: transfer amount exceeds balance"
311
);
312
unchecked {
313
_balances[sender] = senderBalance - amount;
314
}
315
_balances[recipient] += amount;
316
317
emit Transfer(sender, recipient, amount);
318
319
_afterTokenTransfer(sender, recipient, amount);
320
}
321
322
function _mint(address account, uint256 amount) internal virtual {
323
require(account != address(0), "ERC20: mint to the zero address");
324
325
_beforeTokenTransfer(address(0), account, amount);
326
327
_totalSupply += amount;
328
_balances[account] += amount;
329
emit Transfer(address(0), account, amount);
330
331
_afterTokenTransfer(address(0), account, amount);
332
}
333
334
function _burn(address account, uint256 amount) internal virtual {
335
require(account != address(0), "ERC20: burn from the zero address");
336
337
_beforeTokenTransfer(account, address(0), amount);
338
339
uint256 accountBalance = _balances[account];
340
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
341
unchecked {
342
_balances[account] = accountBalance - amount;
343
}
344
_totalSupply -= amount;
345
346
emit Transfer(account, address(0), amount);
347
348
_afterTokenTransfer(account, address(0), amount);
349
}
350
351
function _approve(
352
address owner,
353
address spender,
354
uint256 amount
355
) internal virtual {
356
require(owner != address(0), "ERC20: approve from the zero address");
357
require(spender != address(0), "ERC20: approve to the zero address");
358
359
_allowances[owner][spender] = amount;
360
emit Approval(owner, spender, amount);
361
}
362
363
function _beforeTokenTransfer(
364
address from,
365
address to,
366
uint256 amount
367
) internal virtual {}
368
369
function _afterTokenTransfer(
370
address from,
371
address to,
372
uint256 amount
373
) internal virtual {}
374
}
375
376
library SafeMath {
377
/**
378
* @dev Returns the addition of two unsigned integers, with an overflow flag.
379
*
380
* _Available since v3.4._
381
*/
382
function tryAdd(
383
uint256 a,
384
uint256 b
385
) internal pure returns (bool, uint256) {
386
unchecked {
387
uint256 c = a + b;
388
if (c < a) return (false, 0);
389
return (true, c);
390
}
391
}
392
393
/**
394
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
395
*
396
* _Available since v3.4._
397
*/
398
function trySub(
399
uint256 a,
400
uint256 b
401
) internal pure returns (bool, uint256) {
402
unchecked {
403
if (b > a) return (false, 0);
404
return (true, a - b);
405
}
406
}
407
408
/**
409
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
410
*
411
* _Available since v3.4._
412
*/
413
function tryMul(
414
uint256 a,
415
uint256 b
416
) internal pure returns (bool, uint256) {
417
unchecked {
418
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
419
// benefit is lost if 'b' is also tested.
420
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
421
if (a == 0) return (true, 0);
422
uint256 c = a * b;
423
if (c / a != b) return (false, 0);
424
return (true, c);
425
}
426
}
427
428
/**
429
* @dev Returns the division of two unsigned integers, with a division by zero flag.
430
*
431
* _Available since v3.4._
432
*/
433
function tryDiv(
434
uint256 a,
435
uint256 b
436
) internal pure returns (bool, uint256) {
437
unchecked {
438
if (b == 0) return (false, 0);
439
return (true, a / b);
440
}
441
}
442
443
/**
444
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
445
*
446
* _Available since v3.4._
447
*/
448
function tryMod(
449
uint256 a,
450
uint256 b
451
) internal pure returns (bool, uint256) {
452
unchecked {
453
if (b == 0) return (false, 0);
454
return (true, a % b);
455
}
456
}
457
458
function add(uint256 a, uint256 b) internal pure returns (uint256) {
459
return a + b;
460
}
461
462
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
463
return a - b;
464
}
465
466
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
467
return a * b;
468
}
469
470
function div(uint256 a, uint256 b) internal pure returns (uint256) {
471
return a / b;
472
}
473
474
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
475
return a % b;
476
}
477
478
function sub(
479
uint256 a,
480
uint256 b,
481
string memory errorMessage
482
) internal pure returns (uint256) {
483
unchecked {
484
require(b <= a, errorMessage);
485
return a - b;
486
}
487
}
488
489
function div(
490
uint256 a,
491
uint256 b,
492
string memory errorMessage
493
) internal pure returns (uint256) {
494
unchecked {
495
require(b > 0, errorMessage);
496
return a / b;
497
}
498
}
499
500
function mod(
501
uint256 a,
502
uint256 b,
503
string memory errorMessage
504
) internal pure returns (uint256) {
505
unchecked {
506
require(b > 0, errorMessage);
507
return a % b;
508
}
509
}
510
}
511
512
interface IUniswapV2Factory {
513
event PairCreated(
514
address indexed token0,
515
address indexed token1,
516
address pair,
517
uint256
518
);
519
520
function feeTo() external view returns (address);
521
522
function feeToSetter() external view returns (address);
523
524
function getPair(
525
address tokenA,
526
address tokenB
527
) external view returns (address pair);
528
529
function allPairs(uint256) external view returns (address pair);
530
531
function allPairsLength() external view returns (uint256);
532
533
function createPair(
534
address tokenA,
535
address tokenB
536
) external returns (address pair);
537
538
function setFeeTo(address) external;
539
540
function setFeeToSetter(address) external;
541
}
542
543
interface IUniswapV2Pair {
544
event Approval(
545
address indexed owner,
546
address indexed spender,
547
uint256 value
548
);
549
event Transfer(address indexed from, address indexed to, uint256 value);
550
551
function name() external pure returns (string memory);
552
553
function symbol() external pure returns (string memory);
554
555
function decimals() external pure returns (uint8);
556
557
function totalSupply() external view returns (uint256);
558
559
function balanceOf(address owner) external view returns (uint256);
560
561
function allowance(
562
address owner,
563
address spender
564
) external view returns (uint256);
565
566
function approve(address spender, uint256 value) external returns (bool);
567
568
function transfer(address to, uint256 value) external returns (bool);
569
570
function transferFrom(
571
address from,
572
address to,
573
uint256 value
574
) external returns (bool);
575
576
function DOMAIN_SEPARATOR() external view returns (bytes32);
577
578
function PERMIT_TYPEHASH() external pure returns (bytes32);
579
580
function nonces(address owner) external view returns (uint256);
581
582
function permit(
583
address owner,
584
address spender,
585
uint256 value,
586
uint256 deadline,
587
uint8 v,
588
bytes32 r,
589
bytes32 s
590
) external;
591
592
event Mint(address indexed sender, uint256 amount0, uint256 amount1);
593
event Burn(
594
address indexed sender,
595
uint256 amount0,
596
uint256 amount1,
597
address indexed to
598
);
599
event Swap(
600
address indexed sender,
601
uint256 amount0In,
602
uint256 amount1In,
603
uint256 amount0Out,
604
uint256 amount1Out,
605
address indexed to
606
);
607
event Sync(uint112 reserve0, uint112 reserve1);
608
609
function MINIMUM_LIQUIDITY() external pure returns (uint256);
610
611
function factory() external view returns (address);
612
613
function token0() external view returns (address);
614
615
function token1() external view returns (address);
616
617
function getReserves()
618
external
619
view
620
returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
621
622
function price0CumulativeLast() external view returns (uint256);
623
624
function price1CumulativeLast() external view returns (uint256);
625
626
function kLast() external view returns (uint256);
627
628
function mint(address to) external returns (uint256 liquidity);
629
630
function burn(
631
address to
632
) external returns (uint256 amount0, uint256 amount1);
633
634
function swap(
635
uint256 amount0Out,
636
uint256 amount1Out,
637
address to,
638
bytes calldata data
639
) external;
640
641
function skim(address to) external;
642
643
function sync() external;
644
645
function initialize(address, address) external;
646
}
647
648
interface IUniswapV2Router02 {
649
function factory() external pure returns (address);
650
651
function WETH() external pure returns (address);
652
653
function addLiquidity(
654
address tokenA,
655
address tokenB,
656
uint256 amountADesired,
657
uint256 amountBDesired,
658
uint256 amountAMin,
659
uint256 amountBMin,
660
address to,
661
uint256 deadline
662
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);
663
664
function addLiquidityETH(
665
address token,
666
uint256 amountTokenDesired,
667
uint256 amountTokenMin,
668
uint256 amountETHMin,
669
address to,
670
uint256 deadline
671
)
672
external
673
payable
674
returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
675
676
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
677
uint256 amountIn,
678
uint256 amountOutMin,
679
address[] calldata path,
680
address to,
681
uint256 deadline
682
) external;
683
684
function swapExactETHForTokensSupportingFeeOnTransferTokens(
685
uint256 amountOutMin,
686
address[] calldata path,
687
address to,
688
uint256 deadline
689
) external payable;
690
691
function swapExactTokensForETHSupportingFeeOnTransferTokens(
692
uint256 amountIn,
693
uint256 amountOutMin,
694
address[] calldata path,
695
address to,
696
uint256 deadline
697
) external;
698
}
699
700
contract Pepega is ERC20, Ownable {
701
using SafeMath for uint256;
702
703
IUniswapV2Router02 public immutable pcsswapV2Router;
704
address public immutable pcsswapV2Pair;
705
address public constant deadAddress = address(0xdead);
706
707
bool private swapping;
708
709
address public marketingWallet;
710
711
uint256 public maxTransactionAmount;
712
uint256 public swapTokensAtAmount;
713
uint256 public maxWallet;
714
715
bool public limitsInEffect = true;
716
bool public tradingActive = false;
717
bool public swapEnabled = false;
718
719
uint256 public launchedAt;
720
uint256 public launchedAtTimestamp;
721
722
uint256 public buyMarketingFee = 0;
723
724
uint256 public sellMarketingFee = 0;
725
726
uint256 public tokensForMarketing;
727
728
/******************/
729
730
// exlcude from fees and max transaction amount
731
mapping(address => bool) private _isExcludedFromFees;
732
mapping(address => bool) public _isExcludedMaxTransactionAmount;
733
// store addresses that a automatic market maker pairs. Any transfer *to* these addresses
734
// could be subject to a maximum transfer amount
735
mapping(address => bool) public automatedMarketMakerPairs;
736
737
event UpdateUniswapV2Router(
738
address indexed newAddress,
739
address indexed oldAddress
740
);
741
742
event ExcludeFromFees(address indexed account, bool isExcluded);
743
744
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
745
746
event marketingWalletUpdated(
747
address indexed newWallet,
748
address indexed oldWallet
749
);
750
751
constructor() ERC20("Pepega", "$PEPEGA") {
752
IUniswapV2Router02 _pcsswapV2Router = IUniswapV2Router02(
753
0x10ED43C718714eb63d5aA57B78B54704E256024E
754
);
755
756
excludeFromMaxTransaction(address(_pcsswapV2Router), true);
757
pcsswapV2Router = _pcsswapV2Router;
758
759
pcsswapV2Pair = IUniswapV2Factory(_pcsswapV2Router.factory())
760
.createPair(address(this), _pcsswapV2Router.WETH());
761
excludeFromMaxTransaction(address(pcsswapV2Pair), true);
762
_setAutomatedMarketMakerPair(address(pcsswapV2Pair), true);
763
764
uint256 totalSupply = 1_000_000_000 * 1e18;
765
766
maxTransactionAmount = totalSupply / 100; // 1% from total supply maxTransactionAmountTxn
767
maxWallet = totalSupply.mul(3) / 100; // 3% from total supply maxWallet
768
swapTokensAtAmount = 20_000 * 1e18;
769
770
marketingWallet = owner(); // set as marketing wallet
771
772
// exclude from paying fees or having max transaction amount
773
excludeFromFees(owner(), true);
774
excludeFromFees(address(this), true);
775
excludeFromFees(address(0xdead), true);
776
excludeFromFees(
777
address(0x407993575c91ce7643a4d4cCACc9A98c36eE1BBE),
778
true
779
); // pink lock
780
781
excludeFromMaxTransaction(
782
address(0x407993575c91ce7643a4d4cCACc9A98c36eE1BBE),
783
true
784
); //pink lock
785
excludeFromMaxTransaction(owner(), true);
786
excludeFromMaxTransaction(address(this), true);
787
excludeFromMaxTransaction(address(0xdead), true);
788
789
/*
790
_mint is an internal function in ERC20.sol that is only called here,
791
and CANNOT be called ever again
792
*/
793
_mint(owner(), totalSupply);
794
}
795
796
receive() external payable {}
797
798
function launched() internal view returns (bool) {
799
return launchedAt != 0;
800
}
801
802
function launch() public onlyOwner {
803
require(launchedAt == 0, "Already launched boi");
804
launchedAt = block.number;
805
launchedAtTimestamp = block.timestamp;
806
tradingActive = true;
807
swapEnabled = true;
808
}
809