<?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>Developers Forum for XinFin XDC Network: Harshavardhan Gurram</title>
    <description>The latest articles on Developers Forum for XinFin XDC Network by Harshavardhan Gurram (@hasha_netha).</description>
    <link>https://www.xdc.dev/hasha_netha</link>
    <image>
      <url>https://www.xdc.dev/images/ns7yv8tNXFlPIvAj7wQXLJgiTaGxJ-lgP0TuYUoKM5Y/rs:fill:90:90/mb:500000/ar:1/aHR0cHM6Ly93d3cu/eGRjLmRldi91cGxv/YWRzL3VzZXIvcHJv/ZmlsZV9pbWFnZS8y/NTMvYTQwMmUxMjIt/NGExNC00ZTJjLTk5/MGItYTY4N2E0ZmFi/MGQ5LmpwZw</url>
      <title>Developers Forum for XinFin XDC Network: Harshavardhan Gurram</title>
      <link>https://www.xdc.dev/hasha_netha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://www.xdc.dev/feed/hasha_netha"/>
    <language>en</language>
    <item>
      <title>Issue with contract interaction from "Xinfin Remix IDE"</title>
      <dc:creator>Harshavardhan Gurram</dc:creator>
      <pubDate>Thu, 22 Sep 2022 09:06:39 +0000</pubDate>
      <link>https://www.xdc.dev/hasha_netha/issue-with-contract-interaction-from-xinfin-remix-ide-cbh</link>
      <guid>https://www.xdc.dev/hasha_netha/issue-with-contract-interaction-from-xinfin-remix-ide-cbh</guid>
      <description>&lt;p&gt;I've tried to deploy &lt;strong&gt;MultisigContract&lt;/strong&gt; shown below through Xinfin Remix (&lt;a href="https://remix.xinfin.network/"&gt;https://remix.xinfin.network/&lt;/a&gt;) and also Remix IDE (&lt;a href="https://remix.ethereum.org/"&gt;https://remix.ethereum.org/&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Deployment is sucessful, but when it comes to interaction with one of the methods, say submitTransaction, gives below popup and error in Xinfin whether it's working fine on Remix IDE.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.xdc.dev/images/co_514-kcJxtyKtVPmktwUl8s9Cog3hjtaY2qh8BDc4/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/eGRjLmRldi91cGxv/YWRzL2FydGljbGVz/L2R4Y3ExYWF0OW4w/azY4OXN5MGs2LnBu/Zw" class="article-body-image-wrapper"&gt;&lt;img src="https://www.xdc.dev/images/co_514-kcJxtyKtVPmktwUl8s9Cog3hjtaY2qh8BDc4/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/eGRjLmRldi91cGxv/YWRzL2FydGljbGVz/L2R4Y3ExYWF0OW4w/azY4OXN5MGs2LnBu/Zw" alt="Popup Warning after invoking submitTransaction method." width="733" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.xdc.dev/images/8WQ0iWuzsrMuqHgdHY_9XkD8Y3-S-BvXuBVfFJSlsRo/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/eGRjLmRldi91cGxv/YWRzL2FydGljbGVz/LzNybnc0cWF2bnE3/cW5mNmhodXdrLnBu/Zw" class="article-body-image-wrapper"&gt;&lt;img src="https://www.xdc.dev/images/8WQ0iWuzsrMuqHgdHY_9XkD8Y3-S-BvXuBVfFJSlsRo/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/eGRjLmRldi91cGxv/YWRzL2FydGljbGVz/LzNybnc0cWF2bnE3/cW5mNmhodXdrLnBu/Zw" alt="Error Debug Log Part 1" width="880" height="405"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.xdc.dev/images/m5yZ_onH2eieIET3U9chm7uuW1q7o0tl6iZ1bs7J1D4/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/eGRjLmRldi91cGxv/YWRzL2FydGljbGVz/LzlqdzV2eHQ5aXVy/OTZzbDV6YzB6LnBu/Zw" class="article-body-image-wrapper"&gt;&lt;img src="https://www.xdc.dev/images/m5yZ_onH2eieIET3U9chm7uuW1q7o0tl6iZ1bs7J1D4/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/eGRjLmRldi91cGxv/YWRzL2FydGljbGVz/LzlqdzV2eHQ5aXVy/OTZzbDV6YzB6LnBu/Zw" alt="Error Debug Log Part 2" width="749" height="209"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;I request someone who has encountered this previously or who has experience in the same to help us out. &lt;br&gt;
Thanks in advance.&lt;/p&gt;

&lt;p&gt;Below is the contract code:&lt;br&gt;
`pragma solidity ^0.8.7;&lt;/p&gt;

&lt;p&gt;contract Multisig {&lt;br&gt;
  //enum test{Accepted,Rejected,Pending} &lt;br&gt;
    struct Transaction {&lt;br&gt;
      bool executed;&lt;br&gt;
      bool accepted;&lt;br&gt;
      address destination;&lt;br&gt;
      uint value;&lt;br&gt;
    }&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;event Deposit(address indexed sender, uint value);
event Submission(uint indexed transactionId);
event Confirmation(address indexed sender, uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);

/// @dev Fallback function allows to deposit ether.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;fallback() external payable &lt;br&gt;
    {&lt;br&gt;
        if (msg.value &amp;gt; 0) {&lt;br&gt;
            emit Deposit(msg.sender, msg.value);&lt;br&gt;
        }&lt;br&gt;
    }&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/*
 * Public functions
 */

address[] public owners;
uint public required;
mapping (address =&amp;gt; bool) public isOwner;

uint public transactionCount;
mapping (uint =&amp;gt; Transaction) public transactions;

mapping (uint =&amp;gt; mapping (address =&amp;gt; bool)) public confirmations;

mapping (uint =&amp;gt; mapping (address =&amp;gt; bool)) public acceptance;

constructor(address[] memory _owners, uint _required) public payable
    validRequirement(_owners.length,_required) {
    for (uint i=0; i&amp;lt;_owners.length; i++) {
        isOwner[_owners[i]] = true;
    }
    owners = _owners;
    required = _required;
}

modifier validRequirement(uint ownerCount, uint _required) {
    if (_required &amp;gt; ownerCount || _required == 0 || ownerCount == 0)
        revert();
    _;
}  

// @dev Allows an owner to submit and confirm a transaction.
// @param destination Transaction target address.
// @param value Transaction ether value.
// @param data Transaction data payload.
// @return Returns transaction ID.
//function submitTransaction(address destination, uint value, bytes memory data) public returns (uint transactionId) {}

function submitTransaction(address destination, uint value) 
    public payable
    returns (uint transactionId) 
{
    require(isOwner[msg.sender]);
    transactionId = addTransaction(destination, value);
    confirmTransaction(transactionId);
}

/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
    public
{
    require(isOwner[msg.sender]);
    require(transactions[transactionId].destination != address(0));
    require(confirmations[transactionId][msg.sender] == false);
    confirmations[transactionId][msg.sender] = true;
    // Transaction.testing[msg.sender] = true;
    acceptance[transactionId][msg.sender] = true;
    emit Confirmation(msg.sender, transactionId);
    executeTransaction(transactionId);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;function confirmTransactionReject(uint transactionId)&lt;br&gt;
        public&lt;br&gt;
    {&lt;br&gt;
        require(isOwner[msg.sender]);&lt;br&gt;
        require(transactions[transactionId].destination != address(0));&lt;br&gt;
        require(confirmations[transactionId][msg.sender] == false);&lt;br&gt;
        confirmations[transactionId][msg.sender] = true;&lt;br&gt;
        // Transaction.testing[msg.sender] = true;&lt;br&gt;
        acceptance[transactionId][msg.sender] = false;&lt;br&gt;
        emit Confirmation(msg.sender, transactionId);&lt;br&gt;
        executeTransaction(transactionId);&lt;br&gt;
    }&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId) public {}

/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
    public
{
    require(transactions[transactionId].executed == false);
    if (isConfirmed(transactionId)) {
        uint flag=0;
        for(uint i=0;i&amp;lt;required;i++)
        {
            if(acceptance[transactionId][owners[i]] == false)
                flag=1;
        }           

        Transaction storage t = transactions[transactionId];
        if(flag==0)
            t.accepted = true;
        t.executed = true;

        (bool success,) = t.destination.call{value:(t.value)}("");
        if (success)    
            emit Execution(transactionId);
        else {
            emit ExecutionFailure(transactionId);
            t.executed = false;
        }
    }
}
    /*
     * (Possible) Helper Functions
     */
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
    public
    view
    returns (bool)
{
    uint count = 0;
    for (uint i=0; i&amp;lt;owners.length; i++) {
        if (confirmations[transactionId][owners[i]])
            count += 1;
        if (count == required)
            return true;
    }
}

// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
// @param destination Transaction target address.
// @param value Transaction ether value.
// @param data Transaction data payload.
// @return Returns transaction ID.
function addTransaction(address destination, uint value)
    internal
    returns (uint transactionId)
{
    transactionId = transactionCount;
    transactions[transactionId] = Transaction({
        destination: destination,
        value: value,
        executed: false,
        accepted:false
    });
    transactionCount += 1;
    emit Submission(transactionId);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}`&lt;/p&gt;

</description>
      <category>xinfin</category>
      <category>remix</category>
      <category>ide</category>
      <category>interactio</category>
    </item>
    <item>
      <title>Project PATHRAM - A Document Management and Tracking System | Powered by XDC Network</title>
      <dc:creator>Harshavardhan Gurram</dc:creator>
      <pubDate>Tue, 20 Sep 2022 09:02:17 +0000</pubDate>
      <link>https://www.xdc.dev/hasha_netha/project-pathram-a-document-management-and-tracking-system-powered-by-xdc-network-29g7</link>
      <guid>https://www.xdc.dev/hasha_netha/project-pathram-a-document-management-and-tracking-system-powered-by-xdc-network-29g7</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/QtmxoTDdx4Y"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspiration
&lt;/h2&gt;

&lt;p&gt;It was in my 2nd year of intermediate, being passionate about organizing events, I decided to team up with some of my friends who's proactive like me to organize "Teachers' Day" as a gratitude towards our faculty. There were around 200+ faculty who deals for Intermediate, as our strength is pretty high.&lt;/p&gt;

&lt;p&gt;To get all the permissions for this event, I had to write more than 50 letters to various departments and officials. I found it really hard to know the status of my request letter if submitted for further permissions. In other case, I had to wait for almost half of my day before the office of concerned for their presence to get the letter approved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This whole process, I felt like hell!!!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is where an idea striked my brain. &lt;strong&gt;How about digitalising this stuff?&lt;/strong&gt;&lt;br&gt;
There it comes! &lt;br&gt;
Pathram - Document Management and Tracking System&lt;br&gt;
Powered by XDC Network&lt;/p&gt;

&lt;p&gt;First things first, this wasn't coined in my intermediate itself. xD&lt;br&gt;
It took me three years to learn all technical stuff to solve my pain point with an innovative web based solution. To expand my idea to the outer organisations, our team brainstormed hard and arrived at a conclusion where Blockchain can be used to provide security for this solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Our idea is to implement tracking feature for every document which is sent for approval. &lt;br&gt;
For additional security, we are implementing the authorization of documents using “Digital Signatures” with the help of XDC Network.&lt;br&gt;
There will be certain predefined flows under every department which we call as EventType.&lt;br&gt;
An applicant can raise a request under any of the EventTypes with the help of Admin. We call that request as Event.&lt;br&gt;
For every EventType, there will be various set of authenticated users (also known as signers) to authorize the event.&lt;br&gt;
After all the signers associated with particular event type duly approves, then the data is written to blockchain ledger and IPFS, making the event info. immutable.&lt;/p&gt;

&lt;h2&gt;
  
  
  How we built it
&lt;/h2&gt;

&lt;p&gt;• We used NextJS and Firebase on web2 level to pull off the project.&lt;br&gt;
• On web3 layer, for enhanced security, through multisignature protocol of Blockchain, we used XDC Network and IPFS to store the data tamper proof.&lt;br&gt;
• Vercel is the place we hosted our application.&lt;br&gt;
• Solidity, Tatum API, Hardhat are some additional tools we used to automate deployment of smart contract and wallet generation functionalities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges we ran into
&lt;/h2&gt;

&lt;p&gt;As Blockchain, is quite a new area, we felt difficulty in finding the correct resources to learn deploying and interacting with Smart Contracts.&lt;br&gt;
Deploying on other side, automation of deployment by passing dynamic data has eaten half of our day in the Hackathon.&lt;br&gt;
Implementing IPFS was also a challenge we faced while building the project. &lt;/p&gt;

&lt;h2&gt;
  
  
  Accomplishments that we're proud of
&lt;/h2&gt;

&lt;p&gt;First things first, we are proud to pull off this migration in just a 20hr scrum we organised for internal team.&lt;br&gt;
Secondly, we are proud of one accomplishment from AICTE.&lt;br&gt;
There was a similar problem statement floated Ministry of social justice and empowerment under the smart automation bucket of Smart India Hackathon 2022.&lt;br&gt;
The problem statement goes as: Development &amp;amp; Implementation Of An Integrated Web-Based Office Document Management System i.e A Web-Based solution to track the status of document/file going through approval process in any department.&lt;/p&gt;

&lt;p&gt;When we look closure, In this traditional process of document approval, it is difficult to track the status and movement of file until it returns to parent office. As it involves physical movement of files, we need huge workforce to handle, there's high chance of document getting tampered due to natural disasters. It is tough to store such huge num of files.&lt;br&gt;
Last but not least, forgery is also a concern.&lt;/p&gt;

&lt;p&gt;We addressed the same with our project named Dasthavej, which bagged us the First Prize and cash prize of 1 lakh for being the winner of Smart India Hackathon 2022.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we learned
&lt;/h2&gt;

&lt;p&gt;We learn a lot of new tools, frameworks, agile methodology, in the technical part.&lt;br&gt;
Soft skills, networking and many other skills which enhanced us in terms of being a professional developer and an entrepreneur.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next for Pathram - Document Management and Tracking System
&lt;/h2&gt;

&lt;p&gt;As there aren't any competitors with exact idea, we would want to deliver this solution for organizations as SAAS by limiting number of requests and support service in the trial version and doing some subscription model for additional benefits or per/account charge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some numbers
&lt;/h2&gt;

&lt;p&gt;Let us take a Indian Penny i.e 1 rupee.&lt;br&gt;
With that 1 buck, we can do anyone of the below operations:&lt;br&gt;
&lt;strong&gt;1200+&lt;/strong&gt; Multisig Wallet Deployments&lt;br&gt;
&lt;strong&gt;1100+&lt;/strong&gt; Event Creations&lt;br&gt;
&lt;strong&gt;17800+&lt;/strong&gt; Signatures&lt;/p&gt;

&lt;p&gt;So this shows the efficiency and budget optimisation of our solution without compromising on security aspect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Credentials for Try it out link&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Link: &lt;a href="https://pathram-main.vercel.app"&gt;https://pathram-main.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Admin: &lt;br&gt;
Email: &lt;a href="mailto:director@turntbloke.me"&gt;director@turntbloke.me&lt;/a&gt;&lt;br&gt;
Password: 123456&lt;/p&gt;

&lt;p&gt;SignerOne:&lt;br&gt;
Email: &lt;a href="mailto:coordinator.cse@turntbloke.me"&gt;coordinator.cse@turntbloke.me&lt;/a&gt;&lt;br&gt;
Password: 123456&lt;br&gt;
Private Key to import XDCPay Wallet: 0xeb7c9fc943ff1a810c606de373f3ca479656b869e518dbc3b1e53a293fbb2980&lt;/p&gt;

&lt;p&gt;SignerTwo:&lt;br&gt;
Email: &lt;a href="mailto:hod.cse@turntbloke.me"&gt;hod.cse@turntbloke.me&lt;/a&gt;&lt;br&gt;
Password: 123456&lt;br&gt;
Private Key to import XDCPay Wallet: 0x93d7e68352f72ed356c796602a3610788e6b25c58ff3cc4e71ae06655e0b05a1&lt;/p&gt;

&lt;p&gt;Contract Address of Sandbox Multisig Wallet: 0x7B7de5c2Ad5a9e3209d2388C7C7BBFc689105Ea6&lt;br&gt;
Smart Contract Template Link: &lt;a href="https://pastebin.com/zZPyakQ2"&gt;https://pastebin.com/zZPyakQ2&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Instructions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Login using Admin Creds given above.&lt;/li&gt;
&lt;li&gt;Click on create event and choose "Sandbox" from the dropdown.&lt;/li&gt;
&lt;li&gt;Fill all the details and upload relavant documents. (Use only valid email, an alert will be sent to that.)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;...and you are done!&lt;/p&gt;

&lt;p&gt;Now, the process goes to Signers.&lt;br&gt;
"Sandbox" is a hierarchical event type. This means, any particular signer can authorize the event only after their subordinated does it.&lt;br&gt;
Before doing this, install XDCPay and import the two accounts with private keys given above.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Login as Signer one and click on authorize button to see the events queued.&lt;/li&gt;
&lt;li&gt;Click on Approve Event to authorize it. On successful approval, your sign will be done on that request/event and next queued event will appear.
(Note: Reject Event is not not yet added as of now. But the functionality is ready.)&lt;/li&gt;
&lt;li&gt;You can track the event details with it's ID which is shown while authorizing it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As a admin, you can view all events that are created by them.&lt;/p&gt;

&lt;p&gt;How to verify the data on Blockchain?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open apothem remix.&lt;/li&gt;
&lt;li&gt;Create contract by pasting the code shared above and compile it.&lt;/li&gt;
&lt;li&gt;Go to deployments section and paste "0x7B7de5c2Ad5a9e3209d2388C7C7BBFc689105Ea6" to get the setters and getters in GUI.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here you can verify the events data by entering the sequence number of it under any getter or setter.&lt;/p&gt;

&lt;p&gt;Feel free to reach out for any queries:&lt;br&gt;
Team:&lt;br&gt;
*&lt;a href="http://linkedin.com/in/harsha-netha"&gt;Gurram Harshavardhan Netha&lt;/a&gt;&lt;br&gt;
*Sriram Abhinav&lt;br&gt;
*Thoutam Ganesh&lt;br&gt;
*Hafeez Mohamad&lt;br&gt;
*Mohd. Abdul Rahman&lt;/p&gt;

</description>
      <category>pliblockathon</category>
      <category>xdc</category>
      <category>pathram</category>
      <category>grandfinals</category>
    </item>
  </channel>
</rss>
