File tree Expand file tree Collapse file tree 5 files changed +29
-4
lines changed Expand file tree Collapse file tree 5 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,5 @@ build/Release
2525# Dependency directory
2626# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
2727node_modules
28+ package-lock.json
29+ build /
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ contract AirDrop is Ownable {
5959 }
6060
6161 /*
62- Airdrop function which take up a array of address,token amount and eth amount and call the
62+ Airdrop function which take up a array of address, single token amount and eth amount and call the
6363 transfer function to send the token plus send eth to the address is balance is 0
6464 */
6565 function doAirDrop (address [] _address , uint256 _amount , uint256 _ethAmount ) onlyOwner public returns (bool ) {
@@ -75,6 +75,17 @@ contract AirDrop is Ownable {
7575 }
7676 }
7777
78+ /*
79+ Airdrop function which take up a array of address, indvidual token amount and eth amount
80+ */
81+ function sendBatch (address [] _recipients , uint [] _values ) onlyOwner public returns (bool ) {
82+ require (_recipients.length == _values.length );
83+ for (uint i = 0 ; i < _values.length ; i++ ) {
84+ tokenInstance.transfer (_recipients[i], _values[i]);
85+ }
86+ return true ;
87+ }
88+
7889
7990 function transferEthToOnwer () onlyOwner public returns (bool ) {
8091 require (owner.send (this .balance));
Original file line number Diff line number Diff line change @@ -3,8 +3,9 @@ var AirDrop = artifacts.require("./AirDrop.sol");
33var SpringToken = artifacts . require ( "./SPRINGToken.sol" ) ;
44var Attestation = artifacts . require ( "./Attestation.sol" ) ;
55
6- module . exports = function ( deployer , network , accounts ) {
7- deployer . deploy ( SpringToken , 1000000 ) . then ( function ( ) {
6+ module . exports = function ( deployer , network , accounts ) {
7+ deployer . deploy ( SpringToken , 1000000 )
8+ . then ( function ( ) {
89 return deployer . deploy ( AirDrop , SpringToken . address ) ;
910 } ) . then ( function ( ) {
1011 return deployer . deploy ( VanityURL ) ;
Original file line number Diff line number Diff line change 88 },
99 "dependencies" : {
1010 "solc" : " ^0.4.25" ,
11- "truffle" : " ^4.1.14"
11+ "truffle" : " ^4.1.14" ,
12+ "truffle-hdwallet-provider-privkey" : " ^0.3.0"
1213 },
1314 "devDependencies" : {},
1415 "scripts" : {
Original file line number Diff line number Diff line change 1+ var HDWalletProvider = require ( "truffle-hdwallet-provider-privkey" ) ;
2+
13module . exports = {
24 networks : {
35 development : {
46 host : "localhost" ,
57 port : 8545 ,
68 gas : 6721975 ,
79 network_id : "*" // Match any network id
10+ } ,
11+ ropsten : {
12+ provider : function ( ) {
13+ return new HDWalletProvider ( [ "<Priv key goes here>" ] ,
14+ "https://ropsten.infura.io/<Infura pub key>" )
15+ } ,
16+ network_id : 3 ,
17+ gas : 4600000
818 }
919 }
1020} ;
You can’t perform that action at this time.
0 commit comments