简体   繁体   中英

ETH ICO Crowdsale contract hold back reward for KYC

i am learning blockchain programming and meanwhile have a good idea how to create a token and crowdsale contract in the etherum network.

But there is one question left which i cant answer myself and cant find any source. Its about KYC (Know your costumer)

If someone sends ETH to my crowdsale contract i know how to return my own coin as a reward but how do i hold back the reward until the end of the ico? I want to send the reward only after the user filled informations on my webpage for KYC.

I would be very thankfull for every information/tip i can get.

There are potentially many different ways to achieve this outcome. Here's one example:

  1. Your contract contains two functions, the payable function which is called by your user, and an admin-only function called by your site called authorize .
  2. When a user completes the KYC tasks on your site, the authorize function is called from your admin address with the user's address. This address is added to a map in the contract.
  3. When the user calls the payable function, the function verifies the user's address is contained in the map, then issues tokens accordingly. If the user's address is not in the map, ie they have not been authorized by an admin, the function fails.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM