[TWIL] Week of June 09, 2024
![[TWIL] Week of June 09, 2024](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1718689990331%2F8f29b491-ec0f-4ec1-b7b1-b7b417e53b88.png&w=3840&q=75)
Search for a command to run...
![[TWIL] Week of June 09, 2024](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1718689990331%2F8f29b491-ec0f-4ec1-b7b1-b7b417e53b88.png&w=3840&q=75)
No comments yet. Be the first to comment.
This series is about my weekly learning experiences, covering a broad range of topics with a focus on sharing engineering tips and techniques whenever possible.
This week was the first full week of the Onchain Summer Buildathon. I signed up to participate, motivating myself to improve the UX on our platform and build great new features. To start, I upgraded a few npm packages to support the Base network and ...
This year, I decided to attend ETHDenver, one of the most well-known crypto conferences in the world, from February 25th to March 1st. Although I wasn’t there for the entire week, I made it a priority to experience as much as possible within the few ...

AI has become an unavoidable topic in tech, with models like OpenAI’s ChatGPT, DeepSeek, and Gemini dominating headlines. Since ChatGPT’s release in November 2022, AI has rapidly changed how we work and build software. Naturally, I’ve been using it e...

Hello builders! I hope you all had a fantastic week. Mine was a bit more laid-back. I decided to turn off my "build mode" and dive into some reading. I picked up two books: one technical and one non-technical (though still focused on NFTs). In this p...
![[TWIL] Week of August 11, 2024](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1724192926501%2F2ba38d69-5f89-4c41-b2fe-7f994fa97f71.png&w=3840&q=75)
Hello Builders! Hope you had a wonderful week! For this week’s TWIL post, I’d like to share a slight change to the series moving forward. As I mentioned in my previous post, I’ll continue writing one TWIL post each week, but the content might shift a...
![[TWIL] Week of August 04, 2024](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1723410046529%2F77c9c1f6-e0e2-4422-aa2c-0b82b769631c.png&w=3840&q=75)
Hello builders! This past week has been one of the most emotionally charged experiences I've had in a while. After much thought, I've made the difficult decision to leave Ourkive, the startup I co-founded alongside two other incredible people. While ...
![[TWIL] Week of July 28, 2024](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1723335244607%2F22b5f8ee-4c35-4cf0-9666-405c09aae03c.png&w=3840&q=75)
This week marked the second week of the Onchain Summer Buildathon, where I focused on integrating Base, an L2 chain from Coinbase, with Smart Wallet. Here’s a detailed account of what I learned while working on the Smart Wallet integration.
Sign in with Ethereum (SIWE) is a popular authentication method that allows decentralized applications (dapps) to remember their users. Our website leverages this method via the siwe npm package. Initially, I assumed that integrating Smart Wallet, a new smart contract wallet from Coinbase, would be straightforward. However, I encountered an unexpected technical hurdle.
Smart Wallet requires dapps to be compatible with EIP-6492, which outlines the signature validation for a pre-deployed smart contract account. Unfortunately, the siwe package doesn’t support this validation yet, meaning it can't validate Smart Wallet’s signature out-of-the-box.
Thankfully, the community already had an answer to this problem. Someone responded to a GitHub issue with a small package that supports both EIP-1271 and EIP-6492 signature validations. This package offers a verifyMessage function that enables us to validate signatures from Smart Wallet seamlessly. If your dapp needs to support SIWE for Smart Wallet, you can use AmbireTech's signature-validator package.
Beyond SIWE, our dapp also supports EIP-2612, which allows ERC20 tokens to be approved and transferred within a single transaction. Since USDC has already implemented EIP-2612, our dapp could use a permit function within our NFT marketplace smart contract. However, EIP-2612 doesn't support EIP-1271, meaning a Smart Wallet account signature isn't supported on EIP-2612.
Fortunately, Smart Wallet supports batch transactions. To address this, I separated the permit function logic into approve and transfer transactions and batched them using the useWriteContracts hook from the Wagmi package. Here’s an example code snippet:
import { useWriteContracts } from "wagmi/experimental";
function Component() {
const usdcApprove = {
address: "<usdc-contract-address>",
abi,
functionName: "approve",
args: ["<spender-address>", "<amount>"]
}
const usdcTransfer = {
address: "<usdc-contract-address>",
abi,
functionName: "transferFrom",
args: ["<from-address>", "<to-address>", "<amount>"]
}
const { writeContracts } = useWriteContracts();
const handleUsdc = () => {
writeContracts({
contracts: [usdcApprove, usdcTransfer]
});
}
}
Although externally owned accounts (EOAs) will have to go through two separate transactions, Smart Wallet accounts will enjoy a simpler user experience with just one click of transaction confirmation.
That’s it for this week. With two weeks left in the OCS Buildathon, I'll continue building and sharing my progress. Happy hacking, everyone! ☕️