lordlessio / Airdrop
Licence: mit
π¬ Multiple erc20 token airdrop consumes one time gas
Stars: β 22
Programming Languages
shell
77523 projects
Projects that are alternatives of or similar to Airdrop
Erc20 Generator
Create an ERC20 Token for FREE in less than a minute with the most used Smart Contract Generator for ERC20 Token. No login. No setup. No coding required.
Stars: β 202 (+818.18%)
Mutual labels: truffle, erc20
erc1363-payable-token
Code implementation for the ERC-1363 Payable Token
Stars: β 83 (+277.27%)
Mutual labels: truffle, erc20
0xdeca10b
Sharing Updatable Models (SUM) on Blockchain
Stars: β 285 (+1195.45%)
Mutual labels: truffle
Eattheblocks
Source code for Eat The Blocks, a screencast for Ethereum Dapp Developers
Stars: β 431 (+1859.09%)
Mutual labels: truffle
Solidity Idiosyncrasies
Solidity gotchas, pitfalls, limitations, and idiosyncrasies.
Stars: β 267 (+1113.64%)
Mutual labels: truffle
Typechain
π TypeScript bindings for Ethereum smart contracts
Stars: β 769 (+3395.45%)
Mutual labels: truffle
React Ethereum Dapp Example
A starter boilerplate for an Ethereum dapp using web3.js v1.0, truffle, react, and parity
Stars: β 384 (+1645.45%)
Mutual labels: truffle
Upchain Wallet
δ»₯ε€ͺει±ε
(ζ―ζDApp ζ΅θ§ε¨)- A Powerful Ethereum Android Wallet & DApp Browser
Stars: β 359 (+1531.82%)
Mutual labels: erc20
Awesome Graal
A curated list of awesome resources for Graal, GraalVM, Truffle and related topics
Stars: β 302 (+1272.73%)
Mutual labels: truffle
Dapp Boilerplate
π Decentralize application boilerplate with React Redux and Firebase integration.
Stars: β 6 (-72.73%)
Mutual labels: truffle
Uniswap V2 Periphery
π Peripheral smart contracts for interacting with Uniswap V2
Stars: β 267 (+1113.64%)
Mutual labels: erc20
Ethermint Archive
Ethereum on Tendermint using Cosmos-SDK!
Stars: β 667 (+2931.82%)
Mutual labels: truffle
Eth Gas Reporter
Gas usage per unit test. Average gas usage per method. A mocha reporter.
Stars: β 330 (+1400%)
Mutual labels: truffle
Eth Crypto
Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Stars: β 420 (+1809.09%)
Mutual labels: truffle
ERC20 Token Airdrop
Airdrop effect π¬
Multiple airdrop consumes one time gas FYI : https://etherscan.io/tx/0x061e701609d23e6755253fdb55ed1a31d2b253610b9f478600a0c1ad8b1f178e
source code
pragma solidity ^0.4.21;
import "../node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
contract Airdrop is Ownable {
/**
* @dev daAirdrop to address
* @param _tokenAddr address the erc20 token address
* @param dests address[] addresses to airdrop
* @param values uint256[] value(in ether) to airdrop
*/
function doAirdrop(address _tokenAddr, address[] dests, uint256[] values) onlyOwner public
returns (uint256) {
uint256 i = 0;
while (i < dests.length) {
ERC20(_tokenAddr).transferFrom(msg.sender, dests[i], values[i] * (10 ** 18));
i += 1;
}
return(i);
}
usage
const SimpleToken = artifacts.require('SimpleToken');
const Airdrop = artifacts.require('Airdrop');
const BigNumber = web3.BigNumber;
require('chai')
.use(require('chai-as-promised'))
.use(require('chai-bignumber')(BigNumber))
.should();
contract('Airdrop', function (accounts) {
before(async function () {
this.simpleToken = await SimpleToken.new({ from: accounts[0] });
this.airdrop = await Airdrop.new({ from: accounts[0] });
this.airdropAmount = 666
this.mockdata = {
addresses: accounts,
tokenAmounts: Array(10).fill(this.airdropAmount.toString()),
}
});
describe('Airdrop basic test', function () {
it('should airdrop to addresses', async function () {
await this.simpleToken.approve(this.airdrop.address, 1e27);
await this.airdrop.doAirdrop(
this.simpleToken.address,
this.mockdata.addresses,
this.mockdata.tokenAmounts
);
const balance = (await this.simpleToken.balanceOf(accounts[1])).toNumber();
await balance.should.be.equal(parseInt(await web3.toWei(this.airdropAmount)));
});
});
})
# test
npm run test
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].