Closed yogh333 closed 1 year ago
The account is deployed through a proxy, this imply you deploy the proxy class hash, not the fresh account clash.
The proxy has a constructor
, this contrustor takes the fresh account clash and params to call a function on the implementation, here initialize
. And initialize adds the first plugin
An example can be found here, in the tests
ps: I would split the declare and deploy phases. Declare is done only once per contract and it is just a requirement for a deployment.
@CremaFR Thanks for the clarification. I agree about declare phase, put them in the diagram just as a prerequisite. I have updated the on-chain operation sequence diagram as following:
Here are the updated sequence diagrams:
Authentication step:
Linked with #7
⚠️ (in french sorry): Il existe en fait depuis la 0.10.1 un nouveau type de Tx DeployAccount
qui permet de déployer un compte et de lui faire payer les frais. Suite à la disparition de la Tx Deploy
il existe donc 2 manières de déployer un compte:
deploy
): dans ce cas, pour déployer un nouveau compte, il suffit d’un transaction Invoke
sur l’account lui-même qui appelle cette fonction de déploiement de contrat. Les fees seront payés par l’account qui déploie (deployer).DeployAccount
qui permet d’auto-deployer un compte et de payer les fees associés. Il faut au préalable que l’adresse du compte (prédéterminée) soit approvisionnée en ETH.L’utilisation de l’Universal Deployer Contract rejoint le cas 1 mais permet de centraliser le code de déploiement de contrat dans un seul contrat plutôt que dans chaque account contract. Ansi, pour déployer un contrat, il suffit de faire une Invoke
Tx vers l’UDC et sa fonction deploy_contract
(plus besoin d’une fonction de déploiement de contrat dans un account contract).
Related to questions 3 and 4, it is yet not clear for me how the initial deployment is performed onchain. Below is a seq diagram describing on-chain operation, but I am not sure I have properly understood (DECLARE vs INVOKE tx, Deployer account vs Fresh account):
Would be happy to get your feedback !
Originally posted by @yogh333 in https://github.com/LedgerHQ/ledger-fresh-management/issues/21#issuecomment-1354557714