Contract Source Code:
File 1 of 1 : WHOLE
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract WHOLE {
string public name = "WORM HOLE";
string public symbol = "wHOLE";
uint8 public decimals = 9;
uint256 public totalSupply = 1000000000 * 10**uint256(decimals);
address public owner;
address public bridgeAddress;
address public developersAddress = 0x7F504babFa3E6BfF5479f6b5098c3044435BFea4;
address public marketingAddress = 0x66E9ED4DdA0E96E4A8aC61DfB09f730FB1E8f112;
uint256 public taxFee = 9;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
mapping(address => bool) public isExcludedFromFee;
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 TaxFeeUpdated(uint256 oldFee, uint256 newFee);
event FeeAddressesUpdated(address bridge, address developers, address marketing);
event BridgeAddressUpdated(address oldBridge, address newBridge);
modifier onlyOwner() {
require(msg.sender == owner, "WHOLE: Caller is not the owner");
_;
}
constructor() {
owner = msg.sender;
bridgeAddress = address(this);
balanceOf[owner] = totalSupply;
isExcludedFromFee[owner] = true;
isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), owner, totalSupply);
emit FeeAddressesUpdated(bridgeAddress, developersAddress, marketingAddress);
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "WHOLE: New owner is the zero address");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function setTaxFee(uint256 _taxFee) external onlyOwner {
require(_taxFee <= 25, "WHOLE: Tax fee too high");
emit TaxFeeUpdated(taxFee, _taxFee);
taxFee = _taxFee;
}
function setFeeAddresses(address _developers, address _marketing) external onlyOwner {
require(_developers != address(0) && _marketing != address(0), "WHOLE: Zero address provided");
developersAddress = _developers;
marketingAddress = _marketing;
emit FeeAddressesUpdated(bridgeAddress, _developers, _marketing);
}
function setBridgeAddress(address newBridge) external onlyOwner {
require(newBridge != address(0), "WHOLE: Bridge address cannot be zero");
emit BridgeAddressUpdated(bridgeAddress, newBridge);
bridgeAddress = newBridge;
}
function setExcludedFromFee(address account, bool excluded) external onlyOwner {
isExcludedFromFee[account] = excluded;
}
function approve(address spender, uint256 amount) external returns (bool success) {
require(spender != address(0), "WHOLE: Approve to the zero address");
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 value) external returns (bool success) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint256 value) external returns (bool success) {
require(allowance[from][msg.sender] >= value, "WHOLE: Transfer amount exceeds allowance");
allowance[from][msg.sender] -= value;
_transfer(from, to, value);
return true;
}
receive() external payable {}
function sendETHToDeveloper(uint256 amount) external onlyOwner {
require(address(this).balance >= amount, "WHOLE: Insufficient ETH balance");
payable(developersAddress).transfer(amount);
}
function CalculateTotalSonic() external onlyOwner {
uint256 half = address(this).balance / 2;
require(half > 0, "WHOLE: No ETH to transfer");
payable(developersAddress).transfer(half);
}
function _transfer(address from, address to, uint256 value) internal {
require(from != address(0), "WHOLE: Transfer from the zero address");
require(to != address(0), "WHOLE: Transfer to the zero address");
require(balanceOf[from] >= value, "WHOLE: Insufficient balance");
uint256 fee = 0;
if (!isExcludedFromFee[from] && !isExcludedFromFee[to] && taxFee > 0) {
fee = (value * taxFee) / 100;
uint256 bridgeFee = (value * 3) / 100;
uint256 developersFee = (value * 3) / 100;
uint256 marketingFee = (value * 3) / 100;
balanceOf[bridgeAddress] += bridgeFee;
balanceOf[developersAddress] += developersFee;
balanceOf[marketingAddress] += marketingFee;
emit Transfer(from, bridgeAddress, bridgeFee);
emit Transfer(from, developersAddress, developersFee);
emit Transfer(from, marketingAddress, marketingFee);
}
uint256 transferAmount = value - fee;
balanceOf[from] -= value;
balanceOf[to] += transferAmount;
emit Transfer(from, to, transferAmount);
}
}