<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Elendu Ifeanyi</title>
    <description>The latest articles on DEV Community by Elendu Ifeanyi (@lenduking).</description>
    <link>https://dev.to/lenduking</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F728087%2F884957b5-ebd5-4b90-b5c3-5d3ac258f9e8.jpeg</url>
      <title>DEV Community: Elendu Ifeanyi</title>
      <link>https://dev.to/lenduking</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lenduking"/>
    <language>en</language>
    <item>
      <title>The Beauty of Optimistic rollups and the mantle blockchain</title>
      <dc:creator>Elendu Ifeanyi</dc:creator>
      <pubDate>Sun, 11 Jun 2023 22:54:38 +0000</pubDate>
      <link>https://dev.to/lenduking/the-beauty-of-optimistic-rollups-and-the-mantle-blockchain-jn0</link>
      <guid>https://dev.to/lenduking/the-beauty-of-optimistic-rollups-and-the-mantle-blockchain-jn0</guid>
      <description>&lt;p&gt;From the inception of blockchain technology, a common problem has characterized many of its infrastructure and networks, namely the so-called trilemma issue which occurs because a given blockchain can hardly achieve decentralization while being scalable and having a high security profile. &lt;br&gt;
This problem is common with early blockchains which were mostly referred to as L1 blockchains as all activities such as computations and storage were done on the main network which often resulted in higher gas fees and slower experience.&lt;/p&gt;

&lt;p&gt;To combat this issue, many other blockchains have implemented varying solutions ranging from sidechain implementations to plasma chain implementations and varying consensus mechanisms.&lt;/p&gt;

&lt;p&gt;One such solution is optimistic rollups which aim to speed up the blockchain experience by taking computation and state management tasks off chain, and then publishing results on chain thereby leveraging on the security of the main network such as ethereum.&lt;/p&gt;

&lt;p&gt;This solutions are known as layer 2 networks as they build on top of the base (layer 1 ) networks and help reduce gas fees while improving transaction speeds&lt;/p&gt;

&lt;h2&gt;
  
  
  The Mantle Network
&lt;/h2&gt;

&lt;p&gt;Since optimistic rollups maintain efficiency by taking computations and state storage off-chain, it is vital that the transaction result returned which would then be published on chain be valid. To this effect, fraud proofs are put in place to checkmate the activities of bad actors by checking for invalid transactions. So network validators submit fraud proofs if malicious actions are suspected and the necessary punishment enacted to discourage such actions.&lt;/p&gt;

&lt;p&gt;By reducing the load on the main chain which is the ethereum chain, making transactions and activities execute faster, optimistic rollups maintain faster transaction speed and favorable blockchain experience. Mantle network employs an optimistic rollup approach to providing a lesser gas and more favorable blockchain experience as compared to other Layer 2 networks&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;By building on top of ethereum, mantle maintains a high security profile by leveraging on the tested and trusted security of the ethereum blockchain, and having a large developer base that are already familiar with building ethereum smart contracts now easily porting to mantle due to been evm compatible and so same language works on both.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;By utilizing eigenlayer mantle is able to access data faster and this means data gets processed faster in return giving it an edge over other traditional layer 2 networks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mantle uses Multi party Computation(A secure cryptographic technique that allows parties to cooperate on a computation without revealing their individual data to each other) to improve the correctness of off-chain results which given this additional power and advantage helps to shorten the length of withdrawals, once more improving the blockchain experience&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;By Using sequencers(specialized node that connects an l2 network to its L1 using set of smart contracts) mantle aims to provide a greater decentralization experience by rotating through sequencer sets which in turn reduces the risk of a singular point of failure.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why Mantle matters for L2 Networks
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Doesn’t use ethereum as data availability layer thereby improving transaction speeds&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Being a modular blockchain means it delegates tasks such as settlement, data availability and consensus which on other layer 1 blockchains are usually done on the core network which is ethereum, to various specialized layers for processing thereby reducing the load and cost of running everything on one layer which would have been the ethereum network. This delegation helps increase speed and blockchain performance which can be viewed as a solution to the blockchain trilemma problem(A devious cycle of scalability, security and decentralization not being achievable all at once).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fraud proofs reduces validation load on the main chain, thereby reducing congestion and increasing efficiency&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Technical Edge
&lt;/h2&gt;

&lt;h3&gt;
  
  
  EigenLayer
&lt;/h3&gt;

&lt;p&gt;Instead of relying on ethereum for data availability, mantle goes about this by employing EigenLayer data availability solution which allows nodes to provide data availability services to the mantle network&lt;/p&gt;

&lt;h3&gt;
  
  
  Improved and more compatible fraud proof system
&lt;/h3&gt;

&lt;p&gt;Most fraud proof systems are usually implemented using low level languages and as such forces the EVM client to recompile their fraud proofs into lower level languages to be interpretable by the on-chain verifier which then adds the transaction into the ethereum chain.&lt;/p&gt;

&lt;p&gt;But with mantles innovation, this proof is compiled and thus verified with EVM level instructions thereby allowing clients to work with a common proof system instead of recompiling and also increase the trustworthiness across verifiers, clients and compilers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bridging
&lt;/h3&gt;

&lt;p&gt;Mantle provides a bridge so other networks can transfer tokens into the mantle network&lt;/p&gt;

&lt;h2&gt;
  
  
  How Mantle compares against popular blockchains
&lt;/h2&gt;

&lt;p&gt;Using covalent's innovative web3 analysis platorm; increment, we can see a chart of average block times on mantle and how it compares with those from polygon and ethereum, in the charts below, it is clear mantle has a lower block time meaning it is capable of processing transactions faster &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eLnNpObE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y57fk3uskcz9ht26tbvu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eLnNpObE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y57fk3uskcz9ht26tbvu.png" alt="block time comparison between mantle and matic" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7S3hbVm3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b88eq1mcxcaeno0r15k2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7S3hbVm3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b88eq1mcxcaeno0r15k2.png" alt="block time comparison between mantle and ethereum" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As layer two blockchains come to maturity, it is important that while trying to solve the shortfalls of Layer 1 infrastructures, we don't compound the problems and make the experience worse. By leveraging on optimistic rollup architecture, innovative data availablility approach and improved fraud proving system, mantle network aims to deliver a blockchain experience that puts the users first by providing a lesser gas usage experience and faster transaction times all while delivering a top notch security design.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>web3</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Deploying a MultiSend Contract on Polygon via ThirdWeb</title>
      <dc:creator>Elendu Ifeanyi</dc:creator>
      <pubDate>Wed, 29 Mar 2023 21:32:41 +0000</pubDate>
      <link>https://dev.to/lenduking/deploying-a-multisend-contract-on-polygon-via-thirdweb-3mfa</link>
      <guid>https://dev.to/lenduking/deploying-a-multisend-contract-on-polygon-via-thirdweb-3mfa</guid>
      <description>&lt;p&gt;Thirdweb recently upgraded its framework by adding support for all EVM-compatible blockchains (EVM-Ethereum Virtual Machine: this deals with the ability to write and deploy smart contracts that work seamlessly with the Ethereum Virtual Machine and hence can be recognized by nodes running on the Ethereum blockchain.)&lt;/p&gt;

&lt;p&gt;With this development, thirdweb now boast of a dashboard that works with any existing smart contract, regardless of how it was deployed. While this works most of the time, other times further actions are needed for contracts to be fully imported, such as verifying the contract and ensuring that its metadata is recognized&lt;/p&gt;

&lt;p&gt;This improvement has also increased thirdweb’s blockchain base to around 700+ making it an all-in-one solution for most deployment need.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding thirdweb
&lt;/h2&gt;

&lt;p&gt;Prior to thirdweb inception, writing, compiling and deploying smart contracts would require extensive knowledge on the path of choice be it solidity with hardhat or truffle framework, this required writing scripts, testing and ensuring everything works as planned. These actions can be time-consuming and prone to errors. Thirdweb removed all this hurdles by providing users and developers with set of prepared contracts for their needs. Be it NFT, token, authentication e.t.c. Within minutes, such contracts can be deployed to any chain of choice, greatly reducing the time for a developer to produce. Now with increased support for all EVM compatible chains, thirdweb aims to become the default choice for all your deployment needs. &lt;/p&gt;

&lt;h2&gt;
  
  
  Importing custom “MultiSend” contract
&lt;/h2&gt;

&lt;p&gt;By importing your contracts to the thirdweb dashboard, you gain the advantage of integrating directly to the thirdweb suite of tools like their SDK, custom explorer and other functionality for testing and visualizing your contract.&lt;/p&gt;

&lt;p&gt;Navigate to the thirdweb &lt;a href="https://thirdweb.com/dashboard" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt;, click on search and input your custom contract address, click on the recognized contract to begin the import.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff2k8x2wkowxz3h2djspd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff2k8x2wkowxz3h2djspd.png" alt="Search for contract to import"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The contract is finally imported, giving you a view to custom actions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frr7gxyxgip7mm32gfycl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frr7gxyxgip7mm32gfycl.png" alt="Imported contract"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the left side, you can see custom tabs namely build, explorer and events. These allow you to perform actions such as integrating your contract to the thirdweb SDK for easy front end development, accessing your contracts methods for testing and viewing all events available in your contract.&lt;/p&gt;

&lt;p&gt;Under the ‘source’ tab, it further gives you an option to verify your contract and shows you the source code and ABI. Truly a convenient way to manage custom contract.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxj7zld6em4jz31qzmff5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxj7zld6em4jz31qzmff5.png" alt="Thirdweb sources"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying contracts via thirdweb
&lt;/h2&gt;

&lt;p&gt;A convenient way to deploy smart contracts is with the thirdweb command line interface (CLI), accessible from a terminal.&lt;/p&gt;

&lt;p&gt;To begin, navigate to a folder of choice and input:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx thirdweb create&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will install the thirdweb package for you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1zwnpk29vf7h1b6qqlf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1zwnpk29vf7h1b6qqlf.png" alt="Select Contract"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select “contract”&lt;br&gt;
And fill in other prompts with your choice&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk9blwm26793obkzn6slz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk9blwm26793obkzn6slz.png" alt="installation prompt"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this project, I chose forge as my framework&lt;/p&gt;

&lt;p&gt;After the setup is completed with the folder generated, copy your contract source code into the ‘src’ folder, replacing the generated ‘contract.sol’ file.&lt;/p&gt;

&lt;p&gt;The main function in the "MultiSend" Contract can be seen below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function sendAll (address[] calldata recievers, uint amt) external payable{
        senderBalance[msg.sender] += msg.value;
        uint arrLength = recievers.length;
        uint totalToSend = amt * arrLength;
        uint tempAmt = amt;
        uint bal = checkSendersBalanceOfContract();
        require(bal &amp;gt;= totalToSend, "Insufficient balance");

        for (uint i = 0; i &amp;lt; arrLength; i++) {
            if(recievers[i] != address(0)) {
                address _to = payable(recievers[i]);
                senderBalance[msg.sender] -= tempAmt;
                (bool sent, ) = _to.call{value: amt}("");

                require(sent, "Failed to send Ether");
                emit SendAll(recievers[i], amt);

            }else{
                revert SendFailed(recievers[0], amt);
            }
        }
        whitelistToWithdraw[msg.sender] = true;

    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which ensures that senders balance is sufficient to distribute the given value between the recipients. This is important as the purpose of a multisend contract is to send value to multiple recipients, thereby saving on gas cost.&lt;/p&gt;

&lt;p&gt;Back in the terminal, run &lt;code&gt;yarn build&lt;/code&gt; to compile your project and &lt;code&gt;yarn deploy&lt;/code&gt; to upload your contract to IPFS(Interplanetary File System; a decentralized storage medium)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flney3nlqhqa5vpnsck2i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flney3nlqhqa5vpnsck2i.png" alt="Final prompt"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this, the thirdweb deployment utility gets opened, from where you can connect your wallet and choose a network for deployment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhvjdj2s8mdns3gz8lzr8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhvjdj2s8mdns3gz8lzr8.png" alt="Deploy to Mumbai"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this project, I chose to use the polygon Mumbai, which is a Layer-two network, for testing purposes. Click on "deploy now" and follow through with the prompts from Metamask to finalize the contract deployment. &lt;/p&gt;

&lt;p&gt;Below is the deployed multisend contract on the thirdweb dashboard&lt;/p&gt;

&lt;p&gt;&lt;a href="https://thirdweb.com/mumbai/0xd04B1Ebea6CfFdF2b9bc8aE5C71cCf04e7D662b8" rel="noopener noreferrer"&gt;https://thirdweb.com/mumbai/0xd04B1Ebea6CfFdF2b9bc8aE5C71cCf04e7D662b8&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With technological advancement and the demand for rapid project delivery, it has become very important to find a solution that provide security and speed to contracts deployment. Thirdweb provides an easy and intuitive way to quickly deploy smart contracts and standards for your quick use. This can prove handy in situations like hackathons, bounties and time sensitive projects where a feature needs to be quickly added without fear of compromising on quality and security. Indeed, thirdweb has made smart contract accessibility and deployment problem a thing of the past, and with it “Any contract, any EVM” upgrade, it has become the Swiss army knife for deployment and contract management.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://blog.thirdweb.com/any-contract-any-evm-chain/" rel="noopener noreferrer"&gt;https://blog.thirdweb.com/any-contract-any-evm-chain/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://portal.thirdweb.com/" rel="noopener noreferrer"&gt;https://portal.thirdweb.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>thirdweb</category>
      <category>polygon</category>
      <category>web3</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
