Address Contract Partially Verified
Address
0x18eF464fD73Ed484c12339eAa5d5E3C8f6C48180
Balance
0 ETH
Nonce
1
Code Size
5902 bytes
Creator
0x29ad53FD...A46e at tx 0x59c9790b...ee4079
Indexed Transactions
0
Contract Bytecode
5902 bytes
0x6080604052600436106101d3575f3560e01c806395d89b41116100fd578063c01dfd6611610092578063db05e5cb11610062578063db05e5cb1461050d578063dd62ed3e14610521578063ed99530714610540578063f2fde38b14610554575f80fd5b8063c01dfd66146104bc578063c3f70b52146104d0578063c9567bf9146104e5578063d579d4ed146104f9575f80fd5b8063a9e282b8116100cd578063a9e282b814610431578063aca2cd6e14610450578063ad5dff731461046f578063bc3371821461049d575f80fd5b806395d89b41146103cb578063a457c2d7146103df578063a508de62146103fe578063a9059cbb14610412575f80fd5b80633950935111610173578063667f652611610143578063667f65261461034757806370a0823114610366578063715018a61461039a5780638da5cb5b146103ae575f80fd5b806339509351146102c957806349bd5a5e146102e857806349deb75c1461031f5780635637bce114610333575f80fd5b8063095ea7b3116101ae578063095ea7b31461024c57806318160ddd1461027b57806323b872dd1461028f578063313ce567146102ae575f80fd5b8063027cc97a146101de57806306fdde03146101ff578063084cf61514610229575f80fd5b366101da57005b5f80fd5b3480156101e9575f80fd5b506101fd6101f83660046112de565b610573565b005b34801561020a575f80fd5b50610213610597565b60405161022091906112f5565b60405180910390f35b348015610234575f80fd5b5061023e600c5481565b604051908152602001610220565b348015610257575f80fd5b5061026b610266366004611355565b610627565b6040519015158152602001610220565b348015610286575f80fd5b5060025461023e565b34801561029a575f80fd5b5061026b6102a936600461137f565b610640565b3480156102b9575f80fd5b5060405160128152602001610220565b3480156102d4575f80fd5b5061026b6102e3366004611355565b610663565b3480156102f3575f80fd5b50600954610307906001600160a01b031681565b6040516001600160a01b039091168152602001610220565b34801561032a575f80fd5b506101fd610684565b34801561033e575f80fd5b5061023e6106b3565b348015610352575f80fd5b506101fd6103613660046113bd565b6106d2565b348015610371575f80fd5b5061023e6103803660046113dd565b6001600160a01b03165f9081526020819052604090205490565b3480156103a5575f80fd5b506101fd6106fa565b3480156103b9575f80fd5b506005546001600160a01b0316610307565b3480156103d6575f80fd5b5061021361070b565b3480156103ea575f80fd5b5061026b6103f9366004611355565b61071a565b348015610409575f80fd5b5061023e610799565b34801561041d575f80fd5b5061026b61042c366004611355565b6107b3565b34801561043c575f80fd5b506101fd61044b3660046112de565b6107c0565b34801561045b575f80fd5b506101fd61046a3660046113f8565b6107e4565b34801561047a575f80fd5b5061026b6104893660046113dd565b600a6020525f908152604090205460ff1681565b3480156104a8575f80fd5b506101fd6104b73660046112de565b610816565b3480156104c7575f80fd5b506101fd61086f565b3480156104db575f80fd5b5061023e600b5481565b3480156104f0575f80fd5b506101fd610884565b348015610504575f80fd5b506101fd61089f565b348015610518575f80fd5b506101fd6108f4565b34801561052c575f80fd5b5061023e61053b366004611433565b61090f565b34801561054b575f80fd5b506101fd610939565b34801561055f575f80fd5b506101fd61056e3660046113dd565b610a3b565b61057b610ab1565b6105876012600a611553565b6105919082611561565b60125550565b6060600380546105a690611578565b80601f01602080910402602001604051908101604052809291908181526020018280546105d290611578565b801561061d5780601f106105f45761010080835404028352916020019161061d565b820191905f5260205f20905b81548152906001019060200180831161060057829003601f168201915b5050505050905090565b5f33610634818585610b0b565b60019150505b92915050565b5f3361064d858285610c2e565b610658858585610ca6565b506001949350505050565b5f33610634818585610675838361090f565b61067f91906115b0565b610b0b565b61068c610ab1565b60145460ff16156106a3576014805460ff19169055565b6014805460ff191660011790555b565b5f6106c06012600a611553565b6011546106cd91906115c3565b905090565b6106da610ab1565b6014821080156106ea5750601481105b6106f2575f80fd5b600755600655565b610702610ab1565b6106b15f610f4e565b6060600480546105a690611578565b5f3381610727828661090f565b90508381101561078c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6106588286868403610b0b565b5f6107a66012600a611553565b6012546106cd91906115c3565b5f33610634818585610ca6565b6107c8610ab1565b6107d46012600a611553565b6107de9082611561565b60115550565b6107ec610ab1565b6001600160a01b03919091165f908152600a60205260409020805460ff1916911515919091179055565b61081e610ab1565b606461082960025490565b61083391906115c3565b61083f6012600a611553565b6108499083611561565b1015610853575f80fd5b61085f6012600a611553565b6108699082611561565b600b5550565b610877610ab1565b600d805461ff0019169055565b61088c610ab1565b600d805460ff1916600117905543600e55565b6040516001600160a01b037f00000000000000000000000085b5c11f05063a2c668705f17165fe4699f9eb8916904780156108fc02915f818181858888f193505050501580156108f1573d5f803e3d5ffd5b50565b6108fc610ab1565b600d805461ff0019169055600254600b55565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b610941610ab1565b600854305f81815260208190526040902054610966926001600160a01b031690610b0b565b6008546001600160a01b031663f305d7194730610997816001600160a01b03165f9081526020819052604090205490565b5f806109ab6005546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a11573d5f803e3d5ffd5b50505050506040513d601f19601f82011682018060405250810190610a3691906115e2565b505050565b610a43610ab1565b6001600160a01b038116610aa85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610783565b6108f181610f4e565b6005546001600160a01b031633146106b15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610783565b6001600160a01b038316610b6d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610783565b6001600160a01b038216610bce5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610783565b6001600160a01b038381165f8181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b5f610c39848461090f565b90505f198114610ca05781811015610c935760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610783565b610ca08484848403610b0b565b50505050565b6001600160a01b0383165f908152600a602052604090205460ff16158015610ce657506001600160a01b0382165f908152600a602052604090205460ff16155b15610f4357600d5460ff16610d2c5760405162461bcd60e51b815260206004820152600c60248201526b139bdd081b185d5b98da195960a21b6044820152606401610783565b600d545f90610100900460ff168015610d47575043600e5414155b15610d9257600c54821115610d8d5760405162461bcd60e51b815260206004820152600c60248201526b13505608151608131253525560a21b6044820152606401610783565b610dd3565b600b54821115610dd35760405162461bcd60e51b815260206004820152600c60248201526b13505608151608131253525560a21b6044820152606401610783565b6009546001600160a01b0390811690841603610e6c5750600754305f9081526020819052604090205460115481118015610e10575060145460ff16155b15610e6657600f54431115610e24575f6010555b60036010541015610e665760108054905f610e3e8361160d565b909155505043600f55601254610e6690610e6190610e5c8685610f9f565b610f9f565b610fb6565b50610ef9565b6009546001600160a01b0390811690851603610ef95750600654600e544303610ef95760138054905f610e9e8361160d565b91905055505f9050600b6013541115610ef95760405162461bcd60e51b815260206004820181905260248201527f457863656564732062757973206f6e2074686520666972737420626c6f636b2e6044820152606401610783565b5f6064610f068385611561565b610f1091906115c3565b90505f610f1d8285611625565b90508115610f3057610f3086308461113c565b610f3b86868361113c565b505050505050565b610a3683838361113c565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f818311610fad5782610faf565b815b9392505050565b6014805460ff19166001179055600854610fdb9030906001600160a01b031683610b0b565b6040805160028082526060820183525f9260208301908036833701905050905030815f8151811061100e5761100e611638565b6001600160a01b03928316602091820292909201810191909152600854604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611065573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611089919061164c565b8160018151811061109c5761109c611638565b6001600160a01b03928316602091820292909201015260085460405163791ac94760e01b815291169063791ac947906111019085905f9086907f000000000000000000000000bf550c6c1283385d1d08c58c7e89d9cec3a8d5fe904290600401611667565b5f604051808303815f87803b158015611118575f80fd5b505af115801561112a573d5f803e3d5ffd5b50506014805460ff1916905550505050565b6001600160a01b0383166111a05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610783565b6001600160a01b0382166112025760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610783565b6001600160a01b0383165f90815260208190526040902054818110156112795760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610783565b6001600160a01b038481165f81815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610ca0565b5f602082840312156112ee575f80fd5b5035919050565b5f602080835283518060208501525f5b8181101561132157858101830151858201604001528201611305565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b03811681146108f1575f80fd5b5f8060408385031215611366575f80fd5b823561137181611341565b946020939093013593505050565b5f805f60608486031215611391575f80fd5b833561139c81611341565b925060208401356113ac81611341565b929592945050506040919091013590565b5f80604083850312156113ce575f80fd5b50508035926020909101359150565b5f602082840312156113ed575f80fd5b8135610faf81611341565b5f8060408385031215611409575f80fd5b823561141481611341565b915060208301358015158114611428575f80fd5b809150509250929050565b5f8060408385031215611444575f80fd5b823561144f81611341565b9150602083013561142881611341565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156114ad57815f19048211156114935761149361145f565b808516156114a057918102915b93841c9390800290611478565b509250929050565b5f826114c35750600161063a565b816114cf57505f61063a565b81600181146114e557600281146114ef5761150b565b600191505061063a565b60ff8411156115005761150061145f565b50506001821b61063a565b5060208310610133831016604e8410600b841016171561152e575081810a61063a565b6115388383611473565b805f190482111561154b5761154b61145f565b029392505050565b5f610faf60ff8416836114b5565b808202811582820484141761063a5761063a61145f565b600181811c9082168061158c57607f821691505b6020821081036115aa57634e487b7160e01b5f52602260045260245ffd5b50919050565b8082018082111561063a5761063a61145f565b5f826115dd57634e487b7160e01b5f52601260045260245ffd5b500490565b5f805f606084860312156115f4575f80fd5b8351925060208401519150604084015190509250925092565b5f6001820161161e5761161e61145f565b5060010190565b8181038181111561063a5761063a61145f565b634e487b7160e01b5f52603260045260245ffd5b5f6020828403121561165c575f80fd5b8151610faf81611341565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b818110156116b75784516001600160a01b031683529383019391830191600101611692565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220fe625567f98ab46bbc6a9921168e3317e1e35d07c213cb6ce8aea0e99bb2f26564736f6c63430008170033
Verified Source Code Partial Match
Compiler: v0.8.23+commit.f704f362
EVM: shanghai
Optimization: Yes (200 runs)
ERC20.sol 365 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./IERC20Metadata.sol";
import "./Context.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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* 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 ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @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 default value returned by this function, unless
* it's 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:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, 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}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, 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}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, 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) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, 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) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* 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:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, 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:
*
* - `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;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_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;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_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 Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - 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 {}
}
COFFEE.sol 228 lines
/*
Twitter: x.com/weare_coffee?s=21
Telegram: t.me/coffeeAI_portal
Website: Coffee.to
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
import "./ERC20.sol";
import "./Ownable.sol";
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint256 amountIn,uint256 amountOutMin,address[] calldata path,address to,uint256 deadline) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract COFFEE is ERC20, Ownable {
uint256 private buyTax = 20;
uint256 private sellTax = 25;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
mapping(address => bool) public isExempt;
address private immutable marketingAddress;
address private immutable taxAddress;
uint256 public maxTransaction;
uint256 public maxTxLaunch;
bool private launch = false;
bool private launchLimits = true;
uint256 private blockLaunch;
uint256 private lastSellBlock;
uint256 private sellCount;
uint256 private minSwap;
uint256 private maxSwap;
uint256 private _buyCount= 0;
bool private inSwap;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(
address _taxAddress,
address _marketingAddress,
address _reserve,
address _team,
address _grants,
address _ps
) ERC20("COFFEE", "COFFEE") Ownable() payable {
uint256 totalSupply = 100000000 * 10**18;
marketingAddress = _marketingAddress;
taxAddress = _taxAddress;
isExempt[msg.sender] = true;
isExempt[address(this)] = true;
isExempt[_reserve] = true;
isExempt[marketingAddress] = true;
isExempt[taxAddress] = true;
isExempt[_grants] = true;
isExempt[_team] = true;
isExempt[_ps] = true;
_mint(_ps, totalSupply * 10 / 100);
_mint(_team, totalSupply * 5 / 100);
_mint(_grants, totalSupply * 10 / 100);
_mint(_reserve, totalSupply * 8 / 100);
_mint(_marketingAddress, totalSupply * 5 / 100);
_mint(address(this), totalSupply * 62 / 100);
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Pair = address(
IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH())
);
maxTransaction = totalSupply * 2 / 100;
maxTxLaunch = totalSupply * 5 / 1000;
maxSwap = 150000 * 10**18;
minSwap = 25000 * 10**18;
}
function addLiquidityETH() external onlyOwner {
_approve(address(this), address(uniswapV2Router), balanceOf(address(this)));
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
}
function getMinCaSwap() public view returns (uint256){
return minSwap / 10**decimals();
}
function setMaxCaSwap(uint256 _maxSwap) external onlyOwner{
maxSwap = _maxSwap * 10**decimals();
}
function setMinSwap(uint256 _minSwap) external onlyOwner{
minSwap = _minSwap * 10**decimals();
}
function switchCaCanSell() external onlyOwner {
if (inSwap){
inSwap = false;
} else {
inSwap = true;
}
}
function removeLaunchLimits() external onlyOwner {
launchLimits = false;
}
function getMaxCASwap() public view returns (uint256){
return maxSwap / 10**decimals();
}
function swapTokensEth(uint256 tokenAmount) internal lockTheSwap {
_approve(address(this), address(uniswapV2Router), tokenAmount);
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
taxAddress,
block.timestamp
);
}
function _transfer(address from, address to, uint256 value) internal virtual override {
if (!isExempt[from] && !isExempt[to]) {
require(launch, "Not launched");
uint256 tax = 0;
if (launchLimits && blockLaunch!=block.number){
require(value <= maxTxLaunch, "MAX TX LIMIT");
} else {
require(value <= maxTransaction, "MAX TX LIMIT");
}
if (to == uniswapV2Pair) {
tax = sellTax;
uint256 tokensSwap = balanceOf(address(this));
if (tokensSwap > minSwap && !inSwap) {
if (block.number > lastSellBlock) {
sellCount = 0;
}
if (sellCount < 3){
sellCount++;
lastSellBlock = block.number;
swapTokensEth(min(maxSwap, min(value, tokensSwap)));
}
}
} else if (from == uniswapV2Pair){
tax = buyTax;
if(block.number == blockLaunch){
_buyCount++;
tax = 0;
require(_buyCount <= 11,"Exceeds buys on the first block.");
}
}
uint256 taxAmount = value * tax / 100;
uint256 amountAfterTax = value - taxAmount;
if (taxAmount > 0){
super._transfer(from, address(this), taxAmount);
}
super._transfer(from, to, amountAfterTax);
return;
}
super._transfer(from, to, value);
}
function min(uint256 a, uint256 b) private pure returns (uint256){
return (a>b)?b:a;
}
function setMaxTx(uint256 newMaxTx) external onlyOwner {
require(newMaxTx* 10**decimals() >= totalSupply()/100); //Protect: MaxTx more then 1%
maxTransaction= newMaxTx * 10**decimals();
}
function setExcludedWallet(address wAddress, bool isExcle) external onlyOwner {
isExempt[wAddress] = isExcle;
}
function openTrading() external onlyOwner {
launch = true;
blockLaunch = block.number;
}
function setTax(uint256 newBuyTax , uint256 newSellTax) external onlyOwner {
require(newBuyTax < 20 && newSellTax < 20); //Protect: Tax less then 20%
sellTax = newSellTax;
buyTax = newBuyTax;
}
function removeAllLimits() external onlyOwner {
launchLimits = false;
maxTransaction = totalSupply();
}
function exportETH() external {
payable(marketingAddress).transfer(address(this).balance);
}
receive() external payable {}
}
IERC20.sol 78 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}
Context.sol 24 lines
// 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;
}
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "./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 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);
}
}
IERC20Metadata.sol 28 lines
// 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);
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
getMaxCASwap 0xa508de62 → uint256
getMinCaSwap 0x5637bce1 → uint256
isExempt 0xad5dff73 → bool
maxTransaction 0xc3f70b52 → uint256
maxTxLaunch 0x084cf615 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
uniswapV2Pair 0x49bd5a5e → address
Write Contract 18 functions
These functions modify contract state and require a wallet transaction to execute.
addLiquidityETH 0xed995307
No parameters
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
exportETH 0xd579d4ed
No parameters
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
openTrading 0xc9567bf9
No parameters
removeAllLimits 0xdb05e5cb
No parameters
removeLaunchLimits 0xc01dfd66
No parameters
renounceOwnership 0x715018a6
No parameters
setExcludedWallet 0xaca2cd6e
address wAddress
bool isExcle
setMaxCaSwap 0x027cc97a
uint256 _maxSwap
setMaxTx 0xbc337182
uint256 newMaxTx
setMinSwap 0xa9e282b8
uint256 _minSwap
setTax 0x667f6526
uint256 newBuyTax
uint256 newSellTax
switchCaCanSell 0x49deb75c
No parameters
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address