<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kriptonio on Medium]]></title>
        <description><![CDATA[Stories by Kriptonio on Medium]]></description>
        <link>https://medium.com/@kriptonio?source=rss-7b9bc51709c6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*W995EKFvRo7V9EF2p4Lg4w.png</url>
            <title>Stories by Kriptonio on Medium</title>
            <link>https://medium.com/@kriptonio?source=rss-7b9bc51709c6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 16 May 2026 14:54:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kriptonio/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[How to create an ERC-4337 Smart Wallet and send a Sponsored Transaction]]></title>
            <link>https://medium.com/@kriptonio/how-to-create-an-erc-4337-smart-wallet-and-send-a-sponsored-transaction-4a4d58dd20d1?source=rss-7b9bc51709c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a4d58dd20d1</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[account-abstraction]]></category>
            <category><![CDATA[smart-wallet]]></category>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[Kriptonio]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 16:57:09 GMT</pubDate>
            <atom:updated>2024-04-04T14:51:25.870Z</atom:updated>
            <content:encoded><![CDATA[<p>Smart Wallets powered by the ERC-4337 standard are a new way of representing wallets on EVM-compatible blockchain networks.</p><p>In contrast to traditional wallets based on a private key (aka EOAs), smart wallets provide new exciting features, like the ability to sign/authenticate transactions with a different mechanism than just a private key, the ability to sponsor the gas required to run a transaction, the ability to have social login, recovery, plugins, basically anything that you can program with Solidity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*6W5VOdjg-eUQf78seo-KHw.png" /><figcaption>ERC4337 Compatible Smart Wallets</figcaption></figure><h3>How to create an ERC-4337 Smart Wallet?</h3><p>The first step in creating a smart wallet is deciding which smart wallet implementation you want to use. There are a few popular choices like:</p><ul><li><a href="https://zerodev.app/">ZeroDev</a></li><li><a href="https://www.biconomy.io/">Biconomy</a></li><li><a href="https://safe.global/">Safe</a></li></ul><p>In this article, we will be using the ZeroDev Kernel.</p><p>Apart from the smart wallet implementation, you will need a few more things:</p><ul><li>An SDK to create and interact with the smart wallet</li><li>An RPC/Bundler endpoint</li><li>A Paymaster</li></ul><p>As an SDK, we are going to use the <a href="https://docs.kriptonio.com/sdk/introduction/installation">Kriptonio SDK</a> which also automatically creates the rpc, bundler, and paymaster endpoints for us.</p><h3>Coding time</h3><p>The first step is to install Kriptonio SDK:</p><pre>yarn add @kriptonio/sdk</pre><p>If you are a Typescript user, we suggest that you check the additional setup hints <a href="https://docs.kriptonio.com/sdk/introduction/installation#typescript-users">here</a>.</p><p>Next, you will need to acquire an access token for the Kriptonio SDK. Here is how:</p><ol><li>Go to <a href="https://app.kriptonio.com">Kriptonio Web App</a></li><li>Create an account</li><li>Go to the settings page (top right corner, cog icon)</li><li>Select the Access Tokens tab and copy your access token</li></ol><p>Now we are ready to initialize the Kriptonio SDK:</p><pre>import { ChainId, KriptonioSdk } from &#39;@kriptonio/sdk&#39;;<br> <br>const sdk = new KriptonioSdk({ accessToken: &#39;paste-access-token-here&#39; });</pre><p>With the Kriptonio SDK, you can manage both smart and classic wallets. Smart wallets are the default, so to create one, we will use the wallet generate function. The only thing you need to provide is the wallet type and the chain id of the chain with which you want to interact.</p><pre>const wallet = await sdk.wallet.generate({<br>  chainId: ChainId.BaseSepolia,<br>  type: &#39;kernel&#39;,<br>});</pre><p>Congrats, you have created an ERC-4337 smart wallet! 🎉.</p><p>Under the hood, the Kriptonio SDK creates a smart wallet powered by the ZeroDev Kernel. Now you can use the wallet object to check the wallet address.</p><pre>console.log(wallet.address);</pre><p>It’s now time to send a transaction using your smart wallet.</p><pre>const hash = await wallet.sendTransaction({<br>  to: wallet.address,<br>  value: 0n,<br>});</pre><p>That’s it! You have created a smart wallet and sent a transaction using it.</p><p>But what happened under the hood?</p><p>Under the hood, the Kriptonio SDK created the RPC, Bundler, and Paymaster endpoints. It also sponsored the transaction gas fee for you, so you didn’t have to worry about it.</p><p>Another thing that happened is that since this was the first transaction from your smart wallet, it has been automatically deployed to the selected blockchain network, in this case, the Base Sepolia network.</p><p>You did great! To learn more about smart wallets and how to utilize the Kriptonio SDK more, check out the <a href="https://docs.kriptonio.com/sdk/introduction/installation">official docs</a>.</p><p>If you need help, feel free to reach us via our Discord server <a href="https://discord.gg/7QreJNYuaz">https://discord.gg/7QreJNYuaz</a>.</p><h3>Source Code</h3><p>The complete source code for this article can be found <a href="https://github.com/kriptonio/sdk/tree/main/examples/simple-smart-wallet">here</a>.</p><h3>Bonus Tip</h3><p>You can use the Kriptonio iOS/Android mobile apps to import smart wallets that you created with the Kriptonio SDK.</p><p>Links to the mobile apps are here: <a href="https://docs.kriptonio.com/mobile">https://docs.kriptonio.com/mobile</a></p><p><em>Originally published at </em><a href="https://docs.kriptonio.com/blog/how-to-create-erc4337-smart-wallet"><em>https://docs.kriptonio.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a4d58dd20d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a Gasless Farcaster NFT Mint Frame with Frog.fm and Kriptonio]]></title>
            <link>https://medium.com/@kriptonio/how-to-create-a-gasless-farcaster-nft-mint-frame-with-frog-fm-and-kriptonio-9aa38cbf9304?source=rss-7b9bc51709c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9aa38cbf9304</guid>
            <category><![CDATA[farcaster]]></category>
            <category><![CDATA[decentralization]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Kriptonio]]></dc:creator>
            <pubDate>Fri, 15 Mar 2024 13:38:23 GMT</pubDate>
            <atom:updated>2024-04-04T14:50:32.001Z</atom:updated>
            <content:encoded><![CDATA[<p>A Frame is a special type of an Farcaster interactive post (a.k.a., a “cast”) that you can program to do anything you want. A Frame has an image and up to four buttons.</p><p>Recently, the <a href="https://wevm.dev">Wevm</a> team released a great minimal framework for building Frames called <a href="https://frog.fm/">Frog</a>. With it, you can create a Frame with JSX. Under the hood, JSX code is rendered to SVG and then to PNG. This makes Frames much more powerful because they don’t show just static images anymore but dynamic content.</p><p>One of the very popular current uses of Frames is minting NFTs inside Farcaster client apps. With <a href="https://kriptonio.com">Kriptonio</a>, you can mint NFTs for your users without them having to pay gas fees. This is a great way to onboard new users to your NFT collection.</p><p>In this article, you will learn how to create a gasless Farcaster NFT mint frame with Frog.fm and <a href="https://kriptonio.com">Kriptonio</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LU542iXbekhvdHrt.png" /></figure><h4>Preparation</h4><p>First, let’s create a new Frog project.</p><pre>yarn create frog</pre><p>Follow the instructions, enter the name, and decide how you would like to deploy your Frame.</p><p>After that, let’s install the Kriptonio SDK.</p><pre>yarn add @kriptonio/sdk</pre><h4>NFT Smart Contract</h4><p>To create an NFT Collection, you will need a smart contract. Here is the simple NFT contract that we will use in this article. We recommend using the same one while following this article.</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.20;<br> <br>import &quot;@openzeppelin/contracts/token/ERC721/ERC721.sol&quot;;<br>import &quot;@openzeppelin/contracts/access/Ownable.sol&quot;;<br> <br>contract FarcasterNFT is ERC721, Ownable {<br>    constructor(address initialOwner)<br>        ERC721(&quot;Farcaster NFT&quot;, &quot;FNFT&quot;)<br>        Ownable(initialOwner)<br>    {}<br> <br>    function safeMint(address to, uint256 tokenId) public onlyOwner {<br>        require(balanceOf(to) == 0, &quot;User already owns an NFT&quot;);<br>        _safeMint(to, tokenId);<br>    }<br>}</pre><p>It has a safeMint function that prevents users from minting more than one NFT.</p><p>There are multiple ways to deploy this smart contract, but one of the easiest ways is to use the <a href="https://kriptonio.com">Kriptonio</a> Platform to help deploy it.</p><p>First, import the contract to the <a href="https://kriptonio.com">Kriptonio</a> Platform, and then afterwards we are going to deploy it via the <a href="https://kriptonio.com">Kriptonio</a> SDK, gaslessly.</p><blockquote><strong><em>1. Create Account</em></strong></blockquote><p>Go to <a href="https://app.kriptonio.com">https://app.kriptonio.com</a> and create a new free account.</p><blockquote><strong><em>2. Create the Contract</em></strong></blockquote><p>After logging in, go to Smart Contracts =&gt; New Smart Contract =&gt; By Providing Solidity Source Code, enter the title you like, select the blockchain network where you are planning to deploy the contract (we will use Base Sepolia), paste the contract code from above, and click Save.</p><blockquote><strong><em>3. Copy the Smart Contract ID</em></strong></blockquote><p>After the contract is created on the Kriptonio platform, you will see the Smart Contract ID field. Copy the value, we will need it soon. Please note that the contract is not yet deployed to the blockchain network, but soon it will be.</p><h4>Deploy the Smart Contract</h4><p>You can deploy the smart contract via Kriptonio Web UI or via SDK. In case you want to deploy it via Web UI, simply go to smart contract detail page and follow the instructions.</p><p>Here we will show how to do it via SDK.</p><p>Open the src/index.tsx file, remove the default code, and add the following code:</p><pre>import { Frog } from &#39;frog&#39;;<br>import { KriptonioSdk } from &#39;@kriptonio/sdk&#39;;<br> <br>export const app = new Frog();<br>const sdk = new KriptonioSdk({ accessToken: &#39;&lt;kriptonio-access-token&gt;&#39; });</pre><p>Here we just import Frog and the <a href="https://kriptonio.com">Kriptonio</a> SDK, and create a new instance of both. To obtain&lt;kriptonio-access-token&gt;, go to settings in your <a href="https://kriptonio.com">Kriptonio</a> account =&gt; Access Tokens and</p><p>copy the token.</p><p>Next, we will need a wallet that is going to deploy the smart contract. We will generate one with the <a href="https://kriptonio.com">Kriptonio</a> SDK.</p><pre>const wallet = await sdk.wallet.generate({<br>  chainId: 84532,<br>  type: &#39;kernel&#39;,<br>});</pre><p>Now we are ready to deploy the smart contract, if not already deployed.</p><pre>const smartContract = await sdk.smartContract.get({<br>  id: &#39;&lt;smart-contract-id&gt;&#39;,<br>  wallet,<br>});<br> <br>if (!(await smartContract.deployed())) {<br>  await smartContract.deploy({<br>    params: [wallet.address],<br>  });<br>}</pre><p>Milestone reached! 🎉 We have created and deployed an NFT smart contract gaslessly.</p><p>Let’s create the Frame UI.</p><h4>Frame UI</h4><p>The Frog framework exposes a frame function that accepts the URL path where your frame will be accessible, and as a return, it expects a specification on how to render the frame.</p><p>Here is the full code first, and then we will explain it.</p><pre>app.frame(&#39;/&#39;, async (c) =&gt; {<br>  let alreadyMinted = false;<br>  let account: Account | null = null;<br>  const isMint = c.buttonValue === &#39;mint&#39;;<br> <br>  if (c.frameData &amp;&amp; isMint) {<br>    account = await fetch(`https://fnames.farcaster.xyz/transfers?fid=${c.frameData.fid}`)<br>      .then((r) =&gt; r.json())<br>      .then((r) =&gt; r.transfers[0]);<br> <br>    const tokenId = c.frameData.timestamp;<br>    const balance = await smartContract.read&lt;bigint&gt;(&#39;balanceOf&#39;, {<br>      params: [account.owner],<br>    });<br>    alreadyMinted = balance &gt; 0;<br> <br>    if (!alreadyMinted) {<br>      smartContract<br>        .write(&#39;safeMint&#39;, {<br>          params: [account.owner, tokenId],<br>        })<br>        .then((tx) =&gt; console.log(&#39;minted&#39;, tx))<br>        .catch((e) =&gt; console.error(&#39;minting error&#39;, e.message));<br>    }<br>  }<br> <br>  return c.res({<br>    image: (<br>      &lt;div<br>        style={{<br>          display: &#39;flex&#39;,<br>          width: &#39;100%&#39;,<br>          height: &#39;100%&#39;,<br>          justifyContent: &#39;center&#39;,<br>          alignItems: &#39;center&#39;,<br>          background: &#39;linear-gradient(to right, #432889, #17101F)&#39;,<br>        }}<br>      &gt;<br>        &lt;span style={{ color: &#39;white&#39;, fontSize: &#39;50px&#39; }}&gt;<br>          {alreadyMinted<br>            ? &#39;NFT Already Minted&#39;<br>            : isMint<br>              ? `NFT Minted to ${account.username} 🏆`<br>              : &#39;Click Mint to mint a free NFT 🖼&#39;}<br>        &lt;/span&gt;<br>      &lt;/div&gt;<br>    ),<br>    intents: alreadyMinted ? [] : [&lt;Button value=&quot;mint&quot;&gt;Mint&lt;/Button&gt;],<br>  });<br>});</pre><p>The Frame function provides us with a context c that contains information about the frame, the user interacting with the frame, and other HTTP request-related data.</p><p>When a user clicks the Mint button, c.buttonValue will have a mint value, because of the attribute that we defined in the Button component.</p><p>In order to mint an NFT, we need the receiver’s wallet address. We can get one from Farcaster directly. We want to get the wallet address of the user who is interacting with the Frame.</p><p>For that purpose, we have:</p><pre>account = await fetch(`https://fnames.farcaster.xyz/transfers?fid=${c.frameData.fid}`)<br>  .then((r) =&gt; r.json())<br>  .then((r) =&gt; r.transfers[0]);</pre><p>The next important part is to check if the user has already minted an NFT. We can do that by reading the smart contract state and checking how many NFTs the user has.</p><pre>const balance = await smartContract.read&lt;bigint&gt;(&#39;balanceOf&#39;, {<br>  params: [account.owner],<br>});<br> <br>alreadyMinted = balance &gt; 0;</pre><p>If the user has not minted an NFT, we can mint one for them.</p><pre>smartContract.write(&#39;safeMint&#39;, {<br>  params: [account.owner, tokenId],<br>});</pre><p>Here we call the safeMint smart contract function and pass the receiver&#39;s wallet address and the generated NFT token id.</p><p>The last part is to define the image and the buttons.</p><p>We will have only one button, the Mint button. If the user has already minted an NFT, we will not show any buttons.</p><pre>intents: alreadyMinted ? [] : [&lt;Button value=&quot;mint&quot;&gt;Mint&lt;/Button&gt;],</pre><p>The image will be a component that is a simple div that shows the message and the status of the minting process.</p><pre>image: (<br>  &lt;div<br>    style={{<br>      display: &#39;flex&#39;,<br>      width: &#39;100%&#39;,<br>      height: &#39;100%&#39;,<br>      justifyContent: &#39;center&#39;,<br>      alignItems: &#39;center&#39;,<br>      background: &#39;linear-gradient(to right, #432889, #17101F)&#39;,<br>    }}<br>  &gt;<br>    &lt;span style={{ color: &#39;white&#39;, fontSize: &#39;50px&#39; }}&gt;<br>      {alreadyMinted<br>        ? &#39;NFT Already Minted&#39;<br>        : isMint<br>          ? `NFT Minted to ${account.username} 🏆`<br>          : &#39;Click Mint to mint a free NFT 🖼&#39;}<br>    &lt;/span&gt;<br>  &lt;/div&gt;<br>),</pre><p>Congratulations! You have created a gasless Farcaster NFT mint frame with Frog.fm and <a href="https://kriptonio.com">Kriptonio</a>.</p><p>The full code is available on <a href="https://github.com/kriptonio/sdk/tree/main/examples/farcaster-frog-frame-mint-nft">GitHub</a>.</p><p>If you have any questions, feel free to ask in our <a href="https://discord.gg/7QreJNYuaz">Discord</a>.</p><h4>Remarks</h4><p>The above code is a minimal example that will give you a good starting point to expand it further and cover different edge cases.</p><p>One of the first things that you might want to adjust is to have a persistent wallet private key, instead of generating a wallet on every app start. In fact, NFT minting will fail if the smart contract is initialized with a wallet that has not deployed it (not the owner).</p><p>Here is an example of how to create a wallet from your own private key:</p><p>You can read more about importing existing wallets <a href="https://docs.kriptonio.com/sdk/wallets/import">here</a>.</p><p>Thanks for reading, and happy coding!</p><h4>Bonus Tip</h4><p>You can operate and inspect created NFT smart contract via Kriptonio iOS/Android mobile apps. Simply login to the mobile app, import the wallet that you used to deploy the wallet, and play with the smart contract.</p><p>Links to the mobile app here: <a href="https://docs.kriptonio.com/mobile">https://docs.kriptonio.com/mobile</a></p><p><em>Originally published at </em><a href="https://docs.kriptonio.com/blog/farcaster-gasless-nft-frame"><em>https://docs.kriptonio.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9aa38cbf9304" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create simple Smart Wallet based on ERC-4337 standard]]></title>
            <link>https://medium.com/@kriptonio/how-to-create-simple-smart-wallet-based-on-erc-4337-standard-ff9f42866e11?source=rss-7b9bc51709c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff9f42866e11</guid>
            <category><![CDATA[account-abstraction]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[eip-4337]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[erc-4337]]></category>
            <dc:creator><![CDATA[Kriptonio]]></dc:creator>
            <pubDate>Fri, 19 May 2023 13:54:20 GMT</pubDate>
            <atom:updated>2023-06-21T08:04:51.397Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J-OslBp2tX8nm3cjfsChaw.jpeg" /></figure><p>Account abstraction based on the <a href="https://eips.ethereum.org/EIPS/eip-4337">ERC-4337</a> standard is a new way to represent user wallets on Ethereum, offering multiple benefits for users. Wallets will be represented as smart contracts, allowing for the abstraction and programmability of various aspects of current wallets. These include the ability to change the signer/owner of the wallet, the possibility of social recovery, paying gas fees in tokens, sponsoring transaction gas fees, and more.</p><p>This article is intended for readers who are already familiar with the basic concepts and components of the ERC-4337 standard and want to learn how to create a simple smart wallet based on the ERC-4337 standard.</p><h3>Key ingredients</h3><p>To create a smart wallet, we will need the following:</p><ul><li>Bundler RPC</li><li>Solidity smart contracts for the smart wallet</li><li>Web3 libraries</li></ul><h3>Bundler RPC</h3><p>For the bundler RPC, you can get one for free from <a href="https://kriptonio.com/">Kriptonio</a>. Simply register on <a href="https://kriptonio.com/">Kriptonio</a> and create a new bundler RPC endpoint.</p><p>In this example, we will use the Polygon Mumbai blockchain network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8r156blYaql-5K_yUR1kuA.png" /></figure><p>Next, copy the RPC endpoint. We will need it soon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b21cUiWrPlGYjZtBQNNFCg.png" /></figure><h3>Solidity Smart Contracts for Smart Wallet</h3><p>We will use contracts provided by eth-infinitism, specifically <a href="https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol">SimpleAccount.sol</a> for our smart wallet and <a href="https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccountFactory.sol">SimpleAccountFactory.sol</a>. The latter one is used to create new smart wallets on the chain.</p><h3>Web3 libraries</h3><p>For sending RPC requests to the blockchain network, we will use the <a href="https://docs.ethers.org/v5/">ethers v5</a> library, and as a helper library for creating and signing UserOperation structs, we will use <a href="https://github.com/stackup-wallet/userop.js">userop</a> library.</p><h3>Project setup &amp; installing dependencies</h3><p>Initialize a new npm project.</p><pre>npm init -y</pre><p>Install the required smart wallet dependencies.</p><pre>yarn add ethers@5 userop</pre><p>We will also use TypeScript in the project, so let’s install TypeScript dependencies as well.</p><pre>yarn add -D typescript ts-node<br>yarn run tsc --init</pre><h3>Let’s code</h3><p>The first thing we need to do is to create a new classic wallet (EOA) that will be the owner of our new smart wallet. The owner is allowed to send transactions from the smart wallet.</p><pre>const privateKey = ethers.Wallet.createRandom().privateKey;<br>const owner = new ethers.Wallet(privateKey);</pre><p>To create a new Smart Wallet, we need two smart contracts which should be deployed before deploying our smart wallet. The first contract is the EntryPoint contract. It acts as a mediator between bundlers and the actual smart contract wallet.</p><p>The second one is the contract used as a factory for deploying a new instance of our smart wallet.</p><p>The former one is deployed by the core team, and the latter one has to be deployed by the creator of the smart wallet contract. In this case, it’s eth-infinitism.</p><p>In both cases, we don’t need to worry about deployment, so let’s just specify the addresses of these contracts.</p><pre>const entryPointAddress = &#39;0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789&#39;;<br>const factoryAddress = &#39;0x9406Cc6185a346906296840746125a0E44976454&#39;;</pre><p>We are now ready to use the userop library to prepare our smart wallet contract object.</p><p>On top of your file, add the following import:</p><pre>import { Client, Presets } from &quot;userop&quot;;</pre><p>Now you can create a smart account builder instance:</p><pre>const smartAccount = await Presets.Builder.SimpleAccount.init(<br>    owner,<br>    bundlerRpcUrl,<br>    {<br>      entryPoint: entryPointAddress,<br>      factory: factoryAddress,<br>    }<br>  );</pre><p>This will create a builder instance which knows how to create user operations based on <a href="https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol">SimpleAccount.sol</a> smart contract.</p><p>It also knows how to deploy the smart contract upon sending first transaction.</p><p>You can already see the future address of our smart wallet by calling getSender method.</p><pre>console.log(&#39;smart wallet address&#39;, smartAccount.getSender());</pre><p><strong>IMPORTANT:</strong> In order to successfully send transactions later, the smart wallet needs to have enough funds to pay for gas fees. In this example using the Polygon Mumbai network, we will use the <a href="https://faucet.matic.network/">Polygon Mumbai Faucet</a> to get some free test tokens. Simply go to the <a href="https://faucet.matic.network/">faucet</a> and paste your wallet address. Wait a few seconds and you should see some tokens in your wallet.</p><p>To send transactions from the smart wallet, we need to construct a UserOperation struct, fill it with gas estimates, and sign it. User Operation contains following fields:</p><pre>{<br>  sender,<br>  nonce,<br>  initCode,<br>  callData,<br>  callGasLimit,<br>  verificationGasLimit,<br>  preVerificationGas,<br>  maxFeePerGas,<br>  maxPriorityFeePerGas,<br>  paymasterAndData,<br>  signature,<br>}</pre><p>We won’t go into details for each field. Each of these fields is exampled in <a href="https://eips.ethereum.org/EIPS/eip-4337">ERC-4337 spec</a>.</p><p>To speed up the process we will be using userop library to create and sign UserOperation struct.</p><pre>const client = await Client.init(bundlerRpcUrl, {<br>  entryPoint: entryPointAddress,<br>});<br><br>const result = await client.sendUserOperation(<br>  smartAccount.execute(smartAccount.getSender(), 0, &quot;0x&quot;),<br>);</pre><p>This user operation will send 0 MATIC back to the owner. This transaction doesn’t make much sense in a real-life scenario, but it’s enough to demonstrate account deployment and transaction sending in our scenario.</p><p>Let’s now wait for the transaction to be mined.</p><pre>const event = await result.wait();<br>console.log(`Transaction hash: ${event?.transactionHash}`);</pre><p>After transaction is mined you can extract transaction hash from the event object.</p><p>As this is the first transaction from the smart wallet, the smart wallet itself will be deployed.</p><p>Congratulations 🎉! You have successfully deployed your smart wallet and sent the first user operation via it.</p><h3>Source Code</h3><p>You can find the complete source code used in this article <a href="https://github.com/kriptonio/erc4337-smart-wallet-example">here</a>.</p><h3>Questions</h3><p>Hopefully, this article was helpful. If you have any questions, feel free to ask them in our <a href="https://discord.gg/7QreJNYuaz">Discord</a> server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff9f42866e11" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>