diff options
author | Hsuan Lee <boczeratul@gmail.com> | 2019-04-08 22:18:34 +0800 |
---|---|---|
committer | Hsuan Lee <boczeratul@gmail.com> | 2019-04-08 22:18:34 +0800 |
commit | b9c0c169ce805124cb6b3fb84c7db8df9a76151e (patch) | |
tree | 88d4b5a09267a9cc9e4d56ccadeebe588dc36284 /runTimer.js | |
parent | 336162ac78ad3d5c787c5ecfe735b98d423c4053 (diff) | |
download | dexon-lottery-b9c0c169ce805124cb6b3fb84c7db8df9a76151e.tar dexon-lottery-b9c0c169ce805124cb6b3fb84c7db8df9a76151e.tar.gz dexon-lottery-b9c0c169ce805124cb6b3fb84c7db8df9a76151e.tar.bz2 dexon-lottery-b9c0c169ce805124cb6b3fb84c7db8df9a76151e.tar.lz dexon-lottery-b9c0c169ce805124cb6b3fb84c7db8df9a76151e.tar.xz dexon-lottery-b9c0c169ce805124cb6b3fb84c7db8df9a76151e.tar.zst dexon-lottery-b9c0c169ce805124cb6b3fb84c7db8df9a76151e.zip |
Complete webapp
Diffstat (limited to 'runTimer.js')
-rw-r--r-- | runTimer.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runTimer.js b/runTimer.js index 3981687..f16098d 100644 --- a/runTimer.js +++ b/runTimer.js @@ -3,6 +3,7 @@ const { mnemonicToSeed } = require('bip39'); const { fromMasterSeed } = require('ethereumjs-wallet/hdkey'); const { mnemonic } = require('./secret'); const lottery = require('./build/contracts/Lottery.json'); + const address = '0xd6141c8099670fe22a67eea3224d559c5d05aa55'; const web3 = new Web3('https://testnet-rpc.dexon.org'); @@ -74,7 +75,7 @@ const times = [ let account; let contract; -const runTime = time => { +const runTime = (time) => { if ((time + 5) > (Date.now() / 1000)) { setTimeout(() => runTime(time), 5000); return; @@ -89,7 +90,7 @@ const runTime = time => { }; mnemonicToSeed(mnemonic) - .then(seed => { + .then((seed) => { const hdWallet = fromMasterSeed(seed); const key = hdWallet.derivePath('m/44\'/237\'/0\'/0/0'); const privateKey = `0x${key._hdkey._privateKey.toString('hex')}`; |