Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
package-lock.json
build/
13 changes: 12 additions & 1 deletion contracts/AirDrop.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract AirDrop is Ownable {
}

/*
Airdrop function which take up a array of address,token amount and eth amount and call the
Airdrop function which take up a array of address, single token amount and eth amount and call the
transfer function to send the token plus send eth to the address is balance is 0
*/
function doAirDrop(address[] _address, uint256 _amount, uint256 _ethAmount) onlyOwner public returns (bool) {
Expand All @@ -75,6 +75,17 @@ contract AirDrop is Ownable {
}
}

/*
Airdrop function which take up a array of address, indvidual token amount and eth amount
*/
function sendBatch(address[] _recipients, uint[] _values) onlyOwner public returns (bool) {
require(_recipients.length == _values.length);
for (uint i = 0; i < _values.length; i++) {
tokenInstance.transfer(_recipients[i], _values[i]);
}
return true;
}


function transferEthToOnwer() onlyOwner public returns (bool) {
require(owner.send(this.balance));
Expand Down
5 changes: 3 additions & 2 deletions migrations/2_deploy_contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ var AirDrop = artifacts.require("./AirDrop.sol");
var SpringToken = artifacts.require("./SPRINGToken.sol");
var Attestation = artifacts.require("./Attestation.sol");

module.exports = function(deployer,network,accounts) {
deployer.deploy(SpringToken,1000000).then(function() {
module.exports = function(deployer, network, accounts) {
deployer.deploy(SpringToken, 1000000)
.then(function() {
return deployer.deploy(AirDrop, SpringToken.address);
}).then(function() {
return deployer.deploy(VanityURL);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
},
"dependencies": {
"solc": "^0.4.25",
"truffle": "^4.1.14"
"truffle": "^4.1.14",
"truffle-hdwallet-provider-privkey": "^0.3.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need hd provider ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fo truffle.js. line 13

},
"devDependencies": {},
"scripts": {
Expand Down
10 changes: 10 additions & 0 deletions truffle.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
var HDWalletProvider = require("truffle-hdwallet-provider-privkey");

module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
gas: 6721975,
network_id: "*" // Match any network id
},
ropsten: {
provider: function() {
return new HDWalletProvider(["<Priv key goes here>"],
"https://ropsten.infura.io/<Infura pub key>")
},
network_id: 3,
gas: 4600000
}
}
};