<?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>Forem: Nawodya Ishan</title>
    <description>The latest articles on Forem by Nawodya Ishan (@nawodyaishan).</description>
    <link>https://forem.com/nawodyaishan</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%2F750339%2F50b4d1b5-be60-4fe3-9278-00ecee2cced6.jpg</url>
      <title>Forem: Nawodya Ishan</title>
      <link>https://forem.com/nawodyaishan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nawodyaishan"/>
    <language>en</language>
    <item>
      <title>Simple Storage Smart Contract on Avalanche Blockchain with Solidity, TypeScript, EVM, HardHat and EthersJS</title>
      <dc:creator>Nawodya Ishan</dc:creator>
      <pubDate>Sun, 23 Apr 2023 14:40:08 +0000</pubDate>
      <link>https://forem.com/nawodyaishan/simple-storage-smart-contract-on-avalanche-blockchain-with-solidity-typescript-evm-hardhat-and-avalanchejs-59i5</link>
      <guid>https://forem.com/nawodyaishan/simple-storage-smart-contract-on-avalanche-blockchain-with-solidity-typescript-evm-hardhat-and-avalanchejs-59i5</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Avalanche is a relatively new blockchain platform that aims to solve some of the scalability and efficiency issues faced by other blockchain networks like Bitcoin and Ethereum. It was created by a team of computer scientists led by Emin Gün Sirer, a well-known figure in the blockchain community.&lt;/p&gt;

&lt;p&gt;Avalanche uses a novel consensus mechanism called Avalanche consensus, which allows for high throughput, low latency, and high transaction finality. Unlike traditional Proof-of-Work or Proof-of-Stake consensus algorithms, Avalanche relies on a random sampling of network participants to quickly reach consensus on the state of the network.&lt;/p&gt;

&lt;p&gt;One of the key features of Avalanche is its ability to support multiple subnets or "blockchains within a blockchain." This means that different groups of users can create their own subnets with their own rules and governance structures while still being able to interact with the wider Avalanche network.&lt;/p&gt;

&lt;p&gt;Another notable feature of Avalanche is its support for the creation of smart contracts using the Solidity programming language, which is also used by Ethereum. This allows developers to build decentralised applications (dApps) on the Avalanche platform with familiar tools and languages.&lt;/p&gt;

&lt;p&gt;Overall, Avalanche is a promising blockchain platform that offers significant improvements in scalability, speed, and flexibility over other existing blockchain networks. Its unique consensus mechanism and support for multiple subnets make it an interesting option for developers and users looking to build decentralised applications or participate in a fast and efficient blockchain ecosystem.&lt;/p&gt;

&lt;h1&gt;
  
  
  Steps
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Prerequisites&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before we begin, make sure you have the following tools installed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Node.js (v14+)&lt;/li&gt;
&lt;li&gt;npm (v7+)&lt;/li&gt;
&lt;li&gt;HardHat (v2+)&lt;/li&gt;
&lt;li&gt;Solidity (v0.8+)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Setting up the project&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Create a new directory for the project and navigate into it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir simple-storage
cd simple-storage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Initialize a new Node.js project and install the required dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init -y
npm install --save-dev hardhat @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers typescript ts-node dotenv @types/dotenv @types/mocha @types/chai avalanche
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Initialize HardHat:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose "Create an empty hardhat.config.js" when prompted.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 2: Configure TypeScript and HardHat&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Create a new &lt;strong&gt;&lt;code&gt;tsconfig.json&lt;/code&gt;&lt;/strong&gt; file in the root of the project with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es2017"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"commonjs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"strict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"esModuleInterop"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"skipLibCheck"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"forceConsistentCasingInFileNames"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"resolveJsonModule"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"outDir"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dist"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"include"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"./scripts"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./test"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"files"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"./hardhat.config.ts"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rename &lt;strong&gt;&lt;code&gt;hardhat.config.js&lt;/code&gt;&lt;/strong&gt; to &lt;strong&gt;&lt;code&gt;hardhat.config.ts&lt;/code&gt;&lt;/strong&gt; and update its content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { HardhatUserConfig } from 'hardhat/config';
import '@nomiclabs/hardhat-waffle';
import '@nomiclabs/hardhat-ethers';
import 'dotenv/config';

const config: HardhatUserConfig = {
  solidity: '0.8.0',
  networks: {
    hardhat: {
      chainId: 31337,
    },
  },
  mocha: {
    timeout: 20000,
  },
};

export default config;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3: Creating the Simple Storage Contract&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Create a new directory &lt;strong&gt;&lt;code&gt;contracts&lt;/code&gt;&lt;/strong&gt; and a new Solidity file &lt;strong&gt;&lt;code&gt;SimpleStorage.sol&lt;/code&gt;&lt;/strong&gt; inside it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir contracts
touch contracts/SimpleStorage.sol
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following code to &lt;strong&gt;&lt;code&gt;SimpleStorage.sol&lt;/code&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight solidity"&gt;&lt;code&gt;&lt;span class="c1"&gt;// SPDX-License-Identifier: MIT
&lt;/span&gt;
&lt;span class="k"&gt;pragma&lt;/span&gt; &lt;span class="n"&gt;solidity&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;contract&lt;/span&gt; &lt;span class="n"&gt;SimpleStorage&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kt"&gt;uint256&lt;/span&gt; &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="n"&gt;_storedData&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint256&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_storedData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;view&lt;/span&gt; &lt;span class="k"&gt;returns&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint256&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_storedData&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Overview&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The Simple Storage contract is designed to demonstrate the basic functionality of a smart contract by allowing users to store and retrieve data on the Ethereum blockchain. The contract consists of a single state variable that holds an unsigned integer and two functions for setting and getting the stored value.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;State Variables&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The contract has one state variable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;storedData&lt;/code&gt;&lt;/strong&gt;: This unsigned integer (&lt;strong&gt;&lt;code&gt;uint256&lt;/code&gt;&lt;/strong&gt;) holds the stored data. It is the main data storage for the contract, and its value can be modified using the &lt;strong&gt;&lt;code&gt;set()&lt;/code&gt;&lt;/strong&gt; function and retrieved using the &lt;strong&gt;&lt;code&gt;get()&lt;/code&gt;&lt;/strong&gt; function.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Functions&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The contract has two main functions:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;set()&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This function allows users to update the value of the &lt;strong&gt;&lt;code&gt;storedData&lt;/code&gt;&lt;/strong&gt; state variable. It takes a single input parameter, a &lt;strong&gt;&lt;code&gt;uint256&lt;/code&gt;&lt;/strong&gt; value, which represents the new data to be stored.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight solidity"&gt;&lt;code&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint256&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;storedData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When called, this function updates the &lt;strong&gt;&lt;code&gt;storedData&lt;/code&gt;&lt;/strong&gt; state variable with the provided input value.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;get()&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This function allows users to retrieve the current value of the &lt;strong&gt;&lt;code&gt;storedData&lt;/code&gt;&lt;/strong&gt; state variable. It takes no input parameters and returns the &lt;strong&gt;&lt;code&gt;uint256&lt;/code&gt;&lt;/strong&gt; value stored in &lt;strong&gt;&lt;code&gt;storedData&lt;/code&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight solidity"&gt;&lt;code&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;view&lt;/span&gt; &lt;span class="k"&gt;returns&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint256&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;storedData&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When called, this function returns the current value of the &lt;strong&gt;&lt;code&gt;storedData&lt;/code&gt;&lt;/strong&gt; state variable without modifying it.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Interaction Flow&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The following steps outline the typical interaction flow for users interacting with the Simple Storage contract:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Deploy the contract&lt;/strong&gt;: The user deploys the Simple Storage contract to the Ethereum blockchain. Upon deployment, the &lt;strong&gt;&lt;code&gt;storedData&lt;/code&gt;&lt;/strong&gt; state variable is initialized with the value of &lt;strong&gt;&lt;code&gt;0&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set the stored data&lt;/strong&gt;: The user calls the &lt;strong&gt;&lt;code&gt;set()&lt;/code&gt;&lt;/strong&gt; function, providing a &lt;strong&gt;&lt;code&gt;uint256&lt;/code&gt;&lt;/strong&gt; value as input. The function updates the &lt;strong&gt;&lt;code&gt;storedData&lt;/code&gt;&lt;/strong&gt; state variable with the provided value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Get the stored data&lt;/strong&gt;: The user calls the &lt;strong&gt;&lt;code&gt;get()&lt;/code&gt;&lt;/strong&gt; function to retrieve the current value of the &lt;strong&gt;&lt;code&gt;storedData&lt;/code&gt;&lt;/strong&gt; state variable. The function returns the &lt;strong&gt;&lt;code&gt;uint256&lt;/code&gt;&lt;/strong&gt; value without modifying it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The Simple Storage smart contract demonstrates the basic functionality of a smart contract on the Ethereum blockchain. It allows users to store and retrieve an unsigned integer value through two simple functions, &lt;strong&gt;&lt;code&gt;set()&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;get()&lt;/code&gt;&lt;/strong&gt;. This contract serves as a starting point for understanding the fundamentals of smart contract development and can be expanded upon to implement more complex features and use cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4: Writing tests for the contract&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Create a new directory &lt;strong&gt;&lt;code&gt;test&lt;/code&gt;&lt;/strong&gt; and a new TypeScript file &lt;strong&gt;&lt;code&gt;SimpleStorage.test.ts&lt;/code&gt;&lt;/strong&gt; inside it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir test
touch test/SimpleStorage.test.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following code to &lt;strong&gt;&lt;code&gt;SimpleStorage.test.ts&lt;/code&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// @ts-ignore&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;waffle&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hardhat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Contract&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ethers&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;expect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;chai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SimpleStorage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="na"&gt;simpleStorage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Contract&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;beforeEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SimpleStorage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getContractFactory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SimpleStorage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;simpleStorage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;SimpleStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deployed&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Initial stored data should be 0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;storedData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;storedData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Should set stored data to a new value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;storedData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;storedData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;42&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 5: Compile the contract and run tests&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Compile the contract using HardHat:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat compile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the tests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything is set up correctly, you should see the tests passing.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 6: Deploy the contract on a local network&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Create a new directory &lt;strong&gt;&lt;code&gt;scripts&lt;/code&gt;&lt;/strong&gt; and a new TypeScript file &lt;strong&gt;&lt;code&gt;deploy.ts&lt;/code&gt;&lt;/strong&gt; inside it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir scripts
touch scripts/deploy.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following code to &lt;strong&gt;&lt;code&gt;deploy.ts&lt;/code&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// @ts-ignore&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ethers&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hardhat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SimpleStorageFactory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getContractFactory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SimpleStorage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;SimpleStorageFactory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deployed&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SimpleStorage deployed to:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the deployment script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat run scripts/deploy.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the contract deployed to a local address.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 7: Deploy the contract on Avalanche Testnet using Ethers.js&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To deploy the contract on Avalanche Testnet, you need an account with test AVAX. You can get some from the &lt;strong&gt;&lt;a href="https://faucet.avax-test.network/"&gt;Avalanche Faucet&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Add the following configuration to your &lt;strong&gt;&lt;code&gt;hardhat.config.ts&lt;/code&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HardhatUserConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hardhat/config&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@nomiclabs/hardhat-waffle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@nomiclabs/hardhat-ethers&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Add this line&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dotenv/config&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;HardhatUserConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;solidity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0.8.0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;hardhat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;chainId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;31337&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;fuji&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.avax-test.network/ext/bc/C/rpc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;chainId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;43113&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;gasPrice&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;225000000000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;accounts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PRIVATE_KEY&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;mocha&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure to replace &lt;strong&gt;&lt;code&gt;PRIVATE_KEY&lt;/code&gt;&lt;/strong&gt; in the &lt;strong&gt;&lt;code&gt;accounts&lt;/code&gt;&lt;/strong&gt; array with your private key.&lt;/p&gt;

&lt;p&gt;Run the deployment script on Avalanche Testnet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat run scripts/deploy.ts --network fuji
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the contract deployed to an Avalanche Testnet address.&lt;/p&gt;

&lt;p&gt;Now you have successfully created a simple storage contract in Solidity with TypeScript, EVM, and AvalancheJS, along with HardHat local testing and deployments.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 8: Interacting with the contract using AvalancheJS&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To interact with the deployed contract, create a new TypeScript file &lt;strong&gt;&lt;code&gt;interact.ts&lt;/code&gt;&lt;/strong&gt; inside the &lt;strong&gt;&lt;code&gt;scripts&lt;/code&gt;&lt;/strong&gt; directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch scripts/interact.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following code to &lt;strong&gt;&lt;code&gt;interact.ts&lt;/code&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ethers&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;dotenv&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;dotenv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;CONTRACT_ADDRESS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CONTRACT_ADDRESS&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;CONTRACT_ADDRESS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Please set your contract address in the interact.ts script&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// Your ABI Here&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ABI&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;inputs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;get&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;outputs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;internalType&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uint256&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uint256&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;stateMutability&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;view&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;function&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;inputs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;internalType&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uint256&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uint256&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;set&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;outputs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;stateMutability&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;nonpayable&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;function&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;FUJI_RPC_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.avax-test.network/ext/bc/C/rpc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PRIVATE_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PRIVATE_KEY&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;interact&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;dotenv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;CONTRACT_ADDRESS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Please set your contract address in the interact.ts script&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;JsonRpcProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;FUJI_RPC_URL&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;wallet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Wallet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;PRIVATE_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Wallet address:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;wallet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Contract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;CONTRACT_ADDRESS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ABI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;wallet&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Contract address:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;CONTRACT_ADDRESS&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Contract instance:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Read stored data&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;storedData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Stored data:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;storedData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

    &lt;span class="c1"&gt;// Set new data&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;tx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wait&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// Read updated stored data&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;updatedStoredData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;simpleStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Updated stored data:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;updatedStoredData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;interact&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Complete&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;strong&gt;&lt;code&gt;YOUR_CONTRACT_ADDRESS&lt;/code&gt;&lt;/strong&gt; with the address of your deployed contract and add your contract's ABI.&lt;/p&gt;

&lt;p&gt;Run the interaction script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx ts-node scripts/interact.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the stored data, transaction receipt, and updated stored data in the console output.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight solidity"&gt;&lt;code&gt;&lt;span class="err"&gt;╰─&lt;/span&gt; &lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="n"&gt;ts&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt; &lt;span class="n"&gt;scripts&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;interact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ts&lt;/span&gt;

&lt;span class="n"&gt;Wallet&lt;/span&gt; &lt;span class="kt"&gt;address&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0x2E3bE6ddaC75f8dA97d14009A540E917d881ea92&lt;/span&gt;
&lt;span class="n"&gt;Contract&lt;/span&gt; &lt;span class="kt"&gt;address&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0x0697aBc8Dc960d53911f4A8BB8989826b78CaF61&lt;/span&gt;
&lt;span class="n"&gt;Contract&lt;/span&gt; &lt;span class="n"&gt;instance&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Contract&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;interface&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Interface&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fragments&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;FunctionFragment&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;FunctionFragment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;_abiCoder&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AbiCoder&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;coerceFunc&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;null&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;functions&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;'get()'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;FunctionFragment&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="s"&gt;'set(uint256)'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;FunctionFragment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
    &lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
    &lt;span class="n"&gt;structs&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
    &lt;span class="n"&gt;deploy&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ConstructorFragment&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s"&gt;'constructor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;inputs&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
      &lt;span class="k"&gt;payable&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;stateMutability&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s"&gt;'nonpayable'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;gas&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;_isFragment&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;_isInterface&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;JsonRpcProvider&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_isProvider&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;_events&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
    &lt;span class="n"&gt;_emitted&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;disableCcipRead&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;formatter&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Formatter&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;formats&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;anyNetwork&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;_networkPromise&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Promise&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;pending&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;_maxInternalBlockNumber&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;_lastBlockNumber&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;_maxFilterBlockRange&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;_pollingInterval&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;_fastQueryDate&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s"&gt;'https://api.avax-test.network/ext/bc/C/rpc'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;_nextId&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="n"&gt;signer&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Wallet&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_isSigner&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;_signingKey&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="n"&gt;_mnemonic&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="kt"&gt;address&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s"&gt;'0x2E3bE6ddaC75f8dA97d14009A540E917d881ea92'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;JsonRpcProvider&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;_isProvider&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;_events&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
      &lt;span class="n"&gt;_emitted&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="n"&gt;disableCcipRead&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;formatter&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Formatter&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="n"&gt;anyNetwork&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;_networkPromise&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="n"&gt;_maxInternalBlockNumber&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;_lastBlockNumber&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;_maxFilterBlockRange&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;_pollingInterval&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;_fastQueryDate&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="n"&gt;_nextId&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="n"&gt;callStatic&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s"&gt;'get()'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="s"&gt;'set(uint256)'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="n"&gt;estimateGas&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s"&gt;'get()'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="s"&gt;'set(uint256)'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="n"&gt;functions&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s"&gt;'get()'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="s"&gt;'set(uint256)'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="n"&gt;populateTransaction&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s"&gt;'get()'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="s"&gt;'set(uint256)'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
    &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="n"&gt;filters&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="n"&gt;_runningEvents&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="n"&gt;_wrappedEmits&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="kt"&gt;address&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s"&gt;'0x0697aBc8Dc960d53911f4A8BB8989826b78CaF61'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;resolvedAddress&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Promise&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;pending&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="s"&gt;'get()'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
  &lt;span class="s"&gt;'set(uint256)'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
  &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
  &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;anonymous&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;Stored&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;Updated&lt;/span&gt; &lt;span class="n"&gt;stored&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;span class="n"&gt;Complete&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! You have now successfully developed a simple storage contract in Solidity with TypeScript, EVM, HardHat, and EthersJS, including local testing, deployments on Avalanche Testnet, and interactions with the deployed contract.&lt;/p&gt;

&lt;h2&gt;
  
  
  Source Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/nawodyaishan/avalanche-simple-storage"&gt;https://github.com/nawodyaishan/avalanche-simple-storage&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>avalanche</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
    <item>
      <title>Ethereum Blockchain App Developer Learning Path</title>
      <dc:creator>Nawodya Ishan</dc:creator>
      <pubDate>Sun, 23 Apr 2023 11:49:29 +0000</pubDate>
      <link>https://forem.com/nawodyaishan/ethereum-blockchain-app-developer-learning-path-4l7f</link>
      <guid>https://forem.com/nawodyaishan/ethereum-blockchain-app-developer-learning-path-4l7f</guid>
      <description>

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Fundamentals of Computer Science and Programming&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Learn a programming language&lt;/strong&gt;: Start with a language like Python or JavaScript, which are beginner-friendly and commonly used in blockchain development.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://www.python.org/doc/"&gt;Python&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"&gt;JavaScript&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Study data structures and algorithms&lt;/strong&gt;: Understand basic data structures (arrays, linked lists, trees) and algorithms (sorting, searching).

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://www.coursera.org/specializations/algorithms"&gt;Coursera - Algorithms&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learn basic web development&lt;/strong&gt;: Understand HTML, CSS, and JavaScript to build user interfaces for web applications.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://www.freecodecamp.org/"&gt;FreeCodeCamp&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 2: Blockchain Fundamentals&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Understand blockchain basics&lt;/strong&gt;: Learn about distributed ledgers, consensus mechanisms, cryptography, and smart contracts.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://www.coursera.org/learn/blockchain-basics"&gt;Blockchain Basics&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explore popular blockchain platforms&lt;/strong&gt;: Study platforms like Ethereum, Bitcoin, and Hyperledger to understand their ecosystems and use cases.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://ethereum.org/"&gt;Ethereum&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://bitcoin.org/"&gt;Bitcoin&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://www.hyperledger.org/"&gt;Hyperledger&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3: Smart Contract Development&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Learn Solidity&lt;/strong&gt;: This is the primary language for writing smart contracts on the Ethereum platform.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://solidity.readthedocs.io/"&gt;Solidity Documentation&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Understand the Ethereum development environment&lt;/strong&gt;: Learn about tools like Truffle, Ganache, and Metamask to streamline development.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://www.trufflesuite.com/"&gt;Truffle Suite&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Study other smart contract languages&lt;/strong&gt;: Consider learning languages like Vyper (Ethereum), Rust (Polkadot, Solana), or Go (Hyperledger).

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://vyper.readthedocs.io/"&gt;Vyper&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://www.rust-lang.org/"&gt;Rust&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://golang.org/"&gt;Go&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4: Decentralized Application (DApp) Development&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Learn to build DApps&lt;/strong&gt;: Understand the architecture and components of decentralized applications.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://www.youtube.com/c/DappUniversity"&gt;DApp University&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend development for DApps&lt;/strong&gt;: Utilize web development skills to build user interfaces, and integrate with blockchain using libraries like Web3.js or Ethers.js.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://web3js.readthedocs.io/"&gt;Web3.js&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://docs.ethers.io/"&gt;Ethers.js&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security best practices&lt;/strong&gt;: Learn to write secure smart contracts and protect DApps from common vulnerabilities.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://consensys.github.io/smart-contract-best-practices/"&gt;Smart Contract Security&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 5: Advanced Topics&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Layer 2 scaling solutions&lt;/strong&gt;: Study technologies like Plasma, Optimistic Rollups, and zk-SNARKs to improve blockchain scalability.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://ethereum.org/en/developers/docs/layer-2-scaling/"&gt;Ethereum Layer 2 Scaling Solutions&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interoperability&lt;/strong&gt;: Understand cross-chain communication and bridges for seamless integration between different blockchain networks.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://cosmos.network/"&gt;Cosmos&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://polkadot.network/"&gt;Polkadot&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decentralized finance (DeFi)&lt;/strong&gt;: Learn about DeFi protocols, lending platforms, decentralized exchanges, and other financial applications built on blockchain.&lt;/li&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://defipulse.com/"&gt;DeFi Pulse&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://aave.com/"&gt;Aave&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://uniswap.org/"&gt;Uniswap&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Non-fungible tokens (NFTs)&lt;/strong&gt;: Understand the concept of NFTs and learn how to create, manage, and trade unique digital assets on blockchain platforms.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://opensea.io/"&gt;OpenSea&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://nftschool.dev/"&gt;NFT School&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Identity and privacy&lt;/strong&gt;: Study blockchain-based identity solutions and privacy-preserving techniques like zero-knowledge proofs.

&lt;ul&gt;
&lt;li&gt;Resources: &lt;strong&gt;&lt;a href="https://www.uport.me/"&gt;uPort&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="https://z.cash/technology/zksnarks/"&gt;zk-SNARKs&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 6: Hands-on Experience and Networking&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Build personal projects&lt;/strong&gt;: Create DApps, smart contracts, or other blockchain-related projects to solidify your skills and showcase your capabilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contribute to open-source projects&lt;/strong&gt;: Engage with the blockchain community by contributing to existing projects, reporting bugs, or suggesting improvements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Participate in hackathons&lt;/strong&gt;: Join blockchain hackathons to collaborate with others, develop new ideas, and compete for prizes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network&lt;/strong&gt;: Attend conferences, meetups, and webinars to connect with other professionals, learn about the latest trends, and stay up-to-date with the industry.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 7: Job Search and Continuous Learning&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Prepare your portfolio&lt;/strong&gt;: Create a professional portfolio showcasing your projects, contributions, and skills to impress potential employers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhance your online presence&lt;/strong&gt;: Maintain an active presence on platforms like GitHub, LinkedIn, and Twitter to connect with industry professionals and showcase your expertise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apply for jobs&lt;/strong&gt;: Look for job opportunities at blockchain startups, established companies, or freelance platforms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stay informed&lt;/strong&gt;: Keep learning about new developments, technologies, and trends in the blockchain space to stay ahead in the industry.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By following this learning path, you will gain the essential knowledge and skills to become a successful blockchain app developer software engineer. Remember that the field is constantly evolving, so staying up-to-date and continuing to learn is crucial for your success.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>blockchain</category>
      <category>ethereum</category>
      <category>web3</category>
    </item>
    <item>
      <title>ASP.NET Core MVC - What are HTTP Status Codes?</title>
      <dc:creator>Nawodya Ishan</dc:creator>
      <pubDate>Sat, 18 Jun 2022 14:50:27 +0000</pubDate>
      <link>https://forem.com/nawodyaishan/aspnet-core-mvc-what-are-http-status-codes-3992</link>
      <guid>https://forem.com/nawodyaishan/aspnet-core-mvc-what-are-http-status-codes-3992</guid>
      <description>&lt;p&gt;Any RESTful Web API relies on request and response. Every status code has a specific significance, and we must ensure that we are sending a proper answer with a valid status code during development.&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%2F2natgey293ate0w7l8me.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%2F2natgey293ate0w7l8me.png" alt="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why HTTP Status Codes ?
&lt;/h2&gt;

&lt;p&gt;HTTP response status codes represent whether or not a specific HTTP request were successfully completed. These responses are divided into the following 5 categories.&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%2Fjqmuo02p414z5muwqvil.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%2Fjqmuo02p414z5muwqvil.png" alt="Error Types"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Status-Code element in a server response is a three-digit integer where the first digit indicates the response type and the final two digits have no classifications role.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Informational Responses
&lt;/h2&gt;

&lt;p&gt;These codes are informative, they are telling like the server has received a request and is continuing to process.  &lt;/p&gt;

&lt;p&gt;Ex:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;100 Continue - This interim response indicates that the client should continue the request or ignore the response if the request is already finished.&lt;/li&gt;
&lt;li&gt;101 Switching protocols - This code is sent in response to an &lt;code&gt;Upgrade&lt;/code&gt; request header from the client and indicates the protocol the server is switching to.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  2. Succesful Responses
&lt;/h2&gt;

&lt;p&gt;This means the request has been successful and the browser has received the expected information data.&lt;/p&gt;

&lt;p&gt;Ex:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;200 OK - The request is OK. The request succeeded. The result meaning of "success" depends on the HTTP method:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;GET&lt;/code&gt;: The resource has been fetched and transmitted in the message body.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;HEAD&lt;/code&gt;: The representation headers are included in the response without any message body.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PUT&lt;/code&gt; or &lt;code&gt;POST&lt;/code&gt;: The resource describing the result of the action is transmitted in the message body.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TRACE&lt;/code&gt;: The message body contains the request message as received by the server.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;202 Accepted - The request is accepted for processing, but the processing is not complete.&lt;/li&gt;
&lt;li&gt;201 Created - The request is complete, and a new resource is created .&lt;/li&gt;
&lt;li&gt;203 Non-authoritative Information - The information in the entity header is from a local or third-party copy, not from the original server.&lt;/li&gt;
&lt;li&gt;204 No Content - A status code and a header are given in the response, but there is no entity-body in the reply.&lt;/li&gt;
&lt;li&gt;205 Reset Content - The browser should clear the form used for this transaction for additional input.&lt;/li&gt;
&lt;li&gt;206 Partial Content - The server is returning partial data of the size requested. Used in response to a request specifying a &lt;em&gt;Range&lt;/em&gt;
 header. The server must specify the range included in the response with the &lt;em&gt;Content-Range&lt;/em&gt;
 header.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Redirection Responses
&lt;/h2&gt;

&lt;p&gt;This code says that we have been redirected and completion of the request need further actions.&lt;/p&gt;

&lt;p&gt;Ex:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;300 Multiple Choices - A link list. The user can select a link and go to that location. Maximum five addresses .&lt;/li&gt;
&lt;li&gt;301 Moved Permanently - The requested page has moved to a new url .&lt;/li&gt;
&lt;li&gt;302 Found - The requested page has moved temporarily to a new url .&lt;/li&gt;
&lt;li&gt;303 See Other - The requested page can be found under a different url .&lt;/li&gt;
&lt;li&gt;304 Not Modified - This is the response code to an If-Modified-Since or If-None-Match header, where the URL has not been modified since the specified date.&lt;/li&gt;
&lt;li&gt;305 Use Proxy - The requested URL must be accessed through the proxy mentioned in the Location header.&lt;/li&gt;
&lt;li&gt;306 Unused - This code was used in a previous version. It is no longer used, but the code is reserved.&lt;/li&gt;
&lt;li&gt;307 Temporary Redirect - The requested page has moved temporarily to a new url.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  4. Client Error Responses
&lt;/h2&gt;

&lt;p&gt;This indicates the client errors such as some pages cannot be reached, unavailable etc.&lt;/p&gt;

&lt;p&gt;Ex:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;400 Bad Request - The server did not understand the request.&lt;/li&gt;
&lt;li&gt;401 Unauthorised - The requested page needs a username and a password.&lt;/li&gt;
&lt;li&gt;402 Payment Required - &lt;em&gt;You can not use this code yet.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;403 Forbidden - Access is forbidden to the requested page.&lt;/li&gt;
&lt;li&gt;404 Not Found - The server can not find the requested page.&lt;/li&gt;
&lt;li&gt;405 Method Not Allowed - The method specified in the request is not allowed.&lt;/li&gt;
&lt;li&gt;406 Not Acceptable - The server can only generate a response that is not accepted by the client.&lt;/li&gt;
&lt;li&gt;407 Proxy Authentication Required - You must authenticate with a proxy server before this request can be served.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  5. Server Error
&lt;/h2&gt;

&lt;p&gt;These are the code that tells request is valid but the server could not complete the request.&lt;/p&gt;

&lt;p&gt;Ex: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;500 Internal Server Error - The request was not completed. The server met an unexpected condition.&lt;/li&gt;
&lt;li&gt;501 Not Implemented - The request was not completed. The server did not support the functionality required.&lt;/li&gt;
&lt;li&gt;502 Bad Gateway - The request was not completed. The server received an invalid response from the upstream server.&lt;/li&gt;
&lt;li&gt;503 Service Unavailable - The request was not completed. The server is temporarily overloading or down.&lt;/li&gt;
&lt;li&gt;504 Gateway Timeout - The gateway has timed out.&lt;/li&gt;
&lt;li&gt;505 HTTP Version Not Supported - The server does not support the "http protocol" version.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;You can learn more information via Microsoft’s Official Documentation &lt;a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.statuscodes?view=aspnetcore-6.0" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>csharp</category>
      <category>dot</category>
      <category>mvc</category>
    </item>
    <item>
      <title>ASP.NET Core MVC - What is IActionResult?</title>
      <dc:creator>Nawodya Ishan</dc:creator>
      <pubDate>Sat, 18 Jun 2022 14:45:52 +0000</pubDate>
      <link>https://forem.com/nawodyaishan/aspnet-core-mvc-what-is-iactionresult-1ee</link>
      <guid>https://forem.com/nawodyaishan/aspnet-core-mvc-what-is-iactionresult-1ee</guid>
      <description>&lt;p&gt;The IActionResult type is a based abstraction of an ActionResult.&lt;/p&gt;

&lt;p&gt;💡 An ActionResult is a return type of a controller method, also called an action method, and serves as the base class for *Result classes. Action methods return models to views, file streams, redirect to other controllers, or whatever is necessary for the task at hand.&lt;/p&gt;

&lt;p&gt;It specifies how a response is going to be given for a Specific Request.&lt;/p&gt;

&lt;p&gt;The IActionResult return type is appropriate when multiple action result return types are possible in an action.&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%2Fj9eq3d2uuskrhmfmteg0.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%2Fj9eq3d2uuskrhmfmteg0.png" alt="IActionResult Overview Diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The IActionResult is an interface, while action results themselves are abstract classes.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>mvc</category>
      <category>csharp</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>ASP.NET Core MVC - Introduction</title>
      <dc:creator>Nawodya Ishan</dc:creator>
      <pubDate>Sat, 18 Jun 2022 14:42:52 +0000</pubDate>
      <link>https://forem.com/nawodyaishan/aspnet-core-mvc-introduction-1ij8</link>
      <guid>https://forem.com/nawodyaishan/aspnet-core-mvc-introduction-1ij8</guid>
      <description>&lt;p&gt;Hey fellows, In this article series I’m going to cover the following areas in the Web development with C#, ASP .NET Core MVC, MVVM Tech Stack.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ASP .NET Core&lt;/li&gt;
&lt;li&gt;Razor Pages and Blazor&lt;/li&gt;
&lt;li&gt;MVC Architecture&lt;/li&gt;
&lt;li&gt;MVVM Architecture&lt;/li&gt;
&lt;li&gt;Models, ViewModels, Views, Partial views, Controllers, ViewComponents&lt;/li&gt;
&lt;li&gt;Dependency injection, Major dependency injection lifetimes, Services&lt;/li&gt;
&lt;li&gt;SQL Server configuration, EFCore migrations, Relationship types&lt;/li&gt;
&lt;li&gt;Authentication, Authorization, Cookie-based Authentication&lt;/li&gt;
&lt;li&gt;Azure Deployment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, In this section, we will talk about MVC architecture at a high level.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is MVC mean?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Model-View-Controller (MVC)&lt;/strong&gt; is an architectural design pattern that divides a software application/system into three main logical components,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The model&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The view&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The controller&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each of these components is made to control and manage specific development domains in an application. &lt;/p&gt;

&lt;p&gt;MVC is one of the most frequently used industry-standard web development frameworks to create scalable and extensible projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8MvssFcC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/maimprt3bgkt2hcjs3ea.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8MvssFcC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/maimprt3bgkt2hcjs3ea.png" alt="MVC Architecture Diagram" width="444" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Model
&lt;/h2&gt;

&lt;p&gt;In basic C# ASP .NET Core Web applications, it acts as a C# class which holds application data as a Data Blueprint. It also manages the Database operations and relations.&lt;/p&gt;

&lt;p&gt;Ex: Buyer, Seller, Admin User, Categories Classes in e-commerce Applications&lt;/p&gt;

&lt;p&gt;So Basically, The Model component corresponds to all the data-related logic that the user works with.&lt;/p&gt;

&lt;h2&gt;
  
  
  View
&lt;/h2&gt;

&lt;p&gt;The view is a component that displays the user interface. In C#, It’s the CSHTML file (Razor Views). This handles the app's data presentation and user interaction&lt;/p&gt;

&lt;p&gt;In view, you can trigger/notify the events that get handled by the controllers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Controller
&lt;/h2&gt;

&lt;p&gt;A controller controls the workflow that a user interacts with MVC application*&lt;em&gt;.&lt;/em&gt;* A controller contains the flow control logic for an ASP.NET MVC application. A controller determines what response to send back to a user when a user makes a browser request.&lt;/p&gt;

&lt;p&gt;According to some folks,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Controllers are the brain of an &lt;a href="http://asp.net/"&gt;ASP.NET&lt;/a&gt; Core application. They process incoming requests, perform operations on data provided through Models, and selects Views to render on the browser.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Controllers are stored inside the Controllers folder in the root of the app.&lt;/p&gt;

&lt;p&gt;Next Article, we will talk about these 3 main sections with C# examples.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>dotnet</category>
      <category>csharp</category>
      <category>mvc</category>
    </item>
    <item>
      <title>Basic Input and Output in C Language</title>
      <dc:creator>Nawodya Ishan</dc:creator>
      <pubDate>Sun, 12 Jun 2022 08:59:40 +0000</pubDate>
      <link>https://forem.com/nawodyaishan/basic-input-and-output-in-c-language-32ip</link>
      <guid>https://forem.com/nawodyaishan/basic-input-and-output-in-c-language-32ip</guid>
      <description>&lt;p&gt;Basic meaning behind the Input and output in programming is&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In Input, we feed data int to a program&lt;/li&gt;
&lt;li&gt;In Output, we feed data out from the program&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The C programming language includes standard libraries that enable input and output in programs. The file pointers provide access to the file for reading and writing.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Standard File&lt;/th&gt;
&lt;th&gt;File Pointer&lt;/th&gt;
&lt;th&gt;Device&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Standard input&lt;/td&gt;
&lt;td&gt;stdin&lt;/td&gt;
&lt;td&gt;Keyboard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Standard output&lt;/td&gt;
&lt;td&gt;stdout&lt;/td&gt;
&lt;td&gt;Screen&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Standard error&lt;/td&gt;
&lt;td&gt;stderr&lt;/td&gt;
&lt;td&gt;Your screen&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The stdio.h or standard input output library in C contains input and output methods. The header file stdio.h stands for Standard Input Output. It has the information related to input/output functions.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;printf()&lt;/td&gt;
&lt;td&gt;It is used to print the strings, integer, character etc on the output screen.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;scanf()&lt;/td&gt;
&lt;td&gt;It reads the character, string, integer etc from the keyboard.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;getc()&lt;/td&gt;
&lt;td&gt;It reads the character from the file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;putc()&lt;/td&gt;
&lt;td&gt;It writes the character to the file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fopen()&lt;/td&gt;
&lt;td&gt;It opens the file and all file handling functions are defined in stdio.h header file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fclose()&lt;/td&gt;
&lt;td&gt;It closes the opened file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;remove()&lt;/td&gt;
&lt;td&gt;It deletes the file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fflush()&lt;/td&gt;
&lt;td&gt;It flushes the file.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;putchar(), getchar() function in C&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The putchar() method in the C programming language is used to write a character to standard output/screen. The getchar() method retrieves/reads a character from keyboard input. Please see the explanation and syntax for the aforementioned file handling method below.&lt;/p&gt;

&lt;h3&gt;
  
  
  putchar(0
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Declaration:&lt;/strong&gt; int putchar(int char)&lt;/p&gt;

&lt;p&gt;putchar() function is used to write a character on standard output/screen. In a C program, we can use putchar function as below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;putchar&lt;/strong&gt;(char);&lt;/p&gt;

&lt;p&gt;where, char is a character variable/value.&lt;/p&gt;

&lt;h3&gt;
  
  
  getchar()
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Declaration:&lt;/strong&gt; int getchar(void)&lt;/p&gt;

&lt;p&gt;getchar() function is used to get/read a character from keyboard input. In a C program, we can use getchar function as below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;getchar&lt;/strong&gt;(char);&lt;/p&gt;

&lt;p&gt;where, char is a character variable/value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

   &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

   &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"Enter a value :"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;

   &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;You entered: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="n"&gt;putchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;

   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;According to above example, The int getchar(void) method returns the next available character from the screen as an integer. This function only reads one character at a time. If you wish to read more than one character from the screen, you may use this technique in the loop.&lt;/p&gt;

&lt;p&gt;The int putchar(int c) method displays the character provided to it and returns the same character. This function only inserts one character at a time. If you wish to display more than one character on the screen, you may use this approach in the loop.&lt;/p&gt;

&lt;p&gt;But when we are using more than 1 character in a program we need to use &lt;strong&gt;The gets() and puts() Functions.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

   &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

   &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"Enter a value :"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="n"&gt;gets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;

   &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;You entered: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;

   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;The scanf() and printf() Functions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The scanf() method, in C, reads the value from the console as per the type specified. The scanf(const char *format,...) function receives input from the standard input stream stdin and scans it using the format specified.&lt;/p&gt;

&lt;p&gt;The printf() method, in C, prints the value passed as the parameter to it, on the console screen. The printf(const char *format,...) function outputs to the standard output stream stdout and conforms to the format specified.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Using scanf() and printf() Functions with basic data types in C.&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Integer
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="nl"&gt;Input:&lt;/span&gt; &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;intVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;Output&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;intVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;# include &amp;lt;stdio.h&amp;gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;fahrenheit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;celsius&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Please enter fahrenheit as a integer: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;fahrenheit&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You have entered: %d as the temperature in fahrenheit"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fahrenheit&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;celsius&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fahrenheit&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt; %d fahrenheit is %d celsius &lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fahrenheit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;celsius&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Float
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input: scanf("%f", &amp;amp;floatVariable);
Output: printf("%f", floatVariable);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;speed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;********************************"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Enter Your Speed: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%f"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;speed&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You have entered: %f as the Speed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;speed&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Your Speed is Normal"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Your Speed is Too High"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Character
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input: scanf("%c", &amp;amp;charVariable);
Output: printf("%c", charVariable);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="s"&gt;Enter the Character: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Entered character is: %c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;String
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input: scanf("%s", stringVariable);
Output: printf("%s", stringVariable);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter the Word: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Entered Word is: %s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="s"&gt;Enter the Sentence: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%[^&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;]&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Entered Sentence is: %s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What is &lt;code&gt;%[^\n]\ns&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;[^\n]&lt;/code&gt; when we include this in &lt;code&gt;scanf&lt;/code&gt; we will input the string until it encounter a new line in input.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;%[^\n]&lt;/code&gt; scans everything until a &lt;code&gt;\n&lt;/code&gt;, but doesn't scan in the &lt;code&gt;\n&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;^&lt;/code&gt; is caret operator. It helps us to ignore a particular character.&lt;/li&gt;
&lt;li&gt;whenever we write &lt;code&gt;^\n&lt;/code&gt; in &lt;code&gt;scanf&lt;/code&gt; function, we will be able to write string with spaces and also able to store in a particular variable(here, &lt;code&gt;str&lt;/code&gt; variable),until &lt;code&gt;\n&lt;/code&gt; (here, &lt;code&gt;\n&lt;/code&gt; is Enter key) is encountered.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>cpp</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Begin your C# Game Development Journey Using This Challenge</title>
      <dc:creator>Nawodya Ishan</dc:creator>
      <pubDate>Mon, 04 Apr 2022 14:02:44 +0000</pubDate>
      <link>https://forem.com/nawodyaishan/begin-your-c-game-development-journey-using-this-challenge-1d59</link>
      <guid>https://forem.com/nawodyaishan/begin-your-c-game-development-journey-using-this-challenge-1d59</guid>
      <description>&lt;p&gt;Hi Fellows,&lt;/p&gt;

&lt;p&gt;Here we will discuss a simple but important programming challenge that will help you enhance your fundamental knowledge of C# .NET Console Applications, Data Types, Declaring Variables, Constants, &amp;amp; mathematical operations that are critical for game development.&lt;/p&gt;

&lt;h2&gt;
  
  
  C# Pre-requisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Declaring and using variables&lt;/li&gt;
&lt;li&gt;Calculating with integers, floats and doubles.&lt;/li&gt;
&lt;li&gt;Prompting for inputs and Getting inputs&lt;/li&gt;
&lt;li&gt;Declaring and Using Constants and Variables&lt;/li&gt;
&lt;li&gt;Trigonometry with floats&lt;/li&gt;
&lt;li&gt;Calculations and Rounding&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Challenge Description
&lt;/h2&gt;

&lt;p&gt;Here you want to have an impossible imagination. What if you are about to visit ancient Greek and meet Pythagoras, Hipparchus using a time machine. And you visit them with modern computers and games you developed using their amazing mathematical theories like Trigonometry and Pythagoras Theorem. &lt;/p&gt;

&lt;p&gt;So on that occasion, you are about to show a simple program to show them how you implemented the Pythagoras theorem using C# Programming Language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Wait !! Pythagoras' theorem is a critical theorem used in game development mostly to calculate the distance between two points.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Pythagoras Theorem
&lt;/h2&gt;

&lt;p&gt;The Pythagorean Theorem tells us how to calculate the length of the hypotenuse of a right triangle.&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%2Fys5pue00pzbqbc7tq45k.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%2Fys5pue00pzbqbc7tq45k.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then,&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%2Fardwp7kw2zc34lgyl9an.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%2Fardwp7kw2zc34lgyl9an.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are some applications of the theorem.&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%2F2v2pgo8ofo3vza53kxrf.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%2F2v2pgo8ofo3vza53kxrf.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h4&gt;
  
  
  Challenge !!
&lt;/h4&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;In the following scenario, Imagine there are two players. Player A wants to throw a projectile at Player B as they are enemies.&lt;/p&gt;

&lt;p&gt;The requirement for Projectile Throwing is the Direction and distance of Player B from Player A's position. &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%2F7e6yjw97u35v0h0d46kx.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%2F7e6yjw97u35v0h0d46kx.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First of all, we have to take the current positions of 2 Players as x y coordinates imagining a 2D cartesian plane.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Player A -&amp;gt; (point1X, point1y)&lt;br&gt;
Player B-&amp;gt; (point2X, point2y)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So Let's Implement it in C# Script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using System;
using System.Runtime.ConstrainedExecution;

namespace GameDevPythagoras
{
    /// &amp;lt;summary&amp;gt;
    /// Pythagoras Implementation for position calculation using C#
    /// &amp;lt;/summary&amp;gt;
    class Program
    {
        // declaring x and y coordinates for player positions
        static float point1X;
        static float point1Y;
        static float point2X;
        static float point2Y;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then we can assign values for declared variables using the C# input function. Here we input data as a one-line string.&lt;/p&gt;

&lt;p&gt;Player A's XY Coordinates and Player B's XY Coordinates Separated by spaces like below,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;5 5 4 4&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Also we assign q to end the while loop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/// &amp;lt;param name="args"&amp;gt;command-line args&amp;lt;/param&amp;gt;
static void Main(string[] args)
{
    // loop while there's more input
    string input = Console.ReadLine();
    while (input[0] != 'q')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we read the input and assign values for points using the following function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;static void GetInputValuesFromString(string input)
{
    // extract point 1 x
    int spaceIndex = input.IndexOf(' ');
    point1X = float.Parse(input.Substring(0, spaceIndex));

    // move along string and extract point 1 y
    input = input.Substring(spaceIndex + 1);
    spaceIndex = input.IndexOf(' ');
    point1Y = float.Parse(input.Substring(0, spaceIndex));

    // move along string and extract point 2 x
    input = input.Substring(spaceIndex + 1);
    spaceIndex = input.IndexOf(' ');
    point2X = float.Parse(input.Substring(0, spaceIndex));

    // point 2 y is the rest of the string
    input = input.Substring(spaceIndex + 1);
    point2Y = float.Parse(input);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then inside the previous while loop, we call the above function to assign values from the input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// extract point coordinates from string
GetInputValuesFromString(input);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we are going to calculate the distance between 2 points as a float. To do the implementation of the Pythagoras Theorem, we want the delta x and delta y as 2 vertices of the triangle.&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%2Flchq0zucs15b5e8b9ty9.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%2Flchq0zucs15b5e8b9ty9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To do the next calculations, we are going to use the Math class in C#.&lt;/p&gt;

&lt;h3&gt;
  
  
  Calculating Distance
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Math.Sqrt -&amp;gt; Returns the square root of a specified number as a Double.&lt;/li&gt;
&lt;li&gt;Math.Pow -&amp;gt; Returns a specified number raised to the specified power as a Double.&lt;/li&gt;
&lt;li&gt;Math.Atan2 -&amp;gt; Returns the angle whose tangent is the quotient of two specified numbers as a Double.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So we calculate the distance between 2 player positions as follows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;float distance = (float) Math.Sqrt((Math.Pow(point1X - point2X, 2) + Math.Pow(point1Y - point2Y, 2)));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basically what happens here is,&lt;/p&gt;

&lt;p&gt;DeltaX = Player B's X Coordinate Magnitude-Player A's X Coordinate Magnitude&lt;br&gt;
DeltaY = Player B's Y Coordinate Magnitude-Player A's Y Coordinate Magnitude&lt;/p&gt;

&lt;p&gt;Then,&lt;br&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%2F3mf2ehcqzz8mnlk0asw9.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%2F3mf2ehcqzz8mnlk0asw9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We use Math.Pow method by giving 2 numbers as the parameters like below,&lt;/p&gt;

&lt;p&gt;_&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Math.Pow (double x, double y);&lt;br&gt;
double x = A double-precision floating-point number to be raised to a power.&lt;br&gt;
double y = A double-precision floating-point number that specifies a power.&lt;br&gt;
_&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We use Math.Sqrt method by giving the number required to calculate the square root as the parameter.&lt;/p&gt;

&lt;p&gt;Then we convert calculated double values to float using (float).&lt;/p&gt;
&lt;h2&gt;
  
  
  Calculating the angle
&lt;/h2&gt;

&lt;p&gt;To calculate the angle we have to use Math.Atan2 method which returns the angle whose tangent is the quotient of two specified numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;double angle = (float)Math.Atan2(point2Y - point1Y, point2X - point1X);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This returns the radiant value of the angle, so we need to convert it to degrees to proceed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;angle *= (float)180/Math.PI;   //angle = angle * (float)180/Math.PI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;&amp;gt; The Math.PI property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159: Math.PI = π ≈ 3.14159&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Next, we print out the calculation answers using Console.WriteLine method in DOT NET.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Console.WriteLine("The Distance Between Player A and B is " + (float) Math.Round(distance, 6));
Console.WriteLine("The Angle from Player A to Player B is " + (float)Math.Round(angle, 5) + " degrees");
input = Console.ReadLine();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is a test case.&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%2Furb4kqiiof8yqdej5j9f.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%2Furb4kqiiof8yqdej5j9f.png" alt="Image description"&gt;&lt;/a&gt;&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%2Fvv7m68ouojwmh4c4pfk8.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%2Fvv7m68ouojwmh4c4pfk8.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here you can have look at the &lt;a href="https://github.com/nawodyaishan/gamedev-pythagoras" rel="noopener noreferrer"&gt;source code&lt;/a&gt;.
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using System;
using System.Runtime.ConstrainedExecution;

namespace GameDevPythagoras
{
    /// &amp;lt;summary&amp;gt;
    /// Pythagoras Implementation for position calculation using C#
    /// &amp;lt;/summary&amp;gt;
    class Program
    {
        // declaring x and y coordinates for player positions
        static float point1X;
        static float point1Y;
        static float point2X;
        static float point2Y;


        /// &amp;lt;param name="args"&amp;gt;command-line args&amp;lt;/param&amp;gt;
        static void Main(string[] args)
        {
            // loop while there's more input
            string input = Console.ReadLine();
            while (input[0] != 'q')
            {
                // extract point coordinates from string
                GetInputValuesFromString(input);

                // calculate distance between points 1 and 2
                float distance = (float) Math.Sqrt((Math.Pow(point1X - point2X, 2) + Math.Pow(point1Y - point2Y, 2)));

                double angle = (float)Math.Atan2(point2Y - point1Y, point2X - point1X);

                angle *= (float)180/Math.PI;

                Console.WriteLine("The Distance Between Player A and B is " + (float) Math.Round(distance, 6));
                Console.WriteLine("The Angle from Player A to Player B is " + (float)Math.Round(angle, 5) + " degrees");
                input = Console.ReadLine();


            }
        }

        /// &amp;lt;summary&amp;gt;
        /// Extracts point coordinates from the given input string
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="input"&amp;gt;input string&amp;lt;/param&amp;gt;
        static void GetInputValuesFromString(string input)
        {
            // extract point 1 x
            int spaceIndex = input.IndexOf(' ');
            point1X = float.Parse(input.Substring(0, spaceIndex));

            // move along string and extract point 1 y
            input = input.Substring(spaceIndex + 1);
            spaceIndex = input.IndexOf(' ');
            point1Y = float.Parse(input.Substring(0, spaceIndex));

            // move along string and extract point 2 x
            input = input.Substring(spaceIndex + 1);
            spaceIndex = input.IndexOf(' ');
            point2X = float.Parse(input.Substring(0, spaceIndex));

            // point 2 y is the rest of the string
            input = input.Substring(spaceIndex + 1);
            point2Y = float.Parse(input);
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, I believe this guide would've provided some basic introduction to C# Programming for Game Development as a beginner.&lt;/p&gt;

&lt;p&gt;Thank you. &lt;/p&gt;

</description>
      <category>csharp</category>
      <category>gamedev</category>
      <category>programming</category>
      <category>unity3d</category>
    </item>
    <item>
      <title>Introduction to Machine Learning and Hello World in Neural Networks</title>
      <dc:creator>Nawodya Ishan</dc:creator>
      <pubDate>Sun, 27 Mar 2022 11:35:44 +0000</pubDate>
      <link>https://forem.com/nawodyaishan/introduction-to-machine-learning-and-hello-world-in-neural-networks-51e1</link>
      <guid>https://forem.com/nawodyaishan/introduction-to-machine-learning-and-hello-world-in-neural-networks-51e1</guid>
      <description>&lt;p&gt;Hi fellows,&lt;/p&gt;

&lt;p&gt;Here we are going to build basic pattern recognition models using neural networks. Neural Networks are a more advanced topic in machine learning that belongs to deep learning but in this basic introductory example we use the external libraries to make things easy a little bit.&lt;/p&gt;

&lt;p&gt;First of you have to have some basics prerequisites of machine learning&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Machine Learning?
&lt;/h2&gt;

&lt;p&gt;Yes, as the topic says machines are learning. Machine learning is all about how machines are learning and how do we teach the machines to learn. In so near future machines can learn and do the thing that we, humans do.&lt;/p&gt;

&lt;p&gt;From the computer programming perspective, traditionally we write computer programs by defining rules and data by ourselves to the computer.&lt;/p&gt;

&lt;p&gt;As the following diagram, the user gives rules and data and answers come out.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lxyoplix--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1yoszyn6lohmp8zwruu4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lxyoplix--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1yoszyn6lohmp8zwruu4.png" alt="Image description" width="800" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But in a machine learning scenario, we give answers and data to the machine, the computer and it produces the rules, the connection between answers, and data itself. &lt;/p&gt;

&lt;p&gt;Basically, the thing happening here is we give the exiting examples to the computer which we cant figure out how it's happening, and through machine recognizes the how it happening by the rules.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sl6ql7CB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cdcateut3q83c1bax83g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sl6ql7CB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cdcateut3q83c1bax83g.png" alt="Image description" width="800" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's take a quick simple example,&lt;br&gt;
Here I show you, a Human coded BMI Calculator using Python.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# height input as "h" and weight in as "w"
h = float(input("Please Enter Your Height in cm: "))
w = float(input("Please Enter Your Weight in kg: "))
BMI = w / (h/100)**2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As above code, we can calculate each person's BMI index and give feedback on their inputs as follows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(f"You BMI Index is {BMI}")
if BMI &amp;lt;= 18.4:
    print("You are slightly underweight.")
elif BMI &amp;lt;= 24.9:
    print("You are pretty healthy.")
elif BMI &amp;lt;= 29.9:
    print("You are slightly overweight.")
elif BMI &amp;lt;= 34.9:
    print("You are severely overweight.")
elif BMI &amp;lt;= 39.9:
    print("You are obese.. -_-")
else:
    print("You are severely obese... Get Some Help")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But what if we want to calculate different health indexes using the same or different input data (like Body Adiposity Index AKA BAI, Waist-to-Hip, etc), this approach has to be failed.&lt;/p&gt;

&lt;p&gt;So as previous diagrams explain, we teach computers that this is BMI and how to calculate BMI, this is BAI how to calculate that using given example data and outputs. So those will become Answers and Data according to our previous diagrams. what is happening inside is the computer is learning the pattern of data and answers using machine learning algorithms. So this has opened a new horizon in the computer science and data science world.&lt;/p&gt;

&lt;h3&gt;
  
  
  Machine Learning Road Map
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Introduction to Machine Learning&lt;/li&gt;
&lt;li&gt;Supervised Learning and Linear Regression&lt;/li&gt;
&lt;li&gt;Classification and Logistic Regression&lt;/li&gt;
&lt;li&gt;Decision Tree and Random Forest&lt;/li&gt;
&lt;li&gt;Naïve Bayes and Support Vector Machine&lt;/li&gt;
&lt;li&gt;Unsupervised Learning&lt;/li&gt;
&lt;li&gt;Natural Language Processing and Text Mining&lt;/li&gt;
&lt;li&gt;Introduction to Deep Learning&lt;/li&gt;
&lt;li&gt;Time Series Analysis&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;if you want to study machine learning in-depth, I recommend &lt;a href="https://www.freecodecamp.org/news/best-machine-learning-courses/"&gt;these courses&lt;/a&gt; for a successful career through machine learning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple Number Pattern Prediction using Neural Networks
&lt;/h2&gt;

&lt;p&gt;Here I am going to show you how to do a simple pattern recognition like above using Neural Networks which is a part of Deep Learning.&lt;/p&gt;

&lt;p&gt;Deep Learning is a more complicated advanced topic of machine learning but it is easier with neural networks to do simple pattern recognitions using external Python Libraries like NumPy, Pandas, and Tensorflow.&lt;/p&gt;

&lt;p&gt;As previously said, machine learning is the computer learning pattern to do certain things.&lt;/p&gt;

&lt;p&gt;So as an example following number sequence has a pattern. try to recognize this pattern.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;x = -1, 0, 1, 2, 3, 4&lt;br&gt;
y = -3, -1, 1, 3, 5, 7&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;so the relationship is,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;y = 2x-1&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In our mind, you might figure out that between -1 and 3 there is a difference of 2 and between 0 and -1 there is 1 difference. so there might be multiple of x with 2 and + or - of some value.&lt;/p&gt;

&lt;p&gt;So let's implement this in the Python programming language.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Waaaiiiit !!!! Why Python? Python is simple and consistent, already have massive community support worldwide, have tons of libraries and frameworks for machine learning and data science (NumPy, Pandas, Matplotlib, Seaborn for Data Analysis and Visualization, TensorFlow, Keras, Scikit-learn for Machine learning, OpenCV, Pillow for Computer vision, NLTK, spaCy for Natural language processing)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's dive into our first code,&lt;/p&gt;

&lt;p&gt;First, we import Keras API (application programming interface) from TensorFlow.&lt;/p&gt;

&lt;p&gt;Here keras make it easy with its set of functions for neural networks. In this line of code, we implemented the simplest possible neurons. "Dense" defines the connected neurons. &lt;/p&gt;

&lt;p&gt;As there is only one layer of dense here, there is only one layer on neurons in here. And input shape of this layer is also the simplest form with one value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import keras

model = keras.Sequential([keras.layers.Dense(units=1,input_shape[1])])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But when it comes to machine learning we need to calculate using Linear algebra calculus and more advanced theories but in Tensorflow and Keras those complicated ones are already implemented.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;but if you need to optimize and go deep you want Machine Learning Concepts with Advcanec Scientific mathematical Background.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then we implement loss function and optimizer. The loss function guesses the relation between x and y and gives the measured result data (good or bad, how much loss or close) to the optimizer to make the next guess. &lt;br&gt;
Optimizer decides the accuracy of the guess done by the loss function. Optimizers are methods or approaches that adjust the properties of your neural network, such as weights and learning rate, to decrease losses. &lt;br&gt;
The main logic is here to make each guess made by loss function to be better than one before.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;model.compile(optimizer="sgd", loss='mean_squared_error')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When gues are making some progress with gues becoming better and better the convergence is being used. To study more about convergence visit &lt;a href="https://www.linkedin.com/pulse/knowing-what-makes-ml-training-converge-deepak-kumar/"&gt;this site&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Next, we import the NumPy library to do calculations easily.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import numpy as np
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;next we implement two flat arrays to x and y values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xs = np.array([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0], dtype=float)
ys = np.array([-3.0, -1.0, 1.0, 3.0, 5.0, 7.0], dtype=float)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the next cell we figure out how do these xs value fit in ys values by implementing model.fit method for 500 number of times. epochs = 500 means the training loop will do 500 times its guesses.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Training the model
model.fit(xs, ys, epochs=500)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the output looks like this&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Epoch 1/500&lt;br&gt;
6/6 [==============================] - 0s 36ms/step - loss: 12.7812&lt;br&gt;
Epoch 2/500&lt;br&gt;
6/6 [==============================] - 0s 524us/step - loss: 10.2833&lt;br&gt;
…….&lt;br&gt;
6/6 [==============================] - 0s 157us/step - loss: 3.9143e-05&lt;br&gt;
Epoch 499/500&lt;br&gt;
6/6 [==============================] - 0s 185us/step - loss: 3.8338e-05&lt;br&gt;
Epoch 500/500&lt;br&gt;
6/6 [==============================] - 0s 255us/step - loss: 3.7551e-05&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is called training the model. After running 500 training loops you can see that loss is getting lower. so next we do prediction of our custon number for X using predict method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(model.predict([10.0]))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the output should be close to 19 but instead it showed&lt;br&gt;
[[18.982122]]&lt;/p&gt;

&lt;p&gt;This is happening because of insufficient training data.&lt;br&gt;
if we Train the model with 1000 loops answer will look like this.&lt;br&gt;
[[18.999987]]&lt;/p&gt;

&lt;p&gt;So with model training, it becomes close to the real answer.&lt;/p&gt;

&lt;p&gt;You can find the source code for &lt;a href="https://github.com/nawodyaishan/hello-world-neural-networks/blob/main/SimpleNumberPatternPredistion.ipynb"&gt;this here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Simple House Price Prediction using Neural Network Basics and Tensorflow
&lt;/h2&gt;

&lt;p&gt;Here we are going to do a real-life scenario to Build a Neural network using TensorFlow.&lt;/p&gt;

&lt;p&gt;Here is the simple formula for the prediction&lt;/p&gt;

&lt;p&gt;House of Price with one bedroom = 100k&lt;br&gt;
House of Price with one bedroom = 150k&lt;/p&gt;

&lt;p&gt;Accordingly, the price of the houses increases by the number of bedrooms.&lt;/p&gt;

&lt;p&gt;Here we going to build a neural network to predict the prices of houses according to their bedrooms.&lt;/p&gt;

&lt;p&gt;here is the two x and y data for this&lt;br&gt;
x = 1, 2, 3, 4, 5, 6, 7&lt;br&gt;
y = 1, 1.5, 2, 2.5, 3, 3.5, 4&lt;/p&gt;

&lt;p&gt;And Let's start by importing essential libraries for this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import tensorflow as tf
import numpy as np
from tensorflow import keras
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we implement whole methods as loss function, optimization, and defining number arrays, defining training loops ( Here 1000 epochs ) inside a basic python function called house_model and return model with empty arguments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def house_model():
    xs = np.array([1.0,2.0,3.0,4.0,5.0,6.0], dtype=float)
    ys = np.array([1.0,1.5,2.0,2.5,3.0,3.5],dtype=float)
    model = tf.keras.models.Sequential([tf.keras.layers.Dense(units=1,input_shape=[1])])
    model.compile(optimizer = 'sgd', loss = 'mean_squared_error')
    model.fit(xs,ys,epochs=1000)
    return model
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we assign the number of beds to value to new_y and use predict method and execute the house_model function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new_y = 10.0
model = house_model()
prediction = model.predict([new_y])[0]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After training the data 1000 times the prediction will print as follows&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(prediction)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;[5.5149393]&lt;/p&gt;

&lt;p&gt;You can find the source code &lt;a href="https://github.com/nawodyaishan/hello-world-neural-networks/blob/main/HousePricePrediction.ipynb"&gt;from here.&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want to continue your self-study in Neural networks while parallel to Machine Learning, You can follow the DeepLearning Coursera specialization by applying for financial Aid.&lt;br&gt;
Visit &lt;a href="https://www.coursera.org/professional-certificates/tensorflow-in-practice"&gt;Coursera&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, I believe this guide would've provided some basic introduction on how machine learning and artificial intelligence are applied through the neural network.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>neuralnetworks</category>
      <category>python</category>
      <category>tensorflow</category>
    </item>
  </channel>
</rss>
