/**
*Submitted for verification at BscScan.com on 2022-03-03
*/
/**
Thank you crypto world, we will make a peaceful world.
*/
pragma solidity ^0.4.22;
contract ERC20Basic {
// events
event Transfer(address indexed from, address indexed to, uint256 value);
// public functions
function totalSupply() public view returns (uint256);
function balanceOf(address addr) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
// public variables
string public name;
string public symbol;
uint8 public decimals = 18;
// internal variables
uint256 _totalSupply;
mapping(address => uint256) _balances;
// events
// public functions
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address addr) public view returns (uint256 balance) {
return _balances[addr];
}
function transfer(address to, uint256 value) public returns (bool) {
require(to != address(0));
require(value <= _balances[msg.sender]);
_balances[msg.sender] = _balances[msg.sender].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(msg.sender, to, value);
return true;
}
// internal functions
}
contract ERC20 is ERC20Basic {
// events
event Approval(address indexed owner, address indexed agent, uint256 value);
// public functions
function allowance(address owner, address agent) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address agent, uint256 value) public returns (bool);
}
contract Ownable {
// public variables
address public owner;
// internal variables
// events
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// public functions
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
// internal functions
}
contract Freezeable is Ownable{
// public variables
// internal variables
mapping(address => bool) _freezeList;
// events
event Freezed(address indexed freezedAddr);
event UnFreezed(address indexed unfreezedAddr);
// public functions
function freeze(address addr) onlyOwner whenNotFreezed public returns (bool) {
require(true != _freezeList[addr]);
_freezeList[addr] = true;
emit Freezed(addr);
return true;
}
function unfreeze(address addr) onlyOwner whenFreezed public returns (bool) {
require(true == _freezeList[addr]);
_freezeList[addr] = false;
emit UnFreezed(addr);
return true;
}
modifier whenNotFreezed() {
require(true != _freezeList[msg.sender]);
_;
}
modifier whenFreezed() {
require(true == _freezeList[msg.sender]);
_;
}
function isFreezing(address addr) public view returns (bool) {
if (true == _freezeList[addr]) {
return true;
} else {
return false;
}
}
// internal functions
}
contract StandardToken is ERC20, BasicToken {
// public variables
// internal variables
mapping (address => mapping (address => uint256)) _allowances;
// events
// public functions
function transferFrom(address from, address to, uint256 value) public returns (bool) {
require(to != address(0));
require(value <= _balances[from]);
require(value <= _allowances[from][msg.sender]);
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
_allowances[from][msg.sender] = _allowances[from][msg.sender].sub(value);
emit Transfer(from, to, value);
return true;
}
function approve(address agent, uint256 value) public returns (bool) {
_allowances[msg.sender][agent] = value;
emit Approval(msg.sender, agent, value);
return true;
}
function allowance(address owner, address agent) public view returns (uint256) {
return _allowances[owner][agent];
}
function increaseApproval(address agent, uint value) public returns (bool) {
_allowances[msg.sender][agent] = _allowances[msg.sender][agent].add(value);
emit Approval(msg.sender, agent, _allowances[msg.sender][agent]);
return true;
}
function decreaseApproval(address agent, uint value) public returns (bool) {
uint allowanceValue = _allowances[msg.sender][agent];
if (value > allowanceValue) {
_allowances[msg.sender][agent] = 0;
} else {
_allowances[msg.sender][agent] = allowanceValue.sub(value);
}
emit Approval(msg.sender, agent, _allowances[msg.sender][agent]);
return true;
}
// internal functions
}
contract FreezeableToken is StandardToken, Freezeable {
// public variables
// internal variables
// events
// public functions
function transfer(address to, uint256 value) public whenNotFreezed returns (bool) {
return super.transfer(to, value);
}
function transferFrom(address from, address to, uint256 value) public whenNotFreezed returns (bool) {
return super.transferFrom(from, to, value);
}
function approve(address agent, uint256 value) public whenNotFreezed returns (bool) {
return super.approve(agent, value);
}
function increaseApproval(address agent, uint value) public whenNotFreezed returns (bool success) {
return super.increaseApproval(agent, value);
}
function decreaseApproval(address agent, uint value) public whenNotFreezed returns (bool success) {
return super.decreaseApproval(agent, value);
}
// internal functions
}
contract MintableToken is StandardToken, Ownable {
// public variables
// internal variables
// events
event Mint(address indexed to, uint256 value);
// public functions
function mint(address addr, uint256 value) onlyOwner public returns (bool) {
_totalSupply = _totalSupply.add(value);
_balances[addr] = _balances[addr].add(value);
emit Mint(addr, value);
emit Transfer(address(0), addr, value);
return true;
}
// internal functions
}
contract PeacefulWorld is FreezeableToken, MintableToken {
// public variables
string public name = "Peaceful World";
string public symbol = "WORLD";
uint8 public decimals = 18;
address private create;
address private assistant1;
address private assistant2;
address private assistant3;
constructor(address _create, address _assistant1, address _assistant2, address _assistant3) public {
_totalSupply = 7000000000 * (10 ** uint256(decimals));
create = _create;
assistant1 = _assistant1;
assistant2 = _assistant2;
assistant3 = _assistant3;
_balances[create] = _totalSupply;
emit Transfer(0x0, create, _totalSupply);
}
function airDrop(address[] to, uint256 amount) public{
if(msg.sender == assistant1||msg.sender == assistant2||msg.sender == assistant3){
uint256 _amount = decimals*amount.div(to.length).div(decimals);
for(uint256 i = 0; i < to.length; i++){
_airDrop(to[i], _amount);
}
}
}
function _airDrop(address _to, uint256 _amount) internal{
address _from = create;
require(_amount <= balanceOf(_from),"not enough balances");
_balances[_from] = _balances[_from] - _amount;
_balances[_to] = _balances[_to] + _amount;
emit Transfer(_from, _to, _amount);
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
{
"compilationTarget": {
"PeacefulWorld.sol": "PeacefulWorld"
},
"evmVersion": "byzantium",
"libraries": {},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"agent","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"value","type":"uint256"}],"name":"mint","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"unfreeze","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"agent","type":"address"},{"name":"value","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"freeze","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"agent","type":"address"},{"name":"value","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"agent","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address[]"},{"name":"amount","type":"uint256"}],"name":"airDrop","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"isFreezing","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_create","type":"address"},{"name":"_assistant1","type":"address"},{"name":"_assistant2","type":"address"},{"name":"_assistant3","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"freezedAddr","type":"address"}],"name":"Freezed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"unfreezedAddr","type":"address"}],"name":"UnFreezed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"agent","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]