1
+ /**
2
+ *Submitted for verification at BscScan.com on 2022-01-27
3
+ */
4
+
5
+ /**
6
+ *Develop by CPTRedHawk
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ */
10
+
11
+ pragma solidity ^ 0.8.11 ;
12
+
13
+ abstract contract Context {
14
+ function _msgSender () internal view virtual returns (address ) {
15
+ return msg .sender ;
16
+ }
17
+
18
+ function _msgData () internal view virtual returns (bytes calldata ) {
19
+ return msg .data ;
20
+ }
21
+ }
22
+
23
+ abstract contract Ownable is Context {
24
+ address private _owner;
25
+
26
+ event OwnershipTransferred (address indexed previousOwner , address indexed newOwner );
27
+
28
+ /**
29
+ * @dev Initializes the contract setting the deployer as the initial owner.
30
+ */
31
+ constructor () {
32
+ _transferOwnership (_msgSender ());
33
+ }
34
+
35
+ /**
36
+ * @dev Returns the address of the current owner.
37
+ */
38
+ function owner () public view virtual returns (address ) {
39
+ return _owner;
40
+ }
41
+
42
+ /**
43
+ * @dev Throws if called by any account other than the owner.
44
+ */
45
+ modifier onlyOwner () {
46
+ require (owner () == _msgSender (), "Ownable: caller is not the owner " );
47
+ _;
48
+ }
49
+
50
+ /**
51
+ * @dev Leaves the contract without owner. It will not be possible to call
52
+ * `onlyOwner` functions anymore. Can only be called by the current owner.
53
+ *
54
+ * NOTE: Renouncing ownership will leave the contract without an owner,
55
+ * thereby removing any functionality that is only available to the owner.
56
+ */
57
+ function renounceOwnership () public virtual onlyOwner {
58
+ _transferOwnership (address (0 ));
59
+ }
60
+
61
+ /**
62
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
63
+ * Can only be called by the current owner.
64
+ */
65
+ function transferOwnership (address newOwner ) public virtual onlyOwner {
66
+ require (newOwner != address (0 ), "Ownable: new owner is the zero address " );
67
+ _transferOwnership (newOwner);
68
+ }
69
+
70
+ /**
71
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
72
+ * Internal function without access restriction.
73
+ */
74
+ function _transferOwnership (address newOwner ) internal virtual {
75
+ address oldOwner = _owner;
76
+ _owner = newOwner;
77
+ emit OwnershipTransferred (oldOwner, newOwner);
78
+ }
79
+ }
80
+
81
+ contract Whitelist is Ownable {
82
+
83
+
84
+ uint256 private withdrawableBalance;
85
+ address [] public whitelister;
86
+
87
+ mapping (address => bool ) whitelistedAddresses;
88
+
89
+
90
+ modifier isWhitelisted (address _address ) {
91
+ require (whitelistedAddresses[_address], "Whitelist: You need to be whitelisted " );
92
+ _;
93
+ }
94
+
95
+ function addUser (address _addressToWhitelist ) external onlyOwner {
96
+ whitelistedAddresses[_addressToWhitelist] = true ;
97
+ }
98
+
99
+ function verifyUser (address _whitelistedAddress ) public view returns (bool ) {
100
+ bool userIsWhitelisted = whitelistedAddresses[_whitelistedAddress];
101
+ return userIsWhitelisted;
102
+ }
103
+
104
+
105
+
106
+
107
+ function withdrawLockedBNB (address payable to ) external onlyOwner () {
108
+ withdrawableBalance = address (this ).balance;
109
+ uint256 amount = withdrawableBalance;
110
+ withdrawableBalance = 0 ;
111
+ to.transfer (amount);
112
+
113
+ }
114
+
115
+ function enter () public isWhitelisted (msg .sender ) payable {
116
+ require (msg .value > 1 ether);
117
+ whitelister.push (msg .sender );
118
+ }
119
+
120
+ }
0 commit comments