<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Nonthakon's Blog]]></title><description><![CDATA[Share my thoughts on startups, tech, ai, ml, web3, and random stuff]]></description><link>https://nonthakon-blog.fly.dev/</link><image><url>https://nonthakon-blog.fly.dev/favicon.png</url><title>Nonthakon&apos;s Blog</title><link>https://nonthakon-blog.fly.dev/</link></image><generator>Ghost 5.17</generator><lastBuildDate>Sat, 09 May 2026 04:00:11 GMT</lastBuildDate><atom:link href="https://nonthakon-blog.fly.dev/blog/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[NEAR BOS X Chainlink CCIP: The Workshop]]></title><description><![CDATA[<figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/2023/12/image.png" class="kg-image" alt loading="lazy" width="800" height="800" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/2023/12/image.png 600w, https://nonthakon-blog.fly.dev/content/images/2023/12/image.png 800w" sizes="(min-width: 720px) 720px"></figure><blockquote>First of all, I would like to say thank you to <strong>Solange Gueiros </strong>fellow Chainlink Developer Expert for a wonderful session (which I&apos;ve used as a guide to wrote this article haha) </blockquote><hr><h3 id="outline">Outline</h3><ul><li>Basic CCIP</li><li>Smart Contracts structure</li><li>Pre-requisite</li><li>Hands-on</li><li>Summary</li></ul><hr><!--kg-card-begin: html--><iframe src="https://docs.google.com/presentation/d/e/2PACX-1vSZHYRfoIER42o3LmXtcjnJmM9PXsJTynfQU3KgR3-skn0TpLYloUt9GCgBWRjD_8XwawAkeNKqwdC1/embed?start=false&amp;loop=false&amp;delayms=3000" frameborder="0" width="960" height="569" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe><!--kg-card-end: html--><hr><h3 id="basic-ccip">Basic CCIP</h3><figure class="kg-card kg-image-card"><img src="https://lh4.googleusercontent.com/IQBkLQ1WRJbDpnFiPe-ml7nOgH21_4cI1fyAMtBZcF1b1NDNKliCCB3PAJCrbAGudhv7hfJt5GVU14RW1SE9DUP9UHqwszh-_RIN-_cqtoRcZ5MjCnWnWKbZ8fKVIO-LZayf_iKDQwp8ivuqFsEKxZU" class="kg-image" alt loading="lazy" width="624" height="260"></figure><h3 id="smart-contracts-structure">Smart Contracts structure</h3><p>We will</p>]]></description><link>https://nonthakon-blog.fly.dev/ccip-x-bos/</link><guid isPermaLink="false">6579bc3cfa165201376d9b8e</guid><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Wed, 13 Dec 2023 14:31:28 GMT</pubDate><content:encoded><![CDATA[<figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/2023/12/image.png" class="kg-image" alt loading="lazy" width="800" height="800" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/2023/12/image.png 600w, https://nonthakon-blog.fly.dev/content/images/2023/12/image.png 800w" sizes="(min-width: 720px) 720px"></figure><blockquote>First of all, I would like to say thank you to <strong>Solange Gueiros </strong>fellow Chainlink Developer Expert for a wonderful session (which I&apos;ve used as a guide to wrote this article haha) </blockquote><hr><h3 id="outline">Outline</h3><ul><li>Basic CCIP</li><li>Smart Contracts structure</li><li>Pre-requisite</li><li>Hands-on</li><li>Summary</li></ul><hr><!--kg-card-begin: html--><iframe src="https://docs.google.com/presentation/d/e/2PACX-1vSZHYRfoIER42o3LmXtcjnJmM9PXsJTynfQU3KgR3-skn0TpLYloUt9GCgBWRjD_8XwawAkeNKqwdC1/embed?start=false&amp;loop=false&amp;delayms=3000" frameborder="0" width="960" height="569" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe><!--kg-card-end: html--><hr><h3 id="basic-ccip">Basic CCIP</h3><figure class="kg-card kg-image-card"><img src="https://lh4.googleusercontent.com/IQBkLQ1WRJbDpnFiPe-ml7nOgH21_4cI1fyAMtBZcF1b1NDNKliCCB3PAJCrbAGudhv7hfJt5GVU14RW1SE9DUP9UHqwszh-_RIN-_cqtoRcZ5MjCnWnWKbZ8fKVIO-LZayf_iKDQwp8ivuqFsEKxZU" class="kg-image" alt loading="lazy" width="624" height="260"></figure><h3 id="smart-contracts-structure">Smart Contracts structure</h3><p>We will create 3 smart contracts on 2 chains in this session and it would look somewhat similar to this.</p><p><u>Ethereum Sepolia</u><br>1. MyNFT.sol<br>2. CCIPTokenAndDataReceiver.sol</p><p><u>Avalanche Fuji</u><br>1. CCIPTokenAndDataSender.sol</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/2023/12/image-1.png" class="kg-image" alt loading="lazy" width="2000" height="1459" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/2023/12/image-1.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/2023/12/image-1.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/2023/12/image-1.png 1600w, https://nonthakon-blog.fly.dev/content/images/2023/12/image-1.png 2084w" sizes="(min-width: 720px) 720px"></figure><h3 id="prerequisite">Prerequisite</h3><ul><li>Get ETH/LINK on Sepolia -&gt; <a href="https://faucets.chain.link/sepolia">https://faucets.chain.link/sepolia</a></li><li>Get AVAX/LINK on Fuji -&gt; &#xA0;<a href="https://faucets.chain.link/fuji">https://faucets.chain.link/fuji</a></li></ul><h3 id="hands-on">Hands-On</h3><p>Refer to all the code from this gist &#x1F447;</p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/1d9fa4de78c1aa70bb70299b4ab6a9ab.js"></script><!--kg-card-end: html--><p><u>Sepolia</u></p><ol><li>MyNFT<br>We&apos;re using <strong><a href="https://wizard.openzeppelin.com/#erc721">https://wizard.openzeppelin.com/#erc721</a></strong><br>Try visit <a href="https://testnets.opensea.io/">testnet.opensea.com</a> after deployed</li><li>CCIPTokenAndDataReceiver.sol</li></ol><p><u>Avalanche Fuji</u></p><p>3. CCIPTokenAndDataSender.sol</p><h3 id="steps">Steps</h3><ol><li>We deployed <u>MyNFT, CCIPTokenAndDataReceiver</u> on Sepolia</li><li>Change the chain to Avalanche Fuji, Then we deployed <u>CCIPTokenAndDataSender</u> on Fuji</li><li>Supply LINK to <u>CCIPTokenAndDataSender</u> contract</li><li>We can call mintNFT() on <u>CCIPTokenAndDataSender</u> to mint a new NFT on Sepolia!</li></ol><h3 id="deployed-contract">Deployed Contract</h3><p><strong><u>Sepolia</u></strong><br>MyNFT: 0xBF3d94450104487c25C2BEe4CA7E40eDD7caC73D<br>Receiver: 0x1d151E9c47f78742827e25F1D80fCE58cb2b6caE</p><p><u><strong>Fuji</strong></u><br>Sender: 0xd0FD63f94811d9Fd8f147f22bd94AbF21c1d0445</p><p><u><strong>Success Transaction</strong></u></p><p>TX Hash: <a href="https://testnet.snowtrace.io/tx/0x7d11de32d00fff6f9e46adbda885f93719daa4cadadbf31489302d47baac6116?chainId=43113">0x7d11de32d00fff6f9e46adbda885f93719daa4cadadbf31489302d47baac6116</a></p>]]></content:encoded></item><item><title><![CDATA[Laika just received grant from Arbitrum]]></title><description><![CDATA[<p></p><p>Hey folks! I want to announce to you all that Laika Labs just received grant from Arbitrum Grants Program provided by @QuestBook<br>and i am super proud to tell you that we&apos;re also the first grant approved by the program!</p><p>before i jump to what we&apos;ll</p>]]></description><link>https://nonthakon-blog.fly.dev/laika-just-received-grant-from-arbitrum/</link><guid isPermaLink="false">6528c5f99b9aa801370b11e8</guid><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Fri, 13 Oct 2023 05:31:13 GMT</pubDate><content:encoded><![CDATA[<p></p><p>Hey folks! I want to announce to you all that Laika Labs just received grant from Arbitrum Grants Program provided by @QuestBook<br>and i am super proud to tell you that we&apos;re also the first grant approved by the program!</p><p>before i jump to what we&apos;ll do next, i want to tell you guys a little bit of our story for the past year.</p><p>the past year was a really tough year for us, and for me personally. terra crash, ftx crash and the market plummeted. and we&apos;re not success on secure funding in time. thus, we&apos;re running out of funds to operating laika at that point. that make us decided to part ways and take a pause on it for a while until everything is better.</p><p>at that moment it was really sad for me, we spent almost 2 years working and dreaming on laika and watching it blur away from our faces. at that moment all of us were really sad but we got no way to fix it.</p><p>but we&apos;re still keep laika website operational and use our personal saving to pay for the infrastructure cost to keep it running. because we believe that our tool is still cool and it&apos;s still useful for the ecosystem as a whole.</p><p>months has passed, some of us tackling on new project. some of us get a corporate job. we just learned a lot from laika. and that was a story of our last year, that&apos;s why you haven&apos;t heard from us for a while.</p><p>but we&apos;re back now! and this time, even stronger. today i would like to announce to you again that we&apos;re building up laika again. and this time we&apos;re building it for the community. the new laika code will cherish with the open source ethos at day one. we&apos;re a community member and we&apos;re building for the community. stay tune!</p><p></p><p>before i end this post i want to say thank you to a lot of people that help us along the way, thank you to P&apos;Chom @chomtana for a big push that re-direct me back to Laika, thank you to @Jean @Boss @Ishan for staying with me through our roughest year, thank you to @Srijith @Juan @Sebastiano for the grant we&apos;re really appreciate! and last of all thank you to you all laika users, otherwise none of this would happen. cheers!</p><p></p>]]></content:encoded></item><item><title><![CDATA[[Workshop] Build a Cross-Chain NFT with Chainlink CCIP]]></title><description><![CDATA[<figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/2023/10/Copy-of-CCIP-Cross-Chain-NFTs-2.png" class="kg-image" alt loading="lazy" width="960" height="540" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/2023/10/Copy-of-CCIP-Cross-Chain-NFTs-2.png 600w, https://nonthakon-blog.fly.dev/content/images/2023/10/Copy-of-CCIP-Cross-Chain-NFTs-2.png 960w" sizes="(min-width: 720px) 720px"></figure><blockquote>First of all, I would like to say thank you to <strong>Solange Gueiros </strong>fellow Chainlink Developer Expert for a wonderful session (which I&apos;ve used as a guide to wrote this article hehe) </blockquote><hr><h3 id="outline">Outline</h3><ul><li>Basic CCIP</li><li>Smart Contracts structure</li><li>Pre-requisite</li><li>Hands-on</li><li>Summary</li></ul><hr><!--kg-card-begin: html--><iframe src="https://docs.google.com/presentation/d/e/2PACX-1vQ1DC3CLcBcqCKDyI5qD8M4cLGFtPDl9_7SVfLuQcRZ3lSwdpQrQl2ydAG0JD4GAAjRM-Bd9lbWecsh/embed?start=false&amp;loop=false&amp;delayms=3000" frameborder="0" width="960" height="569" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe><!--kg-card-end: html--><hr><h3 id="basic-ccip">Basic CCIP</h3><figure class="kg-card kg-image-card"><img src="https://lh4.googleusercontent.com/IQBkLQ1WRJbDpnFiPe-ml7nOgH21_4cI1fyAMtBZcF1b1NDNKliCCB3PAJCrbAGudhv7hfJt5GVU14RW1SE9DUP9UHqwszh-_RIN-_cqtoRcZ5MjCnWnWKbZ8fKVIO-LZayf_iKDQwp8ivuqFsEKxZU" class="kg-image" alt loading="lazy" width="624" height="260"></figure><h3 id="smart-contracts-structure">Smart Contracts structure</h3><p>We will</p>]]></description><link>https://nonthakon-blog.fly.dev/cross-chain-nft-ccip/</link><guid isPermaLink="false">65275e5255b0970137c64cba</guid><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Thu, 12 Oct 2023 04:37:40 GMT</pubDate><content:encoded><![CDATA[<figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/2023/10/Copy-of-CCIP-Cross-Chain-NFTs-2.png" class="kg-image" alt loading="lazy" width="960" height="540" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/2023/10/Copy-of-CCIP-Cross-Chain-NFTs-2.png 600w, https://nonthakon-blog.fly.dev/content/images/2023/10/Copy-of-CCIP-Cross-Chain-NFTs-2.png 960w" sizes="(min-width: 720px) 720px"></figure><blockquote>First of all, I would like to say thank you to <strong>Solange Gueiros </strong>fellow Chainlink Developer Expert for a wonderful session (which I&apos;ve used as a guide to wrote this article hehe) </blockquote><hr><h3 id="outline">Outline</h3><ul><li>Basic CCIP</li><li>Smart Contracts structure</li><li>Pre-requisite</li><li>Hands-on</li><li>Summary</li></ul><hr><!--kg-card-begin: html--><iframe src="https://docs.google.com/presentation/d/e/2PACX-1vQ1DC3CLcBcqCKDyI5qD8M4cLGFtPDl9_7SVfLuQcRZ3lSwdpQrQl2ydAG0JD4GAAjRM-Bd9lbWecsh/embed?start=false&amp;loop=false&amp;delayms=3000" frameborder="0" width="960" height="569" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe><!--kg-card-end: html--><hr><h3 id="basic-ccip">Basic CCIP</h3><figure class="kg-card kg-image-card"><img src="https://lh4.googleusercontent.com/IQBkLQ1WRJbDpnFiPe-ml7nOgH21_4cI1fyAMtBZcF1b1NDNKliCCB3PAJCrbAGudhv7hfJt5GVU14RW1SE9DUP9UHqwszh-_RIN-_cqtoRcZ5MjCnWnWKbZ8fKVIO-LZayf_iKDQwp8ivuqFsEKxZU" class="kg-image" alt loading="lazy" width="624" height="260"></figure><h3 id="smart-contracts-structure">Smart Contracts structure</h3><p>We will create 3 smart contracts on 2 chains in this session and it would look somewhat similar to this.</p><p><u>Mumbai</u><br>1. ChainlinkNFT.sol<br>2. DestinationMinter.sol</p><p><u>Avalanche Fuji</u><br>1. SourceMinter.sol</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/2023/10/image-1.png" class="kg-image" alt loading="lazy" width="2000" height="1408" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/2023/10/image-1.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/2023/10/image-1.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/2023/10/image-1.png 1600w, https://nonthakon-blog.fly.dev/content/images/2023/10/image-1.png 2168w" sizes="(min-width: 720px) 720px"></figure><h3 id="prerequisite">Prerequisite</h3><ul><li>Get MATIC on Mumbai -&gt; <a href="https://mumbaifaucet.com/">https://mumbaifaucet.com/</a></li><li>Get LINK on Mumbai -&gt; <a href="https://faucets.chain.link/mumbai">https://faucets.chain.link/mumbai</a></li><li>Get AVAX/LINK on Fuji -&gt; &#xA0;<a href="https://faucets.chain.link/fuji">https://faucets.chain.link/fuji</a></li></ul><h3 id="hands-on">Hands-On</h3><p>Refer to all the code from this gist &#x1F447;</p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/49bc474ae032b2e705e583e56d2d2cd7.js"></script><!--kg-card-end: html--><p><u>Sepolia</u></p><ol><li>ChainlinkNFT<br>We&apos;re using <strong><a href="https://wizard.openzeppelin.com/#erc721">https://wizard.openzeppelin.com/#erc721</a></strong><br>Try visit <a href="https://testnets.opensea.io/">testnet.opensea.com</a> after deployed</li><li>DestinationMinter.sol</li></ol><p><u>Avalanche Fuji</u></p><p>3. SourceMinter.sol</p><h3 id="summary">Summary</h3><ol><li>We deployed <u>ChainlinkNFT</u> on Mumbai</li><li>Then we deployed <u>DestinationMinter</u> on Mumbai</li><li>Change the chain to Avalanche Fuji, Then deploy <u>SourceMinter</u></li><li>Supply LINK to <u>SourceMinter</u> contract</li><li>We can call mintOnMumbai() on <u>SourceMinter</u> to mint a new NFT on Mumbai!</li></ol>]]></content:encoded></item><item><title><![CDATA[🥢 Ethereum Shanghai Upgrade]]></title><description><![CDATA[Introduction to Ethereum Shanghai Upgrade 🎉]]></description><link>https://nonthakon-blog.fly.dev/ethereum-shanghai-upgrade/</link><guid isPermaLink="false">65260db4393b990137d44631</guid><category><![CDATA[Web3]]></category><category><![CDATA[Ethereum]]></category><category><![CDATA[Ethereum The Merge]]></category><category><![CDATA[Blockchain]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Sun, 19 Feb 2023 16:19:23 GMT</pubDate><media:content url="https://nonthakon-blog.fly.dev/content/images/max/800/1-utlh6axc81pybxzjdijeog-2.png" medium="image"/><content:encoded><![CDATA[<h4 id="introduction-to-ethereum-shanghai-upgrade-"><strong>Introduction to Ethereum Shanghai Upgrade &#x1F389;</strong></h4><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-utlh6axc81pybxzjdijeog-2.png" alt="&#x1F962; Ethereum Shanghai Upgrade"><p>A big upgrade is on its way and it&#x2019;s called the Shanghai Upgrade. This upgrade promises to bring several improvements to the Ethereum network, making it more efficient, consistent and upgradeable. The upgrade is slated to happen in March 2023, and it&#x2019;s a highly anticipated event in the Ethereum community. Let&#x2019;s see what we have!</p><blockquote>For all the information used in writing this article, we compiled it from ACD wrote by Ethereum Foundation&#x2019;s Tim Beiko. If you want to learn more, you can refer to the following links for additional information!</blockquote><blockquote><a href="https://hackmd.io/@timbeiko/acd/" rel="nofollow noopener">https://hackmd.io/@timbeiko/acd/</a></blockquote><hr><p><strong>Beacon Chain Stake and Withdrawal </strong>&#x1F4B0;</p><p>One of the key features of the Shanghai Upgrade is the introduction of withdrawal capabilities for Beacon Chain stakers. Currently, Beacon Chain stakers can only stake ETH, but with the upcoming EIP-4895, they will now be able to withdraw their stakes as well. This is a top priority for the upgrade and is expected to bring a lot of excitement to the Ethereum community.</p><p><strong>Ethereum Object Format (EOF) </strong>&#x1F4BB;</p><p>Another major highlight of the Shanghai Upgrade is the Ethereum Object Format (EOF). EOF is a suite of 5 Ethereum Improvement Proposals (EIPs) that promises to make Ethereum execution more efficient, more consistent, and more upgradeable. EOF is the first upgrade in the Ethereum Virtual Machine&#x2019;s (EVM) history and it&#x2019;s a big step forward for the Ethereum network. Here are the key EIPs that make up the EOF:</p><ul><li><strong>EIP-3540</strong>: Changes the structure of EVM instructions, making it easier to upgrade the EVM.</li><li><strong>EIP-3670</strong>: Introduces code validation for smart contracts during deployment, saving execution costs.</li><li><strong>EIP-4200</strong>: Improves the efficiency of the Ethereum stack machine, leading to lower gas fees.</li><li><strong>EIP-4750</strong>: Introduces functions that the stack machine can perform, making programs more efficient.</li><li><strong>EIP-5450</strong>: Validates contracts during deployment, preventing stack overflows and underflows.</li></ul><p><strong>How it Could Impact Developer Experience? </strong>&#x1F468;&#x200D;&#x1F4BB;</p><p>The Shanghai Upgrade and EOF in particular, has the potential to significantly improve the developer experience on the Ethereum network. With code validation during deployment, efficient stack machine operation, and easier upgradability, developers can expect their smart contracts to run more smoothly on the network. Additionally, the introduction of withdrawal capabilities for Beacon Chain stakers is also a big win for developers who have been eagerly waiting for this feature.</p><p><strong>Can I try Ethereum Shanghai? </strong>&#x1F914;&#x1F4BB;</p><p>Yes, you can try Ethereum Shanghai! &#x1F680; As of now, We have a public testnet for the upcoming Ethereum Shanghai and it&#x2019;s called Zhejiang public testnet. And luckily it is now live and you can try playing with it!</p><p>You can also try to interact with it with Laika just go ahead to <a href="https://web.getlaika.app" rel="noopener">https://web.getlaika.app</a> Connect to your wallet and on the top-right pick on the chain selector and type &#x201C;Zhejiang&#x201D;</p><p>And Wallah! You can interact with any smart contracts on it with a few clicks away!</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-kenydm7umvhsrwyyfmtaca.png" class="kg-image" alt="&#x1F962; Ethereum Shanghai Upgrade" loading="lazy" width="853" height="443" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-kenydm7umvhsrwyyfmtaca.png 600w, https://nonthakon-blog.fly.dev/content/images/max/800/1-kenydm7umvhsrwyyfmtaca.png 853w" sizes="(min-width: 720px) 720px"><figcaption>Laika Interface</figcaption></figure><p><strong>Closing Thoughts &#x1F914;</strong></p><p>In conclusion, the Ethereum Shanghai Upgrade is a big step forward for the Ethereum network and the entire community. With the introduction of withdrawal capabilities for Beacon Chain stakers, and the Ethereum Object Format (EOF), the network is expected to become more efficient, consistent, and upgradeable. Developers can look forward to a better experience building and deploying their smart contracts on the Ethereum network. &#x1F680; Get ready for the big launch in March 2023!</p><hr><p>That&#x2019;s it for today! Catch up with you guys later!</p><blockquote><strong><em>Connect with us</em></strong></blockquote><blockquote><em>Twitter: </em><a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener"><em>https://twitter.com/getlaikaapp</em></a><br><em>Facebook: </em><a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener"><em>https://www.facebook.com/getlaikaapp/</em></a><br><em>Discord: </em><a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener"><em>https://discord.gg/4DzwHuxhcf</em></a></blockquote><blockquote><em>PS. This article is co-written by ChatGPT. A big shoutout to ChatGPT for its amazing assistance in writing this article!</em></blockquote>]]></content:encoded></item><item><title><![CDATA[A Deep Dive into Laika and Osmosis: How Laika help you build faster]]></title><description><![CDATA[Hello and welcome to our article on A Deep Dive into Laika and Osmosis! If you’re interested in building decentralized applications (dApps)…]]></description><link>https://nonthakon-blog.fly.dev/a-deep-dive-into-laika-and-osmosis-how-laika-help-you-build-faster/</link><guid isPermaLink="false">65260db4393b990137d44632</guid><category><![CDATA[Web3]]></category><category><![CDATA[Developer]]></category><category><![CDATA[Cosmwasm]]></category><category><![CDATA[Interchain Academy]]></category><category><![CDATA[Blockchain]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Thu, 02 Feb 2023 14:38:57 GMT</pubDate><media:content url="https://nonthakon-blog.fly.dev/content/images/max/800/0-sokjrovr3mgszivq-2.png" medium="image"/><content:encoded><![CDATA[<hr><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-sokjrovr3mgszivq-2.png" alt="A Deep Dive into Laika and Osmosis: How Laika help you build faster"><p>Hello and welcome to our article on <strong>A Deep Dive into Laika and Osmosis</strong>! If you&#x2019;re interested in building decentralized applications (dApps) on the Osmosis blockchain. whether you&#x2019;re a veteran builder who built for quite some time or a builder who just getting started. I&#x2019;m sure that our tool that we building at Laika Labs could help you somehow!</p><hr><h4 id="introduction">Introduction</h4><p>Laika is a request builder tool that allows users to interact with smart contracts through a graphical user interface (GUI). It allows users to create requests to call functions on contracts, view data, and even deploy new contracts, all without the need for coding. Laika is a useful tool for developers who want to test and debug their contracts quickly and easily, as well as for non-developers who want to interact with existing contracts.</p><hr><h4 id="what-we-building-so-far">What we building so far</h4><p>Here&#x2019;s a List of what we build that could help you build faster on Osmosis!</p><ol><li><strong>A Request Builder &#x1F477;</strong></li></ol><p>We create easy &amp; intuitive UIs (with collection management supported) to interact with smart contracts on-chain so developers don&#x2019;t have to spend time writing a code to send a request to the smart contract. But just make that request on the UI to help speed-up development time a lot!</p><p>(Right now, Laika is supported on Osmosis Mainnet, Osmosis Testnet, and LocalOsmosis)</p><p>Visit: <a href="https://interchain.getlaika.app/" rel="nofollow noopener">https://interchain.getlaika.app/</a></p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-ys-4w9twz5fbc9fbahw1mg.png" class="kg-image" alt="A Deep Dive into Laika and Osmosis: How Laika help you build faster" loading="lazy" width="2000" height="1166" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-ys-4w9twz5fbc9fbahw1mg.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-ys-4w9twz5fbc9fbahw1mg.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-ys-4w9twz5fbc9fbahw1mg.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-ys-4w9twz5fbc9fbahw1mg.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>2. <strong>LocalOsmosis supported via Laika Proxy Extension &#x1F469;&#x200D;&#x1F52C;</strong></p><p>Laika is not just support on Osmosis Mainnet, Testnet. But you can spin your chain locally using LocalOsmosis. And you can use Laika on your local network through <strong>Laika Proxy Extension!</strong></p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://medium.com/laika-lab/introduction-to-laika-proxy-extension-193c2a3ad91"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Introduction to Laika Proxy Extension</div><div class="kg-bookmark-description">Hello everyone! In this article, I&#x2019;m going to introduce you to Laika Proxy Extension which we&#x2019;ve just released.</div><div class="kg-bookmark-metadata"><span class="kg-bookmark-author">medium.com</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://nonthakon-blog.fly.dev/content/images/fit/c/160/160/1-kf8vyjn3_moqtwj9z_ntea.png" alt="A Deep Dive into Laika and Osmosis: How Laika help you build faster"></div></a></figure><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-dj4bskhle85c8qr4.png" class="kg-image" alt="A Deep Dive into Laika and Osmosis: How Laika help you build faster" loading="lazy" width="1400" height="938" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-dj4bskhle85c8qr4.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-dj4bskhle85c8qr4.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-dj4bskhle85c8qr4.png 1400w" sizes="(min-width: 720px) 720px"></figure><p><strong>3. Code Snippet Generator</strong> &#x1F916;</p><p>Not only you can create a new request through UIs, but Laika also gives you a way to generate code snippets with ease so you can use them on your backend, bot, or anything you want.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-wxt9p2ufr3s7hzuuqridaw.png" class="kg-image" alt="A Deep Dive into Laika and Osmosis: How Laika help you build faster" loading="lazy" width="2000" height="1166" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-wxt9p2ufr3s7hzuuqridaw.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-wxt9p2ufr3s7hzuuqridaw.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-wxt9p2ufr3s7hzuuqridaw.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-wxt9p2ufr3s7hzuuqridaw.png 2400w" sizes="(min-width: 720px) 720px"></figure><p><strong>4. Environment Variables &#x1F30F;</strong></p><p>You can even create environment variables so they can be reused many times for any requests you build.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-6brh75am1twmdcmwncc-rg.png" class="kg-image" alt="A Deep Dive into Laika and Osmosis: How Laika help you build faster" loading="lazy" width="2000" height="1166" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-6brh75am1twmdcmwncc-rg.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-6brh75am1twmdcmwncc-rg.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-6brh75am1twmdcmwncc-rg.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-6brh75am1twmdcmwncc-rg.png 2400w" sizes="(min-width: 720px) 720px"></figure><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-prdyzy5zl6kuvjjork89lw.png" class="kg-image" alt="A Deep Dive into Laika and Osmosis: How Laika help you build faster" loading="lazy" width="2000" height="1166" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-prdyzy5zl6kuvjjork89lw.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-prdyzy5zl6kuvjjork89lw.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-prdyzy5zl6kuvjjork89lw.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-prdyzy5zl6kuvjjork89lw.png 2400w" sizes="(min-width: 720px) 720px"></figure><p><strong>5. Laika Labs CLI </strong>&#x1F4BB;</p><p>Laika Labs CLI is a command line tool that simplifies working with web3, providing an efficient and easy way to create and test smart contracts through Laika, a request builder for web3.</p><p>We create it to make integration of Laika and <a href="https://github.com/osmosis-labs/beaker" rel="noopener">Beaker</a> possible, Osmosis&#x2019;s smart contract developer can now write and check their smart contract as fast as a few clicks away!</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-jrhcp12o7f4beylq.gif" class="kg-image" alt="A Deep Dive into Laika and Osmosis: How Laika help you build faster" loading="lazy" width="600" height="338" srcset="https://nonthakon-blog.fly.dev/content/images/max/800/0-jrhcp12o7f4beylq.gif 600w"><figcaption>Demo of Laika Labs CLI syncing to&#xA0;Beaker</figcaption></figure><p>Other than all of that we also added a lot of utility features that you can use to boost your development workflow such as</p><ul><li>Notes &#x1F4DD; (A handy feature that you can use to jot down details of each request)</li><li>Converter &#x2696;&#xFE0F; (To help you convert the value to make it easier for the request making)</li><li>History &#x1F4DC; (Gives you the list of past requests sent via Laika)</li></ul><p>And much more!</p><hr><p>That&#x2019;s all for this article. Hope you guys like it! See you again next time! &#x1F603;</p><blockquote><strong><em>Connect with us</em></strong></blockquote><blockquote><em>Twitter: </em><a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener"><em>https://twitter.com/getlaikaapp</em></a><br><em>Facebook: </em><a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener"><em>https://www.facebook.com/getlaikaapp/</em></a><br><em>Discord: </em><a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener"><em>https://discord.gg/4DzwHuxhcf</em></a></blockquote>]]></content:encoded></item><item><title><![CDATA[Introduction to Laika-Labs-CLI]]></title><description><![CDATA[Laika Labs CLI is a command line tool that simplifies working with web3, providing an efficient and easy way to create and test smart…]]></description><link>https://nonthakon-blog.fly.dev/introduction-to-laika-labs-cli/</link><guid isPermaLink="false">65260db4393b990137d44633</guid><category><![CDATA[Web3]]></category><category><![CDATA[Developer]]></category><category><![CDATA[Cosmwasm]]></category><category><![CDATA[Interchain Academy]]></category><category><![CDATA[Blockchain]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Wed, 01 Feb 2023 13:40:26 GMT</pubDate><media:content url="https://nonthakon-blog.fly.dev/content/images/max/800/1-vu-hgshzqu_vtukxpd3zuq-2.png" medium="image"/><content:encoded><![CDATA[<h4 id="laika-labs-cli-is-a-command-line-tool-that-simplifies-working-with-web3-providing-an-efficient-and-easy-way-to-create-and-test-smart-contracts-through-laika-the-request-builder-for-web3-">Laika Labs CLI is a command line tool that simplifies working with web3, providing an efficient and easy way to create and test smart contracts through Laika, the Request Builder for Web3.</h4><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-vu-hgshzqu_vtukxpd3zuq-2.png" alt="Introduction to Laika-Labs-CLI"><p>Good day everyone! Today I&#x2019;m really excited to introduce you to a tool that we&#x2019;ve been building for a while now called the <strong>&#x201C;Laika-Labs-CLI&#x201D;.</strong></p><p>Laika Labs CLI is a command line tool that simplifies the process of working with web3 and blockchain technology. It is built to work with Laika, the request builder for web3 that acts as the &#x201C;Postman for blockchain.&#x201D; And it will provide developers with an efficient and easy way to create, and test smart contracts.</p><h4 id="installing-laika-labs-cli">Installing Laika Labs CLI</h4><ol><li>To install Laika Labs CLI, open a terminal window and run the command <code>npm install -g @laika-labs/cli</code>. <br>This installs the CLI globally on your computer.</li><li>Verify the installation by running <code>laika -v</code>, which should display the version number of the CLI.</li></ol><h4 id="syncing-a-beaker-smart-contract-to-laika-via-laika-labs-cli">Syncing a Beaker Smart Contract to Laika via Laika Labs CLI</h4><p>Beaker is a smart contract development tool that allows developers to create and deploy CosmWasm smart contracts on the blockchain. Laika, on the other hand, is a web3 request builder similar to Postman, which makes it easy to test and interact with your smart contracts.</p><ol><li>To sync a Beaker project with Laika, navigate to the directory of the Beaker project in your terminal.</li><li>Run the command <code>beaker wasm ts-gen</code> to generate schema for smart contracts, and then run <code>laika beaker sync &lt;contract-name&gt;</code>, where <code>&lt;contract-name&gt;</code> is the name of the contract you want to sync.</li><li>A link will be generated in the terminal, click on it, and it will automatically generate a new request for you in Laika, allowing you to easily test and interact with your smart contract.</li></ol><p>By following these steps, you can easily use Laika and Beaker together to streamline your smart contract development process.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-m5p1xletj_efhsky.gif" class="kg-image" alt="Introduction to Laika-Labs-CLI" loading="lazy" width="600" height="338" srcset="https://nonthakon-blog.fly.dev/content/images/max/800/0-m5p1xletj_efhsky.gif 600w"><figcaption>Demo for Laika-Labs CLI syncing requests in beaker project to&#xA0;Laika</figcaption></figure><hr><p>That&#x2019;s it for today! Catch up with you guys later!</p><blockquote><strong>Connect with us</strong></blockquote><blockquote>Twitter: <a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener">https://twitter.com/getlaikaapp</a><br>Facebook: <a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener">https://www.facebook.com/getlaikaapp/</a><br>Discord: <a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener">https://discord.gg/4DzwHuxhcf</a></blockquote><hr><blockquote>PS. This article is co-written by ChatGPT. A big shoutout to ChatGPT for its amazing assistance in writing this article!</blockquote>]]></content:encoded></item><item><title><![CDATA[Introduction to Laika Proxy Extension]]></title><description><![CDATA[Hello everyone! In this article, I’m going to introduce you to Laika Proxy Extension which we’ve just released.]]></description><link>https://nonthakon-blog.fly.dev/introduction-to-laika-proxy-extension/</link><guid isPermaLink="false">65260db4393b990137d44634</guid><category><![CDATA[Laika Blockchain Lab]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[Osmosis]]></category><category><![CDATA[Developer Tools]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Thu, 29 Sep 2022 14:38:27 GMT</pubDate><media:content url="https://nonthakon-blog.fly.dev/content/images/max/800/1-kf8vyjn3_moqtwj9z_ntea-2.png" medium="image"/><content:encoded><![CDATA[<img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-kf8vyjn3_moqtwj9z_ntea-2.png" alt="Introduction to Laika Proxy Extension"><p>Hello everyone! In this article, I&#x2019;m going to introduce you to <strong>Laika Proxy Extension </strong>which we&#x2019;ve just released.</p><p>To give you folks a little more context is that, We&#x2019;ve just added CosmWasm support which you can explore at <a href="https://interchain.getlaika.app" rel="noopener">https://interchain.getlaika.app</a> or look at the tweet below!</p><figure class="kg-card kg-embed-card"><blockquote class="twitter-tweet"><a href="https://twitter.com/getlaikaapp/status/1562443508832956418?s=20&amp;t=ECGhJRSU9MM-lWTuUt2l4w"></a></blockquote><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></figure><p>But Laika&apos;s interchain version has limitations in that it could not directly communicate with the chain running locally. Since the browser not allowed the web app to directly communicate with the local process.</p><p>And that&#x2019;s why we built <strong>Laika Proxy Extension</strong> to make it possible to interact with local chains using Laika!</p><hr><p>You can take a quick glance at Laika&apos;s official repository here</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://github.com/laika-lab/laika-extension"><div class="kg-bookmark-content"><div class="kg-bookmark-title">GitHub - laika-lab/laika-extension</div><div class="kg-bookmark-description">You can&apos;t perform that action at this time. You signed in with another tab or window. You signed out in another tab or&#x2026;</div><div class="kg-bookmark-metadata"><span class="kg-bookmark-author">github.com</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://nonthakon-blog.fly.dev/content/images/fit/c/160/160/0-jqwtetqfscwn0hcb.png" alt="Introduction to Laika Proxy Extension"></div></a></figure><hr><p><strong>Let&#x2019;s see how to use it!</strong></p><p>1. Clone Laika Proxy Extension from GitHubgit clone <a href="https://github.com/laika-lab/laika-extension" rel="nofollow noopener">https://github.com/laika-lab/laika-extension</a></p><p>2. Install dependenciescd laika-extensionnpm install<br># or<br>yarn install</p><p>3. Build the extensionnpm run build<br># or<br>yarn build</p><p>4. Install the extension by entering <code>chrome://extensions/</code> it into your browser, You&#x2019;ll be seeing something similar to this (Don&#x2019;t forget to turn on Developer Mode)</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-ero0db5o9z3wm4-s.png" class="kg-image" alt="Introduction to Laika Proxy Extension" loading="lazy" width="2000" height="1254" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-ero0db5o9z3wm4-s.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-ero0db5o9z3wm4-s.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/0-ero0db5o9z3wm4-s.png 1600w, https://nonthakon-blog.fly.dev/content/images/max/800/0-ero0db5o9z3wm4-s.png 2000w" sizes="(min-width: 720px) 720px"></figure><p>5. Click on <code>Load unpacked</code> and pick <code>dist</code> from the folder that we built on step (3)</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-dtueu4x5nvet8fpf.png" class="kg-image" alt="Introduction to Laika Proxy Extension" loading="lazy" width="2000" height="1255" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-dtueu4x5nvet8fpf.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-dtueu4x5nvet8fpf.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/0-dtueu4x5nvet8fpf.png 1600w, https://nonthakon-blog.fly.dev/content/images/max/800/0-dtueu4x5nvet8fpf.png 2000w" sizes="(min-width: 720px) 720px"></figure><p>6. Wallah! We just installed Laika Proxy Extension!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-kovvutzp2av5hs7q.png" class="kg-image" alt="Introduction to Laika Proxy Extension" loading="lazy" width="2000" height="1253" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-kovvutzp2av5hs7q.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-kovvutzp2av5hs7q.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/0-kovvutzp2av5hs7q.png 1600w, https://nonthakon-blog.fly.dev/content/images/max/800/0-kovvutzp2av5hs7q.png 2000w" sizes="(min-width: 720px) 720px"></figure><p>Now you can use Laika with chain running using LocalOsmosis just as you use with other chains that we&#x2019;ve supported</p><hr><p>That&#x2019;s all for this article. Hope you guys like it! See you again next time! &#x1F603;</p><blockquote><strong><em>Connect with us</em></strong></blockquote><blockquote><em>Twitter: </em><a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener noopener"><em>https://twitter.com/getlaikaapp</em></a><br><em>Facebook: </em><a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener"><em>https://www.facebook.com/getlaikaapp/</em></a><br><em>Discord: </em><a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener"><em>https://discord.gg/4DzwHuxhcf</em></a></blockquote>]]></content:encoded></item><item><title><![CDATA[Explore Lens Protocol with Laika]]></title><description><![CDATA[A lot of you might have heard about Lens Protocol. It’s a new Web3 social graph protocol built by the Aave team. To solve a lot of…]]></description><link>https://nonthakon-blog.fly.dev/explore-lens-protocol-with-laika/</link><guid isPermaLink="false">65260db4393b990137d44635</guid><category><![CDATA[Lens Protocol]]></category><category><![CDATA[Laika Blockchain Lab]]></category><category><![CDATA[Smart Contracts]]></category><category><![CDATA[Web3]]></category><category><![CDATA[Blockchain Development]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Mon, 27 Jun 2022 06:19:38 GMT</pubDate><content:encoded><![CDATA[<p>A lot of you might have heard about Lens Protocol. It&#x2019;s a new Web3 social graph protocol built by the Aave team. To solve a lot of significant issues in social media that we are currently using. For more details about Lens Protocol you can check out their documentation at <a href="https://docs.lens.xyz/docs/what-is-lens" rel="nofollow noopener">https://docs.lens.xyz/docs/what-is-lens</a></p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-22d7xkvzrnjqn-wkcfzapw.jpg" class="kg-image" alt loading="lazy" width="2000" height="1336" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-22d7xkvzrnjqn-wkcfzapw.jpg 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-22d7xkvzrnjqn-wkcfzapw.jpg 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-22d7xkvzrnjqn-wkcfzapw.jpg 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-22d7xkvzrnjqn-wkcfzapw.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><blockquote><strong>Introduction</strong></blockquote><blockquote>The Lens Protocol is a Web3 social graph on the Polygon Proof-of-Stake blockchain. It is designed to empower creators to own the links between themselves and their community, forming a fully composable, user-owned social graph. The protocol is built from the ground up with modularity in mind, allowing new features and fixes to be added while ensuring immutable user-owned content and social relationships.</blockquote><blockquote>&#x2014; <a href="https://docs.lens.xyz/docs/what-is-lens" rel="nofollow noopener noopener">https://docs.lens.xyz/docs/what-is-lens</a></blockquote><hr><p>This article aims to be a small article in that we&#x2019;re going to explore how we can use Laika to interact with Lens Protocol (It&#x2019;s going to be a fairly short article)</p><p>But here&#x2019;s the list of what we&#x2019;re going to do. In which I hope you could get a glimpse of how you can interact with Lens Protocol through Laika</p><p><strong>What we&#x2019;re going to do</strong></p><ul><li>We going to explore Lens Protocol on Polygon Mumbai Testnet</li><li>Create our own Lens Handle (xxx.lens) through <strong>MockProfileCreationProxy </strong>contract</li><li>Create a new post on Lens through <strong>LensHub Proxy</strong></li></ul><hr><h4 id="lens-protocol-overview"><strong>Lens Protocol Overview</strong></h4><p>The team at Lens Protocol designed it to be modular. this is so it is easy to scale the community of Lens Protocol itself. Lens Protocol tokenizes a lot of functionality into ERC721-compliant. So if someone wanted to add more features to Lens Protocol. They just write a new module and then plug it into it. Simple as that!</p><p>The smart contract that you&#x2019;ll be going to interact with a lot is called <strong>&#x201C;Lens Hub&#x201D;</strong>. This is where Lens Protocol places the entry point for the majority of interactions with its protocol.</p><p>For the list of contracts deployed on each chain you can look for it here: <a href="https://docs.lens.xyz/docs/deployed-contract-addresses" rel="nofollow noopener">https://docs.lens.xyz/docs/deployed-contract-addresses</a></p><hr><blockquote>Before beginning with anything make sure you have MATIC in your wallet on Mumbai Testnet. You can request tokens here <a href="https://faucet.polygon.technology/" rel="nofollow noopener">https://faucet.polygon.technology/</a></blockquote><hr><h4 id="create-lens-profile"><strong>Create Lens Profile</strong></h4><p>To create a Lens Profile on Polygon Mumbai is using a little bit different way than other interactions. As I wrote above that you&#x2019;ll have to interact with <strong>Lens Hub. </strong>Well, this is not the case haha.</p><p>Lens Protocol has a whitelist of people who could create a Lens Profile. Typically, Our address is not in there. But we could create Lens Profile by creating it through the <strong>MockProfileCreationProxy </strong>contract. Which is going to be a proxy that gave us permission to create a new Profile.</p><blockquote>For Polygon Mumbai MockProfileCreationProxy is deployed at <a href="https://mumbai.polygonscan.com/address/0x420f0257D43145bb002E69B14FF2Eb9630Fc4736" rel="noopener">0x420f0257D43145bb002E69B14FF2Eb9630Fc4736</a></blockquote><p>Alright! Let&#x2019;s do it then.</p><p>To make it easier for you guys to follow this tutorial. I exported collections that we&#x2019;re going to use in this article. You can download it from gist here.</p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/b337023202121fbbebe9b4514a79fb82.js"></script><!--kg-card-end: html--><p>Then open Laika at <a href="http://web.getlaika.app" rel="noopener">web.getlaika.app</a> Click on Import Collection. Then drop in the JSON file you just downloaded.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-bambupglashkncmbcaiq9q.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-bambupglashkncmbcaiq9q.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-bambupglashkncmbcaiq9q.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-bambupglashkncmbcaiq9q.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-bambupglashkncmbcaiq9q.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>You&#x2019;re going to see lists of requests that I&#x2019;ve prepared. Feels free to look around!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-nmokkuyyy5iku_1ietu1fw.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-nmokkuyyy5iku_1ietu1fw.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-nmokkuyyy5iku_1ietu1fw.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-nmokkuyyy5iku_1ietu1fw.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-nmokkuyyy5iku_1ietu1fw.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>The request that we&#x2019;re going to use to create a profile is called <strong>&#x201C;proxyCreateProfile&#x201D; </strong>so let&#x2019;s get to it!</p><p>But before we&#x2019;re doing anything you&#x2019;ll notice that. it shows an <strong>Invalid address </strong>under the contract address field. This is because I put in the environment variable with the name <strong>MOCK_PROFILE_CREATOR_PROXY.</strong></p><p>We have to set this up before going next!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-l6rb8ipm7f4c0as7xecknq.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-l6rb8ipm7f4c0as7xecknq.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-l6rb8ipm7f4c0as7xecknq.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-l6rb8ipm7f4c0as7xecknq.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-l6rb8ipm7f4c0as7xecknq.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>Let&#x2019;s hit the environment variables button (The globe icon) on the left side of the UI. Then hit <strong>New </strong>Button to create a new one.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-_rlisdvbwkjcldwy5-dvcg.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-_rlisdvbwkjcldwy5-dvcg.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-_rlisdvbwkjcldwy5-dvcg.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-_rlisdvbwkjcldwy5-dvcg.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-_rlisdvbwkjcldwy5-dvcg.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>Now just add new variables to it.</p><blockquote><em>Here I added </em><br><em>LENS_HUB = </em>0x60Ae865ee4C725cd04353b5AAb364553f56ceF82<br>MOCK_PROFILE_CREATOR_PROXY = <em>0x420f0257D43145bb002E69B14FF2Eb9630Fc4736</em><br><em>Which is address of both of these contracts on Polygon Mumbai</em></blockquote><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-hbqktlytimvsm2nvpn8g0q.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-hbqktlytimvsm2nvpn8g0q.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-hbqktlytimvsm2nvpn8g0q.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-hbqktlytimvsm2nvpn8g0q.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-hbqktlytimvsm2nvpn8g0q.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>And then change our Environment variables to the environment we just created.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-9d1-d1peqgjtz-1piohfqg.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-9d1-d1peqgjtz-1piohfqg.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-9d1-d1peqgjtz-1piohfqg.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-9d1-d1peqgjtz-1piohfqg.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-9d1-d1peqgjtz-1piohfqg.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>Now Let&#x2019;s fill in the parameters.</p><blockquote>to = your address<br>handle = your desired lens handle<br>imageURI = link to your profile pic<br>followModule = address to follow module (This is add when you want some fancy logic happen when someone follow you. In this case we just put Null Address to it)<br>followModuleInitData = data that use to initialized follow module<br>followNFTURI = uri for followNFT</blockquote><p>And here is a list of what I put</p><blockquote>to = &lt;My Address&gt;<br>handle = &lt;My Desired Handle&gt;<br>imageURI = <a href="https://nonthakon-blog.fly.dev/content/images/ipfs/qmy9duwyu67puawbmxrkw98lpbxcznpwhubhx5newncjbx.jpg" rel="nofollow noopener">/content/images/ipfs/qmy9duwyu67puawbmxrkw98lpbxcznpwhubhx5newncjbx.jpg</a><br>followModule = 0x0000000000000000000000000000000000000000<br>followModuleInitData = 0x00<br>followNFTURI = <a href="https://nonthakon-blog.fly.dev/content/images/ipfs/qmtflsxdeq6qsszaxacsntiv6wa56qq87ytxj182dxdqjs.jpg" rel="nofollow noopener">/content/images/ipfs/qmtflsxdeq6qsszaxacsntiv6wa56qq87ytxj182dxdqjs.jpg</a></blockquote><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-ocuqx4paxzohivtajkjudg.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-ocuqx4paxzohivtajkjudg.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-ocuqx4paxzohivtajkjudg.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-ocuqx4paxzohivtajkjudg.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-ocuqx4paxzohivtajkjudg.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>Now that you filled all of the parameters. Let&#x2019;s go ahead and click send to create a new Profile!</p><p>And then after the transaction is complete. You&#x2019;re going to have a new Lens Profile of yourself. (You can check the transaction at Polygonscan to verify it too)</p><p>Let&#x2019;s see what it looks like!</p><p>I go to tokenOfOwnerByIndex of LensHub contract. go ahead and just out our address (That we just minted a new profile by) and index of 0</p><p>It&#x2019;s going to return us the tokenID of our profile. So that we can use it to query for data again via <strong>getProfile</strong> request.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-3cdwxzjeochf1eavofungw.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-3cdwxzjeochf1eavofungw.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-3cdwxzjeochf1eavofungw.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-3cdwxzjeochf1eavofungw.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-3cdwxzjeochf1eavofungw.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>Now I just query for the <strong>getProfile</strong> method. You&#x2019;ll see the details of my Lens Profile here.</p><p>There are also a lot of other methods to call to get data like<strong> tokenURI, tokenDataOf </strong>But I&#x2019;ll leave it for you guys to check out!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-a02ieb-mkdntubgjawdxba.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-a02ieb-mkdntubgjawdxba.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-a02ieb-mkdntubgjawdxba.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-a02ieb-mkdntubgjawdxba.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-a02ieb-mkdntubgjawdxba.png 2400w" sizes="(min-width: 720px) 720px"></figure><hr><blockquote>Tips: We&#x2019;re going to reuse ProfileID a lot it will be really handy if we store it as a Environment Variable!</blockquote><h4 id="publish-a-post"><strong>Publish a Post</strong></h4><p>Now that we have our own Lens Profile. Let&#x2019;s get to create a new post!</p><p>Just look for the method <strong>post </strong>inside the Lens Hub folder. This is the method we&#x2019;re going to use to publish a post.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-ptk6f-oihsjfrdcu_mosyq.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-ptk6f-oihsjfrdcu_mosyq.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-ptk6f-oihsjfrdcu_mosyq.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-ptk6f-oihsjfrdcu_mosyq.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-ptk6f-oihsjfrdcu_mosyq.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>Now Let&#x2019;s fill in the parameters</p><blockquote>profileId = your profile id from previous<br>contentURI = URI to the content of the post<br>collectModule = address to collect module (remember about follow module? this is similar to it. since anyone can collect any post you who post the content can specify how the collect process is going to be like)<br>collectModuleInitData = data that use to initialized collect module<br>referenceModule = address to reference module<br>collectModuleInitData = data that use to initialized reference module</blockquote><p>Again here&#x2019;s a list of what I put</p><blockquote>profileId = 13329<br>contentURI = <a href="https://ipfs.io/ipfs/Qmby8QocUU2sPZL46rZeMctAuF5nrCc7eR1PPkooCztWPz" rel="nofollow noopener">https://ipfs.io/ipfs/Qmby8QocUU2sPZL46rZeMctAuF5nrCc7eR1PPkooCztWPz</a><br>collectModule = 0x0BE6bD7092ee83D44a6eC1D949626FeE48caB30c<br>collectModuleInitData = 0x0000000000000000000000000000000000000000000000000000000000000001<br>referenceModule = 0x0000000000000000000000000000000000000000<br>collectModuleInitData = 0x00</blockquote><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-mtxr-g3nzjnrbhpc48kiya.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-mtxr-g3nzjnrbhpc48kiya.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-mtxr-g3nzjnrbhpc48kiya.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-mtxr-g3nzjnrbhpc48kiya.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-mtxr-g3nzjnrbhpc48kiya.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>And after we publish a new post you can read it using method <strong>getPub</strong></p><blockquote>Here I put pubId = 1 because the index in Lens starts with 1!</blockquote><p>And Wallah! We&#x2019;ve got our post now!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-v7j9kykpob2jg0snqsfzfq.png" class="kg-image" alt loading="lazy" width="2000" height="1133" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-v7j9kykpob2jg0snqsfzfq.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-v7j9kykpob2jg0snqsfzfq.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-v7j9kykpob2jg0snqsfzfq.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-v7j9kykpob2jg0snqsfzfq.png 2400w" sizes="(min-width: 720px) 720px"></figure><hr><p>And that&#x2019;s it! We just create a new Lens Profile and Publish a new post on Lens Protocol! For more information about Lens Protocol please refer to their official documentation at <a href="https://docs.lens.xyz/docs" rel="nofollow noopener">https://docs.lens.xyz/docs</a></p><p>That&#x2019;s all for this article. Hope you guys like it! See you again next time! &#x1F603;</p><hr><blockquote><strong><em>Connect with us</em></strong></blockquote><blockquote><em>Facebook: </em><a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener"><em>https://www.facebook.com/getlaikaapp/</em></a><br><em>Discord: </em><a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener"><em>https://discord.gg/4DzwHuxhcf</em></a><br><em>Twitter: </em><a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener"><em>https://twitter.com/getlaikaapp</em></a></blockquote>]]></content:encoded></item><item><title><![CDATA[Explore Seaport Gas Optimization with Laika]]></title><description><![CDATA[As you might know, OpenSea just released the new SeaPort, a brand new NFT Marketplace that is efficient in terms of gas-saving (and more).]]></description><link>https://nonthakon-blog.fly.dev/explore-seaport-gas-optimization/</link><guid isPermaLink="false">65260db4393b990137d44636</guid><category><![CDATA[Solidity]]></category><category><![CDATA[Smart Contracts]]></category><category><![CDATA[Ethereum]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Tue, 31 May 2022 07:12:51 GMT</pubDate><media:content url="https://nonthakon-blog.fly.dev/content/images/max/800/1-xzyyyvavfy4volxadgx5sg-2.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-xzyyyvavfy4volxadgx5sg-2.jpg" alt="Explore Seaport Gas Optimization with Laika"><p>As you might know, OpenSea just released the new SeaPort, a brand new NFT Marketplace that is efficient in terms of gas-saving (and more).</p><p>This article will be about what Seaport does for their gas optimization as well as how you can poke Seaport smart contracts using Laika.</p><hr><blockquote>My inspiration for this article came from gist posted by ecmendenhall <a href="https://gist.github.com/ecmendenhall/9408082d8f3cfe50076642d8745fc6d3?fbclid=IwAR2hKI240Agtp7nSP4pPyZd7uztwPIbJBKgwL84vhtEnzA40Y1e_TO8HBGs" rel="noopener">here</a>. I liked the way they (OpenSea) did for their smart contracts optimization so I figured let&#x2019;s take some part of it to be article!</blockquote><hr><p>In this article, we&#x2019;re going to talk a little bit about Ethereum Calldata. If you never heard of it before I advise you quickly check the article below here before continuing here:</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://medium.com/laika-lab/get-to-know-ethereum-calldata-72f65e8bffef"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Get to know Ethereum Calldata</div><div class="kg-bookmark-description">This article explain what Ethereum Calldata is and how it&#x2019;s structured.</div><div class="kg-bookmark-metadata"><span class="kg-bookmark-author">medium.com</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://nonthakon-blog.fly.dev/content/images/fit/c/160/160/1-7kus-s9nmtsso1hq3q_npw.jpg" alt="Explore Seaport Gas Optimization with Laika"></div></a></figure><p>And some of the Assembly here:</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://jeancvllr.medium.com/solidity-tutorial-all-about-assembly-5acdfefde05c"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Solidity Tutorial&amp;nbsp;: all about Assembly</div><div class="kg-bookmark-description">What is Assembly&amp;nbsp;?</div><div class="kg-bookmark-metadata"><span class="kg-bookmark-author">jeancvllr.medium.com</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://nonthakon-blog.fly.dev/content/images/fit/c/160/160/1-ocolqtxw8kfq1ehf_jibyq.jpg" alt="Explore Seaport Gas Optimization with Laika"></div></a></figure><hr><p>The smart contract that we&#x2019;re going to look at today is going to be <strong>Seaport </strong>smart contract. And to be more specific we&#x2019;re going to look at how they implement their transfer on their <strong>_performERC20Transfer() </strong>function. So let&#x2019;s look into it!</p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/0adc1f670d3835149a4ce4b1f8b3f8b4.js"></script><!--kg-card-end: html--><p>As you can see that it is fairly long here. To make it easier to look at, I&#x2019;m going to summarize what they do before we&#x2019;re going to look at it.</p><p>They simply optimize their token transfer by instead of calling a function from another smart contract the ordinary way we use in Solidity they turn it into assembly and perform the call process by themself. (As you can see from lines 10&#x2013;199)</p><p>Their smart contract consists of a few parts where they have to</p><ul><li>Constructing Ethereum Call data</li><li>Call it on another smart contract</li><li>Handle Errors</li><li>Clean up</li></ul><p>Let&#x2019;s look into it part by part!</p><ol><li><strong>Constructing Ethereum Calldata</strong></li></ol><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-jq0fj7tnw8gmf9wi_f5xhg.png" class="kg-image" alt="Explore Seaport Gas Optimization with Laika" loading="lazy" width="1274" height="498" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-jq0fj7tnw8gmf9wi_f5xhg.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-jq0fj7tnw8gmf9wi_f5xhg.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/1-jq0fj7tnw8gmf9wi_f5xhg.png 1274w" sizes="(min-width: 720px) 720px"></figure><p>The code above is from lines 11&#x2013;22. What they do is just load new memory using <strong>mload </strong>and call that <strong>memPointer.</strong></p><p>After that things were fairly simple. They add numbers of values into that memory by storing them using <strong>mstore </strong>function.</p><p>After this finish, the memPointer would be storing something similar to(Function Signature) + (from arg) + (to arg) + (amount arg)</p><p>then we&#x2019;re ready to go to the next part.</p><p><strong>2. Call it on another smart contract</strong></p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-6-io6wkk2lnknyezzxfftw.png" class="kg-image" alt="Explore Seaport Gas Optimization with Laika" loading="lazy" width="1150" height="960" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-6-io6wkk2lnknyezzxfftw.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-6-io6wkk2lnknyezzxfftw.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/1-6-io6wkk2lnknyezzxfftw.png 1150w" sizes="(min-width: 720px) 720px"></figure><p>For this part, we use the calldata we construct on the above to call to another smart contract. Hereafter the contract is called we store the data into the variable <strong>callStatus</strong>. and then check if the call is a success by using a beautiful trick on lines 37&#x2013;46</p><p><strong>3. Handle Errors</strong></p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/a296b04e7696b0d464adad8c7002ce60.js"></script><!--kg-card-end: html--><p>Alright, this is the part where it&#x2019;s the longest. But the reason that it&#x2019;s quite long is that there are a number of cases where the call could go wrong not because it was complicated.</p><p>To make this article small I will show you just how we could add a revert message using Solidity. (If you are interesting in a more complicated situation I advise you look deeply into the codebase)// Otherwise revert with error about token not having code: &#xA0; &#xA0; &#xA0; &#xA0;mstore(NoContract_error_sig_ptr, NoContract_error_signature) &#xA0; &#xA0; &#xA0; &#xA0;mstore(NoContract_error_token_ptr, token) &#xA0; &#xA0; &#xA0; &#xA0;revert(NoContract_error_sig_ptr, NoContract_error_length)</p><p>This is from lines 137&#x2013;140. As you can see it&#x2019;s quite similar to what we do at <strong>1.</strong> <strong>Constructing Ethereum Calldata. </strong>What we&#x2019;re doing here was to store the data into some memory and then just call <strong>revert()</strong> to let it revert the transaction.</p><p><strong>4. Clean up</strong>// Restore the original free memory pointer. &#xA0; &#xA0; &#xA0; &#xA0; &#xA0; &#xA0;mstore(FreeMemoryPointerSlot, memPointer)// Restore the zero slot to zero.<br>mstore(ZeroSlot, 0)</p><p>To clean up the memory there were simply just 2 lines of code (from lines 195&#x2013;199)</p><p>We clean up the memory since there might be some function that runs after this function that wants to use a memory.</p><hr><p>Alright! So this is just a small walkthrough of <strong>_performERC20Transfer() </strong>there were several examples like this in <strong>Seaport</strong> smart contract which really fun to look at. And if you want to look at their smart contracts Laika would be really helpful when you want to try to look at some functions.</p><p>Let&#x2019;s see how we could use Laika to help poke their smart contract!</p><p>But first let&apos;s get where the smart contracts are you can look where they deploy their smart contracts here: <a href="https://github.com/ProjectOpenSea/seaport" rel="nofollow noopener">https://github.com/ProjectOpenSea/seaport</a></p><p>(I will use Rinkeby in this case)</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-lxmeybxoa7m8or1izaauww.png" class="kg-image" alt="Explore Seaport Gas Optimization with Laika" loading="lazy" width="1230" height="1084" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-lxmeybxoa7m8or1izaauww.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-lxmeybxoa7m8or1izaauww.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/1-lxmeybxoa7m8or1izaauww.png 1230w" sizes="(min-width: 720px) 720px"></figure><p>To import their smart contract in Laika is fairly simple just click on the <strong>New</strong> button here.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-xxrkypjub7cu3wlthlztoq.png" class="kg-image" alt="Explore Seaport Gas Optimization with Laika" loading="lazy" width="532" height="158"></figure><p>Select <strong>Chain Explorer</strong></p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-thb684rxc8zw7x7ussqiug.png" class="kg-image" alt="Explore Seaport Gas Optimization with Laika" loading="lazy" width="1562" height="764" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-thb684rxc8zw7x7ussqiug.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-thb684rxc8zw7x7ussqiug.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/1-thb684rxc8zw7x7ussqiug.png 1562w" sizes="(min-width: 720px) 720px"></figure><p>Copy and Paste the address, Pick your desired chain. and then hit <strong>import</strong> button</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-5q9nueiqakbpwzxd1vgiew.png" class="kg-image" alt="Explore Seaport Gas Optimization with Laika" loading="lazy" width="1562" height="764" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-5q9nueiqakbpwzxd1vgiew.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-5q9nueiqakbpwzxd1vgiew.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/1-5q9nueiqakbpwzxd1vgiew.png 1562w" sizes="(min-width: 720px) 720px"></figure><p>Done! Here&#x2019;s a list of requests that you can try playing with their smart contracts.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-1v5vcbnexihmzjcaya1x5g.png" class="kg-image" alt="Explore Seaport Gas Optimization with Laika" loading="lazy" width="2000" height="1155" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-1v5vcbnexihmzjcaya1x5g.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-1v5vcbnexihmzjcaya1x5g.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-1v5vcbnexihmzjcaya1x5g.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-1v5vcbnexihmzjcaya1x5g.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>Another really cool feature in Laika is that it can auto-generate the Ethereum Call Data for you. This would be really convenient if you want to try to optimize your smart contract using Assembly</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-m_3xx8eltx0l4jq0e15nya.png" class="kg-image" alt="Explore Seaport Gas Optimization with Laika" loading="lazy" width="2000" height="1218" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-m_3xx8eltx0l4jq0e15nya.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-m_3xx8eltx0l4jq0e15nya.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-m_3xx8eltx0l4jq0e15nya.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-m_3xx8eltx0l4jq0e15nya.png 2400w" sizes="(min-width: 720px) 720px"></figure><hr><p>Alright! That&#x2019;s it for today. Hope you find it useful &#x1F603; See you next time!</p><blockquote><strong><em>Connect with us</em></strong></blockquote><blockquote><em>Facebook: </em><a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener"><em>https://www.facebook.com/getlaikaapp/</em></a><br><em>Discord: </em><a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener"><em>https://discord.gg/4DzwHuxhcf</em></a><br><em>Twitter: </em><a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener"><em>https://twitter.com/getlaikaapp</em></a></blockquote>]]></content:encoded></item><item><title><![CDATA[Introduction to hardhat-laika]]></title><description><![CDATA[Hi, Buidlers! 🙌 In this article I want to introduce you to another great thing that we’ve been working on lately. It’s a Hardhat plugin…]]></description><link>https://nonthakon-blog.fly.dev/introduction-to-hardhat-laika/</link><guid isPermaLink="false">65260db4393b990137d44637</guid><category><![CDATA[Laika Blockchain Lab]]></category><category><![CDATA[Hard Hat]]></category><category><![CDATA[Ethereum]]></category><category><![CDATA[Smart Contracts]]></category><category><![CDATA[Blockchain]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Sun, 20 Feb 2022 12:15:23 GMT</pubDate><media:content url="https://nonthakon-blog.fly.dev/content/images/max/800/1-4vnrptvp6nslpla7u7x5rg-2.png" medium="image"/><content:encoded><![CDATA[<img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-4vnrptvp6nslpla7u7x5rg-2.png" alt="Introduction to hardhat-laika"><p>Hi, Buidlers! &#x1F64C; In this article I want to introduce you to another great thing that we&#x2019;ve been working on lately. It&#x2019;s a Hardhat plugin called <strong>&#x201C;hardhat-laika&#x201D;</strong></p><p><strong>What is hardhat-laika ?</strong></p><p>hardhat-laika is a Hardhat plugin that helps you sync your compiled contract with Laika. So you can make a request without having to write a single line of code.</p><p>And also, Boost your performance when working with Hardhat &#x1F4AA;</p><p><strong>Let&#x2019;s try it out!</strong></p><p>First, you going to need to start a new Hardhat project.npx hardhat init</p><p>Then, pick a configuration you like (I pick this specific configuration because I need Greeter.sol as an example contract so we could get going easily)&#x221A; What do you want to do? &#xB7; Create a basic sample project<br>&#x221A; Hardhat project root: &#xB7; /path/to/project/<br>&#x221A; Do you want to add a .gitignore? (Y/n) &#xB7; y<br>&#x221A; Do you want to install this sample project&apos;s dependencies with npm (...)? (Y/n) &#xB7; y</p><p>After the setup is completed let&#x2019;s install hardhat-laikanpm i hardhat-laika</p><p>Now, import it to your hardhat.config.js (By adding require(&#x2026;) on the top)</p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/b3a7e1dade2f0c89f2b41c9731565001.js"></script><!--kg-card-end: html--><p>Alright, now we&#x2019;re all set. Let&#x2019;s try to use it!</p><p>There are 2 ways to use hardhat-laika 1. using it through the command line and 2. using it through your own scripts (hardhat-laika define task is hre so you can use it easily)</p><p>Let&#x2019;s try the first way.</p><ol><li><strong>Command-Line way</strong></li></ol><p>First, Let&#x2019;s compile our contract so we get the ABIs.npx hardhat compile</p><p>Then, use the <strong>laika-sync </strong>task to sync it to Laikanpx hardhat laika-sync --contract &lt;contract_name&gt; --address &lt;OPTIONAL address_of_that_contract&gt;</p><p>For this example, I&#x2019;ll use the commandnpx hardhat laika-sync --contract Greeter --address 0x5FbDB2315678afecb367f032d93F642f64180aa</p><p>You should be able to see something like this.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-2bkx75lbofii1pl_ucda1a.gif" class="kg-image" alt="Introduction to hardhat-laika" loading="lazy" width="616" height="338" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-2bkx75lbofii1pl_ucda1a.gif 600w, https://nonthakon-blog.fly.dev/content/images/max/800/1-2bkx75lbofii1pl_ucda1a.gif 616w"><figcaption>laika-sync task</figcaption></figure><p><strong>2. Script way</strong></p><p>Let&#x2019;s take a look at scripts/sample-script.js</p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/d9e0137c2005a2c91fc8c2e43c13b44f.js"></script><!--kg-card-end: html--><p>I just have to simply add hre.run() to line 25 and we&#x2019;ll all set! Let&#x2019;s run it using the command.npx hardhat run scripts/sample-script.js</p><p>You should be able to see something like this.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-sjvc6bi5sieuakbu.gif" class="kg-image" alt="Introduction to hardhat-laika" loading="lazy" width="600" height="330" srcset="https://nonthakon-blog.fly.dev/content/images/max/800/0-sjvc6bi5sieuakbu.gif 600w"></figure><hr><p>Alright! That&#x2019;s it for today. Hope you find it useful &#x1F603; See you next time!</p><blockquote><strong>Connect with us</strong></blockquote><blockquote>Facebook: <a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener">https://www.facebook.com/getlaikaapp/</a><br>Discord: <a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener">https://discord.gg/4DzwHuxhcf</a><br>Twitter: <a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener">https://twitter.com/getlaikaapp</a></blockquote>]]></content:encoded></item><item><title><![CDATA[Build your own Custom Hardhat Plugins from scratch]]></title><description><![CDATA[If you’ve been using Hardhat for a while, there might be some situations where you have some tasks that you perform regularly (eg. remove…]]></description><link>https://nonthakon-blog.fly.dev/build-your-own-custom-hardhat-plugins-from-scratch/</link><guid isPermaLink="false">65260db4393b990137d44638</guid><category><![CDATA[Ethereum]]></category><category><![CDATA[Smart Contracts]]></category><category><![CDATA[Development]]></category><category><![CDATA[Laika Blockchain Lab]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Thu, 17 Feb 2022 13:27:23 GMT</pubDate><media:content url="https://nonthakon-blog.fly.dev/content/images/max/800/1--r-cf7o8lgmlxqpylhygjg-2.png" medium="image"/><content:encoded><![CDATA[<img src="https://nonthakon-blog.fly.dev/content/images/max/800/1--r-cf7o8lgmlxqpylhygjg-2.png" alt="Build your own Custom Hardhat Plugins from scratch"><p>If you&#x2019;ve been using Hardhat for a while, there might be some situations where you have some tasks that you perform regularly (eg. remove console.log from your code). In that case, it would be really helpful to create some tasks or some plugins to reuse later.</p><p>So, in this article, we&#x2019;re going to walk through how we can create a new custom hardhat plugin from scratch (really really from scratch).</p><h3 id="what-we-going-to-create">What we going to create</h3><p>In this article, I&#x2019;m going to walk through how I write a custom plugin called hardhat-laika which is the plugin that going to sync ABI of artifacts generate from Hardhat to an application called <strong>Laika</strong></p><blockquote>If you don&#x2019;t know what Laika is, Laika is a Blockchain development tool that helps you request smart contracts without having the hassle of writing a single line of code&#x200A;&#x2014;&#x200A;a postman for web3!</blockquote><h3 id="how-does-it-work">How does it work?</h3><p>How hardhat-laika is going to work is really simple. It works as follows.</p><ol><li>get the compiled artifacts from specific contracts</li><li>send its ABI to <a href="https://api.getlaika.app" rel="noopener">https://api.getlaika.app</a></li><li>get a response from it then generate a new URL so user can access their own contract through Laika</li></ol><p>Alright, as you can see the purpose of it is pretty specific (it is not too simple or too complicated so I think it would be a pretty good example to walk through together).</p><p>So I want to encourage you guys to think about something you want to do yourself and follow along.</p><p>And by all means, I&#x2019;m no expert in building a custom Hardhat plugin so if you want to add some suggestions I&#x2019;m really welcome for it!</p><h3 id="what-exactly-are-hardhat-plugins">What exactly are Hardhat plugins?</h3><p>According to <a href="https://hardhat.org/advanced/building-plugins.html" rel="noopener">https://hardhat.org/advanced/building-plugins.html</a></p><p>Hardhat plugins are reusable configurations or anything you can add to your config file you can pack it together to create another plugin.</p><p>Yep, so the easiest way to build a Hardhat plugin is to get started on your hardhat.config.js!</p><h3 id="so-what-can-you-do-with-the-hardhat-plugin">So what can you do with the Hardhat plugin?</h3><p>As said in the documentation, you can do whatever you want on your config file. Let&#x2019;s list them out so we can get the idea.</p><ul><li>Extending environment (adding a new property to &#x201C;hre&#x201D; object)</li><li>Extending configurations</li><li>Create some tasks (<a href="https://hardhat.org/guides/create-task.html" rel="noopener">https://hardhat.org/guides/create-task.html</a>)</li></ul><p>and that&#x2019;s about it!</p><h3 id="let-s-scaffold-our-plugin-on-the-config-file">Let&#x2019;s scaffold our plugin on the config file</h3><p>Before anything else, let&#x2019;s create a new Hardhat project by using the commandnpx hardhat init</p><p>Then, set it up however you like, but for me, I will use this configuration.&#x221A; What do you want to do? &#xB7; Create a basic sample project<br>&#x221A; Hardhat project root: &#xB7; /path/to/project/<br>&#x221A; Do you want to add a .gitignore? (Y/n) &#xB7; y<br>&#x221A; Do you want to install this sample project&apos;s dependencies with npm (...)? (Y/n) &#xB7; y</p><p>Because I want my hardhat-laika plugin that when I install it I would be able to do something like.npx hardhat laika-sync --contract &lt;name&gt; --address &lt;address&gt;</p><p>Absolutely, The first thing I have to do is to create a new task for that.</p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/75893950dab7ea2024b585cf54923f1c.js"></script><!--kg-card-end: html--><p>The things that we are doing with this task are really simple and the thing is that this is all we have to do for the task that I want. We get the ABI and contract address upload it to Laika&#x2019;s backend then generate a new URL so users can access it through the browsers.</p><p>Notice that I&#x2019;ve been using &#x201C;open&#x201D; (to open up the browser) and node-fetch so don&#x2019;t forget to install it!</p><p>Alright, let&#x2019;s try it :))</p><p>First I use the command</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-ed3zunajucehbss2.png" class="kg-image" alt="Build your own Custom Hardhat Plugins from scratch" loading="lazy" width="1586" height="88" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-ed3zunajucehbss2.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-ed3zunajucehbss2.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-ed3zunajucehbss2.png 1586w" sizes="(min-width: 720px) 720px"></figure><p>Then the plugin would open up the browser and we&#x2019;ll see the collection that is going to be imported.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-xczctnqpi3aijv4k.png" class="kg-image" alt="Build your own Custom Hardhat Plugins from scratch" loading="lazy" width="2000" height="1202" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-xczctnqpi3aijv4k.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-xczctnqpi3aijv4k.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/0-xczctnqpi3aijv4k.png 1600w, https://nonthakon-blog.fly.dev/content/images/max/800/0-xczctnqpi3aijv4k.png 2000w" sizes="(min-width: 720px) 720px"></figure><p>Cool!</p><h3 id="now-let-s-move-it-to-plugin">Now Let&#x2019;s move it to Plugin</h3><p>When building a new plugin, I really recommend you to use boilerplate provided by Nomiclabs which you can find here <a href="https://github.com/nomiclabs/hardhat-ts-plugin-boilerplate/" rel="noopener">https://github.com/nomiclabs/hardhat-ts-plugin-boilerplate/</a></p><p>Try looking around the repo to see how things link together.</p><p>Another great way to explore how things link together is by looking around other plugins if you&#x2019;re really getting started there are a lot of small plugins that you could go look around.</p><p>eg.</p><ul><li>hardhat-fund-link (<a href="https://github.com/appliedblockchain/chainlink-consumer/tree/master/plugins/fund-link" rel="noopener">https://github.com/appliedblockchain/chainlink-consumer/tree/master/plugins/fund-link</a>)</li><li>hardhat-log-remover (<a href="https://github.com/ItsNickBarry/hardhat-log-remover" rel="noopener">https://github.com/ItsNickBarry/hardhat-log-remover</a>)</li></ul><p>Alright so first thing first let&#x2019;s clone the boilerplate to our Hardhat project (You can also click use as a template and just clone that repo)</p><p>git clone <a href="https://github.com/nomiclabs/hardhat-ts-plugin-boilerplate.git" rel="noopener">https://github.com/nomiclabs/hardhat-ts-plugin-boilerplate.git</a></p><p>Then let&#x2019;s head to type-extensions.ts (I find it easier for me to set things up what it should look like first)</p><p>I&#x2019;m going to put this code in that file.</p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/44a286fb762915ac481753a6818ef96d.js"></script><!--kg-card-end: html--><p>This chunk of code is where I describe the interface of the task I created (laikaSync)</p><p>Next, let&#x2019;s move our task to the plugin. I&#x2019;m going to create a new folder call tasks and create a new file in that folder name laika-sync.ts (So when we have more and more tasks every task will not be mixed up in index.ts)</p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/83df1291fe5c2ccf9dd35ff85c4211e5.js"></script><!--kg-card-end: html--><p>I move the task from hardhat.config.js to here. You might notice that I have changed the code structure a little bit to make it more versatile (hopefully lol). Also, you might notice that I have imported endpoint URL from config</p><p>So let&#x2019;s create it.</p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/71c8d277cc2610407e73ca139a469e6c.js"></script><!--kg-card-end: html--><p>Yep, this is quite simple. Now let&#x2019;s move to our index.ts</p><!--kg-card-begin: html--><script src="https://gist.github.com/nonkung51/6aec302257acec9e58be6bc9d9095c43.js"></script><!--kg-card-end: html--><p>Also, quite simple haha. In this file, I just extend the environment by adding laikaSync to the hre. And this is about it! your plugin is ready &#x1F440;</p><h3 id="let-s-test-it-publish">Let&#x2019;s test it &amp; publish</h3><blockquote><em>Because our plugin is written in Typescript so don&#x2019;t forget to build it!</em></blockquote><p>After I clone the boilerplate I change the name to hardhat-laika</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-yjyw1gcv8udpzslg.png" class="kg-image" alt="Build your own Custom Hardhat Plugins from scratch" loading="lazy" width="534" height="616"></figure><p>So when I&#x2019;m going to use it I would have to add require(&#x201D;./hardhat-laika&#x201D;) to my hardhat.config.js (the root of project one)</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-1sytwpybjcigjzll.png" class="kg-image" alt="Build your own Custom Hardhat Plugins from scratch" loading="lazy" width="1558" height="94" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-1sytwpybjcigjzll.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-1sytwpybjcigjzll.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-1sytwpybjcigjzll.png 1558w" sizes="(min-width: 720px) 720px"></figure><p>Yep! It&#x2019;s still working like expected! Anyway, It would be a great idea if we write a test script for it but that&#x2019;s the topic for another article! &#x1F440;</p><p>If you want to publish to npm and have never done it before just head to <a href="https://docs.npmjs.com/cli/v8/commands/npm-publish" rel="noopener">https://docs.npmjs.com/cli/v8/commands/npm-publish</a> for more information.</p><hr><p>Phew~, That was a lot to cover. Thanks a lot for reading up until this point! Hope you get a grasp of how to build a new Hardhat plugin.</p><p>Anyway if you have time I really encourage you to try hardhat-laika with Laika out here: <a href="https://www.npmjs.com/package/hardhat-laika" rel="noopener">https://www.npmjs.com/package/hardhat-laika</a></p><p>We will surely have more articles about how to use hardhat-laika out soon. Stay tuned!</p><p>See ya next time &#x1F603;</p><hr><blockquote><strong><em>Connect with us</em></strong></blockquote><blockquote><em>Facebook: </em><a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener"><em>https://www.facebook.com/getlaikaapp/</em></a><br><em>Discord: </em><a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener"><em>https://discord.gg/4DzwHuxhcf</em></a><br><em>Twitter: </em><a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener"><em>https://twitter.com/getlaikaapp</em></a></blockquote>]]></content:encoded></item><item><title><![CDATA[Laika Blockchain Lab (12 Feb 2022 Update)]]></title><description><![CDATA[Hello there! 😃 It’s nice to see you guys again!]]></description><link>https://nonthakon-blog.fly.dev/laika-blockchain-lab-12-feb-2022-update/</link><guid isPermaLink="false">65260db4393b990137d44639</guid><category><![CDATA[Laika Blockchain Lab]]></category><category><![CDATA[Smart Contracts]]></category><category><![CDATA[Ethereum]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Blockchain]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Sat, 12 Feb 2022 10:12:25 GMT</pubDate><media:content url="https://nonthakon-blog.fly.dev/content/images/max/800/1-beoi6en8i0_qhsgaiylqlw-2.png" medium="image"/><content:encoded><![CDATA[<img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-beoi6en8i0_qhsgaiylqlw-2.png" alt="Laika Blockchain Lab (12 Feb 2022 Update)"><p>Hello there! &#x1F603; It&#x2019;s nice to see you guys again!</p><p>This blog is intended to be the update of what we have been doing since the last update. Let&#x2019;s go!&#x1F440;</p><hr><ol><li><strong>Variable Suggestion </strong>&#x1F916;</li></ol><p>We added the variable suggestions (for environment variables, etc.) hope this comes in handy!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-bpdmrepjzglqwxto9trmtq.png" class="kg-image" alt="Laika Blockchain Lab (12 Feb 2022 Update)" loading="lazy" width="1246" height="274" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-bpdmrepjzglqwxto9trmtq.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-bpdmrepjzglqwxto9trmtq.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/1-bpdmrepjzglqwxto9trmtq.png 1246w" sizes="(min-width: 720px) 720px"></figure><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-t8zic9cxewtny2jb.png" class="kg-image" alt="Laika Blockchain Lab (12 Feb 2022 Update)" loading="lazy" width="572" height="330"></figure><p>2. <strong>Theme sync with System &#x1F313;</strong></p><p>A small thing to update but the Theme is now syncing with your system!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-cg35shveozjgcdnxvbkzbw.png" class="kg-image" alt="Laika Blockchain Lab (12 Feb 2022 Update)" loading="lazy" width="300" height="296"></figure><p>3. <strong>Chain Switcher</strong> &#x1F39B;</p><p>This came in handy when you want to work with a new chain (eg. REI)</p><p>Also, when you select a new chain that never use before it would auto add that new chain to your Metamask!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-rj_rhtrk1lbulmpskddhyw.png" class="kg-image" alt="Laika Blockchain Lab (12 Feb 2022 Update)" loading="lazy" width="1246" height="818" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-rj_rhtrk1lbulmpskddhyw.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-rj_rhtrk1lbulmpskddhyw.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/1-rj_rhtrk1lbulmpskddhyw.png 1246w" sizes="(min-width: 720px) 720px"></figure><p>4. <strong>Home Revamp</strong> &#x1F3E0;</p><p>We revamp our home interface a bit. You should be able to quickly create a new Request or Look at the documentation from here &#x1F440;</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-0j4sebekxaitisax60mtfg.png" class="kg-image" alt="Laika Blockchain Lab (12 Feb 2022 Update)" loading="lazy" width="2000" height="1162" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-0j4sebekxaitisax60mtfg.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-0j4sebekxaitisax60mtfg.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-0j4sebekxaitisax60mtfg.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-0j4sebekxaitisax60mtfg.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>5. <strong>Rei Chain Support</strong> &#x1F91D;</p><p>We&#x2019;ve just partner with REI Chain to make it easier to work with the Rei chain. Using Laika it was really easy to work with the Rei chain. You can directly import ABI from the reiscan.</p><p>If you never used the REI chain before you can just click on chain switcher and pick Rei Chain we&#x2019;ll automatically add it for you!</p><blockquote>Check out REI here: <a href="https://reichain.io/" rel="nofollow noopener">https://reichain.io/</a></blockquote><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-a8u2fi4skqxqzzux.png" class="kg-image" alt="Laika Blockchain Lab (12 Feb 2022 Update)" loading="lazy" width="288" height="126"></figure><p>6. <strong>Token Transfer Inspector</strong> &#x1F52D;</p><p>You can now inspect token transfer directly in Laika &#x1F440; If you&#x2019;re working with requests involving Tokens this should come in handy!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-cblmbrtus9tk9knb.png" class="kg-image" alt="Laika Blockchain Lab (12 Feb 2022 Update)" loading="lazy" width="1549" height="346" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-cblmbrtus9tk9knb.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-cblmbrtus9tk9knb.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-cblmbrtus9tk9knb.png 1549w" sizes="(min-width: 720px) 720px"></figure><p>7. <strong>Hardhat Integrations</strong> &#x1F6E0;</p><p>This feature is not come out yet. But just to hype you guy a little bit Laika team just start working on the Hardhat plugin that will sync your Hardhat project with Laika!</p><p>Stay tuned!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-vatkkrdah204nt1vohzddg.png" class="kg-image" alt="Laika Blockchain Lab (12 Feb 2022 Update)" loading="lazy" width="1464" height="164" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-vatkkrdah204nt1vohzddg.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-vatkkrdah204nt1vohzddg.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/1-vatkkrdah204nt1vohzddg.png 1464w" sizes="(min-width: 720px) 720px"></figure><hr><p>And there&#x2019;s a lot more! Just try it at <a href="https://getlaika.app/" rel="noopener ugc nofollow noopener">https://getlaika.app</a></p><p>See ya next time! &#x1F917;</p><p>#BUIDL #getlaikaapp</p><hr><blockquote><strong>Connect with us</strong></blockquote><blockquote>Facebook: <a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener">https://www.facebook.com/getlaikaapp/</a><br>Discord: <a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener">https://discord.gg/4DzwHuxhcf</a><br>Twitter: <a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener">https://twitter.com/getlaikaapp</a></blockquote>]]></content:encoded></item><item><title><![CDATA[Laika Blockchain Lab (19 Jan 2022 Update)]]></title><description><![CDATA[An update of Laika (19 Jan 2022 Update)]]></description><link>https://nonthakon-blog.fly.dev/laika-blockchain-lab-19-jan-2022-update/</link><guid isPermaLink="false">65260db4393b990137d4463a</guid><category><![CDATA[Laika Blockchain Lab]]></category><category><![CDATA[Blockchain Development]]></category><category><![CDATA[Smart Contracts]]></category><category><![CDATA[Ethereum]]></category><category><![CDATA[Solidity]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Wed, 19 Jan 2022 04:29:15 GMT</pubDate><media:content url="https://nonthakon-blog.fly.dev/content/images/max/800/0-dsqhdnhh3zcbxg5b-2.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-dsqhdnhh3zcbxg5b-2.jpg" alt="Laika Blockchain Lab (19 Jan 2022 Update)"><p>Hello! It&#x2019;s nice to see you again :)</p><p>We&#x2019;ve been working on a lot of things for the past few weeks and there&#x2019;s a lot of new features since our last update. Let&#x2019;s see what is it! &#x1F440;</p><hr><ol><li><strong>Chain Request (Beta)</strong> &#x26D3;</li></ol><p>Want to test with a scenario? There&#x2019;s some method you want to call first and then another? Chain Request come here to help!</p><p>You can structure requests in a flow and easily look at the result one by one!</p><p><em>(Note: Chain Request is currently in Beta)</em></p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-6pxerxbqcbaotnim2u0ygg.png" class="kg-image" alt="Laika Blockchain Lab (19 Jan 2022 Update)" loading="lazy" width="2000" height="1365" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-6pxerxbqcbaotnim2u0ygg.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-6pxerxbqcbaotnim2u0ygg.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-6pxerxbqcbaotnim2u0ygg.png 1600w, https://nonthakon-blog.fly.dev/content/images/max/800/1-6pxerxbqcbaotnim2u0ygg.png 2178w" sizes="(min-width: 720px) 720px"></figure><p><strong>2. Environment Variables</strong> &#x1F3D5;</p><p>Have a lot of repeating values? Let&#x2019;s make it an Environment variable and just reuse it!</p><p>Laika is now supporting Environment Variables just click on the &#x1F30D; icon on the left bar add a new variable.</p><p>when you want to use it just put a <strong>{{ variable_name }}</strong> on any field!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-l6vxjmul_gmwlmaxixmzuw.png" class="kg-image" alt="Laika Blockchain Lab (19 Jan 2022 Update)" loading="lazy" width="1410" height="384" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-l6vxjmul_gmwlmaxixmzuw.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-l6vxjmul_gmwlmaxixmzuw.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/1-l6vxjmul_gmwlmaxixmzuw.png 1410w" sizes="(min-width: 720px) 720px"></figure><p><strong>3. Calldata Inspector </strong>&#x1F52D;</p><p>You can now inspect the Calldata of each request with the Call Data tab! This makes it easier to inspect the request byte by byte &#x1F440;</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-h7s4e0aj20duoucgzrt1yw.png" class="kg-image" alt="Laika Blockchain Lab (19 Jan 2022 Update)" loading="lazy" width="2000" height="760" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-h7s4e0aj20duoucgzrt1yw.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-h7s4e0aj20duoucgzrt1yw.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-h7s4e0aj20duoucgzrt1yw.png 1600w, https://nonthakon-blog.fly.dev/content/images/max/800/1-h7s4e0aj20duoucgzrt1yw.png 2264w" sizes="(min-width: 720px) 720px"></figure><p><strong>4. Sighash Request #&#xFE0F;&#x20E3;</strong></p><p>Another cool thing is you can now use Sighash as a method name! just put Sighash to the method name field and that was it!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-16htujiqkuhhfewkncb4cw.png" class="kg-image" alt="Laika Blockchain Lab (19 Jan 2022 Update)" loading="lazy" width="2000" height="760" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-16htujiqkuhhfewkncb4cw.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-16htujiqkuhhfewkncb4cw.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-16htujiqkuhhfewkncb4cw.png 1600w, https://nonthakon-blog.fly.dev/content/images/max/800/1-16htujiqkuhhfewkncb4cw.png 2264w" sizes="(min-width: 720px) 720px"></figure><p><strong>5. Hash Converter &#x2696;&#xFE0F;</strong></p><p>We added Hash Converter into the right toolbar! Hope this comes in handy &#x1F917;</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-s2piefb5euyb41tkrn5lvg.png" class="kg-image" alt="Laika Blockchain Lab (19 Jan 2022 Update)" loading="lazy" width="900" height="1276" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-s2piefb5euyb41tkrn5lvg.png 600w, https://nonthakon-blog.fly.dev/content/images/max/800/1-s2piefb5euyb41tkrn5lvg.png 900w" sizes="(min-width: 720px) 720px"></figure><hr><p>And there&#x2019;s a lot more! Just try it at <a href="https://getlaika.app/" rel="noopener ugc nofollow noopener">https://getlaika.app</a></p><p>See ya next time! &#x1F917;</p><p>#BUIDL #getlaikaapp</p><hr><blockquote><strong><em>Connect with us</em></strong></blockquote><blockquote><em>Facebook: </em><a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener"><em>https://www.facebook.com/getlaikaapp/</em></a><br><em>Discord: </em><a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener"><em>https://discord.gg/4DzwHuxhcf</em></a><br><em>Twitter: </em><a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener"><em>https://twitter.com/getlaikaapp</em></a></blockquote>]]></content:encoded></item><item><title><![CDATA[Upgrading smart contracts with Openzeppelin Upgradable Plugin]]></title><description><![CDATA[How you could easily upgrading your smart contracts & how it work!]]></description><link>https://nonthakon-blog.fly.dev/upgrading-smart-contracts-with-openzeppelin-upgradable-plugin/</link><guid isPermaLink="false">65260db4393b990137d4463b</guid><category><![CDATA[Smart Contracts]]></category><category><![CDATA[Openzeppelin]]></category><category><![CDATA[Ethereum]]></category><category><![CDATA[Laika Blockchain Lab]]></category><category><![CDATA[Web3]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Mon, 10 Jan 2022 12:30:52 GMT</pubDate><media:content url="https://nonthakon-blog.fly.dev/content/images/max/800/0-makwdhc7rdfvqvvw-2.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-makwdhc7rdfvqvvw-2.jpg" alt="Upgrading smart contracts with Openzeppelin Upgradable Plugin"><p><strong>Why do we need to upgrade Smart Contracts?</strong></p><p>Normally, when we deploy smart contracts on the blockchain, it is impossible to edit the code deployed. And it should be totally fine that way. The fact that it could not be deployed to replace the existing codes means that that particular <strong>contract</strong> can not be modified afterward. (this increase safety of people who interact with that contract)</p><p>However, we might really want to edit the code on the contracts in some circumstances like spotting a severe bug on the smart contract that we just have to fix but we can not do so because of the mechanism. What we can do best is to deploy another smart contract that has the bug fixed, and all information migrated. Not only that, but we also need to fix the references that are tied to the old smart contracts, plus telling users to also migrate to use our services on the new contract.</p><p>Feel a bit overwhelmed with the process right? We also felt the same (been there, done that.) With our experiences, we found one use case that helps us with addressing the complex procedures. Let&#x2019;s take a look at it!</p><p><strong>Introducing &#x201C;Upgradable Contract&#x201D;</strong></p><p>An Upgradable contract is a contract that can be (kind of) altered, after the deployment. At the time this article was written, to use an upgradeable smart contract, there is a tool, or plugin, to help us build. This plugin is introduced by OpenZeppelin.</p><p>How to use the plugin? Well, it is not that complicated. Just use this plugin to deploy contracts on hardhat or truffle. Whenever you want to edit the smart contracts, just use the same address to deploy the upgraded contracts via the plugin without worrying about transferring any state in the old implementation.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-zdnmi5jk9dsipucq.png" class="kg-image" alt="Upgrading smart contracts with Openzeppelin Upgradable Plugin" loading="lazy" width="840" height="93" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-zdnmi5jk9dsipucq.png 600w, https://nonthakon-blog.fly.dev/content/images/max/800/0-zdnmi5jk9dsipucq.png 840w" sizes="(min-width: 720px) 720px"></figure><p>The method OpenZeppelin uses is the design pattern named &#x201C;proxy pattern.&#x201D; We will have two deployable contracts. The first one is the storage layer, which stores various states in smart contracts. The second is the logic layer where the contract runs its logic.</p><p>Whenever we interact with the contract, we interact through the proxy contract and then the proxy contract will pass on to the logic contract before sending the output back to us. That being said, imagine you want to change the logic of your smart contracts, you will just need to tell the proxy to refer to the new smart contracts and that is it! Users no longer need to switch the smart contract to interact, they can interact as usual (Super convenient, isn&#x2019;t it?)</p><p>Should you wish to dig deeper, please refer to the official blog of OpenZeppelin here (<em>link</em>)</p><p><strong>How to do it?</strong></p><p>Let&#x2019;s begin by building a new project, in this case, I will use hardhat to do so. To build a project just <strong>npx hardhat</strong> and choose the configuration as you wish. Here&#x2019;s my config for illustration.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-pzwspcskbp0ybs3a.png" class="kg-image" alt="Upgrading smart contracts with Openzeppelin Upgradable Plugin" loading="lazy" width="1600" height="360" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-pzwspcskbp0ybs3a.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-pzwspcskbp0ybs3a.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-pzwspcskbp0ybs3a.png 1600w" sizes="(min-width: 720px) 720px"></figure><p>After we have set up the new project and added contract files, we then install the plugin to upgrade the contract mentioned earlier by using this command below.</p><p><strong>npm install&#x200A;&#x2014;&#x200A;save-dev @openzeppelin/hardhat-upgrades</strong></p><p>After the installation, we have to add this config in the hardhat.config.jsrequire(&#x2018;@nomiclabs/hardhat-ethers&#x2019;);require(&#x2018;@openzeppelin/hardhat-upgrades&#x2019;);</p><p>to let hardhat know that we are using the plugin.</p><p>That is done for the first step. Let&#x2019;s try it out by clicking on Greeter.sol, the contract the hardhat generated for us.//SPDX-License-Identifier: Unlicensepragma solidity ^0.8.0;import &#x201C;hardhat/console.sol&#x201D;;contract Greeter {string private greeting;/*Comment this part out since upgradable contract don&apos;t use constructorconstructor(string memory _greeting) {console.log(&#x201C;Deploying a Greeter with greeting:&#x201D;, _greeting);greeting = _greeting;}*/function greet() public view returns (string memory) {return greeting;}function setGreeting(string memory _greeting) public {console.log(&#x201C;Changing greeting from &#x2018;%s&#x2019; to &#x2018;%s&#x2019;&#x201D;, greeting, &#xA0; &#xA0; _greeting);greeting = _greeting;}}</p><p>To glance at how it works, we run our local blockchain using <strong>npx hardhat</strong> node.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-txlkg7yv_01wmbxh.png" class="kg-image" alt="Upgrading smart contracts with Openzeppelin Upgradable Plugin" loading="lazy" width="1236" height="644" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-txlkg7yv_01wmbxh.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-txlkg7yv_01wmbxh.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-txlkg7yv_01wmbxh.png 1236w" sizes="(min-width: 720px) 720px"></figure><p>To interact with the chain we use</p><p><strong>npx hardhat console&#x200A;&#x2014;&#x200A;network</strong><a href="http://localhost/"><strong> localhost</strong></a></p><p>(Do not forget to choose localhost for the network)</p><p>Then try to deploy using the upgradable plugin.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-ygpnilaxw4anvmb5.png" class="kg-image" alt="Upgrading smart contracts with Openzeppelin Upgradable Plugin" loading="lazy" width="1380" height="348" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-ygpnilaxw4anvmb5.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-ygpnilaxw4anvmb5.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-ygpnilaxw4anvmb5.png 1380w" sizes="(min-width: 720px) 720px"></figure><p>const { ethers, upgrades } = require(&#x2018;hardhat&#x2019;);const Greeter = await ethers.getContractFactory(&#x2018;Greeter&#x2019;);const greeter = await upgrades.deployProxy(Greeter, [&#x2018;Hola!&#x2019;], { initializer: &#x2018;setGreeting&#x2019; });console.log(&#x2018;Greeter deployed to:&#x2019;, greeter.address);</p><p>After the deployment, just copy the address to use to eye the results.</p><p>To view the contract that has been deployed, Laika Blockchain Lab is developing a tool called Laika that helps us make requests to interact with the smart contract without writing a single line of code. We are now under the incubation program of SCB10X, to learn more about us please visit this <a href="https://getlaika.app" rel="noopener">link</a></p><p>Laika can help us with this step. Wonder how? Let&#x2019;s try it out. First, we visit the Laika application here <a href="https://web.getlaika.app" rel="noopener">https://web.getlaika.app</a> and connect the wallet.</p><p>The goal, now, is we want to view the information on the localhost network. Please make sure that you have already had Hardhat set in place, if not, go here is how you can set it up.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-srd4wiitq8twwyyh.png" class="kg-image" alt="Upgrading smart contracts with Openzeppelin Upgradable Plugin" loading="lazy" width="710" height="1200" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-srd4wiitq8twwyyh.png 600w, https://nonthakon-blog.fly.dev/content/images/max/800/0-srd4wiitq8twwyyh.png 710w"></figure><p>In our Laika platform, to make a request, select the &#x201C;New&#x201D; button to create a new collection.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-qtqqeizfdi1nkalk.png" class="kg-image" alt="Upgrading smart contracts with Openzeppelin Upgradable Plugin" loading="lazy" width="1354" height="716" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-qtqqeizfdi1nkalk.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-qtqqeizfdi1nkalk.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-qtqqeizfdi1nkalk.png 1354w" sizes="(min-width: 720px) 720px"></figure><p>Then click the 3 buttons on the right to choose &#x201C;New Method&#x201D;. In this case, we will name it &#x201C;greet.&#x201D;</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-g9nomdgmmyvvlsqn.png" class="kg-image" alt="Upgrading smart contracts with Openzeppelin Upgradable Plugin" loading="lazy" width="1600" height="948" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-g9nomdgmmyvvlsqn.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-g9nomdgmmyvvlsqn.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-g9nomdgmmyvvlsqn.png 1600w" sizes="(min-width: 720px) 720px"></figure><p>Here&#x2019;s what it will look like. Next, we paste the contract address from the Hardhat console, change the method to &#x201C;View&#x201D;, and choose parameters and returns that you want.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-p78agohmjqsf4tgi.png" class="kg-image" alt="Upgrading smart contracts with Openzeppelin Upgradable Plugin" loading="lazy" width="1600" height="928" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-p78agohmjqsf4tgi.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-p78agohmjqsf4tgi.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-p78agohmjqsf4tgi.png 1600w" sizes="(min-width: 720px) 720px"></figure><p>After finishing setting up, we press &#x201C;Send&#x201D; and the results will show as the above picture. We can see that the value is &#x201C;Hola!&#x201D;, the same as what we set when we deployed.</p><p>Now, let&#x2019;s build a contract and try to upgrade it with the new one. (I create GreeterV2.sol for another file, separately)//SPDX-License-Identifier: Unlicensepragma solidity ^0.8.0;import &#x201C;hardhat/console.sol&#x201D;;contract GreeterV2 {string private greeting;// I added _name param to greet functionfunction greet(string memory _name) public view returns (string memory) {// It would simply concat our greeting word with name that pass by callerreturn string(abi.encodePacked(greeting, &#x201C; &#x201C;, _name));}function setGreeting(string memory _greeting) public {console.log(&#x201C;Changing greeting from &#x2018;%s&#x2019; to &#x2018;%s&#x2019;&#x201D;, greeting, _greeting);greeting = _greeting;}}</p><p>We open the console and add in the code as follow:</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-xhc50iizvd1qluh0.png" class="kg-image" alt="Upgrading smart contracts with Openzeppelin Upgradable Plugin" loading="lazy" width="1308" height="236" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-xhc50iizvd1qluh0.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-xhc50iizvd1qluh0.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-xhc50iizvd1qluh0.png 1308w" sizes="(min-width: 720px) 720px"></figure><p>const { ethers, upgrades } = require(&#x2018;hardhat&#x2019;);const GreeterV2 = await ethers.getContractFactory(&#x2018;GreeterV2&#x2019;);// Put the same address of Greeter that deploy earlierawait upgrades.upgradeProxy(&#x2018;0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0&#x2019;, GreeterV2);</p><p>After we upgrade, let&#x2019;s take a look again at the contract. Because we changed the function parameter, we have to also align with the new contract. Press &#x201C;Send&#x201D; to see the result.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-vexe7yvis1fqm8py.png" class="kg-image" alt="Upgrading smart contracts with Openzeppelin Upgradable Plugin" loading="lazy" width="1600" height="937" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/0-vexe7yvis1fqm8py.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/0-vexe7yvis1fqm8py.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/0-vexe7yvis1fqm8py.png 1600w" sizes="(min-width: 720px) 720px"></figure><p>All in all, OpenZeppelin can help us upgrade the smart contract, and it is very easy to do so. It is almost the same as when we normally deploy the smart contract. I encourage you to try it out, if there are any questions, feel free to reach out to us!</p><p><strong>Are there any cons?</strong></p><p>The con about the upgradeable smart contract is the fact that we can mend the implementation of the contract. This means that we can change the logic of how a contract works. The admin can edit the contract and get away with the money in it. Or it can be like the Fulcrum incident that the hacker steals the admin&#x2019;s key and change all of the implementations and get away with the money. We must weigh the pros and cons before we decide to use it.</p><hr><p>That&#x2019;s a lot for today. The article better ends here. Thank you for reading through this article. Hope you find it useful!</p><blockquote><strong>Connect with us</strong></blockquote><blockquote>Facebook: <a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener">https://www.facebook.com/getlaikaapp/</a><br>Discord: <a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener">https://discord.gg/4DzwHuxhcf</a><br>Twitter: <a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener">https://twitter.com/getlaikaapp</a></blockquote>]]></content:encoded></item><item><title><![CDATA[Laika Blockchain Lab (5 Jan 2022 Update)]]></title><description><![CDATA[Hello! Nice to meet you guys again. Happy new year!]]></description><link>https://nonthakon-blog.fly.dev/laika-blockchain-lab-5-jan-2022-update/</link><guid isPermaLink="false">65260db4393b990137d4463c</guid><category><![CDATA[Developer Tools]]></category><category><![CDATA[Laika Blockchain Lab]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[Ethereum]]></category><category><![CDATA[Smart Contracts]]></category><dc:creator><![CDATA[Nonthakon Jitchiranant]]></dc:creator><pubDate>Wed, 05 Jan 2022 07:40:14 GMT</pubDate><media:content url="https://nonthakon-blog.fly.dev/content/images/max/800/0-nfi85mnma6oisqh3-2.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-nfi85mnma6oisqh3-2.jpg" alt="Laika Blockchain Lab (5 Jan 2022 Update)"><p>Hello! Nice to meet you guys again. Happy new year!</p><p>This is the first update of Laika for this year. We&#x2019;ve added a lot of features for the past few weeks. Let&#x2019;s see what we&#x2019;ve got! &#x1F440;</p><hr><ol><li><strong>Code Generator &#x1F9D1;&#x200D;&#x1F4BB;</strong></li></ol><p>We&#x2019;ve had a lot of requests for code generator recently and it&#x2019;s here! you can just create your request and copy the code snippet from the toolbar on the right side!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-1c5o1qnxsb4dwla9apwria.png" class="kg-image" alt="Laika Blockchain Lab (5 Jan 2022 Update)" loading="lazy" width="1120" height="1006" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-1c5o1qnxsb4dwla9apwria.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-1c5o1qnxsb4dwla9apwria.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/1-1c5o1qnxsb4dwla9apwria.png 1120w" sizes="(min-width: 720px) 720px"></figure><p>2. <strong>Drag and Drop</strong> &#x1F90F;</p><p>The request is now <strong>drag &#x2018;n drop</strong> -able! This makes it easier to manage your workspace.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/0-ovrr4u3ebzzes0f.gif" class="kg-image" alt="Laika Blockchain Lab (5 Jan 2022 Update)" loading="lazy" width="600" height="888" srcset="https://nonthakon-blog.fly.dev/content/images/max/800/0-ovrr4u3ebzzes0f.gif 600w"></figure><p>3. <strong>Unit Converter &#x2696;&#xFE0F;</strong></p><p>We&#x2019;ve integrated the unit converter right into the right sidebar (No pun intended!) Hope this comes in handy!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-xosypgsgl0ef5l3et_ecgw.png" class="kg-image" alt="Laika Blockchain Lab (5 Jan 2022 Update)" loading="lazy" width="1120" height="660" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-xosypgsgl0ef5l3et_ecgw.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-xosypgsgl0ef5l3et_ecgw.png 1000w, https://nonthakon-blog.fly.dev/content/images/max/800/1-xosypgsgl0ef5l3et_ecgw.png 1120w" sizes="(min-width: 720px) 720px"></figure><p>4. <strong>More data on selected chain</strong> &#x26D3;</p><p>We&#x2019;ve changed the interface a bit. Laika now shows the ChainID of your selected chain so it would be easier to recognize which chain you&#x2019;re in.</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-ich_z7t6g_itxke2kfws2g.png" class="kg-image" alt="Laika Blockchain Lab (5 Jan 2022 Update)" loading="lazy" width="896" height="144" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-ich_z7t6g_itxke2kfws2g.png 600w, https://nonthakon-blog.fly.dev/content/images/max/800/1-ich_z7t6g_itxke2kfws2g.png 896w" sizes="(min-width: 720px) 720px"></figure><p>5. <strong>A bit of UI Change</strong> &#x1F484;</p><p>We&#x2019;ve changed the UI a bit. if you want to have an array type of parameters you can just tick the array checkbox a lot more simpler!</p><figure class="kg-card kg-image-card"><img src="https://nonthakon-blog.fly.dev/content/images/max/800/1-ufefmjbpihqichctsmpsaq.png" class="kg-image" alt="Laika Blockchain Lab (5 Jan 2022 Update)" loading="lazy" width="2000" height="197" srcset="https://nonthakon-blog.fly.dev/content/images/size/w600/max/800/1-ufefmjbpihqichctsmpsaq.png 600w, https://nonthakon-blog.fly.dev/content/images/size/w1000/max/800/1-ufefmjbpihqichctsmpsaq.png 1000w, https://nonthakon-blog.fly.dev/content/images/size/w1600/max/800/1-ufefmjbpihqichctsmpsaq.png 1600w, https://nonthakon-blog.fly.dev/content/images/size/w2400/max/800/1-ufefmjbpihqichctsmpsaq.png 2400w" sizes="(min-width: 720px) 720px"></figure><hr><p>And there&#x2019;s a lot more! Just try it at <a href="https://getlaika.app/" rel="noopener ugc nofollow noopener">https://getlaika.app</a></p><p>See ya next time! &#x1F917;</p><p>#BUIDL #getlaikaapp</p><hr><blockquote><strong><em>Connect with us</em></strong></blockquote><blockquote><em>Facebook: </em><a href="https://www.facebook.com/getlaikaapp/" rel="noopener ugc nofollow noopener"><em>https://www.facebook.com/getlaikaapp/</em></a><br><em>Discord: </em><a href="https://discord.gg/4DzwHuxhcf" rel="noopener ugc nofollow noopener"><em>https://discord.gg/4DzwHuxhcf</em></a><br><em>Twitter: </em><a href="https://twitter.com/getlaikaapp" rel="noopener ugc nofollow noopener"><em>https://twitter.com/getlaikaapp</em></a></blockquote>]]></content:encoded></item></channel></rss>