2. Deposit Tokens
Last updated
Last updated
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:
Token (e.g. ETH)
Amount (e.g. 0.1)
Process:
Front-End code takes input
Generates a zk note on the browser (nullifier+secret combo)
Note
Commitment
The Note contains ALL parts of the proof (commitment and nullifier and secret). This is saved by the user.
The commitment is sent to the contract to be inserted in the Merkle Tree.
Outputs:
Transaction receipt
The deposit process is highlighted below in red: