smart-signature / smart-gift-contract

Gift library based on smart signature
1 stars 2 forks source link

The design of the anti-bot mechanism. #2

Open lychees opened 5 years ago

lychees commented 5 years ago
...
        uint64_t last_anti_bot_fee = 0;
        uint64_t anti_bot_init_fee;
        time anti_bot_timer;
        time last_buy_timer;        
...

Some of you clever guys might already seen, there are some weird row within the signature structure. What they are and what they are going to do? This article will answer your questions.

Lots of dapp has been attacked by bot, and there are three types of them:

It is hard to refuse them all, the correct way might to design some mechanism in the contract design to avoid the advantage of them over human.

This method is been inspired by Dutch auction (And yes, you may also find them in cryptokitties). Whenever the auction is start, or someone successfully buy the signature, the anti-bot timer will be reset. At the begin of each phrase, the user should pay extra anti-bot fee if he buy the token at once. As time goes on, this extra anti-bot fee will be decrease in linear speed and finally reset to 0 after 'anti_bot_timer'.

So everyone now is go back to the same competition, and there is no incentive to write any kind of bot anymore. If someone choose 'anti_bot_init_fee' equal to 100%, then the bot will lost all their money when it is going to raise the price at the beginning.

This extra anti-bot fee should go to the contract profit pool as a dividend to every share holders.

flyq commented 5 years ago

anti Contract Bot

https://github.com/ProChain/ProRatingEOS