Skip to main content

Payments

A pillar for blockchain programming, Toolblox allows making payments from two sources: the transition caller or workflow. Multiple payments can be done.

From the caller

Direct payments from the caller to a selected other user or to the workflow directly.

Calling other flows

From the workflow

Funds owned by the workflow can be released - paid out - to select users. As an example an escrow payment workflow could hold the funds and release them only after the item has been delivered successfully.

Calling other flows

To the workflow

Funds can be transferred into the workflow. This is useful in situations where the workflow acts as escrow or requires collateral.

Setting up allowance

It is possible to set an allowance, useful in situations where an allowance in ERC20 token needs to be defined. For example if a rental period spans three months and would be paid monthly, then an allowance of the entire sum can be requested beforehand. If monthly rent is 100, an allowance in the sum of 300 can be asked in the beginning of the rantal period - this makes it possible for the workflow to charge 100 tokens each month for three months.

Setting up a separate allowance is not needed for normal payments - an allowance is automatically asked if ERC20 is used as payment.

In case there is a separate allowance and also a payment, then an allowance in the total amount is asked from the transition executor. For example if allowance for 200 is set up, and the first month (100 tokens) needs to be paid straight away in same transaction, then an allowance of 300 is asked when running the transition (200 + 100).