Register (StarkEx Perpetual Trading v1.0)
In StarkEx for perpetual trading (v1.0), the registration function is invoked as a part of the user onboarding flow.
registerUser can be called to add a user to StarkEx. It creates a mapping between the user’s
starkKey and the user’s
The registered user does not have to be the sender of the transaction.
The registration is accepted if the following holds:
starkKeyprovided is not zero and has not been registered in the past under any other
The key provided represents a valid point on the Stark-friendly elliptic curve.
The provided signature is a valid signature on
keccak256("UserRegistration:", ethereumAddress, starkKey)by the
userAdmin(i.e. the application).
If the requirements above hold, the
starkKey is registered in the contract and is mapped to the
ethereumAddress. Note that the contract allows registering many different
starkKey's to one
This mapping is later used to ensure that withdrawal requests are valid. StarkEx checks that a withdrawal from an account that corresponds to a
starkKey can only be performed by a user authenticated with its associated
ethereumAddress (see Withdrawal).
userAdmin may be instantly appointed or removed by the contract Governor (see Governance).