LedgerHQ / ledger-fresh-management

This is where product topics are discussed for Ledger Fresh
Apache License 2.0
14 stars 2 forks source link

[Web] - CREATE2 smart-contract address generator #73

Open qd-qd opened 1 year ago

qd-qd commented 1 year ago

Header

Name of the task: CREATE2 smart-contract address generator

Name of the module: Web

Difficulty: 2

Waiting for: /

Body

Short description

We plan to use CREATE2 to deploy the smart-contract account on-chain. One of the benefits of using CREATE2 is that the address is deterministic. Develop a serverless function in the next repository that calculates an address based on the parameter we pass to it.

Full description

Transactions on Starknet take time to be accepted on layer 2. For the sake of the UX, we can't wait that a transaction to be accepted on layer 2 to navigate on the account view of the user. The trick we plan to do is to redirect the user into a read-only mode of his account view based on the address deterministically calculated thanks to the serverless function you are going to develop.

Additionals ressources

btchip commented 1 year ago

We'll likely be subsidizing the account creation for the initial launch (maybe with a proof of humanity). Later we'd want to have the user pay for the contract creation - lazy creating it until there are enough funds in the account to actually create the contract is another design strategy of CREATE2 (also see #71)