How to build a buyable ERC777?

i want to build a buyable erc777 need help i which i have a function buyToken() which calculate number of tokens to be transfer on the bases of provided ethers

1 Like

Hi @Asadullah_Khan,

Welcome to the community :wave:

I suggest only including functionality in a token needed for the life of the token. Assuming a short lived crowdsale, then I would suggest that the crowdsale functionality not be included in the ERC777 token and instead be included in a separate contract.

I also recommend reading: Points to consider when creating a fungible token (ERC20, ERC777)

As for a crowdsale, you could look at the (ERC20) Crowdsale contracts included in OpenZeppelin Contracts 2.x, see the following example: Simple ERC20 Crowdsale.

If you are looking for a developer to help with this, you could post in the forum, stating what you are looking for and what you are offering in exchange (e.g. payment) and the best way to contact you. See the following examples: