-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
29 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
const TokenStaking = artifacts.require('TokenStaking'); | ||
|
||
module.exports = async function(callback) { | ||
let tokenStaking = await TokenStaking.deployed(); | ||
await tokenStaking.redistributeRewards(); | ||
console.log('--- Daily rewards have been redistributed ---'); | ||
callback(); | ||
if (process.argv[4] === 'custom') { | ||
let tokenStaking = await TokenStaking.deployed(); | ||
await tokenStaking.customRewards(); | ||
console.log('--- Daily [custom] rewards have been redistributed ---'); | ||
callback(); | ||
} else if (!process.argv[4]) { | ||
let tokenStaking = await TokenStaking.deployed(); | ||
await tokenStaking.redistributeRewards(); | ||
console.log('--- Daily rewards have been redistributed ---'); | ||
callback(); | ||
} else { | ||
console.log( | ||
'Error: Invalid argument provided, for custom reward redistribution use: truffle exec scripts/redistribute.js custom' | ||
); | ||
} | ||
}; | ||
|
||
//to run script - truffle exec scripts/redistribute.js | ||
//to run custom redistribution - truffle exec scripts/redistribute.js custom | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.