The TokenPresale smart contract facilitates the sale of a specific ERC-20 token at a predetermined rate in exchange for Ether (ETH). It includes features such as pausing, ownership control, and a cap on the total ETH that can be raised during the presale.
token
: The ERC-20 token being sold.rate
: The rate at which tokens are exchanged for ETH, denominated in wei.cap
: The maximum amount of ETH that can be raised during the presale.weiRaised
: Total amount of ETH raised so far.