andromedaprotocol/andromeda-core

[EPIC] Fixed Amount Splitter

Closed this issue · 0 comments

Description

A contract that sends each recipient a certain amount of funds.

Could be used for payroll; the employer sets the employees' address and the salary of each.

Whenever the employer needs to pay, he sends enough funds to cover the total salaries, and the contract handles sending each recipient his assigned amount, refunding the sender any excess funds.

Implementation

Will have a very similar implementation to the splitter, major difference is using a fixed amount instead of a percentage.

Recipients will have a corresponding coins field which contains a vector of coin structs which constitute of a denomination and amount. Duplitcate denoms are not allowed and neither are zero amounts.

The funds sent should be equal or greater than the total assigned amount for all recipients.

Dependencies

None

Acceptance Criteria

Contract should distribute funds correctly whether there's one coin or two, refund excess funds and error when the denoms of the funds sent don't match the recipients' coin denom.