How we created the World's first smart contract Airdrop, and how it almost failed!
development·@clustertoken·
0.000 HBDHow we created the World's first smart contract Airdrop, and how it almost failed!
# How the ClusterTeam crew created a unique way of doing airdrops, by using an Ethereum Smart Contract. ### Unlike most, we actually love to code and create things. No fast 'n dirty clones for us, we like to take things to another level. We recently brainstormed about a promo campaign for ClusterToken, our self mining contract with clusterized rewards. Given the fact that ClusterToken is very unique, our campaign had to be similar: **One of a kind!**  So we started writing code, and ended up with the world's first smart contract Airdrop on the Ethereum blockchain. Our small scale test on the main network started on 02 August '16 and ended on 09 August 2016. 250 Participants signed up during that time, even though the rewards were insufficient to cover the transaction fee, known as 'gas' on the Ethereum network. The workflow for signing up is amazingly simple: - Interact with our smart contract via MyEtherwallet or MIST - Call the 'registerAirdrop' function of our contract - Wait until the amount of needed participants is reached - Claim rewards by using the 'claimAirdrop' function on the smart contract This process is so simple that it's hard for us to understand why nobody created such contract before. So many projects claiming to have +20 developers on the team, yet such as simple, transparent, hassle free system was never invented. ### Houston, we have a problem When the airdrop closed, and users started to claiming their rewards, a minor bug appeared in our code. Upon registration, our smart contract detects if you have any ClusterToken ($CLRT) in your balance. If you have some, this means you're already an investor, and you should receive more rewards than regular users. Therefore, a bool called 'isInvestor' is set as true. What we overlooked in our smart contract, was the fact that this check altered the global contract variable instead of the local variable in that function! This means that once our first investor has claimed his rewards, the global variable got set at the reward rate that only investors would receive. So, all users that claimed their rewards afterwards got the reward rate reserved for investors only. But, we foresaw such minor glitches. We've deposited enough ClusterTokens to cover the bonus rate to all 250 participants right from the start. As with all code, bugs can occur during the first releases, especially when all code is written from scratch instead of cloning some Github repo. ### So why is all this so special? We hope to inspire more devs to do something special instead of just cloning Git's. To attract users, to show them commitment and capabilities. To deploy working projects without asking for pre-ico, ico, name it whatever you want funds. If the commitment and capabilities of developers drop to 0, so will the future of blockchain technology. We must keep improving, and all contributions help to inspire other developers! ## Keep motivation high and inspiration even higher! 