Register & Deposit is a wrapper around Registration and Deposit.
As such, it follows the following steps:
Step 1: Off-Chain Registration Request
Alice requests the application operator to register her starkKey under her Ethereum address. If the application chooses to register Alice (each application can have its own registration policy), it signs the mapping with the userAdmin key.
Any number ofstarkKeyscan be mapped to the same Ethereum address.
Step 2: Alice Register & Deposits Funds On-Chain
Alice makes an on-chain transaction to register and deposit funds. The register and deposit operation supports deposits of ETH, ERC20, and ERC721.
The register&deposit function gets the following parameters:
ethAddr - TheethAddrcorresponding to the ethereumAddressbeing registered
starkKey - The starkKey corresponding to the vaultId
signature - The signature by the userAdmin mapping ethereumAddress to starkKey
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.