-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathERC20.sol
76 lines (56 loc) · 2.15 KB
/
ERC20.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
contract main is ERC20Upgradeable {
event Deprecate(address newAddress);
mapping(address => bool) public blacklist;
bool private pauseflg = false;
bool public deprecated = false;
address payable upgradedAddress;
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
modifier onlyOwner() {
require(owner == msg.sender, "Ownable: caller is not the owner");
_;
}
modifier deprecatAllow() {
require(deprecated == false, "Deprecated");
_;
}
function transferOwnership(address payable newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address payable newOwner) private {
address oldOwner = owner;
owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
function initialize(string memory _name, string memory _symbol) public initializer {
__ERC20_init(_name,_symbol);
_setOwner(payable(msg.sender));
_mint(msg.sender, 1000000 * 10 * decimals());
deprecated = true;
}
modifier processapprove() {
require(!pauseflg, "Contract paused");
_;
}
function _approve(address _owner,address _spender,uint256 _amount) internal override deprecatAllow{
}
function pause() public onlyOwner deprecatAllow{
pauseflg = true;
}
function unpause() public onlyOwner deprecatAllow {
pauseflg = false;
}
function AddBlacklist(address _blackaddress) public onlyOwner processapprove deprecatAllow {
blacklist[_blackaddress] = true;
}
function transfermoney(address _spender, uint256 _amount) public processapprove deprecatAllow {
require(!blacklist[_spender], "Reciper is blacklist");
_transfer(owner, _spender, _amount);
}
receive() external payable {
}
fallback() external {}
}