// SPDX-License-Identifier: MIT
//Im Rich Bitch is a contract that is unique to that which allows each holder that is early to the token and holds the most tokens to
//"Claim" a reward... The fee is redistributed to the holders to which you can claim.. Be quick and get the bag...You're rich bitch.
pragma solidity ^0.8.0;
contract ImRichBitch {
string public name = "Im Rich Bitch";
string public symbol = "Rich";
uint256 public totalSupply = 60_000_000_00 * 10**18;
uint8 public decimals = 18;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
address public owner;
uint256 public buyFeePercent = 10;
uint256 public sellFeePercent = 10;
uint256 public constant feeRedistributionRate = 5; // Fee redistribution rate per transaction
uint256 public constant maxTransactionsWithFees = 40; // Maximum transactions with fees
uint256 public totalTransactions;
mapping(address => uint256) public feeBalance;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event BuyFeePercentChanged(uint256 newBuyFeePercent);
event SellFeePercentChanged(uint256 newSellFeePercent);
constructor() {
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value);
require(_to != address(0));
uint256 fee = calculateFee(_value, sellFeePercent);
uint256 amountToTransfer = _value - fee;
balanceOf[msg.sender] -= _value;
balanceOf[_to] += amountToTransfer;
emit Transfer(msg.sender, _to, amountToTransfer);
if (fee > 0) {
uint256 redistributedFee = (fee * feeRedistributionRate) / 100;
feeBalance[owner] += redistributedFee;
fee -= redistributedFee;
}
updateFeePercentOnTransfer();
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value);
require(allowance[_from][msg.sender] >= _value);
require(_to != address(0));
uint256 fee = calculateFee(_value, sellFeePercent);
uint256 amountToTransfer = _value - fee;
balanceOf[_from] -= _value;
balanceOf[_to] += amountToTransfer;
emit Transfer(_from, _to, amountToTransfer);
if (fee > 0) {
uint256 redistributedFee = (fee * feeRedistributionRate) / 100;
feeBalance[owner] += redistributedFee;
fee -= redistributedFee;
}
updateFeePercentOnTransfer();
return true;
}
function calculateFee(uint256 _amount, uint256 _percent) internal pure returns (uint256) {
return (_amount * _percent) / 100;
}
function updateFeePercentOnTransfer() internal {
totalTransactions++;
if (totalTransactions <= maxTransactionsWithFees) {
uint256 reductionFactor = 100 - (totalTransactions * feeRedistributionRate);
uint256 newBuyFeePercent = (buyFeePercent * reductionFactor) / 100;
uint256 newSellFeePercent = (sellFeePercent * reductionFactor) / 100;
buyFeePercent = newBuyFeePercent;
sellFeePercent = newSellFeePercent;
}
}
function claimFees() public {
uint256 feeAmount = feeBalance[msg.sender];
require(feeAmount > 0, "No fees to claim.");
feeBalance[msg.sender] = 0;
balanceOf[msg.sender] += feeAmount;
emit Transfer(owner, msg.sender, feeAmount);
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(owner, address(0));
owner = address(0);
}
modifier onlyOwner() {
require(msg.sender == owner, "Only the owner can call this function.");
_;
}
}
{
"compilationTarget": {
"1.sol": "ImRichBitch"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newBuyFeePercent","type":"uint256"}],"name":"BuyFeePercentChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newSellFeePercent","type":"uint256"}],"name":"SellFeePercentChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRedistributionRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTransactionsWithFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sellFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTransactions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]