The first step taken by the user who wishes to trade is to deposit her funds into StarkEx. This is done by first depositing the funds to the on-chain StarkEx contract. A corresponding off-chain deposit transaction then updates the off-chain state.
Step 1: Alice Deposits Funds On-Chain
Alice makes an on-chain transaction to deposit funds. The deposit operation supports deposits of ETH, ERC20, and ERC721.
The deposit function gets the following parameters:
starkKey - The starkKey corresponding to the vaultId.
assetType - The asset identifier of the token to be deposited. For more information, see here.
vaultId - The recipient L2 account.
quantizedAmount - For ERC20 and ERC721, the amount to be deposited.