filecoin-saturn / contracts

contracts
6 stars 0 forks source link

feat: fund command #32

Closed alexander-camuto closed 1 year ago

alexander-camuto commented 1 year ago

Adds a command to fund the factory contract after being deployed (easier than switching to metamask).

AmeanAsad commented 1 year ago

Thoughts on adding some code that checks the balance of the PayoutFactory to make sure it matches the total shares of a new payout before attempting to proceed with spinning up a new PaymentSplitter? In addition, wondering if we should add funding logic in the NewPayout command to just automatically fund the contract from the wallet if the funds in Payout Factory do not match the total share.

We should also make sure that the payout factory has (total shares) + n FIL where n is a contingency amount we use for gas that is used for every contract invocation that requires a transaction.

alexander-camuto commented 1 year ago

Hey @AmeanAsad

  1. That sort of accounting is already done internally to the contract -- it reverts if it has insufficient funds. I'd rather not add complexity beyond that.
  2. I agree that the cli should:

    automatically fund the contract from the wallet if the funds in Payout Factory do not match the total share.

  3. Gas costs are on the invoker end (not the payoutfactory end) so the contigency would be up to the invoker