Skip to content

Commit

Permalink
Add distribute all handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
montera82 committed Aug 28, 2023
1 parent 78245f5 commit 967f2a8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/cli/src/commands/feehandler/distribute-all.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { BaseCommand } from '../../base'
import { displaySendTx } from '../../utils/cli'
import { Flags } from '../../utils/command'

export default class DistributeAll extends BaseCommand {
static description =
'Distributes the available tokens for all registered tokens to the beneficiaries.'

static flags = {
...BaseCommand.flags,
from: Flags.address({ required: true, description: "Initiator's address" }),
}

static examples = ['distribute-all --from 0x5409ed021d9299bf6814279a6a1411a7e866a631']

async run() {
const res = this.parse(DistributeAll)
const from: string = res.flags.from
this.kit.defaultAccount = from
const feeHandler = await this.kit.contracts.getFeeHandler()
await displaySendTx('distributeAll', feeHandler.distributeAll(), {}, 'TokensDistributed')
}
}

0 comments on commit 967f2a8

Please sign in to comment.