Payroll applications

Regardless of if your payroll application is built on top of Gnosis safe or a stand alone application, applications can utilize Loop's relay network to unlock countless payment features from removing the multisig coordination problem to decoupling payment approval from Treasury management. Companies can do this while retaining the values of web3: the ability to self custody, revoke permissions, and interoperability, to name a few.

1. Configuring child entities

Loop needs to be informed about new users (those paying contributors) that are on-boarded to your platform. We suggest that each user is configured as a child entity as you can configure “acceptable tokens” per child entity using “items” (described next).

2. Configure items for each

Each child has its own items and at least one item is required. The amount, frequency, frequencyCount can include dummy variables but you need to configure the accepted token list - thus allowing each child entity to have its own list of tokens they can enable for autopayment.

3. Embedding the modal

Loop provides a modal that allows users to “turn on autopay” and can be embedded anywhere in an application. The modal allows users to give Loop authorization to enable autopay for a specific token with multi-token approval.

Embed the autopay button as a React component. Pass the entityId and planId in as a property to the react component for the button/checkbox. This allows us to know which entity and plan to provide autopay to.

4. Automate transfer requests

Loop only processes transfers that we’ve heard about. Thus, you have to send a transfer request for payroll payments for each wallet that will receive a payment. By doing it this way, Loop allows you to send different amounts, in different tokens, and on different dates to many wallets. In sum, it allows for the most flexibility in payment. For example, if Joe had wallet address 0x123 and we’re paying him a total of $250 splitting the payment equally between WETH and USDC, and John with wallet address 0x456 $100 in USDC, then the payment requests would be as follows:

Payment request 1: $125 worth of USDC to 0x123

Payment request 2: $125 worth of WETH to 0x123

Payment request 3: $100 worth of USDC to 0x456

We suggest you write an application that scans your ‘active users’ and generates a transfer request in line with your most frequent transfer period (i.e. if your users pay contributors weekly, then you should check every week to generate a transfer request). Transfer requests show up on the company dashboard on the “transactions” page.

5. Disabling autopay

Your users can stop autopay while retaining their payment authorization. Add a button on your website that calls the Loop API directly and cancels a user. Canceling results in any transfer request outstanding to be automatically canceled.

6. Enabling allowance management

Natively in the modal users can set their allowance to any amount, thus your users can set their allowance to zero, effectively removing the ability to autopay.

If you choose, you can add a button on your website that opens metamask to send a transaction that sets the allowance to zero.

Last updated