getPriceForAPI
user_4748127
java
2 years ago
300 B
6
Indexable
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); }
Editor is loading...