This will be properly formatted, written, and formulated later. This is a working draft to get the conversation going.
Short
Let’s standardize the UDC interface so SDKs and wallets can easily support alternative deployer contracts.
Long
Now that the UDC has been deployed (mainnet, goerli, goerli2, and integration), many teams from wallets to SDKs have already integrated it (Argent, starknet.py, starknet.js, nile, starknet-devnet, protostar, starknet-rs) which means they are exposing deployment functionalities to their users by calling this function:
@external
func deployContract{
syscall_ptr: felt*,
pedersen_ptr: HashBuiltin*,
range_check_ptr
}(
classHash: felt,
salt: felt,
unique: felt,
calldata_len: felt,
calldata: felt*
) -> (address: felt) {
}
But the UDC standard is also a unique, singleton contract with specific deployment requirements: deployed_from_zero=True
and salt=0
. Any other contract would not be the UDC, let alone “UDC compliant”.
Therefore, we should standardize the UDC interface into a more flexible Deployer Contract Interface that supports alternative deployer contracts (e.g. a factory that restricts by classHash
). By doing so, any SDK or wallet supporting the UDC can immediately support alternative deployer contracts by simply accepting an address.
For completeness, deployer contracts following this standard MUST also emit the following event:
@event
func ContractDeployed(
address: felt,
deployer: felt,
unique: felt,
classHash: felt,
calldata_len: felt,
calldata: felt*,
salt: felt
) {
}