简体   繁体   English

ETH ICO众筹合同延期奖励KYC

[英]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) 关于KYC(了解您的客户)

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? 如果有人将ETH发送到我的销售合同,我知道如何退还我自己的硬币作为奖励,但是我如何保留奖励直到ico结束? I want to send the reward only after the user filled informations on my webpage for KYC. 我只想在用户填写我的网页上的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 . 您的合同包含两个功能,一个是由用户调用的payable功能,另一个是由您的站点称为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. 当用户完成您网站上的KYC任务时,将使用您的地址从您的管理地址中调用authorize功能。 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. 当用户调用payable功能时,该功能会验证用户的地址是否包含在地图中,然后相应地发行令牌。 If the user's address is not in the map, ie they have not been authorized by an admin, the function fails. 如果用户的地址不在地图中,即未经管理员授权,则该功能将失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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