MyBitFoundation / MyBit-Dropzone.tech

🔷 MyBit Dropzone 🔒 A MyBit Network™ powered application for airdropping Ethereum ERC tokens.
1 stars 6 forks source link

Dropzone smart contract #5

Closed bookmoons closed 5 years ago

bookmoons commented 5 years ago

I wonder if the team would consider doing the Dropzone smart contract through the DDF. Since the frontend is being built in https://github.com/MyBitFoundation/MyBit-Network.tech/issues/147, maybe we could have the app live for the token sale.

bookmoons/dropzone has something toward it, based on material on the website and the existing code. Coverage is 100%. Diff.

-----------------------|----------|----------|----------|----------|----------------|
File                   |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-----------------------|----------|----------|----------|----------|----------------|
..
  Dropzone.sol         |      100 |      100 |      100 |      100 |                |
/**
 * @title Token airdropping
 * @notice
 * Anyone can send an airdrop of any ERC20 token.
 *
 * Provide the address of the token contract, recipients, and amounts to
 * airdrop. Use `airdropIdentical` to airdrop an identical amount to each
 * recipient. Use `airdropVariable` to specify a separate amount for each
 * recipient.
 */
contract Dropzone {
..

The feature set seems to be like this:

Deriving from the current code, the interface is like this:

Method Description
airdropIdentical Airdrop an identical token amount to each recipient.
airdropVariable Airdrop to list of recipients with a separate amount specified for each.

There's 1 event emitted:

Event Description
Airdrop An airdrop was performed.
pacamara commented 5 years ago

@bookmoons Hi! What's the advantage of your refactored contracts over the current ones? The existing ERC20Airdrop.sol has methods sendAirdrop (for differing amounts) and sendAirdropEqual, emitting event LogTokensTransferred. They work fine for me so far. Example airdrop txn on ropsten What problems with them does your refactor fix?

bookmoons commented 5 years ago

I think the current code was intended as something temporary to build around, with something clean and complete to be built later:

The smart contracts are not finalised and solely serve to act as the building blocks for this use case.

This is a proposal to undertake that effort. Since the team has the upcoming token sale taking attention, I thought it might be valuable to get someone running on it.

It aims for something that can be comfortably deployed on the livenet. There may be changes needed, but it's intended as a first step. Everything is well commented, and it uses the condition oriented programming pattern recommended by Gavin. The name changes are cosmetic, following the same structure and just simplifying a little.