OmniTrust

OmniTrust allows users to deposit any ERC20 or native asset of their choosing into Omnify. Upon creation of the deposit the creator can specify other owners who can modify any of the deposit's properties. Additionally, beneficiaries can be declared with or without daily allownces. More details are described below. Accessible from trust.omnify.finance and app.omnify.finance/trust

OmniTrust's features

Interactions

OmniTrust contracts are very versatile and support many interactions. In this page we will cover creating deposits and their properties, activating and de-activating deposits, withdrawing from a deposit, retracting a deposit, and depositing funds into an existing deposit. You can find a list of all Omnify services' tiers and fees at omnify.finance/fees.

Start by downloading the OmniTrust interface from our Github repo.

Deposits and their properties

Before we dive in let's take a look at the createDeposit function, the Owner struct, and the Beneficiary struct.

Owner Struct

Beneficiary Struct

Create a Deposit

1

Define an OmniTrust variable

2

Get Omnify's deposit & beneficiary fee and define msgVal variable

Omnify's deposit fee is charged when creating a deposit, or when depositing into an existing deposit. The beneficiary fee is charge per beneficiary when creating the deposit and when adding new beneficiaries while modifying the deposit.

3

Create the list of Beneficiaries and add them

In this example we defined 2 beneficiaries, one that withdraw without limits from the deposit, and one that is limited by a daily allowance.

4

Create the list of Owners and add them

These addresses will have Owner privileges:

  1. if the deposit is modifiable they can modify it.

  2. if the deposit is retractable they can retract it.

  3. they can activate and de-activate the deposit.

5

We can now call createDeposit with our parameters

Activating and De-activating a deposit

To activate or de-activate a deposit any of the owners can simply call setDepositActiveVal with the parameters of deposit id, and active status as a boolean.

Activate

De-Activate

Withdraw from a deposit

An address has to be a beneficiary of a deposit to be able to withdraw from it. Additionally, if that beneficiary is limited by a daily allowance they can only withdraw their specified allowance once every 24 hours. To withdraw from a deposit a beneficiary should call withdrawFromDeposit and pass the deposit ID, and amount.

Retracting all the deposit's funds

When any of the owners retract a deposit, all the funds contained within are transferred to their balance, and the deposit is de-activated until re-activated again. To Retract a deposit any of the owners should call retractDeposit and pass the id of the deposit.

Deposit into existing deposit

Any modifiable deposit can accept deposits by anyone who has the id. The assets deposited should match the initial asset the deposit was created for. Just call depositIntoExistingDeposit and pass the id, asset address, and the amount in Wei.

We are now able to utilize OmniTrust's versatility. 🏦

Last updated