2. Deposit Tokens

User deposits the predetermined amount into the Sacred pool. After the tokens are deposited, they are moved into a DeFi platform (Aave) where they can earn yield. The deposit process is as follows:

Code Summary - Deposit

User Inputs:

  1. Token (e.g. ETH)

  2. Amount (e.g. 0.1)

Process:

  1. Front-End code takes input

  2. Generates a zk note on the browser (nullifier+secret combo)

    1. Note

    2. Commitment

  3. The Note contains ALL parts of the proof (commitment and nullifier and secret). This is saved by the user.

  4. The commitment is sent to the contract to be inserted in the Merkle Tree.

Outputs:

  1. Transaction receipt

The deposit process is highlighted below in red:

Last updated