Address Contract Verified
Address
0x5ca83216Fae72717332469E6A2eb28c4BF9AF9ec
Balance
0 ETH
Nonce
1
Code Size
5117 bytes
Creator
0x76cD3b3E...AcB4 at tx 0x6a3da2bb...dcafc4
Indexed Transactions
0
Contract Bytecode
5117 bytes
0x608060405234801561000f575f80fd5b50600436106101a1575f3560e01c80638da5cb5b116100f3578063aad41a4111610093578063c9567bf91161006e578063c9567bf914610377578063cc1776d31461037f578063dd62ed3e14610388578063f2fde38b1461039b575f80fd5b8063aad41a411461034e578063bbc0c74214610361578063c78d0fa01461036e575f80fd5b8063a457c2d7116100ce578063a457c2d7146102fd578063a539731e14610310578063a5ece94114610323578063a9059cbb1461033b575f80fd5b80638da5cb5b146102db57806395d89b41146102ec5780639e93ad8e146102f4575f80fd5b8063313ce5671161015e5780634f7041a5116101395780634f7041a514610280578063540dd4521461028957806370a08231146102ab578063715018a6146102d3575f80fd5b8063313ce5671461024b578063395093511461025a578063452ed4f11461026d575f80fd5b806306fdde03146101a55780630758d924146101c3578063095ea7b3146101ee57806318160ddd146102115780632369bf831461022357806323b872dd14610238575b5f80fd5b6101ad6103ae565b6040516101ba919061104a565b60405180910390f35b600d546101d6906001600160a01b031681565b6040516001600160a01b0390911681526020016101ba565b6102016101fc3660046110aa565b61043e565b60405190151581526020016101ba565b6002545b6040519081526020016101ba565b6102366102313660046110d4565b610457565b005b6102016102463660046110f6565b6104f7565b604051601281526020016101ba565b6102016102683660046110aa565b61051a565b600c546101d6906001600160a01b031681565b61021560085481565b6102016102973660046110d4565b60066020525f908152604090205460ff1681565b6102156102b93660046110d4565b6001600160a01b03165f9081526020819052604090205490565b61023661053b565b6005546001600160a01b03166101d6565b6101ad6105ae565b61021561271081565b61020161030b3660046110aa565b6105bd565b61023661031e366004611134565b610637565b6007546101d69061010090046001600160a01b031681565b6102016103493660046110aa565b6106ee565b61023661035c3660046111b7565b6106fb565b6007546102019060ff1681565b610215600b5481565b610236610836565b61021560095481565b61021561039636600461121e565b6108b3565b6102366103a93660046110d4565b6108dd565b6060600380546103bd9061124a565b80601f01602080910402602001604051908101604052809291908181526020018280546103e99061124a565b80156104345780601f1061040b57610100808354040283529160200191610434565b820191905f5260205f20905b81548152906001019060200180831161041757829003601f168201915b5050505050905090565b5f3361044b8185856109c7565b60019150505b92915050565b6005546001600160a01b0316331461048a5760405162461bcd60e51b815260040161048190611282565b60405180910390fd5b6001600160a01b0381166104cf5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b6044820152606401610481565b600780546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b5f33610504858285610aea565b61050f858585610b62565b506001949350505050565b5f3361044b81858561052c83836108b3565b61053691906112cb565b6109c7565b6005546001600160a01b031633146105655760405162461bcd60e51b815260040161048190611282565b6005546040515f916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600580546001600160a01b0319169055565b6060600480546103bd9061124a565b5f33816105ca82866108b3565b90508381101561062a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610481565b61050f82868684036109c7565b6005546001600160a01b031633146106615760405162461bcd60e51b815260040161048190611282565b306001600160a01b038316036106c45760405162461bcd60e51b815260206004820152602260248201527f43616e6e6f742072656d6f7665206578656d7074696f6e2066726f6d20746f6b60448201526132b760f11b6064820152608401610481565b6001600160a01b03919091165f908152600660205260409020805460ff1916911515919091179055565b5f3361044b818585610b62565b335f9081526006602052604090205460ff168061071a575060075460ff165b61078c5760405162461bcd60e51b815260206004820152603760248201527f4f6e6c79206578656d70742077616c6c657473206d61792061697264726f702060448201527f756e74696c2074726164696e67206973206163746976650000000000000000006064820152608401610481565b8281146107d45760405162461bcd60e51b81526020600482015260166024820152750c2e4e4c2f2e640d8cadccee8d040dad2e6dac2e8c6d60531b6044820152606401610481565b5f5b8381101561082f57610827338686848181106107f4576107f46112de565b905060200201602081019061080991906110d4565b85858581811061081b5761081b6112de565b90506020020135610c16565b6001016107d6565b5050505050565b6005546001600160a01b031633146108605760405162461bcd60e51b815260040161048190611282565b60075460ff16156108a45760405162461bcd60e51b815260206004820152600e60248201526d54726164696e672061637469766560901b6044820152606401610481565b6007805460ff19166001179055565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b6005546001600160a01b031633146109075760405162461bcd60e51b815260040161048190611282565b6001600160a01b03811661096c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610481565b6005546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3600580546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610a295760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610481565b6001600160a01b038216610a8a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610481565b6001600160a01b038381165f8181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b5f610af584846108b3565b90505f198114610b5c5781811015610b4f5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610481565b610b5c84848484036109c7565b50505050565b6001600160a01b0383165f9081526006602052604090205460ff16158015610ba257506001600160a01b0382165f9081526006602052604090205460ff16155b15610c065760075460ff16610bee5760405162461bcd60e51b815260206004820152601260248201527154726164696e67206e6f742061637469766560701b6044820152606401610481565b610bf9838383610db8565b610c0390826112f2565b90505b610c11838383610c16565b505050565b6001600160a01b038316610c7a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610481565b6001600160a01b038216610cdc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610481565b6001600160a01b0383165f9081526020819052604090205481811015610d535760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610481565b6001600160a01b038481165f81815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610b5c565b600b54305f90815260208190526040812054909111158015610ddd5750600a5460ff16155b8015610df65750600c546001600160a01b038481169116145b15610e1b57600a805460ff19166001179055610e10610ebc565b600a805460ff191690555b600c545f906001600160a01b038581169116148015610e3b57505f600954115b15610e625761271060095484610e519190611305565b610e5b919061131c565b9050610ea3565b600c546001600160a01b038681169116148015610e8057505f600854115b15610ea35761271060085484610e969190611305565b610ea0919061131c565b90505b8015610eb457610eb4853083610c16565b949350505050565b305f9081526020819052604081205490819003610ed65750565b600b54610ee4906028611305565b811115610efc57600b54610ef9906028611305565b90505b610f0581610f08565b50565b6040805160028082526060820183525f9260208301908036833701905050905030815f81518110610f3b57610f3b6112de565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610f92573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fb6919061133b565b81600181518110610fc957610fc96112de565b6001600160a01b039283166020918202929092010152600d5460075460405163791ac94760e01b81529183169263791ac947926110199287925f9288926101009004909116904290600401611356565b5f604051808303815f87803b158015611030575f80fd5b505af1158015611042573d5f803e3d5ffd5b505050505050565b5f602080835283518060208501525f5b818110156110765785810183015185820160400152820161105a565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114610f05575f80fd5b5f80604083850312156110bb575f80fd5b82356110c681611096565b946020939093013593505050565b5f602082840312156110e4575f80fd5b81356110ef81611096565b9392505050565b5f805f60608486031215611108575f80fd5b833561111381611096565b9250602084013561112381611096565b929592945050506040919091013590565b5f8060408385031215611145575f80fd5b823561115081611096565b915060208301358015158114611164575f80fd5b809150509250929050565b5f8083601f84011261117f575f80fd5b50813567ffffffffffffffff811115611196575f80fd5b6020830191508360208260051b85010111156111b0575f80fd5b9250929050565b5f805f80604085870312156111ca575f80fd5b843567ffffffffffffffff808211156111e1575f80fd5b6111ed8883890161116f565b90965094506020870135915080821115611205575f80fd5b506112128782880161116f565b95989497509550505050565b5f806040838503121561122f575f80fd5b823561123a81611096565b9150602083013561116481611096565b600181811c9082168061125e57607f821691505b60208210810361127c57634e487b7160e01b5f52602260045260245ffd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610451576104516112b7565b634e487b7160e01b5f52603260045260245ffd5b81810381811115610451576104516112b7565b8082028115828204841417610451576104516112b7565b5f8261133657634e487b7160e01b5f52601260045260245ffd5b500490565b5f6020828403121561134b575f80fd5b81516110ef81611096565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b818110156113a65784516001600160a01b031683529383019391830191600101611381565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220ce9267f7f6714ac8328c7795e180b80daec868cd91e6afa2367d599ae89b78ae64736f6c63430008170033
Verified Source Code Full Match
Compiler: v0.8.23+commit.f704f362
EVM: shanghai
Optimization: Yes (200 runs)
0xcalls.sol 641 lines
pragma solidity 0.8.23;
// SPDX-License-Identifier: MIT
/**
https://x.com/CallHubTech/status/1776197675215409557
Website: https://0xCalls.ai
Twitter: https://twitter.com/0xCallsAi
TG Portal: https://t.me/Calls0x
*/
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;
}
}
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);
}
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);
}
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 {}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() external virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IDexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
}
interface IDexFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract OxCalls is ERC20, Ownable {
mapping (address => bool) public exemptFromTaxes;
bool public tradingActive;
address public marketingAddress;
uint256 public buyTax;
uint256 public sellTax;
bool private swapping;
uint256 public swapTokensAtAmt;
address public lpPair;
IDexRouter public dexRouter;
uint256 public constant FEE_DIVISOR = 10000;
// constructor
constructor()
ERC20("0xCalls", "0XC")
{
uint256 _totalSupply = 10_000_000 * (10 ** decimals());
_mint(msg.sender, _totalSupply);
address _v2Router;
// @dev assumes WETH pair
if(block.chainid == 1){
_v2Router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
} else if(block.chainid == 5){
_v2Router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
} else if(block.chainid == 97){
_v2Router = 0xD99D1c33F9fC3444f8101754aBC46c52416550D1;
} else {
revert("Chain not configured");
}
dexRouter = IDexRouter(_v2Router);
swapTokensAtAmt = _totalSupply * 25 / 100000;
marketingAddress = 0x3b36ADAD69549c6F37628bB53e1e6fD876E35DF2; // update
buyTax = 500; // 1% = 100
sellTax = 500; // 1% = 100
lpPair = IDexFactory(dexRouter.factory()).createPair(address(this), dexRouter.WETH());
exemptFromTaxes[msg.sender] = true;
exemptFromTaxes[address(this)] = true;
exemptFromTaxes[address(dexRouter)] = true;
exemptFromTaxes[address(0x76cD3b3E69cC333B143dDD2055a432c7A84CAcB4)] = true; // previous dev wallet to add LP
_approve(address(this), address(dexRouter), type(uint256).max);
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual override {
if(!exemptFromTaxes[from] && !exemptFromTaxes[to]){
require(tradingActive, "Trading not active");
amount -= handleTaxes(from, to, amount);
}
super._transfer(from,to,amount);
}
function handleTaxes(address from, address to, uint256 amount) internal returns (uint256){
if(balanceOf(address(this)) >= swapTokensAtAmt && !swapping && to == lpPair) {
swapping = true;
swapBack();
swapping = false;
}
uint256 tax = 0;
// on sell
if (to == lpPair && sellTax > 0){
tax = amount * sellTax / FEE_DIVISOR;
}
// on buy
else if(from == lpPair && buyTax > 0) {
tax = amount * buyTax / FEE_DIVISOR;
}
if(tax > 0){
super._transfer(from, address(this), tax);
}
return tax;
}
function swapTokensForETH(uint256 tokenAmt) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = dexRouter.WETH();
dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmt,
0,
path,
address(marketingAddress),
block.timestamp
);
}
function swapBack() private {
uint256 contractBalance = balanceOf(address(this));
if(contractBalance == 0) {return;}
if(contractBalance > swapTokensAtAmt * 40){
contractBalance = swapTokensAtAmt * 40;
}
swapTokensForETH(contractBalance);
}
// owner functions
function setExemptFromTaxes(address wallet, bool isExempt) external onlyOwner {
require(wallet != address(this), "Cannot remove exemption from token");
exemptFromTaxes[wallet] = isExempt;
}
function openTrading() external onlyOwner {
require(!tradingActive, "Trading active");
tradingActive = true;
}
function updateMarketingAddress(address _address) external onlyOwner {
require(_address != address(0), "zero address");
marketingAddress = _address;
}
function multisend(address[] calldata wallets, uint256[] calldata amountsInWei) external {
require(exemptFromTaxes[msg.sender] || tradingActive, "Only exempt wallets may airdrop until trading is active");
require(wallets.length == amountsInWei.length, "arrays length mismatch");
for(uint256 i = 0; i < wallets.length; i++){
super._transfer(msg.sender, wallets[i], amountsInWei[i]);
}
}
}
Read Contract
FEE_DIVISOR 0x9e93ad8e → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
buyTax 0x4f7041a5 → uint256
decimals 0x313ce567 → uint8
dexRouter 0x0758d924 → address
exemptFromTaxes 0x540dd452 → bool
lpPair 0x452ed4f1 → address
marketingAddress 0xa5ece941 → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
sellTax 0xcc1776d3 → uint256
swapTokensAtAmt 0xc78d0fa0 → uint256
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
tradingActive 0xbbc0c742 → bool
Write Contract 11 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
multisend 0xaad41a41
address[] wallets
uint256[] amountsInWei
openTrading 0xc9567bf9
No parameters
renounceOwnership 0x715018a6
No parameters
setExemptFromTaxes 0xa539731e
address wallet
bool isExempt
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateMarketingAddress 0x2369bf83
address _address
Recent Transactions
No transactions found for this address