deposit
, which takes the amount through msg.value.
approval
on the ERC20 contract, authorizing StarkEx to transfer funds on behalf of the user.deposit
call and multiplied by the quantization factor, is transferred on behalf of the user to the contract.starkKey
, assetType
and vaultId
. The starkKey
may belong to the user that called deposit
or to a different user. When this happens, the event LogDeposit
is emitted.getDepositBalance
and getQuantizedDepositBalance
. Both functions get starkKey
, assetId
and vaultId
and return the pending amount of funds that correspond to the input parameters. These funds are pending to enter the vault vaultId
belonging to the user that owns the specified starkKey
. Note that if there are several pending deposits with the same parameters, these functions will return the accumulated value.vaultId
. When the contract receives such valid proof, it deducts the transferred funds from the pending deposits for the specified starkKey
, assetType
and vaultId
.depositCancel
that sets a timer. Once the timer expires, it enables the reclaim of the deposit. Until this timer expires, the user cannot reclaim funds as the application may still be processing the deposit for inclusion in the off-chain vault. Only the recipient of the funds may call depositCancel
. Once this call is done, the event LogDepositCancel
is emitted. depositReclaim
to perform the actual transfer of funds from the contract back to the on-chain user account. This will only succeed if the timer set in the previous call has expired. This operation results in a transfer of all pending funds (i.e. funds not accounted for in proofs for off-chain inclusion) back to the user account (on the ERC20 contract or on their ETH balance). Once this call is done, the event LogDepositCancelReclaimed
is emitted.vaultId
and starkKey
specified in the deposit request do not match each other, this deposit is not valid and cannot be included in a proof. In this case, the money remains in the deposit area. However, it can still be reclaimed to the ethereumAddress
that deposited it by using depositCancel
and depositReclaim
. This call must be performed by the user that the starkKey
in the original deposit
call belongs to.registerAndDeposit
is a wrapper around registerUser
and deposit
and can be called to add a user to StarkEx. starkKey
and the user's ethereumAddress
and deposits funds in the same transaction
On StarkEx for spot trading, this function still exists due to backwards-compatability reasons but is equivalent in functionality to deposit
starkKey
and the appropriate assetType
. At the same time, this amount is also deducted from the off-chain vault.starkKey
, assetType
and the (non-accumulative)quantizedAmount
and unquantized amount as parameters. The event is of type LogWithdrawalAllowed
or LogWithdrawalAllowed
or LogNftWithdrawalAllowed
for ERC20/ETH, ERC721 and off-chain minted asset respectively.getWithdrawalBalance
that gets the starkKey
and assetId
as input. Note that the funds are still at the StarkEx contract.starkKey
of a pending withdrawal account by calling the on-chain withdrawal function, withdraw
for ERC20/ETH and NftWithdraw
for ERC721, to perform the actual withdrawal of the asset, transferring it to the user's on-chain account.Ethereum address
owning the starkKey
:withdrawAndMint
to mint the asset on the fly and transfer them to the user account.withdrawTo
for ERC20/ETH and NftWithdrawTo
for ERC721, providing the recipient
parameter: the ethereumAddress
that should receive the withdrawn funds. This option is not available for off-chain minted assetsLogWithdrawalPerformed
is emitted, with the parameters of the relevant starkKey
, the recipient
Ethereum address, the assetType
, quantizedAmount
and unquantized amounts. LogNftWithdrawalPerformed
is emitted, with the parameters of the relevant starkKey
, the recipient
Ethereum address, the assetId
. LogMintWithdrawalPerformed
is emitted, with the parameters of the relevant starkKey
, the recipient
Ethereum address, the assetType
, quantizedAmount
, unquantized amounts and assetId
assetId
/mintingBlob
and starkKey
.withdraw
,withdrawTo
, withdrawNft
,NftWithdrawTo
and withdrawAndMint
.