Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower gas version uses transfer instead of transferFrom. #5

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
temp/
node_modules
*.csv
46 changes: 5 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,6 @@
# ODEM Airdropper

Airdropper contract for token bounty distribution.

Parts of this implementation (`SafeMath` and `Ownable`) are taken from
[OpenZeppelin] v1.8.0, with modification to support Solidity v0.4.21.

## Why an airdropper?

As part of On-Demand Education Marketplace’s bounty and rewards campaign, the
company is obliged to transfer more than one million ODEM Tokens to thousands
of users. Transferring them one user at a time would be both tedious and
expensive.

Both of these problems can be managed by using an airdropper contract to
complete many individual transfers within one combined transaction. The
contract reduces the number of transactions and fees associated with the
distribution.

## Unique features

This airdropper differs from most others in that it never holds tokens.
Instead it calls ERC20's `transferFrom` to transfer tokens directly from a
given source address to the recipients. This has two distinct advantages:

- ODEM has already published the address which holds the tokens to be
distributed as bounty. The recipients will see that their tokens came
directly from this address, so they can verify that they received their
rewards in good order. The address is recorded in the [ODEM ICO] repository.

- The contract can be tested on the main network without interfering with the
allocation of bounty tokens, and without the need to deploy a new instance
after testing.

This airdropper also has a method to self-destruct, which is called as soon as
tokens have been distributed to all recipients. This prevents it from being
used as an attack vector in any future zero-day exploits, and also takes some
load off the Ethereum network — it's important to be a good neighbour.

[OpenZeppelin]: https://github.com/OpenZeppelin/zeppelin-solidity
[ODEM ICO]: https://github.com/odemio/ico/
# Usage

1. Set the airdropper to be aware of the ERC20 token to be tranferred. To do this, call the function setToken
2. ERC20 approve the contract to take your funds
3. Call topup to execute transfer
4. transferDrop with 500 names.
Binary file added README.pdf
Binary file not shown.
9,978 changes: 9,978 additions & 0 deletions build/contracts/Airdropper.json

Large diffs are not rendered by default.

9,996 changes: 9,996 additions & 0 deletions build/contracts/ERC20.json

Large diffs are not rendered by default.