getPriceForAPI

 avatar
user_4748127
java
7 months ago
300 B
2
Indexable
Never
function getPrice() public view returns (uint256) {
    uint256 totalEthInContract = address(this).balance;
    uint256 totalTokens = totalTokensSupply();
    uint256 fee = excludedFromFee[msg.sender] ? 0 : feePercentage;
    return (1e18 * (100 - fee) * totalTokens) / (100 * totalEthInContract);
}