shapeshift / rFOX

rFOX - RUNE rewards for FOX stakers
MIT License
0 stars 0 forks source link

feat: hot wallet cli #74

Closed kaladinlight closed 4 months ago

kaladinlight commented 5 months ago

Closes https://github.com/shapeshift/rFOX/issues/69

Create and Fund: hotWalletCliCreateAndFund

Recover from keystore file: hotWalletCliRecoverKeystore

Recover from custom keystore file: hotWalletCliCustomKeystoreFile

Recover from manual mnemonic: hotWalletCliManualMnemonic

Fail to recover: hotWalletCliFail

Testing steps:

Add break to signTransactions and/or broadcastTransactions loops to simulate a non complete sign or broadcast step and validate script picks up properly. Known issue is the balance check in wallet.fund() that is only valid on initial fund, but will fail when trying to pick up after 1 or more txs have been broadcast. Also known issue is we broadcast too fast currently resulting in invalid nonce errors

NO NEED TO TEST MULTISIG DOCS (unrelated to script, will be validated manually outside of these PRs)

  1. Seed mock distribution epoch (july example - replace reward address to an address you own if you want to send to yourself) index.ts
    await ipfs.addEpoch({
    number: 0,
    startTimestamp: 1714521600000,
    endTimestamp: 1717199999999,
    startBlock: 206540038,
    endBlock: 217103096,
    totalRevenue: '3',
    totalRewardUnits: '3',
    distributionRate: 0.25,
    burnRate: 0.25,
    distributionsByStakingAddress: {
      '0x6bF198c2B5c8E48Af4e876bc2173175b89b1DA0C': {
        amount: '1',
        rewardUnits: '1',
        txId: '',
        rewardAddress: 'thor10prpfj07j6a7rvtd5tfqhdzp8xsypzatfrc2v5',
      },
      '0x6bF198c2B5c8E48Af4e876bc2173175b89b1DA0D': {
        amount: '2',
        rewardUnits: '2',
        txId: '',
        rewardAddress: 'thor10prpfj07j6a7rvtd5tfqhdzp8xsypzatfrc2v5',
      },
    },
    })
  2. Use the generated unsignedTx_epoch-N.json file to manually fund the hot wallet from a wallet that you control (doesn't have to be multisig). Be sure to use the correct amount to send for funding and you can add the same memo if desired, but has no affect on the script itself