Address Contract Verified
Address
0x4ad434b8CDC3AA5AC97932D6BD18b5d313aB0f6f
Balance
0.000000000 ETH
Nonce
1
Code Size
8330 bytes
Creator
0x995C6550...ce2B at tx 0xb715e1b7...b52d25
Indexed Transactions
0
Contract Bytecode
8330 bytes
0x60806040526004361061021e5760003560e01c8063571ac8b011610123578063b0f7ec38116100ab578063df20fd491161006f578063df20fd49146106ee578063e186ec741461070e578063f2fde38b1461072e578063f40acc3d1461074e578063f84ba65d1461078257600080fd5b8063b0f7ec3814610632578063c38a31de14610653578063d7c0103214610673578063d85a282814610693578063dd62ed3e146106a857600080fd5b80637d1db4a5116100f25780637d1db4a51461058d5780638da5cb5b146105a357806395d89b41146105d5578063a82ed9ec146105ea578063a9059cbb1461061257600080fd5b8063571ac8b014610518578063658d4b7f1461053857806370a0823114610558578063715018a61461057857600080fd5b80632b14ca56116101a6578063364333f411610175578063364333f41461044f578063404e51291461046657806341aea9de1461048657806345ce5365146104a657806347062402146104c657600080fd5b80632b14ca56146103625780632d838119146103f9578063313ce567146104195780633582ad231461043557600080fd5b806316c02129116101ed57806316c02129146102d2578063178002871461030257806318160ddd1461031857806323b872dd1461032d5780632b112e491461034d57600080fd5b80630445b6671461022a57806306fdde0314610253578063095ea7b3146102755780630cfc15f9146102a557600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5061024060105481565b6040519081526020015b60405180910390f35b34801561025f57600080fd5b506102686107a2565b60405161024a9190611beb565b34801561028157600080fd5b50610295610290366004611c4e565b610834565b604051901515815260200161024a565b3480156102b157600080fd5b506102406102c0366004611c7a565b60056020526000908152604090205481565b3480156102de57600080fd5b506102956102ed366004611c7a565b60126020526000908152604090205460ff1681565b34801561030e57600080fd5b5061024060065481565b34801561032457600080fd5b50600354610240565b34801561033957600080fd5b50610295610348366004611c97565b6108a1565b34801561035957600080fd5b506102406109ae565b34801561036e57600080fd5b50600c546103b49060ff8082169161010081048216916201000082048116916301000000810482169164010000000082041690600160281b90046001600160801b031686565b6040805160ff9788168152958716602087015293861693850193909352908416606084015290921660808201526001600160801b0390911660a082015260c00161024a565b34801561040557600080fd5b50610240610414366004611cd8565b6109e1565b34801561042557600080fd5b506040516012815260200161024a565b34801561044157600080fd5b506008546102959060ff1681565b34801561045b57600080fd5b506104646109fe565b005b34801561047257600080fd5b50610464610481366004611d06565b610a5e565b34801561049257600080fd5b506104646104a1366004611d3b565b610a91565b3480156104b257600080fd5b506102406104c1366004611cd8565b610aac565b3480156104d257600080fd5b50600b546103b49060ff8082169161010081048216916201000082048116916301000000810482169164010000000082041690600160281b90046001600160801b031686565b34801561052457600080fd5b50610295610533366004611c7a565b610abf565b34801561054457600080fd5b50610464610553366004611d06565b610acd565b34801561056457600080fd5b50610240610573366004611c7a565b610b00565b34801561058457600080fd5b50610464610b22565b34801561059957600080fd5b5061024060045481565b3480156105af57600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161024a565b3480156105e157600080fd5b50610268610b36565b3480156105f657600080fd5b506105bd737a250d5630b4cf539739df2c5dacb4c659f2488d81565b34801561061e57600080fd5b5061029561062d366004611c4e565b610b45565b34801561063e57600080fd5b50600f5461029590600160a01b900460ff1681565b34801561065f57600080fd5b5061046461066e366004611d67565b610b52565b34801561067f57600080fd5b5061046461068e366004611e21565b610ea1565b34801561069f57600080fd5b50610464610ee8565b3480156106b457600080fd5b506102406106c3366004611e6c565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b3480156106fa57600080fd5b50610464610709366004611ea5565b610f03565b34801561071a57600080fd5b50610464610729366004611cd8565b610f2d565b34801561073a57600080fd5b50610464610749366004611c7a565b610f56565b34801561075a57600080fd5b506105bd7f000000000000000000000000aa665ad2c5f99c9861c1030ef85e48ba07059c2a81565b34801561078e57600080fd5b5061046461079d366004611d06565b610fcc565b6060600180546107b190611ec1565b80601f01602080910402602001604051908101604052809291908181526020018280546107dd90611ec1565b801561082a5780601f106107ff5761010080835404028352916020019161082a565b820191906000526020600020905b81548152906001019060200180831161080d57829003601f168201915b5050505050905090565b3360008181526007602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061088f9086815260200190565b60405180910390a35060015b92915050565b6001600160a01b038316600090815260076020908152604080832033845290915281205460001914610999576001600160a01b03841660009081526007602090815260408083203384529091529020548211156109455760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064015b60405180910390fd5b6001600160a01b0384166000908152600760209081526040808320338452909152902054610974908390611f11565b6001600160a01b03851660009081526007602090815260408083203384529091529020555b6109a4848484610fff565b90505b9392505050565b60006109ba6000610b00565b6109c561dead610b00565b6003546109d29190611f11565b6109dc9190611f11565b905090565b6000600654600354836109f49190611f24565b61089b9190611f3b565b610a06611300565b604051600090339047908381818185875af1925050503d8060008114610a48576040519150601f19603f3d011682016040523d82523d6000602084013e610a4d565b606091505b5050905080610a5b57600080fd5b50565b610a66611300565b6001600160a01b03919091166000908152601260205260409020805460ff1916911515919091179055565b610a99611300565b6008805460ff1916911515919091179055565b6000600354600654836109f49190611f24565b600061089b82600019610834565b610ad5611300565b6001600160a01b03919091166000908152600960205260409020805460ff1916911515919091179055565b6001600160a01b03811660009081526005602052604081205461089b906109e1565b610b2a611300565b610b34600061135a565b565b6060600280546107b190611ec1565b60006109a7338484610fff565b610b5a611300565b600086888a610b698d8f611f5d565b610b739190611f5d565b610b7d9190611f5d565b610b879190611f5d565b60ff1690506000828486610b9b898b611f5d565b610ba59190611f5d565b610baf9190611f5d565b610bb99190611f5d565b60ff169050600a826001600160801b03161115610c0c5760405162461bcd60e51b8152602060048201526011602482015270084eaf240cccacae640e8dede40d0d2ced607b1b604482015260640161093c565b600a816001600160801b03161115610c5b5760405162461bcd60e51b81526020600482015260126024820152710a6cad8d840cccacae640e8dede40d0d2ced60731b604482015260640161093c565b6040518060c001604052808d60ff1681526020018d60ff1681526020018d60ff1681526020018d60ff1681526020018960ff168152602001836001600160801b0316815250600b60008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a8154816001600160801b0302191690836001600160801b031602179055509050506040518060c001604052808860ff1681526020018860ff1681526020018860ff1681526020018860ff1681526020018460ff168152602001826001600160801b0316815250600c60008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a8154816001600160801b0302191690836001600160801b03160217905550905050505050505050505050505050565b610ea9611300565b600d80546001600160a01b039485166001600160a01b031991821617909155600e805493851693821693909317909255600f8054919093169116179055565b610ef0611300565b610a5b3033610efe30610b00565b610fff565b610f0b611300565b600f8054921515600160a01b0260ff60a01b1990931692909217909155601055565b610f35611300565b61271081600354610f469190611f24565b610f509190611f3b565b60045550565b610f5e611300565b6001600160a01b038116610fc35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161093c565b610a5b8161135a565b610fd4611300565b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b6001600160a01b03821660009081526012602052604081205460ff1615801561104157506001600160a01b03841660009081526012602052604090205460ff16155b61107b5760405162461bcd60e51b815260206004820152600b60248201526a109b1858dadb1a5cdd195960aa1b604482015260640161093c565b60115460ff1615611098576110918484846113aa565b90506109a7565b60085460ff1680156110c357506001600160a01b0384166000908152600a602052604090205460ff16155b80156110e857506001600160a01b0383166000908152600a602052604090205460ff16155b15611150576004548211156111505760405162461bcd60e51b815260206004820152602860248201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546044820152673c20b6b7bab73a1760c11b606482015260840161093c565b6111586114d3565b1561116557611165611540565b600061117083610aac565b6001600160a01b0386166000908152600560205260409020549091508111156111d25760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742042616c616e636560601b604482015260640161093c565b6001600160a01b0385166000908152600560205260409020546111f6908290611f11565b6001600160a01b03861660009081526005602052604081209190915561121c8686611932565b6112265781611273565b6112737f000000000000000000000000aa665ad2c5f99c9861c1030ef85e48ba07059c2a6001600160a01b0316876001600160a01b03161461126957600061126c565b60015b8784611978565b6001600160a01b03861660009081526005602052604090205490915061129a908290611f76565b6001600160a01b0380871660008181526005602052604090209290925587167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6112e3846109e1565b60405190815260200160405180910390a350600195945050505050565b6000546001600160a01b03163314610b345760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161093c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806113b683610aac565b6001600160a01b0386166000908152600560205260409020549091508111156114185760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742042616c616e636560601b604482015260640161093c565b6001600160a01b03851660009081526005602052604090205461143c908290611f11565b6001600160a01b03808716600090815260056020526040808220939093559086168152205461146c908290611f76565b6001600160a01b0380861660008181526005602052604090819020939093559151908716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906114c09087815260200190565b60405180910390a3506001949350505050565b6000336001600160a01b037f000000000000000000000000aa665ad2c5f99c9861c1030ef85e48ba07059c2a1614801590611511575060115460ff16155b80156115265750600f54600160a01b900460ff165b80156109dc575060105461153930610b00565b1015905090565b60118054600160ff199091161790556040805160c081018252600c5460ff80821683526101008204811660208401526201000082048116938301939093526301000000810483166060830152640100000000810490921660808201819052600160281b9092046001600160801b031660a082018190526010549192600091906115c99084611f24565b6115d39190611f3b565b905060006115e18284611f11565b9050611601737a250d5630b4cf539739df2c5dacb4c659f2488d82610834565b5061160f3061dead84610fff565b50604080516002808252606082018352600092602083019080368337019050509050308160008151811061164557611645611f89565b60200260200101906001600160a01b031690816001600160a01b031681525050737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116db9190611f9f565b816001815181106116ee576116ee611f89565b6001600160a01b039092166020928302919091019091015260405163791ac94760e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d9063791ac94790611746908590600090869030904290600401611fbc565b600060405180830381600087803b15801561176057600080fd5b505af1158015611774573d6000803e3d6000fd5b5050505060004790506000866080015160ff16876000015160ff168860a0015161179e919061202d565b6117a8919061202d565b6001600160801b03169050600081886020015160ff16846117c99190611f24565b6117d39190611f3b565b9050600082896040015160ff16856117eb9190611f24565b6117f59190611f3b565b90506000838a6060015160ff168661180d9190611f24565b6118179190611f3b565b600d546040519192506000916001600160a01b039091169085908381818185875af1925050503d8060008114611869576040519150601f19603f3d011682016040523d82523d6000602084013e61186e565b606091505b5050600e546040519192506001600160a01b0316908490600081818185875af1925050503d80600081146118be576040519150601f19603f3d011682016040523d82523d6000602084013e6118c3565b606091505b5050600f546040519192506001600160a01b0316908390600081818185875af1925050503d8060008114611913576040519150601f19603f3d011682016040523d82523d6000602084013e611918565b606091505b50506011805460ff19169055505050505050505050505050565b6001600160a01b03821660009081526009602052604081205460ff161580156109a75750506001600160a01b031660009081526009602052604090205460ff1615919050565b6040805160c08082018352600b5460ff8082168452610100808304821660208087019190915262010000808504841687890152630100000080860485166060808a019190915264010000000080880487166080808c01919091526001600160801b03600160281b998a9004811660a0808e01919091528d519b8c018e52600c54808b168d529889048a16978c019790975294870488169b8a019b909b5291850486169088015283049093169685019690965291909104169281019290925260009182861515600114611a6e5760648260a001516001600160801b031686611a5f9190611f24565b611a699190611f3b565b611a93565b60648360a001516001600160801b031686611a899190611f24565b611a939190611f3b565b90506000600188151514611ad1578260a001516001600160801b0316836000015160ff1683611ac29190611f24565b611acc9190611f3b565b611afc565b8360a001516001600160801b0316846000015160ff1683611af29190611f24565b611afc9190611f3b565b905080600654611b0c9190611f11565b6006556000611b1b8284611f11565b90508015611b975730600090815260056020526040902054611b3e908290611f76565b306000818152600560205260409020919091556001600160a01b0389167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611b85846109e1565b60405190815260200160405180910390a35b6006546040805184815260208101929092527fc3b3cc73ac1faef58c428c22be6cb344acfd92a699c8cd758c753af27071b5ac910160405180910390a1611bde8388611f11565b9998505050505050505050565b600060208083528351808285015260005b81811015611c1857858101830151858201604001528201611bfc565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114610a5b57600080fd5b60008060408385031215611c6157600080fd5b8235611c6c81611c39565b946020939093013593505050565b600060208284031215611c8c57600080fd5b81356109a781611c39565b600080600060608486031215611cac57600080fd5b8335611cb781611c39565b92506020840135611cc781611c39565b929592945050506040919091013590565b600060208284031215611cea57600080fd5b5035919050565b80358015158114611d0157600080fd5b919050565b60008060408385031215611d1957600080fd5b8235611d2481611c39565b9150611d3260208401611cf1565b90509250929050565b600060208284031215611d4d57600080fd5b6109a782611cf1565b803560ff81168114611d0157600080fd5b6000806000806000806000806000806101408b8d031215611d8757600080fd5b611d908b611d56565b9950611d9e60208c01611d56565b9850611dac60408c01611d56565b9750611dba60608c01611d56565b9650611dc860808c01611d56565b9550611dd660a08c01611d56565b9450611de460c08c01611d56565b9350611df260e08c01611d56565b9250611e016101008c01611d56565b9150611e106101208c01611d56565b90509295989b9194979a5092959850565b600080600060608486031215611e3657600080fd5b8335611e4181611c39565b92506020840135611e5181611c39565b91506040840135611e6181611c39565b809150509250925092565b60008060408385031215611e7f57600080fd5b8235611e8a81611c39565b91506020830135611e9a81611c39565b809150509250929050565b60008060408385031215611eb857600080fd5b611c6c83611cf1565b600181811c90821680611ed557607f821691505b602082108103611ef557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561089b5761089b611efb565b808202811582820484141761089b5761089b611efb565b600082611f5857634e487b7160e01b600052601260045260246000fd5b500490565b60ff818116838216019081111561089b5761089b611efb565b8082018082111561089b5761089b611efb565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611fb157600080fd5b81516109a781611c39565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561200c5784516001600160a01b031683529383019391830191600101611fe7565b50506001600160a01b03969096166060850152505050608001529392505050565b6001600160801b0382811682821603908082111561204d5761204d611efb565b509291505056fea2646970667358221220d7a3ba09d1d0984024b95f6ce612aa8cd5c789ca64bca10b3df826315690c2f564736f6c63430008130033
Verified Source Code Full Match
Compiler: v0.8.19+commit.7dd6d404
EVM: london
Optimization: Yes (200 runs)
EverMoon.sol 373 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.19;
// https://twitter.com/EverMoonERC
// https://t.me/EverMoonERC
import {IERC20} from "openzeppelin/token/ERC20/IERC20.sol";
import {Ownable} from "openzeppelin/access/Ownable.sol";
interface IUniswapV2Router02 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address UNISWAP_V2_PAIR);
}
contract EverMoon is IERC20, Ownable {
/* -------------------------------------------------------------------------- */
/* events */
/* -------------------------------------------------------------------------- */
event Reflect(uint256 amountReflected, uint256 newTotalProportion);
/* -------------------------------------------------------------------------- */
/* constants */
/* -------------------------------------------------------------------------- */
address constant DEAD = 0x000000000000000000000000000000000000dEaD;
address constant ZERO = 0x0000000000000000000000000000000000000000;
uint256 constant MAX_FEE = 10;
/* -------------------------------------------------------------------------- */
/* states */
/* -------------------------------------------------------------------------- */
IUniswapV2Router02 public constant UNISWAP_V2_ROUTER =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address public immutable UNISWAP_V2_PAIR;
struct Fee {
uint8 reflection;
uint8 marketing;
uint8 lp;
uint8 buyback;
uint8 burn;
uint128 total;
}
string _name = "EverMoon";
string _symbol = "EVERMOON";
uint256 _totalSupply = 1_000_000_000 ether;
uint256 public _maxTxAmount = _totalSupply * 2 / 100;
/* rOwned = ratio of tokens owned relative to circulating supply (NOT total supply, since circulating <= total) */
mapping(address => uint256) public _rOwned;
uint256 public _totalProportion = _totalSupply;
mapping(address => mapping(address => uint256)) _allowances;
bool public limitsEnabled = true;
mapping(address => bool) isFeeExempt;
mapping(address => bool) isTxLimitExempt;
Fee public buyFee = Fee({reflection: 1, marketing: 1, lp: 1, buyback: 1, burn: 1, total: 5});
Fee public sellFee = Fee({reflection: 1, marketing: 1, lp: 1, buyback: 1, burn: 1, total: 5});
address private marketingFeeReceiver;
address private lpFeeReceiver;
address private buybackFeeReceiver;
bool public claimingFees = true;
uint256 public swapThreshold = (_totalSupply * 2) / 1000;
bool inSwap;
mapping(address => bool) public blacklists;
/* -------------------------------------------------------------------------- */
/* modifiers */
/* -------------------------------------------------------------------------- */
modifier swapping() {
inSwap = true;
_;
inSwap = false;
}
/* -------------------------------------------------------------------------- */
/* constructor */
/* -------------------------------------------------------------------------- */
constructor() {
// create uniswap pair
address _uniswapPair =
IUniswapV2Factory(UNISWAP_V2_ROUTER.factory()).createPair(address(this), UNISWAP_V2_ROUTER.WETH());
UNISWAP_V2_PAIR = _uniswapPair;
_allowances[address(this)][address(UNISWAP_V2_ROUTER)] = type(uint256).max;
_allowances[address(this)][tx.origin] = type(uint256).max;
isTxLimitExempt[address(this)] = true;
isTxLimitExempt[address(UNISWAP_V2_ROUTER)] = true;
isTxLimitExempt[_uniswapPair] = true;
isTxLimitExempt[tx.origin] = true;
isFeeExempt[tx.origin] = true;
marketingFeeReceiver = 0xeEA122Ad5f9c02fa3Bec08115E7CDb4D65142C81;
lpFeeReceiver = 0x31D650bdE669fFcd5A7E1745D6E8306c8100E520;
buybackFeeReceiver = 0xF07B6322A5eF6297F10eDE3dbc6ce0612dA9875D;
_rOwned[tx.origin] = _totalSupply;
emit Transfer(address(0), tx.origin, _totalSupply);
}
receive() external payable {}
/* -------------------------------------------------------------------------- */
/* ERC20 */
/* -------------------------------------------------------------------------- */
function approve(address spender, uint256 amount) public override returns (bool) {
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function approveMax(address spender) external returns (bool) {
return approve(spender, type(uint256).max);
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
return _transferFrom(msg.sender, recipient, amount);
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
if (_allowances[sender][msg.sender] != type(uint256).max) {
require(_allowances[sender][msg.sender] >= amount, "ERC20: insufficient allowance");
_allowances[sender][msg.sender] = _allowances[sender][msg.sender] - amount;
}
return _transferFrom(sender, recipient, amount);
}
/* -------------------------------------------------------------------------- */
/* views */
/* -------------------------------------------------------------------------- */
function totalSupply() external view override returns (uint256) {
return _totalSupply;
}
function decimals() external pure returns (uint8) {
return 18;
}
function name() external view returns (string memory) {
return _name;
}
function symbol() external view returns (string memory) {
return _symbol;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function allowance(address holder, address spender) external view override returns (uint256) {
return _allowances[holder][spender];
}
function tokensToProportion(uint256 tokens) public view returns (uint256) {
return tokens * _totalProportion / _totalSupply;
}
function tokenFromReflection(uint256 proportion) public view returns (uint256) {
return proportion * _totalSupply / _totalProportion;
}
function getCirculatingSupply() public view returns (uint256) {
return _totalSupply - balanceOf(DEAD) - balanceOf(ZERO);
}
/* -------------------------------------------------------------------------- */
/* owners */
/* -------------------------------------------------------------------------- */
function clearStuckBalance() external onlyOwner {
(bool success,) = payable(msg.sender).call{value: address(this).balance}("");
require(success);
}
function clearStuckToken() external onlyOwner {
_transferFrom(address(this), msg.sender, balanceOf(address(this)));
}
function setSwapBackSettings(bool _enabled, uint256 _amount) external onlyOwner {
claimingFees = _enabled;
swapThreshold = _amount;
}
function changeFees(
uint8 reflectionFeeBuy,
uint8 marketingFeeBuy,
uint8 lpFeeBuy,
uint8 buybackFeeBuy,
uint8 burnFeeBuy,
uint8 reflectionFeeSell,
uint8 marketingFeeSell,
uint8 lpFeeSell,
uint8 buybackFeeSell,
uint8 burnFeeSell
) external onlyOwner {
uint128 __totalBuyFee = reflectionFeeBuy + marketingFeeBuy + lpFeeBuy + buybackFeeBuy + burnFeeBuy;
uint128 __totalSellFee = reflectionFeeSell + marketingFeeSell + lpFeeSell + buybackFeeSell + burnFeeSell;
require(__totalBuyFee <= MAX_FEE, "Buy fees too high");
require(__totalSellFee <= MAX_FEE, "Sell fees too high");
buyFee = Fee({
reflection: reflectionFeeBuy,
marketing: reflectionFeeBuy,
lp: reflectionFeeBuy,
buyback: reflectionFeeBuy,
burn: burnFeeBuy,
total: __totalBuyFee
});
sellFee = Fee({
reflection: reflectionFeeSell,
marketing: reflectionFeeSell,
lp: reflectionFeeSell,
buyback: reflectionFeeSell,
burn: burnFeeSell,
total: __totalSellFee
});
}
function setIsFeeExempt(address holder, bool exempt) external onlyOwner {
isFeeExempt[holder] = exempt;
}
function setIsTxLimitExempt(address holder, bool exempt) external onlyOwner {
isTxLimitExempt[holder] = exempt;
}
function setFeeReceivers(address m_, address lp_, address b_) external onlyOwner {
marketingFeeReceiver = m_;
lpFeeReceiver = lp_;
buybackFeeReceiver = b_;
}
function setMaxTxBasisPoint(uint256 p_) external onlyOwner {
_maxTxAmount = _totalSupply * p_ / 10000;
}
function setLimitsEnabled(bool e_) external onlyOwner {
limitsEnabled = e_;
}
function blacklist(address _address, bool _isBlacklisting) external onlyOwner {
blacklists[_address] = _isBlacklisting;
}
/* -------------------------------------------------------------------------- */
/* private */
/* -------------------------------------------------------------------------- */
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
require(!blacklists[recipient] && !blacklists[sender], "Blacklisted");
if (inSwap) {
return _basicTransfer(sender, recipient, amount);
}
if (limitsEnabled && !isTxLimitExempt[sender] && !isTxLimitExempt[recipient]) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
if (_shouldSwapBack()) {
_swapBack();
}
uint256 proportionAmount = tokensToProportion(amount);
require(_rOwned[sender] >= proportionAmount, "Insufficient Balance");
_rOwned[sender] = _rOwned[sender] - proportionAmount;
uint256 proportionReceived = _shouldTakeFee(sender, recipient)
? _takeFeeInProportions(sender == UNISWAP_V2_PAIR ? true : false, sender, proportionAmount)
: proportionAmount;
_rOwned[recipient] = _rOwned[recipient] + proportionReceived;
emit Transfer(sender, recipient, tokenFromReflection(proportionReceived));
return true;
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
uint256 proportionAmount = tokensToProportion(amount);
require(_rOwned[sender] >= proportionAmount, "Insufficient Balance");
_rOwned[sender] = _rOwned[sender] - proportionAmount;
_rOwned[recipient] = _rOwned[recipient] + proportionAmount;
emit Transfer(sender, recipient, amount);
return true;
}
function _takeFeeInProportions(bool buying, address sender, uint256 proportionAmount) internal returns (uint256) {
Fee memory __buyFee = buyFee;
Fee memory __sellFee = sellFee;
uint256 proportionFeeAmount =
buying == true ? proportionAmount * __buyFee.total / 100 : proportionAmount * __sellFee.total / 100;
// reflect
uint256 proportionReflected = buying == true
? proportionFeeAmount * __buyFee.reflection / __buyFee.total
: proportionFeeAmount * __sellFee.reflection / __sellFee.total;
_totalProportion = _totalProportion - proportionReflected;
// take fees
uint256 _proportionToContract = proportionFeeAmount - proportionReflected;
if (_proportionToContract > 0) {
_rOwned[address(this)] = _rOwned[address(this)] + _proportionToContract;
emit Transfer(sender, address(this), tokenFromReflection(_proportionToContract));
}
emit Reflect(proportionReflected, _totalProportion);
return proportionAmount - proportionFeeAmount;
}
function _shouldSwapBack() internal view returns (bool) {
return msg.sender != UNISWAP_V2_PAIR && !inSwap && claimingFees && balanceOf(address(this)) >= swapThreshold;
}
function _swapBack() internal swapping {
Fee memory __sellFee = sellFee;
uint256 __swapThreshold = swapThreshold;
uint256 amountToBurn = __swapThreshold * __sellFee.burn / __sellFee.total;
uint256 amountToSwap = __swapThreshold - amountToBurn;
approve(address(UNISWAP_V2_ROUTER), amountToSwap);
// burn
_transferFrom(address(this), DEAD, amountToBurn);
// swap
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = UNISWAP_V2_ROUTER.WETH();
UNISWAP_V2_ROUTER.swapExactTokensForETHSupportingFeeOnTransferTokens(
amountToSwap, 0, path, address(this), block.timestamp
);
uint256 amountETH = address(this).balance;
uint256 totalSwapFee = __sellFee.total - __sellFee.reflection - __sellFee.burn;
uint256 amountETHMarketing = amountETH * __sellFee.marketing / totalSwapFee;
uint256 amountETHLP = amountETH * __sellFee.lp / totalSwapFee;
uint256 amountETHBuyback = amountETH * __sellFee.buyback / totalSwapFee;
// send
(bool tmpSuccess,) = payable(marketingFeeReceiver).call{value: amountETHMarketing}("");
(tmpSuccess,) = payable(lpFeeReceiver).call{value: amountETHLP}("");
(tmpSuccess,) = payable(buybackFeeReceiver).call{value: amountETHBuyback}("");
}
function _shouldTakeFee(address sender, address recipient) internal view returns (bool) {
return !isFeeExempt[sender] && !isFeeExempt[recipient];
}
}
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.7.0) (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 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 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);
}
}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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);
}
Read Contract
UNISWAP_V2_PAIR 0xf40acc3d → address
UNISWAP_V2_ROUTER 0xa82ed9ec → address
_maxTxAmount 0x7d1db4a5 → uint256
_rOwned 0x0cfc15f9 → uint256
_totalProportion 0x17800287 → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
blacklists 0x16c02129 → bool
buyFee 0x47062402 → uint8, uint8, uint8, uint8, uint8, uint128
claimingFees 0xb0f7ec38 → bool
decimals 0x313ce567 → uint8
getCirculatingSupply 0x2b112e49 → uint256
limitsEnabled 0x3582ad23 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
sellFee 0x2b14ca56 → uint8, uint8, uint8, uint8, uint8, uint128
swapThreshold 0x0445b667 → uint256
symbol 0x95d89b41 → string
tokenFromReflection 0x2d838119 → uint256
tokensToProportion 0x45ce5365 → uint256
totalSupply 0x18160ddd → uint256
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
approveMax 0x571ac8b0
address spender
returns: bool
blacklist 0x404e5129
address _address
bool _isBlacklisting
changeFees 0xc38a31de
uint8 reflectionFeeBuy
uint8 marketingFeeBuy
uint8 lpFeeBuy
uint8 buybackFeeBuy
uint8 burnFeeBuy
uint8 reflectionFeeSell
uint8 marketingFeeSell
uint8 lpFeeSell
uint8 buybackFeeSell
uint8 burnFeeSell
clearStuckBalance 0x364333f4
No parameters
clearStuckToken 0xd85a2828
No parameters
renounceOwnership 0x715018a6
No parameters
setFeeReceivers 0xd7c01032
address m_
address lp_
address b_
setIsFeeExempt 0x658d4b7f
address holder
bool exempt
setIsTxLimitExempt 0xf84ba65d
address holder
bool exempt
setLimitsEnabled 0x41aea9de
bool e_
setMaxTxBasisPoint 0xe186ec74
uint256 p_
setSwapBackSettings 0xdf20fd49
bool _enabled
uint256 _amount
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address