How to set the amount of tokens to buy in a Crowdsale?

So, I am using Truffle and OpenZeppelin v2.5 for crowd sale. In the buy token’s methods, is there a way to input the amount on token that you wanna buy?

1 Like

The amount of tokens you buy is computed from the amount of ETH you send when calling the function.
Including the amount of tokens you want to buy would be redundant, since you can query the _rate beforehand and calculate how much you have to send to receive N amount of tokens.

3 Likes

Thanks!!! I was a bit confused earlier due to not being able to find a example of type I wanted, but I think I got it. Thanks again @Madness

3 Likes