This contract's source code is verified! Compiler
0.8.3+commit.8d00100c
File 1 of 5: AIOZToken.sol
pragma solidity ^0.8.0;
import './IERC20.sol' ;
import './IERC20Metadata.sol' ;
import './Ownable.sol' ;
import './TokenTimelock.sol' ;
contract ERC20 is IERC20 , IERC20Metadata {
mapping (address = > uint256 ) private _balances;
mapping (address = > mapping (address = > uint256 )) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor (string memory name_, string memory symbol_ ) {
_name = name_;
_symbol = symbol_;
}
function name ( ) public view virtual override returns (string memory ) {
return _name;
}
function symbol ( ) public view virtual override returns (string memory ) {
return _symbol;
}
function decimals ( ) public view virtual override returns (uint8 ) {
return 18 ;
}
function totalSupply ( ) public view virtual override returns (uint256 ) {
return _totalSupply;
}
function balanceOf (address account ) public view virtual override returns (uint256 ) {
return _balances[account];
}
function transfer (address recipient, uint256 amount ) public virtual override returns (bool ) {
_transfer(msg .sender , recipient, amount);
return true ;
}
function allowance (address owner, address spender ) public view virtual override returns (uint256 ) {
return _allowances[owner][spender];
}
function approve (address spender, uint256 amount ) public virtual override returns (bool ) {
_approve(msg .sender , spender, amount);
return true ;
}
function transferFrom (address sender, address recipient, uint256 amount ) public virtual override returns (bool ) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][msg .sender ];
require (currentAllowance > = amount, "ERC20: transfer amount exceeds allowance" );
_approve(sender, msg .sender , currentAllowance - amount);
return true ;
}
function increaseAllowance (address spender, uint256 addedValue ) public virtual returns (bool ) {
_approve(msg .sender , spender, _allowances[msg .sender ][spender] + addedValue);
return true ;
}
function decreaseAllowance (address spender, uint256 subtractedValue ) public virtual returns (bool ) {
uint256 currentAllowance = _allowances[msg .sender ][spender];
require (currentAllowance > = subtractedValue, "ERC20: decreased allowance below zero" );
_approve(msg .sender , spender, currentAllowance - subtractedValue);
return true ;
}
function _transfer (address sender, address recipient, uint256 amount ) internal virtual {
require (sender ! = address (0 ), "ERC20: transfer from the zero address" );
require (recipient ! = address (0 ), "ERC20: transfer to the zero address" );
uint256 senderBalance = _balances[sender];
require (senderBalance > = amount, "ERC20: transfer amount exceeds balance" );
_balances[sender] = senderBalance - amount;
_balances[recipient] + = amount;
emit Transfer(sender, recipient, amount);
}
function _mint (address account, uint256 amount ) internal virtual {
require (account ! = address (0 ), "ERC20: mint to the zero address" );
_totalSupply + = amount;
_balances[account] + = amount;
emit Transfer(address (0 ), account, amount);
}
function _burn (address account, uint256 amount ) internal virtual {
require (account ! = address (0 ), "ERC20: burn from the zero address" );
uint256 accountBalance = _balances[account];
require (accountBalance > = amount, "ERC20: burn amount exceeds balance" );
_balances[account] = accountBalance - amount;
_totalSupply - = amount;
emit Transfer(account, address (0 ), amount);
}
function _approve (address owner, address spender, uint256 amount ) internal virtual {
require (owner ! = address (0 ), "ERC20: approve from the zero address" );
require (spender ! = address (0 ), "ERC20: approve to the zero address" );
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract AIOZToken is ERC20 , Ownable {
uint256 private _maxTotalSupply;
constructor ( ) ERC20 ("AIOZ Network" , "AIOZ" ) {
_maxTotalSupply = 1000000000e18 ;
TimelockFactory timelockFactory = new TimelockFactory();
mint(0x076592ad72b79bBaBDD05aDd7d367f44f2CFf658 , 10333333e18 );
mint(0xF8477220f8375968E38a3B79ECA4343822b53af2 , 73000000e18 * 25 / 100 );
address privateSalesLock = timelockFactory.createTimelock(this , 0xF8477220f8375968E38a3B79ECA4343822b53af2 , block .timestamp + 30 days , 73000000e18 * 25 / 100 , 30 days );
mint(privateSalesLock, 73000000e18 * 75 / 100 );
address teamLock = timelockFactory.createTimelock(this , 0x82E83054CC631C0Da85Ca67087E45ca31b93F29b , block .timestamp + 180 days , 250000000e18 * 8 / 100 , 30 days );
mint(teamLock, 250000000e18 );
address advisorsLock = timelockFactory.createTimelock(this , 0xBbf78c2Ee1794229e31af81c83F4d5125F08FE0F , block .timestamp + 90 days , 50000000e18 * 8 / 100 , 30 days );
mint(advisorsLock, 50000000e18 );
mint(0x9E2F8e278585CAfD3308E894d2E09ffEc520b1E9 , 30000000e18 * 10 / 100 );
address marketingERC20Lock = timelockFactory.createTimelock(this , 0x9E2F8e278585CAfD3308E894d2E09ffEc520b1E9 , block .timestamp + 30 days , 30000000e18 * 5 / 100 , 30 days );
mint(marketingERC20Lock, 30000000e18 * 90 / 100 );
mint(0x6c3D8872002B66C808aE462Db314B87962DCC7aF , 23333333e18 );
address growthLock = timelockFactory.createTimelock(this , 0xCFd6736a11e76c0e3418FEEbb788822211d92F1e , block .timestamp + 90 days , 0 , 0 );
mint(growthLock, 530000000e18 );
}
function mint (address account, uint256 amount ) public onlyOwner returns (bool ) {
require (totalSupply() + amount < = _maxTotalSupply, "AIOZ Token: mint more than the max total supply" );
_mint(account, amount);
return true ;
}
function burn (uint256 amount ) public onlyOwner returns (bool ) {
_burn(msg .sender , amount);
return true ;
}
} File 2 of 5: IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply ( ) external view returns (uint256 ) ;
function balanceOf (address account ) external view returns (uint256 ) ;
function transfer (address recipient, uint256 amount ) external returns (bool ) ;
function allowance (address owner, address spender ) external view returns (uint256 ) ;
function approve (address spender, uint256 amount ) external returns (bool ) ;
function transferFrom (address sender, address recipient, uint256 amount ) external returns (bool ) ;
event Transfer (address indexed from , address indexed to, uint256 value ) ;
event Approval (address indexed owner, address indexed spender, uint256 value ) ;
} File 3 of 5: IERC20Metadata.sol
pragma solidity ^0.8.0;
import "./IERC20.sol" ;
interface IERC20Metadata is IERC20 {
function name ( ) external view returns (string memory ) ;
function symbol ( ) external view returns (string memory ) ;
function decimals ( ) external view returns (uint8 ) ;
} File 4 of 5: Ownable.sol
pragma solidity ^0.8.0;
abstract contract Ownable {
address private _owner;
event OwnershipTransferred (address indexed previousOwner, address indexed newOwner ) ;
constructor ( ) {
address msgSender = msg .sender ;
_owner = msgSender;
emit OwnershipTransferred(address (0 ), msgSender);
}
function owner ( ) public view virtual returns (address ) {
return _owner;
}
modifier onlyOwner ( ) {
require (owner() = = msg .sender , "Ownable: caller is not the owner" );
_ ;
}
function renounceOwnership ( ) public virtual onlyOwner {
emit OwnershipTransferred(_owner, address (0 ));
_owner = address (0 );
}
function transferOwnership (address newOwner ) public virtual onlyOwner {
require (newOwner ! = address (0 ), "Ownable: new owner is the zero address" );
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
} File 5 of 5: TokenTimelock.sol
pragma solidity ^0.8.0;
import './IERC20.sol' ;
contract TokenTimelock {
IERC20 private _token;
address private _beneficiary;
uint256 private _nextReleaseTime;
uint256 private _releaseAmount;
uint256 private _releasePeriod;
TimelockFactory private _factory;
event Released (address indexed beneficiary, uint256 amount ) ;
event BeneficiaryTransferred (address indexed previousBeneficiary, address indexed newBeneficiary ) ;
constructor ( ) {
_token = IERC20(address (1 ));
}
function init (IERC20 token_, address beneficiary_, uint256 releaseStart_, uint256 releaseAmount_, uint256 releasePeriod_ ) external {
require (_token = = IERC20(address (0 )), "TokenTimelock: already initialized" );
require (token_ ! = IERC20(address (0 )), "TokenTimelock: erc20 token address is zero" );
require (beneficiary_ ! = address (0 ), "TokenTimelock: beneficiary address is zero" );
require (releasePeriod_ = = 0 | | releaseAmount_ ! = 0 , "TokenTimelock: release amount is zero" );
emit BeneficiaryTransferred(address (0 ), beneficiary_);
_token = token_;
_beneficiary = beneficiary_;
_nextReleaseTime = releaseStart_;
_releaseAmount = releaseAmount_;
_releasePeriod = releasePeriod_;
_factory = TimelockFactory(msg .sender );
}
function token ( ) public view virtual returns (IERC20 ) {
return _token;
}
function beneficiary ( ) public view virtual returns (address ) {
return _beneficiary;
}
function nextReleaseTime ( ) public view virtual returns (uint256 ) {
return _nextReleaseTime;
}
function releaseAmount ( ) public view virtual returns (uint256 ) {
return _releaseAmount;
}
function balance ( ) public view virtual returns (uint256 ) {
return token().balanceOf(address (this ));
}
function releasableAmount ( ) public view virtual returns (uint256 ) {
if (block .timestamp < _nextReleaseTime) return 0 ;
uint256 amount = balance();
if (amount = = 0 ) return 0 ;
if (_releasePeriod = = 0 ) return amount;
uint256 passedPeriods = (block .timestamp - _nextReleaseTime) / _releasePeriod;
uint256 maxReleasableAmount = (passedPeriods + 1 ) * _releaseAmount;
if (amount < = maxReleasableAmount) return amount;
return maxReleasableAmount;
}
function releasePeriod ( ) public view virtual returns (uint256 ) {
return _releasePeriod;
}
function release ( ) public virtual returns (bool ) {
require (block .timestamp > = nextReleaseTime(), "TokenTimelock: current time is before release time" );
uint256 _releasableAmount = releasableAmount();
require (_releasableAmount > 0 , "TokenTimelock: no releasable tokens" );
emit Released(beneficiary(), _releasableAmount);
require (token().transfer (beneficiary(), _releasableAmount));
if (_releasePeriod ! = 0 ) {
uint256 passedPeriods = (block .timestamp - _nextReleaseTime) / _releasePeriod;
_nextReleaseTime + = (passedPeriods + 1 ) * _releasePeriod;
}
return true ;
}
function transferBeneficiary (address newBeneficiary ) public virtual returns (bool ) {
require (msg .sender = = beneficiary(), "TokenTimelock: caller is not the beneficiary" );
require (newBeneficiary ! = address (0 ), "TokenTimelock: the new beneficiary is zero address" );
emit BeneficiaryTransferred(beneficiary(), newBeneficiary);
_beneficiary = newBeneficiary;
return true ;
}
function split (address splitBeneficiary, uint256 splitAmount ) public virtual returns (bool ) {
uint256 _amount = balance();
require (msg .sender = = beneficiary(), "TokenTimelock: caller is not the beneficiary" );
require (splitBeneficiary ! = address (0 ), "TokenTimelock: beneficiary address is zero" );
require (splitAmount > 0 , "TokenTimelock: amount is zero" );
require (splitAmount < = _amount, "TokenTimelock: amount exceeds balance" );
uint256 splitReleaseAmount;
if (_releasePeriod > 0 ) {
splitReleaseAmount = _releaseAmount * splitAmount / _amount;
}
address newTimelock = _factory.createTimelock(token(), splitBeneficiary, _nextReleaseTime, splitReleaseAmount, _releasePeriod);
require (token().transfer (newTimelock, splitAmount));
_releaseAmount - = splitReleaseAmount;
return true ;
}
}
contract CloneFactory {
function createClone (address target ) internal returns (address result ) {
bytes20 targetBytes = bytes20 (target);
assembly {
let clone := mload (0x40 )
mstore (clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000 )
mstore (add (clone, 0x14 ), targetBytes)
mstore (add (clone, 0x28 ), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 )
result := create (0 , clone, 0x37 )
}
}
}
contract TimelockFactory is CloneFactory {
address private _tokenTimelockImpl;
event Timelock (address timelockContract ) ;
constructor ( ) {
_tokenTimelockImpl = address (new TokenTimelock());
}
function createTimelock (IERC20 token, address to, uint256 releaseTime, uint256 releaseAmount, uint256 period ) public returns (address ) {
address clone = createClone(_tokenTimelockImpl);
TokenTimelock(clone).init(token, to, releaseTime, releaseAmount, period);
emit Timelock(clone);
return clone;
}
} {
"compilationTarget" : {
"AIOZToken.sol" : "AIOZToken"
} ,
"evmVersion" : "istanbul" ,
"libraries" : { } ,
"metadata" : {
"bytecodeHash" : "ipfs"
} ,
"optimizer" : {
"enabled" : true ,
"runs" : 200
} ,
"remappings" : [ ]
} [{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]