// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
_ _ _ _ ____ _ _ _
| \ | | ___| |__ _ _| | __ _/ ___|| |_ _ __(_) __| | ___
| \| |/ _ \ '_ \| | | | |/ _` \___ \| __| '__| |/ _` |/ _ \
| |\ | __/ |_) | |_| | | (_| |___) | |_| | | | (_| | __/
|_| \_|\___|_.__/ \__,_|_|\__,_|____/ \__|_| |_|\__,_|\___|
*/
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 private _decimals;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_, uint8 decimals_) {
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
if (currentAllowance != type(uint256).max) {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
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");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
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);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
interface IProxy {
function masterCopy() external view returns (address);
}
/*
* @dev Token with the ability to whitelist. This is necessary to prevent the user
* from selling, transferring tokens until it is listed. After listing, the whitelist
* mechanism is disabled with setAllowTransfers() and the owner of the contract
* is removed with renounceOwnership()
*/
contract NSTToken is ERC20, Ownable {
uint8 private constant decimals_ = 18;
string private constant ticker_ = "NST";
string private constant name_ = "Nebula Stride Token";
bool public allowTransfers = false;
uint256 timelock_period = 48*60*60; // 2 days timelock
// initial_multisig admin (safe wallet)
address private constant initial_multisig_admin = 0x8084C611Df9a3166CeccE4c8Dd60cFB5D5a256cE;
mapping(address => bool) public whitelist;
// addresses for token distribution
address public constant presale_contract = 0x3f9437dE4A7184D4D7618f9A17C02A76027F3961;
address public constant staking_safe_wallet = 0x3F321a174A1611B5CC2693FC13834eeF2a3c2eeE;
address public constant liquidity_safe_wallet = 0x7E47CbfFd60eC47788E208DC9c0Cc6684d1df06f;
address public constant team_and_developers_safe_wallet = 0xD9d417405a5f740477E654C2db8f2d0C8186B0c3;
address public constant partners_safe_wallet = 0xf5C0bacA447965711E1ce19625c1aBA201865cab;
address public constant marketing_safe_wallet = 0x2150EAb0E0F1B07BAf8dA3f66f88b74d87D1b2D3;
address public constant giveaways_safe_wallet = 0xA89e1d8C8214aB9801064a0465c1aBEe881789e5;
address public constant community_safe_wallet = 0x56272fB4f5cA1E98eFfE13Ee3af3D96c56a87391;
address public constant ecosystem_safe_wallet = 0xEb0ED2f6657DFe26B8b2918f8610f21b2EC5aC26;
address public constant reserve_safe_wallet = 0x369FD891341D65aD855e639E109FE932664E0aD4;
address public constant airdrop_safe_wallet = 0x547A4126B66f191B5418C9FD39aBaED923C58aEF;
//distribution amounts
uint256 public constant presale_mint_amount = 500000000 * 10 ** decimals_;
uint256 public constant staking_mint_amount = 300000000 * 10 ** decimals_;
uint256 public constant liquidity_mint_amount = 200000000 * 10 ** decimals_;
uint256 public constant team_and_developers_mint_amount = 140000000 * 10 ** decimals_;
uint256 public constant partners_mint_amount = 60000000 * 10 ** decimals_;
uint256 public constant marketing_mint_amount = 300000000 * 10 ** decimals_;
uint256 public constant giveaways_mint_amount = 40000000 * 10 ** decimals_;
uint256 public constant community_mint_amount = 60000000 * 10 ** decimals_;
uint256 public constant ecosystem_mint_amount = 100000000 * 10 ** decimals_;
uint256 public constant reserve_mint_amount = 100000000 * 10 ** decimals_;
uint256 public constant airdrop_mint_amount = 200000000 * 10 ** decimals_;
address public potential_owner = address(0);
constructor() ERC20(name_, ticker_, decimals_) {
//allow for addresses in distribution send tokens
_setWhitelist(presale_contract,true);
_setWhitelist(staking_safe_wallet,true);
_setWhitelist(liquidity_safe_wallet,true);
_setWhitelist(team_and_developers_safe_wallet ,true);
_setWhitelist(partners_safe_wallet,true);
_setWhitelist(marketing_safe_wallet,true);
_setWhitelist(giveaways_safe_wallet,true);
_setWhitelist(community_safe_wallet,true);
_setWhitelist(ecosystem_safe_wallet,true);
_setWhitelist(reserve_safe_wallet,true);
_setWhitelist(airdrop_safe_wallet,true);
_mint(presale_contract, presale_mint_amount);
_mint(staking_safe_wallet, staking_mint_amount);
_mint(liquidity_safe_wallet, liquidity_mint_amount);
_mint(team_and_developers_safe_wallet, team_and_developers_mint_amount);
_mint(partners_safe_wallet, partners_mint_amount);
_mint(marketing_safe_wallet, marketing_mint_amount);
_mint(giveaways_safe_wallet, giveaways_mint_amount);
_mint(community_safe_wallet, community_mint_amount);
_mint(ecosystem_safe_wallet, ecosystem_mint_amount);
_mint(reserve_safe_wallet, reserve_mint_amount);
_mint(airdrop_safe_wallet, airdrop_mint_amount);
//transferring ownership to safe contract
_transferOwnership(initial_multisig_admin);
}
event ScheduleTransferOwnership(
address new_owner_candidate,
uint256 allow_execute_at,
bool canceled,
bool executed
);
event ScheduleRenounceOwnership(
uint256 allow_execute_at,
bool canceled,
bool executed
);
event OwnerNominated(address newOwner);
event AllowTransfers(
bool transfer_state
);
event WhitelistChange(
address user,
bool exmpt
);
event ScheduleSetWhitelist(
address user,
bool exmpt,
uint256 allow_execute_at,
bool canceled,
bool executed
);
event ScheduleAllowTransfers(
uint256 allow_execute_at,
bool canceled,
bool executed
);
uint256 public allow_transfer_ownership_at = 0;
uint256 public allow_renounce_ownership_at = 0;
uint256 public allow_set_whitelist_at = 0;
uint256 public allow_set_allow_transfers_at =0;
address public scheduled_whitelist_user = address(0);
bool public scheduled_whitelist_user_exmpt = false;
address public scheduled_new_owner = address(0);
/*
* @title Schedule transfer ownership with timelock model
* @dev This function “plans” the execution of the transfer of ownership mechanism.
* User can only plan TransferOwnership OR RenounceOwnership at same time.
*/
function scheduleTransferOwnership(address newOwner) public onlyOwner {
require(allow_transfer_ownership_at == 0, "TransferOwnership already planned");
require(newOwner != address(0), "potential owner can not be the zero address.");
require(allow_renounce_ownership_at == 0, "RenounceOwnership already planned");
require(IProxy(newOwner).masterCopy() != address(0), "New owner must be safe wallet");
allow_transfer_ownership_at = block.timestamp + timelock_period;
scheduled_new_owner = newOwner;
emit ScheduleTransferOwnership(
scheduled_new_owner,
allow_transfer_ownership_at,
false,
false
);
}
/*
* @title Cancel schedule transfer ownership with timelock model
* @dev This function cancels a scheduled task for ownership transfer
*/
function cancelTransferOwnership() public onlyOwner {
require(allow_transfer_ownership_at > 0, "TransferOwnership not planned");
emit ScheduleTransferOwnership(
scheduled_new_owner,
allow_transfer_ownership_at,
true,
false
);
allow_transfer_ownership_at=0;
scheduled_new_owner = address(0);
}
/*
* @title Execute schedule transfer ownership with timelock model
* @dev This function execute a scheduled task for ownership transfer
*/
function executeTransferOwnership() public onlyOwner {
require(allow_transfer_ownership_at > 0, "TransferOwnership not planned");
require(allow_transfer_ownership_at <= block.timestamp, "TransferOwnership not unlocked");
potential_owner = scheduled_new_owner;
emit OwnerNominated(potential_owner);
emit ScheduleTransferOwnership(
scheduled_new_owner,
allow_transfer_ownership_at,
false,
true
);
allow_transfer_ownership_at=0;
scheduled_new_owner=address(0);
}
/*
* @title Schedule renounce ownership with timelock model
* @dev This function “plans” the execution of the renounce of ownership mechanism.
* User can only plan TransferOwnership OR RenounceOwnership at same time.
*/
function scheduleRenounceOwnership() public onlyOwner {
require(allow_renounce_ownership_at == 0, "RenounceOwnership already planned");
require(allow_transfer_ownership_at == 0, "TransferOwnership already planned");
allow_renounce_ownership_at = block.timestamp + timelock_period;
emit ScheduleRenounceOwnership(
allow_renounce_ownership_at,
false,
false
);
}
/*
* @title Cancel schedule renounce ownership with timelock model
* @dev This function cancels a scheduled task for ownership renounce
*/
function cancelRenounceOwnership() public onlyOwner {
require(allow_renounce_ownership_at > 0, "RenounceOwnership not planned");
emit ScheduleRenounceOwnership(
allow_renounce_ownership_at,
true,
false
);
allow_renounce_ownership_at=0;
}
/*
* @title Execute schedule renounce ownership with timelock model
* @dev This function execute a scheduled task for ownership renounce
*/
function executeRenounceOwnership() public onlyOwner {
require(allow_renounce_ownership_at > 0, "RenounceOwnership not planned");
require(allow_renounce_ownership_at <= block.timestamp, "RenounceOwnership not unlocked");
_transferOwnership(address(0));
emit ScheduleRenounceOwnership(
allow_renounce_ownership_at,
false,
true
);
allow_renounce_ownership_at = 0;
allow_transfer_ownership_at = 0;
potential_owner = address(0);
scheduled_new_owner = address(0);
}
function acceptOwnership() public {
require(msg.sender == potential_owner, "You must be nominated as potential owner before you can accept ownership");
require(owner() != address(0), "Ownership renounced");
_transferOwnership(potential_owner);
potential_owner = address(0);
}
/*
* @title Schedule set user whitelist with timelock model
* @dev This function “plans” the execution of the set user whitelist mechanism
*/
function scheduleSetWhitelist(address _user, bool _exmpt) public onlyOwner {
require(allow_set_whitelist_at == 0, "SetWhitelist already planned");
allow_set_whitelist_at = block.timestamp + timelock_period;
scheduled_whitelist_user = _user;
scheduled_whitelist_user_exmpt = _exmpt;
emit ScheduleSetWhitelist(scheduled_whitelist_user, scheduled_whitelist_user_exmpt,allow_set_whitelist_at, false, false);
}
/*
* @title Cancel schedule set user whitelist with timelock model
* @dev This function cancels a scheduled task for set user whitelist
*/
function cancelSetWhitelist() public onlyOwner {
require(allow_set_whitelist_at > 0, "SetWhitelist not planned");
emit ScheduleSetWhitelist(scheduled_whitelist_user, scheduled_whitelist_user_exmpt,allow_set_whitelist_at, true, false);
allow_set_whitelist_at=0;
scheduled_whitelist_user = address(0);
scheduled_whitelist_user_exmpt = false;
}
function _setWhitelist(address _user, bool _exmpt) private {
whitelist[_user] = _exmpt;
emit WhitelistChange(
scheduled_whitelist_user,
scheduled_whitelist_user_exmpt
);
}
/*
* @title Execute schedule set user whitelist with timelock model
* @dev This function execute a scheduled task for set user whitelist
*/
function executeWhitelist() public onlyOwner{
require(allow_set_whitelist_at > 0, "SetWhitelist not planned");
require(allow_set_whitelist_at <= block.timestamp, "SetWhitelist not unlocked");
_setWhitelist(scheduled_whitelist_user, scheduled_whitelist_user_exmpt);
emit ScheduleSetWhitelist(scheduled_whitelist_user, scheduled_whitelist_user_exmpt, allow_set_whitelist_at, false, true);
allow_set_whitelist_at=0;
scheduled_whitelist_user = address(0);
scheduled_whitelist_user_exmpt = false;
}
/*
* @title Schedule set allow transfers with timelock model
* @dev This function “plans” the execution of the whitelist mechanism
*/
function scheduleSetAllowTransfers() public onlyOwner {
require(!allowTransfers, "NebulaStride: Already enabled");
require(allow_set_allow_transfers_at == 0, "AllowTransfers already planned");
allow_set_allow_transfers_at = block.timestamp + timelock_period;
emit ScheduleAllowTransfers(allow_set_allow_transfers_at, false, false);
}
/*
* @title Cancel schedule set allow transfers with timelock model
* @dev This function cancels a scheduled task for set user whitelist
*/
function cancelSetAllowTransfers() public onlyOwner {
require(allow_set_allow_transfers_at > 0, "AllowTransfers not planned");
allow_set_allow_transfers_at = 0;
emit ScheduleAllowTransfers(allow_set_allow_transfers_at, true, false);
}
/*
* @title Execute schedule set allow transfers with timelock model
* @dev This function execute a scheduled task for set allow transfers
*/
function executeSetAllowTransfers() external onlyOwner {
require(allow_set_allow_transfers_at > 0, "AllowTransfers not planned");
require(allow_set_allow_transfers_at <= block.timestamp, "AllowTransfers not unlocked");
allowTransfers = true;
emit AllowTransfers(allowTransfers);
emit ScheduleAllowTransfers(allow_set_allow_transfers_at, false, true);
allow_set_allow_transfers_at=0;
}
function getTimestamp() public view returns (uint256) {
return block.timestamp;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
if (!whitelist[from] && !whitelist[to]) {
require(allowTransfers,"NebulaStride: Not transferable until listing");
}
}
function renounceOwnership() public override view onlyOwner{
revert("RenounceOwnership only via timelock mechanism");
}
function transferOwnership(address newOwner) public override view onlyOwner {
revert("TransferOwnership only via timelock mechanism");
}
}
{
"compilationTarget": {
"NSTToken.sol": "NSTToken"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"transfer_state","type":"bool"}],"name":"AllowTransfers","type":"event"},{"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":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","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":false,"internalType":"uint256","name":"allow_execute_at","type":"uint256"},{"indexed":false,"internalType":"bool","name":"canceled","type":"bool"},{"indexed":false,"internalType":"bool","name":"executed","type":"bool"}],"name":"ScheduleAllowTransfers","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"allow_execute_at","type":"uint256"},{"indexed":false,"internalType":"bool","name":"canceled","type":"bool"},{"indexed":false,"internalType":"bool","name":"executed","type":"bool"}],"name":"ScheduleRenounceOwnership","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"exmpt","type":"bool"},{"indexed":false,"internalType":"uint256","name":"allow_execute_at","type":"uint256"},{"indexed":false,"internalType":"bool","name":"canceled","type":"bool"},{"indexed":false,"internalType":"bool","name":"executed","type":"bool"}],"name":"ScheduleSetWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"new_owner_candidate","type":"address"},{"indexed":false,"internalType":"uint256","name":"allow_execute_at","type":"uint256"},{"indexed":false,"internalType":"bool","name":"canceled","type":"bool"},{"indexed":false,"internalType":"bool","name":"executed","type":"bool"}],"name":"ScheduleTransferOwnership","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"exmpt","type":"bool"}],"name":"WhitelistChange","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"airdrop_mint_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"airdrop_safe_wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowTransfers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allow_renounce_ownership_at","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allow_set_allow_transfers_at","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allow_set_whitelist_at","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allow_transfer_ownership_at","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"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":[],"name":"cancelRenounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelSetAllowTransfers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelSetWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelTransferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"community_mint_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"community_safe_wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":[],"name":"ecosystem_mint_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ecosystem_safe_wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"executeRenounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"executeSetAllowTransfers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"executeTransferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"executeWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"giveaways_mint_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"giveaways_safe_wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":[],"name":"liquidity_mint_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidity_safe_wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketing_mint_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketing_safe_wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"partners_mint_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"partners_safe_wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"potential_owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presale_contract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presale_mint_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reserve_mint_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reserve_safe_wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"scheduleRenounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scheduleSetAllowTransfers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"bool","name":"_exmpt","type":"bool"}],"name":"scheduleSetWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"scheduleTransferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scheduled_new_owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"scheduled_whitelist_user","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"scheduled_whitelist_user_exmpt","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"staking_mint_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"staking_safe_wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"team_and_developers_mint_amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"team_and_developers_safe_wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]