Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
manish7534 committed Apr 13, 2024
1 parent 1cbcf4a commit 7bee044
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SmartEnergyToken/contracts/ICO.sol
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ contract ICO is Ownable{
* @return No return value. Emits a TokensPurchased event upon successful token purchase.
*/
function buyTokens(uint256 numberOfTokens) external payable {
uint256 totalCost = numberOfTokens * tokenPrice / 1*10**18;
uint256 totalCost = (numberOfTokens * tokenPrice) / 10**18;
require(msg.value >= totalCost, "Insufficient ETH sent");
token.transfer(msg.sender, numberOfTokens);
payable(owner()).transfer(msg.value);
Expand Down

0 comments on commit 7bee044

Please sign in to comment.