<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Abraham Chase.</title>
        <link>https://paragraph.com/@abraham-chase</link>
        <description>Keeping you informed on cryptocurrency.

Sharing strategies on Airdrops and DeFi.</description>
        <lastBuildDate>Wed, 12 Aug 2026 05:29:51 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Abraham Chase.</title>
            <url>https://storage.googleapis.com/papyrus_images/8f3ef8fc1b98a1afa8f989307fdb528a01a0814e258c456a52c75cf09ff716e6.jpg</url>
            <link>https://paragraph.com/@abraham-chase</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[How to set up a Privasea node to earn rewards.]]></title>
            <link>https://paragraph.com/@abraham-chase/how-to-set-up-a-privasea-node-to-earn-rewards</link>
            <guid>kxdr4m4XG09nkiFjwlrb</guid>
            <pubDate>Wed, 29 Jan 2025 16:33:15 GMT</pubDate>
            <description><![CDATA[Here&apos;s the step-by-step guide on running an incentivized node. With only a handful of node runners currently, this is your chance to get ahead. They&apos;ve raised $15M in funding rounds and are backed by top VCs like @BinanceLabs. Additionally, 10% of the supply is allocated to the community. This is the continuation of the Twitter post. I believe you have already downloaded the Terminus app or software, and your VPS is ready. Open the Terminus app or software and click on "new host". P...]]></description>
            <content:encoded><![CDATA[<p>Here&apos;s the step-by-step guide on running an incentivized node. With only a handful of node runners currently, this is your chance to get ahead.</p><p>They&apos;ve raised $15M in funding rounds and are backed by top VCs like @BinanceLabs. Additionally, 10% of the supply is allocated to the community.</p><p>This is the continuation of the Twitter post.</p><p>I believe you have already downloaded the Terminus app or software, and your VPS is ready.</p><p>Open the Terminus app or software and click on &quot;new host&quot;. Paste the IP address you obtained from pq hosting in the “IP or Hostname“ box, then enter &quot;root&quot; as the username. Use the password you set in the PQ hosting dashboard when you were getting your VPS.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b47e670b8935989154e3248698315125b1df0f453374dde60671b84cc54b435e.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>If you&apos;re confused about your VPS password, navigate to your dashboard and click on the three dots next to the purchased VPS. Then, select &quot;to panel.&quot;</p><p>You will be taken to the next page. Once there, click on the three dots and select &quot;Change password.&quot; This will allow you to change your VPS password.</p><p>Once you are connected to your VPS, you will see something similar to this on your screen.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/91636dfa9faf99ce9a6d0e39a48e391f42e634dee5f8ef563d2a1cb797cc1b7d.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Now, 50% of the work is completed, All you need to do is paste each command individually, and your node will be operational.</p><p>First, let install docker using following command.</p><pre data-type="codeBlock" text="# Update APT package index
sudo apt update

# Install Docker
sudo apt install -y docker-ce
"><code><span class="hljs-comment"># Update APT package index</span>
sudo apt update

<span class="hljs-comment"># Install Docker</span>
sudo apt install -y docker-ce
</code></pre><p>You can verify if docker is installed or not by:</p><pre data-type="codeBlock" text="sudo docker --version
"><code>sudo docker <span class="hljs-operator">-</span><span class="hljs-operator">-</span>version
</code></pre><p>You will see output similar to the following, Docker version 27.5.1, build 9f9e405. This indicates that the installation was successful.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5135a55ff0f0ddd90d39f9f2053718d9031accf1488205ca4315c2233a8d819b.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Now, start and enable docker service in your VPS using following command:</p><pre data-type="codeBlock" text="sudo systemctl start docker 
sudo systemctl enable docker
"><code>sudo systemctl start docker 
sudo systemctl <span class="hljs-built_in">enable</span> docker
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/68a30b6b15f872c9c69a83702ef7c4c4efa293a81686ae18d7684033542134d6.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Now, After this paste this code:</p><pre data-type="codeBlock" text="docker pull privasea/acceleration-node-beta:latest
"><code>docker pull privasea<span class="hljs-operator">/</span>acceleration<span class="hljs-operator">-</span>node<span class="hljs-operator">-</span>beta:latest
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d8cb9d6f639394b0f58883b7c6a39298e57aa3dff6fc16f428ef352be06339ab.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Let’s create directory and navigate to it now:</p><pre data-type="codeBlock" text="mkdir -p ~/privasea/config &amp;&amp; cd ~/privasea
"><code>mkdir <span class="hljs-operator">-</span>p <span class="hljs-operator">~</span><span class="hljs-operator">/</span>privasea<span class="hljs-operator">/</span>config <span class="hljs-operator">&#x26;</span><span class="hljs-operator">&#x26;</span> cd <span class="hljs-operator">~</span><span class="hljs-operator">/</span>privasea
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6ea87a596d56ff5e332985c50009c3f2d2a5e42a488bb973fd95329138fe1e8a.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then run the following command and the program will prompt you to enter a password, please remember this password for future use.</p><pre data-type="codeBlock" text="docker run --rm -it -v &quot;$HOME/privasea/config:/app/config&quot; privasea/acceleration-node-beta:latest ./node-calc new_keystore
"><code>docker run <span class="hljs-operator">-</span><span class="hljs-operator">-</span>rm <span class="hljs-operator">-</span>it <span class="hljs-operator">-</span>v <span class="hljs-string">"$HOME/privasea/config:/app/config"</span> privasea<span class="hljs-operator">/</span>acceleration<span class="hljs-operator">-</span>node<span class="hljs-operator">-</span>beta:latest ./node<span class="hljs-operator">-</span>calc new_keystore
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/39c86f09e751b1367a9420e39f7bfb3d0070da7094870e08d1c5bbc2746a4ed6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Now, we need to move keystore file to a new file.</p><pre data-type="codeBlock" text="mv $HOME/privasea/config/UTC--* $HOME/privasea/config/wallet_keystore
"><code>mv $HOME<span class="hljs-operator">/</span>privasea<span class="hljs-operator">/</span>config<span class="hljs-operator">/</span>UTC<span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">*</span> $HOME<span class="hljs-operator">/</span>privasea<span class="hljs-operator">/</span>config<span class="hljs-operator">/</span>wallet_keystore
</code></pre><p>Then simply go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://deepsea-beta.privasea.ai/privanetixNode">here</a> and connect your wallet and click on “set one up now!”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4d53c15d1b9fb514731c089a554a99346826ff9ef3c916a749326162ddeacf68.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Once you reach to next page, enter your unique name, set commission as 1% and enter your node address that we got in last step and told you to save somewhere safe.</p><p><strong>READ THIS CAREFULLY:</strong> In the command below, replace &quot;YOUR_KEYSTONE_PASSWORD&quot; with the password you set earlier.</p><pre data-type="codeBlock" text="docker run -d --name privanetix-node -v &quot;$HOME/privasea/config:/app/config&quot; -e KEYSTORE_PASSWORD=YOUR_KEYSTONE_PASSWORD privasea/acceleration-node-beta:latest
"><code>docker run <span class="hljs-operator">-</span>d <span class="hljs-operator">-</span><span class="hljs-operator">-</span>name privanetix<span class="hljs-operator">-</span>node <span class="hljs-operator">-</span>v <span class="hljs-string">"$HOME/privasea/config:/app/config"</span> <span class="hljs-operator">-</span>e KEYSTORE_PASSWORD<span class="hljs-operator">=</span>YOUR_KEYSTONE_PASSWORD privasea<span class="hljs-operator">/</span>acceleration<span class="hljs-operator">-</span>node<span class="hljs-operator">-</span>beta:latest
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/aacf1c085b0b0241867157adafd4586d9a93f30074daf355a90646ae79ab833d.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>That&apos;s it. Our node setup is complete, and your node will start running.</p><p>After a moment, your status will change from &quot;Offline&quot; to &quot;Online.&quot;</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f7feb73e4d77cfb62b1b99c13e19104654776c3912560bbc46eee744a86586dd.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Once your node status is online, you can stake your $TPRAI by going <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://deepsea-beta.privasea.ai/nodeDetail/default">here</a>.</p><p>Note: You can get 1 $TPRAI from the faucet by clicking on “Privasea DeepSea Beta faucet” in the top right.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/974c7124589a98a7a26eb61d376be9f9f99e6d65397890ebb2b78500837d9a17.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>If you’re not seeing $TPRAI in your wallet, add it to your wallet using this CA:</p><pre data-type="codeBlock" text="0xe999b25Bc133C913b83D69aEC73ea47c1d451315
"><code></code></pre><p>If you&apos;re receiving a &quot;stake failed&quot; error, set the gas fee as indicated below, and it should succeed.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/dddba9a60a019db8726e46a5551bb01a364373b36a36633e45002a0a2c166a61.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c1040117ee2f058b957e74495cca284e71172fbc1cfb6541a08c479d67e1c9e6.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Keep your node running and you will be able to claim rewards once in a while.</p><p>That’s all for now!</p>]]></content:encoded>
            <author>abraham-chase@newsletter.paragraph.com (Abraham Chase.)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/3b10a3039bb200ec30c0f5862d64fd8e8c6feb033deaad45ebf05ce9cdf47448.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Step-by-step guide on how to update your t3rn node to the latest version.]]></title>
            <link>https://paragraph.com/@abraham-chase/step-by-step-guide-on-how-to-update-your-t3rn-node-to-the-latest-version</link>
            <guid>pJibDPQB2vkFDfaKsxHg</guid>
            <pubDate>Thu, 19 Dec 2024 10:27:57 GMT</pubDate>
            <description><![CDATA[This continues from the Twitter post. Since it’s on the testnet, they’re testing various things. Yesterday, a huge gas spike caused many of us to lose BRN in gas fees. Don’t worry, they’ll compensate us for the lost BRN. They also have an update we need to install on our VPS to run the node perfectly. To access your VPS, enter the VPS screen. Press “CTRL + C” if your node is running to stop it. You will find yourself in the “executor/executor/bin” directory. We need to navigate to the home di...]]></description>
            <content:encoded><![CDATA[<p>This continues from the Twitter post.</p><p>Since it’s on the testnet, they’re testing various things. Yesterday, a huge gas spike caused many of us to lose BRN in gas fees.</p><p>Don’t worry, they’ll compensate us for the lost BRN. They also have an update we need to install on our VPS to run the node perfectly.</p><p>To access your VPS, enter the VPS screen. Press “CTRL + C” if your node is running to stop it.</p><p>You will find yourself in the “executor/executor/bin” directory. We need to navigate to the home directory to begin.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c5675398126cf7070989c6ec4cb20b31778512b515e47d1615e72d64ece53674.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>To go to the home directory, use the following command; remember, you only need to copy and paste the commands.</p><pre data-type="codeBlock" text="cd ../../..
"><code>cd ../../..
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/65c53a32155b12b94b161a72264f3d01f896ee347d47a92709faff3437773f74.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Now that you’re in the home directory let’s remove the outdated folder from our VPS by using the command below:</p><pre data-type="codeBlock" text="rm -r executor
"><code><span class="hljs-built_in">rm</span> -r executor
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2f259b3d7c8544965b58c0f5f24ffffb6f15717e9712ee735711a047e4287c06.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Again, following immediately with this command.</p><pre data-type="codeBlock" text="rm -r executor-linux-v0.27.0.tar.gz
"><code>rm <span class="hljs-operator">-</span>r executor<span class="hljs-operator">-</span>linux<span class="hljs-operator">-</span>v0<span class="hljs-number">.27</span><span class="hljs-number">.0</span>.tar.gz
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0e203e0b7601b2456e8205f2fed2c6dd1961d6184a1b045a1dff9a48e8328064.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Now that both outdated folders have been removed let’s install the new version using the command below.</p><pre data-type="codeBlock" text="wget https://github.com/t3rn/executor-release/releases/download/v0.28.0/executor-linux-v0.28.0.tar.gz
"><code>wget https://github.com/t3rn/executor-release/releases/download/v0.28.0/executor-linux-v0.28.0.tar.gz
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d4abde281826dfe8725746e091ab0fd9c2f58a0529482f15d2db01b9ed43d70a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then copy and paste this command to unzip the folder:</p><pre data-type="codeBlock" text="tar -xvzf executor-linux-v0.28.0.tar.gz
"><code>tar <span class="hljs-operator">-</span>xvzf executor<span class="hljs-operator">-</span>linux<span class="hljs-operator">-</span>v0<span class="hljs-number">.28</span><span class="hljs-number">.0</span>.tar.gz
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ecb12250bfec7a82be275e2767d4e74598770720ddb4536bfd3790a2cca232db.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Followed by:</p><pre data-type="codeBlock" text="cd executor/executor/bin
"><code><span class="hljs-built_in">cd</span> executor/executor/bin
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0799044a2ae4712729319e4c228ab70aaf445d3ebd840b902c58db25186d1583.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Just like this.</p><p>Next, copy and paste the following:</p><pre data-type="codeBlock" text="export NODE_ENV=testnet
"><code>export <span class="hljs-attr">NODE_ENV</span>=testnet
</code></pre><p>Immediately followed by (Copy the two codes below at once and paste):</p><pre data-type="codeBlock" text="export LOG_LEVEL=debug
"><code>export <span class="hljs-attr">LOG_LEVEL</span>=debug
</code></pre><pre data-type="codeBlock" text="export LOG_PRETTY=false
"><code>export <span class="hljs-attr">LOG_PRETTY</span>=<span class="hljs-literal">false</span>
</code></pre><p>Immediately followed by (Copy the two codes below at once and paste):</p><pre data-type="codeBlock" text="export EXECUTOR_PROCESS_ORDERS=true
"><code>export <span class="hljs-attr">EXECUTOR_PROCESS_ORDERS</span>=<span class="hljs-literal">true</span>
</code></pre><pre data-type="codeBlock" text="export EXECUTOR_PROCESS_CLAIMS=true
"><code>export <span class="hljs-attr">EXECUTOR_PROCESS_CLAIMS</span>=<span class="hljs-literal">true</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bd42e569258b3d91c7d4adaab619454b8cf17861c53e207fb01ec796da52f1a5.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then immediately followed by:</p><pre data-type="codeBlock" text="export EXECUTOR_MAX_L3_GAS_PRICE=50
"><code>export <span class="hljs-attr">EXECUTOR_MAX_L3_GAS_PRICE</span>=<span class="hljs-number">50</span>
</code></pre><p>This command, introduced in the latest guide, sets a GWEI limit to prevent issues with our node during gas price spikes.</p><p>Just like this.</p><p>Now, read this carefully, obtain the private key of the wallet you wish to use, or have testnet funds in any wallet you have been using, such as metamask.</p><p>Now you see the code below; see where it says =<code>YOUR_PRIVATE_KEY</code> your private key should be what is there, so remove that <code>YOUR_PRIVATE_KEY</code> and put your private key there before you paste the code into your VPS</p><pre data-type="codeBlock" text="export PRIVATE_KEY_LOCAL=YOUR_PRIVATE_KEY
"><code>export <span class="hljs-attr">PRIVATE_KEY_LOCAL</span>=YOUR_PRIVATE_KEY
</code></pre><p>After you have done that, copy and paste the following:</p><pre data-type="codeBlock" text="export ENABLED_NETWORKS=&apos;arbitrum-sepolia,base-sepolia,optimism-sepolia,l1rn&apos;
"><code>export <span class="hljs-attr">ENABLED_NETWORKS</span>=<span class="hljs-string">'arbitrum-sepolia,base-sepolia,optimism-sepolia,l1rn'</span>
</code></pre><p>Immediately followed by:</p><pre data-type="codeBlock" text="export EXECUTOR_PROCESS_PENDING_ORDERS_FROM_API=false
"><code>export <span class="hljs-attr">EXECUTOR_PROCESS_PENDING_ORDERS_FROM_API</span>=<span class="hljs-literal">false</span>
</code></pre><p>And finally,</p><p><code>./executor</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/35366750ae627fdd38c6e5eb7617ae8b516e96093381fadc486a40c5320bb30f.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Your NODE is running perfectly.</p><p>Press CTRL + A + D together as usual to exit your screen.</p><p>That will be all for now.</p>]]></content:encoded>
            <author>abraham-chase@newsletter.paragraph.com (Abraham Chase.)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/17e928a66e6ea2caf3608cf2fcee423adc44be4ab91b6f97711ae905b9d3ae54.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[How to set up a t3rn_io node to get more $RBN.]]></title>
            <link>https://paragraph.com/@abraham-chase/how-to-set-up-a-t3rn-io-node-to-get-more-rbn</link>
            <guid>2WtGuePfnqGWHOX6IDOq</guid>
            <pubDate>Tue, 17 Dec 2024 10:09:07 GMT</pubDate>
            <description><![CDATA[They’ve raised $7.5M in funding rounds and are still in the testnet phase. The simplest way to earn $BRN is to make a transaction, receiving 1 $BRN for each. We will elevate our efforts by running the node to earn $BRN directly. This is the continuation of the Twitter post. I believe you have already downloaded the Terminus app or software, as well as your VPS is ready. open the Terminus app or software and click on "new host". Paste the IP address you obtained from pq hosting in the “IP or H...]]></description>
            <content:encoded><![CDATA[<p>They’ve raised $7.5M in funding rounds and are still in the testnet phase. The simplest way to earn $BRN is to make a transaction, receiving 1 $BRN for each.</p><p>We will elevate our efforts by running the node to earn $BRN directly.</p><p>This is the continuation of the Twitter post.</p><p>I believe you have already downloaded the Terminus app or software, as well as your VPS is ready.</p><p>open the Terminus app or software and click on &quot;new host&quot;. Paste the IP address you obtained from pq hosting in the “IP or Hostname“ box, then enter &quot;root&quot; as the username. Use the password you set in the PQ hosting dashboard when you were getting your VPS.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0564369264213e2260fd50287fe4ccb21258c41eb49fb07fd73cf6139ce4ee0e.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>If you&apos;re confused about your VPS password, navigate to your dashboard and click on the three dots next to the purchased VPS. Then, select &quot;to panel.&quot;</p><p>You will be taken to the next page. Once there, click on the three dots and select &quot;Change password.&quot; This will allow you to change your VPS password.</p><p>Once you are connected to your VPS, you will see something similar to this on your screen.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5a83fbce7485eeb2da72006fd416777891cc1a4879f61b492a5f1a7853328793.jpg" alt="VPS working fine" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">VPS working fine</figcaption></figure><p>Now, 50% of the work is completed, All you need to do is paste each command individually, and your node will be operational.</p><p>So, copy the following codes (The three of them at once) and paste them into your VPS:</p><p><code>sudo apt update</code></p><p><code>sudo apt install build-essential</code></p><p><code>sudo apt install git -y</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e0698f9339ca21e128368b4ff13688993201a478da269beedc9aa6ec8c661311.png" alt="Just like you see here, copy the three codes at once and paste." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Just like you see here, copy the three codes at once and paste.</figcaption></figure><p>Once it has finished running, you will see something similar to root@t3rn: It indicates that the next command can now be pasted. So, copy and paste:</p><p><code>sudo apt install screen</code></p><p>Immediately followed by:</p><p><code>screen -S t3rn</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c7cba54b52612f75184b047a7e40488fc7b1a66da254750618156be76d8d67ee.png" alt="Remember when you will see something similar to root@t3rn: It indicates that the next command can now be pasted" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Remember when you will see something similar to root@t3rn: It indicates that the next command can now be pasted</figcaption></figure><p>So, now copy and paste:</p><p><code>wget https://github.com/t3rn/executor-release/releases/download/v0.27.0/executor-linux-v0.27.0.tar.gz</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2d3e1fbce6cc894c9cd6cd592d50af6bfcff46b3d87c703be38b7b9cc08c82ef.png" alt="You should see or have something like this" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">You should see or have something like this</figcaption></figure><p>So, copy and paste:</p><p><code>tar -xvzf executor-linux-v0.27.0.tar.gz</code></p><p>Followed by:</p><p><code>cd executor/executor/bin</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f3379ea9bb3973446b7ee76fbcef00eb2d0928699458a28b29981c4e760f363a.png" alt="Just like this." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Just like this.</figcaption></figure><p>Next, copy and paste the following:</p><p><code>export NODE_ENV=testnet</code></p><p>Immediately followed by (Copy the two codes below at once and paste):</p><p><code>export LOG_LEVEL=debug</code></p><p><code>export LOG_PRETTY=false</code></p><p>Immediately followed by (Copy the two codes below at once and paste):</p><p><code>export EXECUTOR_PROCESS_ORDERS=true</code></p><p><code>export EXECUTOR_PROCESS_CLAIMS=true</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/956de492e5d3500cab1190fe8de7d6e74f181f713995077e7a7fac684e70aaa0.png" alt="Just like this." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Just like this.</figcaption></figure><p>Now, read this carefully, obtain the private key of the wallet you wish to use, or have testnet funds in any wallet you have been using, such as metamask.</p><p>Now you see the code below; see where it says =<code>YOUR_PRIVATE_KEY</code> your private key should be what is there, so remove that <code>YOUR_PRIVATE_KEY</code> and put your private key there before you paste the code into your VPS</p><p><code>export PRIVATE_KEY_LOCAL=YOUR_PRIVATE_KEY</code></p><p>After you have done that, copy and paste the following:</p><p><code>export ENABLED_NETWORKS=&apos;arbitrum-sepolia,base-sepolia,optimism-sepolia,l1rn&apos;</code></p><p>Immediately followed by:</p><p><code>export EXECUTOR_PROCESS_PENDING_ORDERS_FROM_API=false</code></p><p>And finally,</p><p><code>./executor</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/fc8efe1db404b4adfd7f1945df8c2b0496f2dda35dc38bbaf42bbcbaf1afb03d.png" alt="Your NODE is running perfectly" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Your NODE is running perfectly</figcaption></figure><p>Press CTRL + A + D together as usual to exit your screen.</p><p>That’s all the easy steps you need to do to run the node.</p>]]></content:encoded>
            <author>abraham-chase@newsletter.paragraph.com (Abraham Chase.)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/0d0425223d14b7d6cdb4fccfffaf30d0ddcf33fe02c6acf7c65e8766512fe8da.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Nillion Network's New Verifier Program: Early Participants Recognized and $40M Raised]]></title>
            <link>https://paragraph.com/@abraham-chase/nillion-network-s-new-verifier-program-early-participants-recognized-and-40m-raised</link>
            <guid>uGcOXRKBlQcJgSNf3QMP</guid>
            <pubDate>Wed, 04 Sep 2024 09:34:10 GMT</pubDate>
            <description><![CDATA[Continuing from Twitter to Mirror, I wanted to provide a step-by-step solution with images to avoid any hassle caused by codes. This platform is perfect for making things easier for you. With everything ready, connect to your VPS using Termius on your mobile phone or laptop while PuTTY works best on your laptop. Then, follow these commands step by step: 1. sudo apt install screen2. screen -S nillionYou will then be redirected to an empty screen, as intended by this code. 3. snap install docke...]]></description>
            <content:encoded><![CDATA[<p>Continuing from Twitter to Mirror, I wanted to provide a step-by-step solution with images to avoid any hassle caused by codes. This platform is perfect for making things easier for you.</p><p>With everything ready, connect to your VPS using Termius on your mobile phone or laptop while PuTTY works best on your laptop.</p><p>Then, follow these commands step by step:</p><p>1. sudo apt install screen</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c5ecb5a6d931a07dded03084c95937b5550c6969bc93e7c5b6fb6eccc0135a4b.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>2. screen -S nillion</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9cec7b90323d991aa097d2727d4da5a9156e403368921de105d50332045ef88e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>You will then be redirected to an empty screen, as intended by this code.</p><p>3. snap install docker</p><p>4. docker pull nillion/retailtoken-accuser:v1.0.0</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/21ff3c89da576e1bf3effd22b6206e944560aff059b7f3e0e3a6c33e009727f7.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>5. mkdir -p nillion/accuser</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/be8b80c89b7df98302bae4ef4ae05c464846803697c80bdab70ae88024443428.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>6. docker run -v ./nillion/accuser:/var/tmp nillion/retailtoken-accuser:v1.0.0 initialise</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1eab5d26f09fc3e9126130ed8b666192ea18fedd80a2cf8bc02c74f1b7b9c4f6.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>After this command, you will see a screen with codes, including &quot;AccountID&quot; and &quot;public key.&quot; Safely save these details and paste them into the respective fields on the Nillion Verifier website.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/07ececeb1a5a817bc96077e79dbb02354f984ec2ef1856130bfa827cdb27dcf8.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Revisit <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://faucet.testnet.nillion.com/">https://faucet.testnet.nillion.com/</a> and get the faucet for the address you obtained from the VPS and saved in your notes earlier.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/44a2769ee9456b039b34653c80403ce253a7968e474a8cb6f497ca9d2936efc7.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Wait at least 30-60 minutes before running the following command.</p><p>7. `docker run -v ./nillion/accuser:/var/tmp nillion/retailtoken-accuser:v1.0.0 accuse --rpc-endpoint &quot;<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://testnet-nillion-rpc.lavenderfive.com/">https://testnet-nillion-rpc.lavenderfive.com</a>&quot; --block-start 5352894`</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2e154321b414764a8272b86eee4bc1e767e132b36bfce4a6bdcf224cf6241356.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Your node will start running smoothly and appear as &quot;pending&quot; on the verifier page. Due to a known bug, the team is fixing, it may stay &quot;pending&quot; for a few moments.</p><p>Then, to detach from the screen, press “CTRL + A + D” simultaneously, and you&apos;re done.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/84b25eda2ca018bd1c42630330cef4ac582606d37bcbf8cd6f68a91bb5b600e7.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8696b597a61cbf634c814b1d94ec658e49e20ee595222c3dabd2a8920c3a713e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Do not worry about this delay. If you encounter any more problems, feel free to comment on my X post or join my Telegram channel:</p><div data-type="embedly" src="https://linktr.ee/Myron_Airdrops" data="{&quot;provider_url&quot;:&quot;https://linktr.ee&quot;,&quot;description&quot;:&quot;Sharing strategies on Airdrops and DeFi.&quot;,&quot;title&quot;:&quot;Chase&apos;s linktree | Twitter | Linktree&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://linktr.ee/Myron_Airdrops&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/1519ee552fbc2e84826adf6c6dbd38ac6ad2e43de40fca937543b7575ee158b1.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Linktree&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/1519ee552fbc2e84826adf6c6dbd38ac6ad2e43de40fca937543b7575ee158b1.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/1519ee552fbc2e84826adf6c6dbd38ac6ad2e43de40fca937543b7575ee158b1.jpg"/><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://linktr.ee/Myron_Airdrops" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Chase&#x27;s linktree | Twitter | Linktree</h2><p>Sharing strategies on Airdrops and DeFi.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://linktr.ee</span></div><img src="https://storage.googleapis.com/papyrus_images/1519ee552fbc2e84826adf6c6dbd38ac6ad2e43de40fca937543b7575ee158b1.jpg"/></div></a></div></div>]]></content:encoded>
            <author>abraham-chase@newsletter.paragraph.com (Abraham Chase.)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/9494e43a046d601a31a7bb374e448e7c0b1996380fda6e67936aac26b51c9579.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Mega guide on snagging a spot for the potential base developer airdrop!]]></title>
            <link>https://paragraph.com/@abraham-chase/mega-guide-on-snagging-a-spot-for-the-potential-base-developer-airdrop</link>
            <guid>XqDuYCyn1bKe27Ia3H3N</guid>
            <pubDate>Sat, 04 May 2024 07:50:01 GMT</pubDate>
            <description><![CDATA[Have you seen those recent airdrops? developers getting treated right. There’s a bunch of contract deployment tasks up for grabs on @base where you can bag all the badges for zero cost! Only 11k completed the task. That’s a huge edge for us! 🔥 Gonna be a bit of a long one, not everyone’s going to vibe with it, but hey, that’s where we shine. First of all, last year we minted this builder NFT when the base hit testnet. Now? You can totally claim your builder NFT on Mainnet right here: https:/...]]></description>
            <content:encoded><![CDATA[<p>Have you seen those recent airdrops? developers getting treated right. There’s a bunch of contract deployment tasks up for grabs on @base where you can bag all the badges for zero cost!</p><p>Only 11k completed the task. That’s a huge edge for us! 🔥</p><p>Gonna be a bit of a long one, not everyone’s going to vibe with it, but hey, that’s where we shine.</p><p>First of all, last year we minted this builder NFT when the base hit testnet. Now? You can totally claim your builder NFT on Mainnet right here: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.base.org/builder-anniversary-nft">https://www.base.org/builder-anniversary-nft</a></p><p>No coding skills? No worries. Just cruise through this guide. You’ll bump into some code snippets to copy-paste. I know X will mess up my tweet, so, as always, catch the full guide on here.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/668bb7f4d4ae9b19eafaa492f216928a64c02da4adf006eaff3fbc39cae54f1f.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><blockquote><p><em>First, you need to open up some websites. I’ll name them to make our journey easier.</em></p></blockquote><ol><li><p>Base developer page: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/deployment-to-testnet/deployment-to-testnet-exercise/">here</a>.</p></li><li><p>Remix page: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://remix.ethereum.org/#lang=en&amp;optimize=false&amp;runs=200&amp;evmVersion=null">here</a>.</p></li><li><p>Testnet page: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.alchemy.com/faucets/base-sepolia">here</a>.</p></li><li><p>Guild page: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://guild.xyz/base/base-camp">here</a>.</p></li></ol><p>Now, on the developer page, you can connect your wallet. It will prompt you to add the “base sepolia” network where all the tasks will be carried out.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5a41f9eae63640179959673062bba5732ca2c367f9329c9599a6d9a516df7da9.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>After adding network in your wallet, let’s get some faucet by going <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.alchemy.com/faucets/base-sepolia">here</a>.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ed03dd386ea05ae8af66e488c1eac96d832029906bc7081b48f78f8c9b3191d2.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, navigate to the remix tool and locate the “owner.sol” file under the contracts folder. Click on the file, and on the left sidebar, you will find the “Solidity compiler” tab. Click on “compile.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/558c11f8d34f30f43614f885ecb9e64ca7e839e9dc0ff5862890cd10ffdf8e14.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, go to the deploy tab and choose the environment as “Injected provider — Metamask”. Once your wallet is connected, click on deploy.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9a41c9c3a4351e4e81eebde3e4c45324c9559e4678aae3c29b3e2c3fefada712.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Great! Now, let’s deploy another contract. On the remix page, go to the contracts folder and create a new file following the example in the image below.</p><p>Next, name the file “BasicMath.” Simply copy the name and paste it in the required location. The file name should remain unchanged.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/77b86433ebf55dc24b1b5a468e9f4b8db4918b54257e4cce6cbc817b90044762.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, the console will open on the right side of the screen. Paste the following code in it.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract BasicMath {
    uint256 constant MAX_INT = type(uint256).max;    function adder(uint256 _a, uint256 _b) external pure returns (uint256 sum, bool error) {
        if (_b &gt; MAX_INT - _a) {
            return (0, true); // Overflow occurred
        }
        return (_a + _b, false);
    }    function subtractor(uint256 _a, uint256 _b) external pure returns (uint256 difference, bool error) {
        if (_b &gt; _a) {
            return (0, true); // Underflow occurred
        }
        return (_a - _b, false);
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.0;</span>

<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">BasicMath</span> </span>{
    <span class="hljs-keyword">uint256</span> <span class="hljs-keyword">constant</span> MAX_INT <span class="hljs-operator">=</span> <span class="hljs-keyword">type</span>(<span class="hljs-keyword">uint256</span>).<span class="hljs-built_in">max</span>;    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">adder</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _a, <span class="hljs-keyword">uint256</span> _b</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">pure</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span> sum, <span class="hljs-keyword">bool</span> <span class="hljs-keyword">error</span></span>) </span>{
        <span class="hljs-keyword">if</span> (_b <span class="hljs-operator">></span> MAX_INT <span class="hljs-operator">-</span> _a) {
            <span class="hljs-keyword">return</span> (<span class="hljs-number">0</span>, <span class="hljs-literal">true</span>); <span class="hljs-comment">// Overflow occurred</span>
        }
        <span class="hljs-keyword">return</span> (_a <span class="hljs-operator">+</span> _b, <span class="hljs-literal">false</span>);
    }    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">subtractor</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _a, <span class="hljs-keyword">uint256</span> _b</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">pure</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span> difference, <span class="hljs-keyword">bool</span> <span class="hljs-keyword">error</span></span>) </span>{
        <span class="hljs-keyword">if</span> (_b <span class="hljs-operator">></span> _a) {
            <span class="hljs-keyword">return</span> (<span class="hljs-number">0</span>, <span class="hljs-literal">true</span>); <span class="hljs-comment">// Underflow occurred</span>
        }
        <span class="hljs-keyword">return</span> (_a <span class="hljs-operator">-</span> _b, <span class="hljs-literal">false</span>);
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/96d61c9d50f1b9ffce39d8609d76ae9499b3c01c1671bd9db2c7f8958de4c9fb.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then on the left sidebar, click on “Solidity Compiler” and then compile BasicMath.sol</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c72570c6f4b9960b67ae35026090c521ba49036a95b8c92b892362c3b1586e5e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Once the contract has been successfully deployed, navigate to the left sidebar and scroll down to view the BasicMath contract code. Copy it and go to the developer page.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f8a31e742efa1ad684ed9089c48622a9670f90c2d9c5232ad19db85193d91e08.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/995bbe8f39eb1e0a96d018095b7739c2599766461895290860840b23d066ebbe.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>You should see something similar after selecting “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9df119c3d0ab24451a7576a5780d191864cb0c9789aa43b58bb5a459fb8228c2.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Great, the first deployment is complete. We have 13 more contracts to deploy, and the process will be similar. Let’s keep going.</p><p><strong>Contract 2: Control Structures</strong></p><p>Make a new file called “Control Structures” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

contract ControlStructures {
    // Define custom errors for use within the contract
    error AfterHours(uint256 time);
    error AtLunch();    // Function to determine the response based on the input number
    function fizzBuzz(uint256 _number) public pure returns (string memory response) {
        // Check if the number is divisible by both 3 and 5
        if (_number % 3 == 0 &amp;&amp; _number % 5 == 0) {
            return &quot;FizzBuzz&quot;; // Return &quot;FizzBuzz&quot; if divisible by both 3 and 5
        } 
        // Check if the number is divisible by 3
        else if (_number % 3 == 0) {
            return &quot;Fizz&quot;; // Return &quot;Fizz&quot; if divisible by 3
        } 
        // Check if the number is divisible by 5
        else if (_number % 5 == 0) {
            return &quot;Buzz&quot;; // Return &quot;Buzz&quot; if divisible by 5
        } 
        // If none of the above conditions are met
        else {
            return &quot;Splat&quot;; // Return &quot;Splat&quot; if none of the conditions are met
        }
    }    // Function to determine the response based on the input time
    function doNotDisturb(uint256 _time) public pure returns (string memory result) {
        // Ensure the input time is within valid bounds (less than 2400)
        assert(_time &lt; 2400);        // Check different time ranges and return appropriate responses or revert with errors
        if (_time &gt; 2200 || _time &lt; 800) {
            revert AfterHours(_time); // Revert with custom error if it&apos;s after 10:00 PM or before 8:00 AM
        } 
        else if (_time &gt;= 1200 &amp;&amp; _time &lt;= 1299) {
            revert AtLunch(); // Revert with custom error if it&apos;s between 12:00 PM and 1:00 PM
        } 
        else if (_time &gt;= 800 &amp;&amp; _time &lt;= 1199) {
            return &quot;Morning!&quot;; // Return &quot;Morning!&quot; if it&apos;s between 8:00 AM and 11:59 AM
        } 
        else if (_time &gt;= 1300 &amp;&amp; _time &lt;= 1799) {
            return &quot;Afternoon!&quot;; // Return &quot;Afternoon!&quot; if it&apos;s between 1:00 PM and 5:59 PM
        } 
        else if (_time &gt;= 1800 &amp;&amp; _time &lt;= 2200) {
            return &quot;Evening!&quot;; // Return &quot;Evening!&quot; if it&apos;s between 6:00 PM and 10:00 PM
        }
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> 0.8.17;</span>

<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">ControlStructures</span> </span>{
    <span class="hljs-comment">// Define custom errors for use within the contract</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">AfterHours</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> time</span>)</span>;
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">AtLunch</span>(<span class="hljs-params"></span>)</span>;    <span class="hljs-comment">// Function to determine the response based on the input number</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fizzBuzz</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _number</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">pure</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> response</span>) </span>{
        <span class="hljs-comment">// Check if the number is divisible by both 3 and 5</span>
        <span class="hljs-keyword">if</span> (_number <span class="hljs-operator">%</span> <span class="hljs-number">3</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span> <span class="hljs-operator">&#x26;</span><span class="hljs-operator">&#x26;</span> _number <span class="hljs-operator">%</span> <span class="hljs-number">5</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>) {
            <span class="hljs-keyword">return</span> <span class="hljs-string">"FizzBuzz"</span>; <span class="hljs-comment">// Return "FizzBuzz" if divisible by both 3 and 5</span>
        } 
        <span class="hljs-comment">// Check if the number is divisible by 3</span>
        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (_number <span class="hljs-operator">%</span> <span class="hljs-number">3</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>) {
            <span class="hljs-keyword">return</span> <span class="hljs-string">"Fizz"</span>; <span class="hljs-comment">// Return "Fizz" if divisible by 3</span>
        } 
        <span class="hljs-comment">// Check if the number is divisible by 5</span>
        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (_number <span class="hljs-operator">%</span> <span class="hljs-number">5</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>) {
            <span class="hljs-keyword">return</span> <span class="hljs-string">"Buzz"</span>; <span class="hljs-comment">// Return "Buzz" if divisible by 5</span>
        } 
        <span class="hljs-comment">// If none of the above conditions are met</span>
        <span class="hljs-keyword">else</span> {
            <span class="hljs-keyword">return</span> <span class="hljs-string">"Splat"</span>; <span class="hljs-comment">// Return "Splat" if none of the conditions are met</span>
        }
    }    <span class="hljs-comment">// Function to determine the response based on the input time</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">doNotDisturb</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _time</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">pure</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> result</span>) </span>{
        <span class="hljs-comment">// Ensure the input time is within valid bounds (less than 2400)</span>
        <span class="hljs-built_in">assert</span>(_time <span class="hljs-operator">&#x3C;</span> <span class="hljs-number">2400</span>);        <span class="hljs-comment">// Check different time ranges and return appropriate responses or revert with errors</span>
        <span class="hljs-keyword">if</span> (_time <span class="hljs-operator">></span> <span class="hljs-number">2200</span> <span class="hljs-operator">|</span><span class="hljs-operator">|</span> _time <span class="hljs-operator">&#x3C;</span> <span class="hljs-number">800</span>) {
            <span class="hljs-keyword">revert</span> AfterHours(_time); <span class="hljs-comment">// Revert with custom error if it's after 10:00 PM or before 8:00 AM</span>
        } 
        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (_time <span class="hljs-operator">></span><span class="hljs-operator">=</span> <span class="hljs-number">1200</span> <span class="hljs-operator">&#x26;</span><span class="hljs-operator">&#x26;</span> _time <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">=</span> <span class="hljs-number">1299</span>) {
            <span class="hljs-keyword">revert</span> AtLunch(); <span class="hljs-comment">// Revert with custom error if it's between 12:00 PM and 1:00 PM</span>
        } 
        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (_time <span class="hljs-operator">></span><span class="hljs-operator">=</span> <span class="hljs-number">800</span> <span class="hljs-operator">&#x26;</span><span class="hljs-operator">&#x26;</span> _time <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">=</span> <span class="hljs-number">1199</span>) {
            <span class="hljs-keyword">return</span> <span class="hljs-string">"Morning!"</span>; <span class="hljs-comment">// Return "Morning!" if it's between 8:00 AM and 11:59 AM</span>
        } 
        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (_time <span class="hljs-operator">></span><span class="hljs-operator">=</span> <span class="hljs-number">1300</span> <span class="hljs-operator">&#x26;</span><span class="hljs-operator">&#x26;</span> _time <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">=</span> <span class="hljs-number">1799</span>) {
            <span class="hljs-keyword">return</span> <span class="hljs-string">"Afternoon!"</span>; <span class="hljs-comment">// Return "Afternoon!" if it's between 1:00 PM and 5:59 PM</span>
        } 
        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (_time <span class="hljs-operator">></span><span class="hljs-operator">=</span> <span class="hljs-number">1800</span> <span class="hljs-operator">&#x26;</span><span class="hljs-operator">&#x26;</span> _time <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">=</span> <span class="hljs-number">2200</span>) {
            <span class="hljs-keyword">return</span> <span class="hljs-string">"Evening!"</span>; <span class="hljs-comment">// Return "Evening!" if it's between 6:00 PM and 10:00 PM</span>
        }
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ec448f8d5b760aa6699389d92208fee345407e813c4634a9ee53730980fc329c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, in the same manner, compile the file, deploy the contract and validate the metamask transaction.</p><p>Then copy the contract code by scrolling down on the left sidebar.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/170bd43fabcbf3b32cbf27937c78d973b11d544cbf37622f8b97a48d3bebaf6d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/control-structures/control-structures-exercise">here</a> and paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5640f35b3fdc93cb4dd4c72392bb82f8d3b52469247a4472b49dc3f7f258e66a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Contract 3: Storage</strong></p><p>Make a new file called “Storage” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

contract EmployeeStorage {
    // Declare private state variables to store employee data
    uint16 private shares; // Number of shares owned by the employee (private to contract)
    uint32 private salary; // Monthly salary of the employee (private to contract)
    uint256 public idNumber; // Unique identification number of the employee (publicly accessible)
    string public name; // Name of the employee (publicly accessible)    // Constructor to initialize employee data when contract is deployed
    constructor(uint16 _shares, string memory _name, uint32 _salary, uint _idNumber) {
        shares = _shares; // Initialize shares
        name = _name; // Initialize name
        salary = _salary; // Initialize salary
        idNumber = _idNumber; // Initialize idNumber
    }    // View function to retrieve the number of shares owned by the employee
    function viewShares() public view returns (uint16) {
        return shares;
    }
    
    // View function to retrieve the monthly salary of the employee
    function viewSalary() public view returns (uint32) {
        return salary;
    }    // Custom error declaration
    error TooManyShares(uint16 _shares);
    
    // Function to grant additional shares to the employee
    function grantShares(uint16 _newShares) public {
        // Check if the requested shares exceed the limit
        if (_newShares &gt; 5000) {
            revert(&quot;Too many shares&quot;); // Revert with error message
        } else if (shares + _newShares &gt; 5000) {
            revert TooManyShares(shares + _newShares); // Revert with custom error message
        }
        shares += _newShares; // Grant the new shares
    }    // Function used for testing packing of storage variables (not relevant to main functionality)
    function checkForPacking(uint _slot) public view returns (uint r) {
        assembly {
            r := sload (_slot)
        }
    }    // Function to reset shares for debugging purposes (not relevant to main functionality)
    function debugResetShares() public {
        shares = 1000; // Reset shares to 1000
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.17;</span>

<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">EmployeeStorage</span> </span>{
    <span class="hljs-comment">// Declare private state variables to store employee data</span>
    <span class="hljs-keyword">uint16</span> <span class="hljs-keyword">private</span> shares; <span class="hljs-comment">// Number of shares owned by the employee (private to contract)</span>
    <span class="hljs-keyword">uint32</span> <span class="hljs-keyword">private</span> salary; <span class="hljs-comment">// Monthly salary of the employee (private to contract)</span>
    <span class="hljs-keyword">uint256</span> <span class="hljs-keyword">public</span> idNumber; <span class="hljs-comment">// Unique identification number of the employee (publicly accessible)</span>
    <span class="hljs-keyword">string</span> <span class="hljs-keyword">public</span> name; <span class="hljs-comment">// Name of the employee (publicly accessible)    // Constructor to initialize employee data when contract is deployed</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"><span class="hljs-keyword">uint16</span> _shares, <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _name, <span class="hljs-keyword">uint32</span> _salary, <span class="hljs-keyword">uint</span> _idNumber</span>) </span>{
        shares <span class="hljs-operator">=</span> _shares; <span class="hljs-comment">// Initialize shares</span>
        name <span class="hljs-operator">=</span> _name; <span class="hljs-comment">// Initialize name</span>
        salary <span class="hljs-operator">=</span> _salary; <span class="hljs-comment">// Initialize salary</span>
        idNumber <span class="hljs-operator">=</span> _idNumber; <span class="hljs-comment">// Initialize idNumber</span>
    }    <span class="hljs-comment">// View function to retrieve the number of shares owned by the employee</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">viewShares</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint16</span></span>) </span>{
        <span class="hljs-keyword">return</span> shares;
    }
    
    <span class="hljs-comment">// View function to retrieve the monthly salary of the employee</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">viewSalary</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint32</span></span>) </span>{
        <span class="hljs-keyword">return</span> salary;
    }    <span class="hljs-comment">// Custom error declaration</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">TooManyShares</span>(<span class="hljs-params"><span class="hljs-keyword">uint16</span> _shares</span>)</span>;
    
    <span class="hljs-comment">// Function to grant additional shares to the employee</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">grantShares</span>(<span class="hljs-params"><span class="hljs-keyword">uint16</span> _newShares</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-comment">// Check if the requested shares exceed the limit</span>
        <span class="hljs-keyword">if</span> (_newShares <span class="hljs-operator">></span> <span class="hljs-number">5000</span>) {
            <span class="hljs-keyword">revert</span>(<span class="hljs-string">"Too many shares"</span>); <span class="hljs-comment">// Revert with error message</span>
        } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (shares <span class="hljs-operator">+</span> _newShares <span class="hljs-operator">></span> <span class="hljs-number">5000</span>) {
            <span class="hljs-keyword">revert</span> TooManyShares(shares <span class="hljs-operator">+</span> _newShares); <span class="hljs-comment">// Revert with custom error message</span>
        }
        shares <span class="hljs-operator">+</span><span class="hljs-operator">=</span> _newShares; <span class="hljs-comment">// Grant the new shares</span>
    }    <span class="hljs-comment">// Function used for testing packing of storage variables (not relevant to main functionality)</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">checkForPacking</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> _slot</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint</span> r</span>) </span>{
        <span class="hljs-keyword">assembly</span> {
            r <span class="hljs-operator">:=</span> <span class="hljs-built_in">sload</span> (_<span class="hljs-built_in">slot</span>)
        }
    }    <span class="hljs-comment">// Function to reset shares for debugging purposes (not relevant to main functionality)</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">debugResetShares</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        shares <span class="hljs-operator">=</span> <span class="hljs-number">1000</span>; <span class="hljs-comment">// Reset shares to 1000</span>
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b00675ba73fcc74b3cd796884dc9c34b305fffe8c51473fbbf1946f28ae45835.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Now on the deploy tab, we need to make some changes.</p><p>Select the dropdown menu as indicated by the picture. Then fill out the details.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d4497a2bcecf746c03191786a3bc9099584b4cbfe55109718125de98d7a7f89d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><ul><li><p><code>shares</code> - 1000</p></li><li><p><code>name</code> - Pat</p></li><li><p><code>salary</code> - 50000</p></li><li><p><code>idNumber</code> - 112358132134</p></li></ul><p>Then click on “Transact” and confirm the metamask popup.</p><p>Then copy the contract code by scrolling down on the left sidebar.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/285df76d40b28c9640c5bd91eca3cee746f47a0f58a341db0108b6f38a5dfd43.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/storage/storage-exercise/">here</a> paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e4ffa4a990ea205460f18c0a6ce672bb8e60a3bbf3128942aadab20d0c88b8c8.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Contract 4: Arrays</strong></p><p>Make a new file called “Arrays” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

contract ArraysExercise {
    // Declare state variables to store arrays of numbers, timestamps, and senders
    uint[] numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; // Array of numbers initialized with values
    uint[] timestamps; // Dynamic array to store timestamps
    address[] senders; // Dynamic array to store sender addresses    uint256 constant Y2K = 946702800; // Constant representing the Unix timestamp for the year 2000    // Function to retrieve the array of numbers
    function getNumbers() external view returns (uint[] memory) {
        // Create a memory array to hold the numbers
        uint[] memory results = new uintUnsupported embed;        // Copy the numbers from the state array to the memory array
        for(uint i=0; i&lt;numbers.length; i++) {
            results[i] = numbers[i];
        }        // Return the memory array
        return results;
    }    // Function to reset the numbers array to its initial values
    function resetNumbers() public {
        numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
    }    // Function to append new numbers to the numbers array
    function appendToNumbers(uint[] calldata _toAppend) public {
        // Iterate through the array to be appended
        for (uint i = 0; i &lt; _toAppend.length; i++) {
            // Push each element of the array to be appended to the numbers array
            numbers.push(_toAppend[i]);
        }
    }    // Function to save a timestamp along with the sender&apos;s address
    function saveTimestamp(uint _unixTimestamp) public {
        // Push the timestamp and sender&apos;s address to their respective arrays
        timestamps.push(_unixTimestamp);
        senders.push(msg.sender);
    }    // Function to retrieve timestamps and senders after the year 2000
    function afterY2K() public view returns (uint256[] memory, address[] memory) {
        // Initialize counter for timestamps after Y2K
        uint256 counter = 0;        // Count the number of timestamps after Y2K
        for (uint i = 0; i &lt; timestamps.length; i++) {
            if (timestamps[i] &gt; Y2K) {
                counter++;
            }
        }        // Initialize memory arrays to hold timestamps and senders after Y2K
        uint256[] memory timestampsAfterY2K = new uint256Unsupported embed;
        address[] memory sendersAfterY2K = new addressUnsupported embed;        // Initialize index for inserting elements into memory arrays
        uint256 index = 0;        // Iterate through timestamps and senders arrays to extract elements after Y2K
        for (uint i = 0; i &lt; timestamps.length; i++) {
            if (timestamps[i] &gt; Y2K) {
                timestampsAfterY2K[index] = timestamps[i];
                sendersAfterY2K[index] = senders[i];
                index++;
            }
        }        // Return timestamps and senders after Y2K
        return (timestampsAfterY2K, sendersAfterY2K);
    }    // Function to reset the senders array
    function resetSenders() public {
        delete senders;
    }    // Function to reset the timestamps array
    function resetTimestamps() public {
        delete timestamps;
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.17;</span>

<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">ArraysExercise</span> </span>{
    <span class="hljs-comment">// Declare state variables to store arrays of numbers, timestamps, and senders</span>
    <span class="hljs-keyword">uint</span>[] numbers <span class="hljs-operator">=</span> [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>, <span class="hljs-number">10</span>]; <span class="hljs-comment">// Array of numbers initialized with values</span>
    <span class="hljs-keyword">uint</span>[] timestamps; <span class="hljs-comment">// Dynamic array to store timestamps</span>
    <span class="hljs-keyword">address</span>[] senders; <span class="hljs-comment">// Dynamic array to store sender addresses    uint256 constant Y2K = 946702800; // Constant representing the Unix timestamp for the year 2000    // Function to retrieve the array of numbers</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getNumbers</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint</span>[] <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-comment">// Create a memory array to hold the numbers</span>
        <span class="hljs-keyword">uint</span>[] <span class="hljs-keyword">memory</span> results <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> uintUnsupported embed;        <span class="hljs-comment">// Copy the numbers from the state array to the memory array</span>
        <span class="hljs-keyword">for</span>(<span class="hljs-keyword">uint</span> i<span class="hljs-operator">=</span><span class="hljs-number">0</span>; i<span class="hljs-operator">&#x3C;</span>numbers.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
            results[i] <span class="hljs-operator">=</span> numbers[i];
        }        <span class="hljs-comment">// Return the memory array</span>
        <span class="hljs-keyword">return</span> results;
    }    <span class="hljs-comment">// Function to reset the numbers array to its initial values</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">resetNumbers</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        numbers <span class="hljs-operator">=</span> [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>, <span class="hljs-number">10</span>];
    }    <span class="hljs-comment">// Function to append new numbers to the numbers array</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">appendToNumbers</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span>[] <span class="hljs-keyword">calldata</span> _toAppend</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-comment">// Iterate through the array to be appended</span>
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">uint</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&#x3C;</span> _toAppend.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
            <span class="hljs-comment">// Push each element of the array to be appended to the numbers array</span>
            numbers.<span class="hljs-built_in">push</span>(_toAppend[i]);
        }
    }    <span class="hljs-comment">// Function to save a timestamp along with the sender's address</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">saveTimestamp</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> _unixTimestamp</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-comment">// Push the timestamp and sender's address to their respective arrays</span>
        timestamps.<span class="hljs-built_in">push</span>(_unixTimestamp);
        senders.<span class="hljs-built_in">push</span>(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>);
    }    <span class="hljs-comment">// Function to retrieve timestamps and senders after the year 2000</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">afterY2K</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span>[] <span class="hljs-keyword">memory</span>, <span class="hljs-keyword">address</span>[] <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-comment">// Initialize counter for timestamps after Y2K</span>
        <span class="hljs-keyword">uint256</span> counter <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;        <span class="hljs-comment">// Count the number of timestamps after Y2K</span>
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">uint</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&#x3C;</span> timestamps.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
            <span class="hljs-keyword">if</span> (timestamps[i] <span class="hljs-operator">></span> Y2K) {
                counter<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
            }
        }        <span class="hljs-comment">// Initialize memory arrays to hold timestamps and senders after Y2K</span>
        <span class="hljs-keyword">uint256</span>[] <span class="hljs-keyword">memory</span> timestampsAfterY2K <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> uint256Unsupported embed;
        <span class="hljs-keyword">address</span>[] <span class="hljs-keyword">memory</span> sendersAfterY2K <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> addressUnsupported embed;        <span class="hljs-comment">// Initialize index for inserting elements into memory arrays</span>
        <span class="hljs-keyword">uint256</span> index <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;        <span class="hljs-comment">// Iterate through timestamps and senders arrays to extract elements after Y2K</span>
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">uint</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&#x3C;</span> timestamps.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
            <span class="hljs-keyword">if</span> (timestamps[i] <span class="hljs-operator">></span> Y2K) {
                timestampsAfterY2K[index] <span class="hljs-operator">=</span> timestamps[i];
                sendersAfterY2K[index] <span class="hljs-operator">=</span> senders[i];
                index<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
            }
        }        <span class="hljs-comment">// Return timestamps and senders after Y2K</span>
        <span class="hljs-keyword">return</span> (timestampsAfterY2K, sendersAfterY2K);
    }    <span class="hljs-comment">// Function to reset the senders array</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">resetSenders</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-keyword">delete</span> senders;
    }    <span class="hljs-comment">// Function to reset the timestamps array</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">resetTimestamps</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-keyword">delete</span> timestamps;
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d302b7cc7512c7d10f439535eab3c5726834a5dfa1445e5518c43f3d105e6e9a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, in the same manner, compile the file, deploy the contract, and validate the metamask transaction.</p><p>Then copy the contract code by scrolling down on the left sidebar.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/295d2a5db685e326abdf13762e81d6edd714187897fee4098530ac4b4211708b.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/arrays/arrays-exercise">here</a> and paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2fc307c0d061235c49832f8f2837897467d4d608fa120a567f88088da8317201.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Contract 5: Mapping</strong></p><p>Make a new file called “Mapping” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/**
 * @title FavoriteRecords
 * @dev Contract to manage a list of approved music records and allow users to add them to their favorites
 */
contract FavoriteRecords {
    // Mapping to store whether a record is approved
    mapping(string =&gt; bool) private approvedRecords;
    // Array to store the index of approved records
    string[] private approvedRecordsIndex;    // Mapping to store user&apos;s favorite records
    mapping(address =&gt; mapping(string =&gt; bool)) public userFavorites;
    // Mapping to store the index of user&apos;s favorite records
    mapping(address =&gt; string[]) private userFavoritesIndex;    // Custom error to handle unapproved records
    error NotApproved(string albumName);    /**
     * @dev Constructor that initializes the approved records list
     */
    constructor() {
        // Predefined list of approved records
        approvedRecordsIndex = [
            &quot;Thriller&quot;, 
            &quot;Back in Black&quot;, 
            &quot;The Bodyguard&quot;, 
            &quot;The Dark Side of the Moon&quot;, 
            &quot;Their Greatest Hits (1971-1975)&quot;, 
            &quot;Hotel California&quot;, 
            &quot;Come On Over&quot;, 
            &quot;Rumours&quot;, 
            &quot;Saturday Night Fever&quot;
        ];
        // Initialize the approved records mapping
        for (uint i = 0; i &lt; approvedRecordsIndex.length; i++) {
            approvedRecords[approvedRecordsIndex[i]] = true;
        }
    }    /**
     * @dev Returns the list of approved records
     * @return An array of approved record names
     */
    function getApprovedRecords() public view returns (string[] memory) {
        return approvedRecordsIndex;
    }    /**
     * @dev Adds an approved record to the user&apos;s favorites
     * @param _albumName The name of the album to be added
     */
    function addRecord(string memory _albumName) public {
        // Check if the record is approved
        if (!approvedRecords[_albumName]) {
            revert NotApproved({albumName: _albumName});
        }
        // Check if the record is not already in the user&apos;s favorites
        if (!userFavorites[msg.sender][_albumName]) {
            // Add the record to the user&apos;s favorites
            userFavorites[msg.sender][_albumName] = true;
            // Add the record to the user&apos;s favorites index
            userFavoritesIndex[msg.sender].push(_albumName);
        }
    }    /**
     * @dev Returns the list of a user&apos;s favorite records
     * @param _address The address of the user
     * @return An array of user&apos;s favorite record names
     */
    function getUserFavorites(address _address) public view returns (string[] memory) {
        return userFavoritesIndex[_address];
    }    /**
     * @dev Resets the caller&apos;s list of favorite records
     */
    function resetUserFavorites() public {
        // Iterate through the user&apos;s favorite records
        for (uint i = 0; i &lt; userFavoritesIndex[msg.sender].length; i++) {
            // Delete each record from the user&apos;s favorites mapping
            delete userFavorites[msg.sender][userFavoritesIndex[msg.sender][i]];
        }
        // Delete the user&apos;s favorites index
        delete userFavoritesIndex[msg.sender];
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.17;</span>

<span class="hljs-comment">/**
 * @title FavoriteRecords
 * @dev Contract to manage a list of approved music records and allow users to add them to their favorites
 */</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">FavoriteRecords</span> </span>{
    <span class="hljs-comment">// Mapping to store whether a record is approved</span>
    <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">string</span> <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">bool</span>) <span class="hljs-keyword">private</span> approvedRecords;
    <span class="hljs-comment">// Array to store the index of approved records</span>
    <span class="hljs-keyword">string</span>[] <span class="hljs-keyword">private</span> approvedRecordsIndex;    <span class="hljs-comment">// Mapping to store user's favorite records</span>
    <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">address</span> <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">string</span> <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">bool</span>)) <span class="hljs-keyword">public</span> userFavorites;
    <span class="hljs-comment">// Mapping to store the index of user's favorite records</span>
    <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">address</span> <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">string</span>[]) <span class="hljs-keyword">private</span> userFavoritesIndex;    <span class="hljs-comment">// Custom error to handle unapproved records</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">NotApproved</span>(<span class="hljs-params"><span class="hljs-keyword">string</span> albumName</span>)</span>;    <span class="hljs-comment">/**
     * @dev Constructor that initializes the approved records list
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"></span>) </span>{
        <span class="hljs-comment">// Predefined list of approved records</span>
        approvedRecordsIndex <span class="hljs-operator">=</span> [
            <span class="hljs-string">"Thriller"</span>, 
            <span class="hljs-string">"Back in Black"</span>, 
            <span class="hljs-string">"The Bodyguard"</span>, 
            <span class="hljs-string">"The Dark Side of the Moon"</span>, 
            <span class="hljs-string">"Their Greatest Hits (1971-1975)"</span>, 
            <span class="hljs-string">"Hotel California"</span>, 
            <span class="hljs-string">"Come On Over"</span>, 
            <span class="hljs-string">"Rumours"</span>, 
            <span class="hljs-string">"Saturday Night Fever"</span>
        ];
        <span class="hljs-comment">// Initialize the approved records mapping</span>
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">uint</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&#x3C;</span> approvedRecordsIndex.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
            approvedRecords[approvedRecordsIndex[i]] <span class="hljs-operator">=</span> <span class="hljs-literal">true</span>;
        }
    }    <span class="hljs-comment">/**
     * @dev Returns the list of approved records
     * @return An array of approved record names
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getApprovedRecords</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">string</span>[] <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-keyword">return</span> approvedRecordsIndex;
    }    <span class="hljs-comment">/**
     * @dev Adds an approved record to the user's favorites
     * @param _albumName The name of the album to be added
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">addRecord</span>(<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _albumName</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-comment">// Check if the record is approved</span>
        <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>approvedRecords[_albumName]) {
            <span class="hljs-keyword">revert</span> NotApproved({albumName: _albumName});
        }
        <span class="hljs-comment">// Check if the record is not already in the user's favorites</span>
        <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>userFavorites[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>][_albumName]) {
            <span class="hljs-comment">// Add the record to the user's favorites</span>
            userFavorites[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>][_albumName] <span class="hljs-operator">=</span> <span class="hljs-literal">true</span>;
            <span class="hljs-comment">// Add the record to the user's favorites index</span>
            userFavoritesIndex[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>].<span class="hljs-built_in">push</span>(_albumName);
        }
    }    <span class="hljs-comment">/**
     * @dev Returns the list of a user's favorite records
     * @param _address The address of the user
     * @return An array of user's favorite record names
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getUserFavorites</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> _address</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">string</span>[] <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-keyword">return</span> userFavoritesIndex[_address];
    }    <span class="hljs-comment">/**
     * @dev Resets the caller's list of favorite records
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">resetUserFavorites</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-comment">// Iterate through the user's favorite records</span>
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">uint</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&#x3C;</span> userFavoritesIndex[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>].<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
            <span class="hljs-comment">// Delete each record from the user's favorites mapping</span>
            <span class="hljs-keyword">delete</span> userFavorites[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>][userFavoritesIndex[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>][i]];
        }
        <span class="hljs-comment">// Delete the user's favorites index</span>
        <span class="hljs-keyword">delete</span> userFavoritesIndex[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>];
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b7e6248f268a0a15d9360f663728243789073e5d66d32ab927364d7aedceb10d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, in the same manner, compile the file, deploy the contract, and validate the metamask transaction.</p><p>Then copy the contract code by scrolling down on the left sidebar.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/dbeb9850770053d78827e09ae91bc64d25965366ba11d80f849a3a240e9ce132.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/mappings/mappings-exercise">here</a> and paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8b82c001ddeeb81ee583d60d599325951c0f2b40382164ff1b6f532f094616cf.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Contract 6: Structs</strong></p><p>Make a new file called “Structs” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/**
 * @title GarageManager
 * @dev Contract to manage a garage of cars for each user
 */
contract GarageManager {
    // Mapping to store the garage of cars for each user
    mapping(address =&gt; Car[]) private garages;    // Struct to represent a car
    struct Car {
        string make; // Make of the car
        string model; // Model of the car
        string color; // Color of the car
        uint numberOfDoors; // Number of doors of the car
    }    // Custom error for handling invalid car index
    error BadCarIndex(uint256 index);    /**
     * @dev Adds a new car to the caller&apos;s garage
     * @param _make The make of the car
     * @param _model The model of the car
     * @param _color The color of the car
     * @param _numberOfDoors The number of doors of the car
     */
    function addCar(string memory _make, string memory _model, string memory _color, uint _numberOfDoors) external {
        // Push a new car struct with the provided details to the caller&apos;s garage
        garages[msg.sender].push(Car(_make, _model, _color, _numberOfDoors));
    }    /**
     * @dev Retrieves the caller&apos;s array of cars
     * @return An array of `Car` structs
     */
    function getMyCars() external view returns (Car[] memory) {
        // Return the array of cars stored in the caller&apos;s garage
        return garages[msg.sender];
    }    /**
     * @dev Retrieves a specific user&apos;s array of cars
     * @param _user The address of the user
     * @return An array of `Car` structs
     */
    function getUserCars(address _user) external view returns (Car[] memory) {
        // Return the array of cars stored in the garage of the specified user
        return garages[_user];
    }    /**
     * @dev Updates a specific car in the caller&apos;s garage
     * @param _index The index of the car in the garage array
     * @param _make The new make of the car
     * @param _model The new model of the car
     * @param _color The new color of the car
     * @param _numberOfDoors The new number of doors of the car
     */
    function updateCar(uint256 _index, string memory _make, string memory _model, string memory _color, uint _numberOfDoors) external {
        // Check if the provided index is valid
        if (_index &gt;= garages[msg.sender].length) {
            revert BadCarIndex({index: _index}); // Revert with custom error if the index is invalid
        }
        // Update the specified car with the new details
        garages[msg.sender][_index] = Car(_make, _model, _color, _numberOfDoors);
    }    /**
     * @dev Deletes all cars in the caller&apos;s garage
     */
    function resetMyGarage() external {
        // Delete all cars from the caller&apos;s garage
        delete garages[msg.sender];
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.17;</span>

<span class="hljs-comment">/**
 * @title GarageManager
 * @dev Contract to manage a garage of cars for each user
 */</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">GarageManager</span> </span>{
    <span class="hljs-comment">// Mapping to store the garage of cars for each user</span>
    <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">address</span> <span class="hljs-operator">=</span><span class="hljs-operator">></span> Car[]) <span class="hljs-keyword">private</span> garages;    <span class="hljs-comment">// Struct to represent a car</span>
    <span class="hljs-keyword">struct</span> <span class="hljs-title">Car</span> {
        <span class="hljs-keyword">string</span> make; <span class="hljs-comment">// Make of the car</span>
        <span class="hljs-keyword">string</span> model; <span class="hljs-comment">// Model of the car</span>
        <span class="hljs-keyword">string</span> color; <span class="hljs-comment">// Color of the car</span>
        <span class="hljs-keyword">uint</span> numberOfDoors; <span class="hljs-comment">// Number of doors of the car</span>
    }    <span class="hljs-comment">// Custom error for handling invalid car index</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">BadCarIndex</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> index</span>)</span>;    <span class="hljs-comment">/**
     * @dev Adds a new car to the caller's garage
     * @param _make The make of the car
     * @param _model The model of the car
     * @param _color The color of the car
     * @param _numberOfDoors The number of doors of the car
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">addCar</span>(<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _make, <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _model, <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _color, <span class="hljs-keyword">uint</span> _numberOfDoors</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> </span>{
        <span class="hljs-comment">// Push a new car struct with the provided details to the caller's garage</span>
        garages[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>].<span class="hljs-built_in">push</span>(Car(_make, _model, _color, _numberOfDoors));
    }    <span class="hljs-comment">/**
     * @dev Retrieves the caller's array of cars
     * @return An array of `Car` structs
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getMyCars</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params">Car[] <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-comment">// Return the array of cars stored in the caller's garage</span>
        <span class="hljs-keyword">return</span> garages[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>];
    }    <span class="hljs-comment">/**
     * @dev Retrieves a specific user's array of cars
     * @param _user The address of the user
     * @return An array of `Car` structs
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getUserCars</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> _user</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params">Car[] <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-comment">// Return the array of cars stored in the garage of the specified user</span>
        <span class="hljs-keyword">return</span> garages[_user];
    }    <span class="hljs-comment">/**
     * @dev Updates a specific car in the caller's garage
     * @param _index The index of the car in the garage array
     * @param _make The new make of the car
     * @param _model The new model of the car
     * @param _color The new color of the car
     * @param _numberOfDoors The new number of doors of the car
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">updateCar</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _index, <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _make, <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _model, <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _color, <span class="hljs-keyword">uint</span> _numberOfDoors</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> </span>{
        <span class="hljs-comment">// Check if the provided index is valid</span>
        <span class="hljs-keyword">if</span> (_index <span class="hljs-operator">></span><span class="hljs-operator">=</span> garages[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>].<span class="hljs-built_in">length</span>) {
            <span class="hljs-keyword">revert</span> BadCarIndex({index: _index}); <span class="hljs-comment">// Revert with custom error if the index is invalid</span>
        }
        <span class="hljs-comment">// Update the specified car with the new details</span>
        garages[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>][_index] <span class="hljs-operator">=</span> Car(_make, _model, _color, _numberOfDoors);
    }    <span class="hljs-comment">/**
     * @dev Deletes all cars in the caller's garage
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">resetMyGarage</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> </span>{
        <span class="hljs-comment">// Delete all cars from the caller's garage</span>
        <span class="hljs-keyword">delete</span> garages[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>];
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7b3c8ac6b5dece7ceed2bd4f042b7a4f426bb4b27cc5d494266baf0ccd67ef8c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, in the same manner, compile the file, deploy the contract, and validate the metamask transaction.</p><p>Then copy the contract code by scrolling down on the left sidebar.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f3500ce24cac9b0fa237242688a41900d057942ddd54648a10e64cbebcf293d3.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/structs/structs-exercise">here</a> and paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1d9d02edf05efd12cd59c811e01b7dba82f92f4e24a8e302670d740f0c078246.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Contract 7: Inheritance</strong></p><p>Make a new file called “Inheritance” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;/**
 * @title Employee
 * @dev Abstract contract defining common properties and behavior for employees.
 */
abstract contract Employee {
    uint public idNumber; // Unique identifier for the employee
    uint public managerId; // Identifier of the manager overseeing the employee    /**
     * @dev Constructor to initialize idNumber and managerId.
     * @param _idNumber The unique identifier for the employee.
     * @param _managerId The identifier of the manager overseeing the employee.
     */
    constructor(uint _idNumber, uint _managerId) {
        idNumber = _idNumber;
        managerId = _managerId;
    }    /**
     * @dev Abstract function to be implemented by derived contracts to get the annual cost of the employee.
     * @return The annual cost of the employee.
     */
    function getAnnualCost() public virtual returns (uint);
}/**
 * @title Salaried
 * @dev Contract representing employees who are paid an annual salary.
 */
contract Salaried is Employee {
    uint public annualSalary; // The annual salary of the employee    /**
     * @dev Constructor to initialize the Salaried contract.
     * @param _idNumber The unique identifier for the employee.
     * @param _managerId The identifier of the manager overseeing the employee.
     * @param _annualSalary The annual salary of the employee.
     */
    constructor(uint _idNumber, uint _managerId, uint _annualSalary) Employee(_idNumber, _managerId) {
        annualSalary = _annualSalary;
    }    /**
     * @dev Overrides the getAnnualCost function to return the annual salary of the employee.
     * @return The annual salary of the employee.
     */
    function getAnnualCost() public override view returns (uint) {
        return annualSalary;
    }
}/**
 * @title Hourly
 * @dev Contract representing employees who are paid an hourly rate.
 */
contract Hourly is Employee {
    uint public hourlyRate; // The hourly rate of the employee    /**
     * @dev Constructor to initialize the Hourly contract.
     * @param _idNumber The unique identifier for the employee.
     * @param _managerId The identifier of the manager overseeing the employee.
     * @param _hourlyRate The hourly rate of the employee.
     */
    constructor(uint _idNumber, uint _managerId, uint _hourlyRate) Employee(_idNumber, _managerId) {
        hourlyRate = _hourlyRate;
    }    /**
     * @dev Overrides the getAnnualCost function to calculate the annual cost based on the hourly rate.
     * Assuming a full-time workload of 2080 hours per year.
     * @return The annual cost of the employee.
     */
    function getAnnualCost() public override view returns (uint) {
        return hourlyRate * 2080;
    }
}/**
 * @title Manager
 * @dev Contract managing a list of employee IDs.
 */
contract Manager {
    uint[] public employeeIds; // List of employee IDs    /**
     * @dev Function to add a new employee ID to the list.
     * @param _reportId The ID of the employee to be added.
     */
    function addReport(uint _reportId) public {
        employeeIds.push(_reportId);
    }    /**
     * @dev Function to reset the list of employee IDs.
     */
    function resetReports() public {
        delete employeeIds;
    }
}/**
 * @title Salesperson
 * @dev Contract representing salespeople who are paid hourly.
 */
contract Salesperson is Hourly {
    /**
     * @dev Constructor to initialize the Salesperson contract.
     * @param _idNumber The unique identifier for the employee.
     * @param _managerId The identifier of the manager overseeing the employee.
     * @param _hourlyRate The hourly rate of the employee.
     */
    constructor(uint _idNumber, uint _managerId, uint _hourlyRate) 
        Hourly(_idNumber, _managerId, _hourlyRate) {}
}/**
 * @title EngineeringManager
 * @dev Contract representing engineering managers who are paid an annual salary and have managerial responsibilities.
 */
contract EngineeringManager is Salaried, Manager {
    /**
     * @dev Constructor to initialize the EngineeringManager contract.
     * @param _idNumber The unique identifier for the employee.
     * @param _managerId The identifier of the manager overseeing the employee.
     * @param _annualSalary The annual salary of the employee.
     */
    constructor(uint _idNumber, uint _managerId, uint _annualSalary) 
        Salaried(_idNumber, _managerId, _annualSalary) {}
}/**
 * @title InheritanceSubmission
 * @dev Contract for deploying instances of Salesperson and EngineeringManager.
 */
contract InheritanceSubmission {
    address public salesPerson; // Address of the deployed Salesperson instance
    address public engineeringManager; // Address of the deployed EngineeringManager instance    /**
     * @dev Constructor to initialize the InheritanceSubmission contract.
     * @param _salesPerson Address of the deployed Salesperson instance.
     * @param _engineeringManager Address of the deployed EngineeringManager instance.
     */
    constructor(address _salesPerson, address _engineeringManager) {
        salesPerson = _salesPerson;
        engineeringManager = _engineeringManager;
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>

<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> 0.8.17;</span><span class="hljs-comment">/**
 * @title Employee
 * @dev Abstract contract defining common properties and behavior for employees.
 */</span>
<span class="hljs-keyword">abstract</span> <span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">Employee</span> </span>{
    <span class="hljs-keyword">uint</span> <span class="hljs-keyword">public</span> idNumber; <span class="hljs-comment">// Unique identifier for the employee</span>
    <span class="hljs-keyword">uint</span> <span class="hljs-keyword">public</span> managerId; <span class="hljs-comment">// Identifier of the manager overseeing the employee    /**</span>
     <span class="hljs-operator">*</span> @dev Constructor to initialize idNumber and managerId.
     * @param _idNumber The unique identifier <span class="hljs-keyword">for</span> the employee.
     * @param _managerId The identifier of the manager overseeing the employee.
     *<span class="hljs-operator">/</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> _idNumber, <span class="hljs-keyword">uint</span> _managerId</span>) </span>{
        idNumber <span class="hljs-operator">=</span> _idNumber;
        managerId <span class="hljs-operator">=</span> _managerId;
    }    <span class="hljs-comment">/**
     * @dev Abstract function to be implemented by derived contracts to get the annual cost of the employee.
     * @return The annual cost of the employee.
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getAnnualCost</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">virtual</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint</span></span>)</span>;
}<span class="hljs-comment">/**
 * @title Salaried
 * @dev Contract representing employees who are paid an annual salary.
 */</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">Salaried</span> <span class="hljs-keyword">is</span> <span class="hljs-title">Employee</span> </span>{
    <span class="hljs-keyword">uint</span> <span class="hljs-keyword">public</span> annualSalary; <span class="hljs-comment">// The annual salary of the employee    /**</span>
     <span class="hljs-operator">*</span> @dev Constructor to initialize the Salaried <span class="hljs-keyword">contract</span>.
     * @param _idNumber The unique identifier <span class="hljs-keyword">for</span> the employee.
     * @param _managerId The identifier of the manager overseeing the employee.
     * @param _annualSalary The annual salary of the employee.
     *<span class="hljs-operator">/</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> _idNumber, <span class="hljs-keyword">uint</span> _managerId, <span class="hljs-keyword">uint</span> _annualSalary</span>) <span class="hljs-title">Employee</span>(<span class="hljs-params">_idNumber, _managerId</span>) </span>{
        annualSalary <span class="hljs-operator">=</span> _annualSalary;
    }    <span class="hljs-comment">/**
     * @dev Overrides the getAnnualCost function to return the annual salary of the employee.
     * @return The annual salary of the employee.
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getAnnualCost</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">override</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint</span></span>) </span>{
        <span class="hljs-keyword">return</span> annualSalary;
    }
}<span class="hljs-comment">/**
 * @title Hourly
 * @dev Contract representing employees who are paid an hourly rate.
 */</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">Hourly</span> <span class="hljs-keyword">is</span> <span class="hljs-title">Employee</span> </span>{
    <span class="hljs-keyword">uint</span> <span class="hljs-keyword">public</span> hourlyRate; <span class="hljs-comment">// The hourly rate of the employee    /**</span>
     <span class="hljs-operator">*</span> @dev Constructor to initialize the Hourly <span class="hljs-keyword">contract</span>.
     * @param _idNumber The unique identifier <span class="hljs-keyword">for</span> the employee.
     * @param _managerId The identifier of the manager overseeing the employee.
     * @param _hourlyRate The hourly rate of the employee.
     *<span class="hljs-operator">/</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> _idNumber, <span class="hljs-keyword">uint</span> _managerId, <span class="hljs-keyword">uint</span> _hourlyRate</span>) <span class="hljs-title">Employee</span>(<span class="hljs-params">_idNumber, _managerId</span>) </span>{
        hourlyRate <span class="hljs-operator">=</span> _hourlyRate;
    }    <span class="hljs-comment">/**
     * @dev Overrides the getAnnualCost function to calculate the annual cost based on the hourly rate.
     * Assuming a full-time workload of 2080 hours per year.
     * @return The annual cost of the employee.
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getAnnualCost</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">override</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint</span></span>) </span>{
        <span class="hljs-keyword">return</span> hourlyRate <span class="hljs-operator">*</span> <span class="hljs-number">2080</span>;
    }
}<span class="hljs-comment">/**
 * @title Manager
 * @dev Contract managing a list of employee IDs.
 */</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">Manager</span> </span>{
    <span class="hljs-keyword">uint</span>[] <span class="hljs-keyword">public</span> employeeIds; <span class="hljs-comment">// List of employee IDs    /**</span>
     <span class="hljs-operator">*</span> @dev Function to add a <span class="hljs-keyword">new</span> employee ID to the list.
     * @param _reportId The ID of the employee to be added.
     *<span class="hljs-operator">/</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">addReport</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> _reportId</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        employeeIds.<span class="hljs-built_in">push</span>(_reportId);
    }    <span class="hljs-comment">/**
     * @dev Function to reset the list of employee IDs.
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">resetReports</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-keyword">delete</span> employeeIds;
    }
}<span class="hljs-comment">/**
 * @title Salesperson
 * @dev Contract representing salespeople who are paid hourly.
 */</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">Salesperson</span> <span class="hljs-keyword">is</span> <span class="hljs-title">Hourly</span> </span>{
    <span class="hljs-comment">/**
     * @dev Constructor to initialize the Salesperson contract.
     * @param _idNumber The unique identifier for the employee.
     * @param _managerId The identifier of the manager overseeing the employee.
     * @param _hourlyRate The hourly rate of the employee.
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> _idNumber, <span class="hljs-keyword">uint</span> _managerId, <span class="hljs-keyword">uint</span> _hourlyRate</span>) 
        <span class="hljs-title">Hourly</span>(<span class="hljs-params">_idNumber, _managerId, _hourlyRate</span>) </span>{}
}<span class="hljs-comment">/**
 * @title EngineeringManager
 * @dev Contract representing engineering managers who are paid an annual salary and have managerial responsibilities.
 */</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">EngineeringManager</span> <span class="hljs-keyword">is</span> <span class="hljs-title">Salaried</span>, <span class="hljs-title">Manager</span> </span>{
    <span class="hljs-comment">/**
     * @dev Constructor to initialize the EngineeringManager contract.
     * @param _idNumber The unique identifier for the employee.
     * @param _managerId The identifier of the manager overseeing the employee.
     * @param _annualSalary The annual salary of the employee.
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> _idNumber, <span class="hljs-keyword">uint</span> _managerId, <span class="hljs-keyword">uint</span> _annualSalary</span>) 
        <span class="hljs-title">Salaried</span>(<span class="hljs-params">_idNumber, _managerId, _annualSalary</span>) </span>{}
}<span class="hljs-comment">/**
 * @title InheritanceSubmission
 * @dev Contract for deploying instances of Salesperson and EngineeringManager.
 */</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">InheritanceSubmission</span> </span>{
    <span class="hljs-keyword">address</span> <span class="hljs-keyword">public</span> salesPerson; <span class="hljs-comment">// Address of the deployed Salesperson instance</span>
    <span class="hljs-keyword">address</span> <span class="hljs-keyword">public</span> engineeringManager; <span class="hljs-comment">// Address of the deployed EngineeringManager instance    /**</span>
     <span class="hljs-operator">*</span> @dev Constructor to initialize the InheritanceSubmission <span class="hljs-keyword">contract</span>.
     * @param _salesPerson Address of the deployed Salesperson instance.
     * @param _engineeringManager Address of the deployed EngineeringManager instance.
     *<span class="hljs-operator">/</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> _salesPerson, <span class="hljs-keyword">address</span> _engineeringManager</span>) </span>{
        salesPerson <span class="hljs-operator">=</span> _salesPerson;
        engineeringManager <span class="hljs-operator">=</span> _engineeringManager;
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/61c582f0a8ea2094975eb1aba4822745760567f42bb1aebc3bdc19403b40cbea.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Compile the file again in the same way, and during deployment, make some changes. In the contract drop-down, choose the “Salesperson” option.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2f9f534f68a74dfb68d4da12e48c47284baee8f245d6d83e43f8b1bdd60eef0c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, select the “Deploy” dropdown menu and enter the information as it appears in the figure.</p><p>Id Number: 55555</p><p>Manager id: 12345</p><p>Salary: 20</p><p>Then click on “Transact” and confirm the metamask transaction.</p><p>Now, on the next step, change the contract to “EngineeringManager.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a5f29b159306f306901572fa4e9e0ba62cc517101bce8d3e1a97fdc8c42d0ed7.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Fill in the following details on the unit detail after that.</p><p>Id Number: 54321</p><p>Manager id: 11111</p><p>Annual salary: 200000</p><p>Then click on “Transact” and confirm the metamask transaction.</p><p>Now, on the next step, change the contract to “Inheritance Submission.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/03b90c43928039c43f3c593ef261dbb9b240523cdb4bf1837ed1f4e88aec9946.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>You must copy the contract code and paste it into this field.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9c6e41ca0324b271e4f3e428e08634fa2ed85e8e58816ade602d2d6183f39b3e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a2ce676303a6f29d3e7e2450b784a2d42822764db43ea68276e76b14cc32e775.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then click on “Transact” and confirm the metamask transaction.</p><p>Then copy the contract code by scrolling down on the left sidebar.</p><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/inheritance/inheritance-exercise">here</a> and paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c50717b41ed77709583cba7011864ea6fc3e0edab150793f8ed9b155cf4d5120.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Contract 8: SillyStringUtils/Imports</strong></p><p>Make a new file called “<strong>SillyStringUtils</strong>” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

library SillyStringUtils {    

struct Haiku {
        string line1;
        string line2;
        string line3;
    }    function shruggie(string memory _input) internal pure returns (string memory) {
        return string.concat(_input, unicode&quot; 🤷&quot;);
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>

<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.17;</span>

<span class="hljs-class"><span class="hljs-keyword">library</span> <span class="hljs-title">SillyStringUtils</span> </span>{    

<span class="hljs-keyword">struct</span> <span class="hljs-title">Haiku</span> {
        <span class="hljs-keyword">string</span> line1;
        <span class="hljs-keyword">string</span> line2;
        <span class="hljs-keyword">string</span> line3;
    }    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">shruggie</span>(<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _input</span>) <span class="hljs-title"><span class="hljs-keyword">internal</span></span> <span class="hljs-title"><span class="hljs-keyword">pure</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-built_in">string</span>.<span class="hljs-built_in">concat</span>(_input, <span class="hljs-string">unicode" 🤷"</span>);
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f3ace7a2f1f53887fa34fe72246c7b0671c8bf3c1409ed68e4fff11eada02366.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Again, Make a new file called “<strong>Imports</strong>” in the contracts folder.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT

// Importing the SillyStringUtils library
import &quot;./SillyStringUtils.sol&quot;;pragma solidity 0.8.17;contract ImportsExercise {
    // Using the SillyStringUtils library for string manipulation
    using SillyStringUtils for string;    // Declaring a public variable to store a Haiku
    SillyStringUtils.Haiku public haiku;    // Function to save a Haiku
    function saveHaiku(string memory _line1, string memory _line2, string memory _line3) public {
        haiku.line1 = _line1;
        haiku.line2 = _line2;
        haiku.line3 = _line3;
    }    // Function to retrieve the saved Haiku
    function getHaiku() public view returns (SillyStringUtils.Haiku memory) {
        return haiku;
    }    // Function to append a shrugging emoji to the third line of the Haiku
    function shruggieHaiku() public view returns (SillyStringUtils.Haiku memory) {
        // Creating a copy of the Haiku
        SillyStringUtils.Haiku memory newHaiku = haiku;
        // Appending the shrugging emoji to the third line using the shruggie function from the SillyStringUtils library
        newHaiku.line3 = newHaiku.line3.shruggie();
        return newHaiku;
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>

<span class="hljs-comment">// Importing the SillyStringUtils library</span>
<span class="hljs-keyword">import</span> <span class="hljs-string">"./SillyStringUtils.sol"</span>;<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> 0.8.17;</span><span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">ImportsExercise</span> </span>{
    <span class="hljs-comment">// Using the SillyStringUtils library for string manipulation</span>
    <span class="hljs-keyword">using</span> <span class="hljs-title">SillyStringUtils</span> <span class="hljs-title"><span class="hljs-keyword">for</span></span> <span class="hljs-title"><span class="hljs-keyword">string</span></span>;    <span class="hljs-comment">// Declaring a public variable to store a Haiku</span>
    SillyStringUtils.Haiku <span class="hljs-keyword">public</span> haiku;    <span class="hljs-comment">// Function to save a Haiku</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">saveHaiku</span>(<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _line1, <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _line2, <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _line3</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        haiku.line1 <span class="hljs-operator">=</span> _line1;
        haiku.line2 <span class="hljs-operator">=</span> _line2;
        haiku.line3 <span class="hljs-operator">=</span> _line3;
    }    <span class="hljs-comment">// Function to retrieve the saved Haiku</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getHaiku</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params">SillyStringUtils.Haiku <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-keyword">return</span> haiku;
    }    <span class="hljs-comment">// Function to append a shrugging emoji to the third line of the Haiku</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">shruggieHaiku</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params">SillyStringUtils.Haiku <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-comment">// Creating a copy of the Haiku</span>
        SillyStringUtils.Haiku <span class="hljs-keyword">memory</span> newHaiku <span class="hljs-operator">=</span> haiku;
        <span class="hljs-comment">// Appending the shrugging emoji to the third line using the shruggie function from the SillyStringUtils library</span>
        newHaiku.line3 <span class="hljs-operator">=</span> newHaiku.line3.shruggie();
        <span class="hljs-keyword">return</span> newHaiku;
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1158cf346d3e7de6cd448166bba259cb34db2ff4d2c82d0a26cd87fffb123ceb.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, in the same manner, compile the file, deploy the contract, and validate the metamask transaction.</p><p>Then copy the contract code by scrolling down on the left sidebar.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c8bef6488a759162cc3064d79054884af26665c05afa3fce8640d0c571e418e6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/imports/imports-exercise">here</a> and paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/551b5450a3f9715232473ae565abc761a8f38fdf3bb783008d813d65d7e5c2d5.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Contract 9: Errors</strong></p><p>Make a new file called “Errors” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;contract ErrorTriageExercise {
    /**
     * @dev Finds the difference between each uint with its neighbor (a to b, b to c, etc.)
     * and returns a uint array with the absolute integer difference of each pairing.
     * 
     * @param _a The first unsigned integer.
     * @param _b The second unsigned integer.
     * @param _c The third unsigned integer.
     * @param _d The fourth unsigned integer.
     * 
     * @return results An array containing the absolute differences between each pair of integers.
     */
    function diffWithNeighbor(
        uint _a,
        uint _b,
        uint _c,
        uint _d
    ) public pure returns (uint[] memory) {
        // Initialize an array to store the differences
        uint[] memory results = new uintUnsupported embed;        // Calculate the absolute difference between each pair of integers and store it in the results array
        results[0] = _a &gt; _b ? _a - _b : _b - _a;
        results[1] = _b &gt; _c ? _b - _c : _c - _b;
        results[2] = _c &gt; _d ? _c - _d : _d - _c;        // Return the array of differences
        return results;
    }    /**
     * @dev Changes the base by the value of the modifier. Base is always &gt;= 1000. Modifiers can be
     * between positive and negative 100.
     * 
     * @param _base The base value to be modified.
     * @param _modifier The value by which the base should be modified.
     * 
     * @return returnValue The modified value of the base.
     */
    function applyModifier(
        uint _base,
        int _modifier
    ) public pure returns (uint returnValue) {
        // Apply the modifier to the base value
        if(_modifier &gt; 0) {
            return _base + uint(_modifier);
        }
        return _base - uint(-_modifier);
    }
    uint[] arr;    function popWithReturn() public returns (uint returnNum) {
        if(arr.length &gt; 0) {
            uint result = arr[arr.length - 1];
            arr.pop();
            return result;
        }
    }    // The utility functions below are working as expected
    function addToArr(uint _num) public {
        arr.push(_num);
    }    function getArr() public view returns (uint[] memory) {
        return arr;
    }    function resetArr() public {
        delete arr;
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>

<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.17;</span><span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">ErrorTriageExercise</span> </span>{
    <span class="hljs-comment">/**
     * @dev Finds the difference between each uint with its neighbor (a to b, b to c, etc.)
     * and returns a uint array with the absolute integer difference of each pairing.
     * 
     * @param _a The first unsigned integer.
     * @param _b The second unsigned integer.
     * @param _c The third unsigned integer.
     * @param _d The fourth unsigned integer.
     * 
     * @return results An array containing the absolute differences between each pair of integers.
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">diffWithNeighbor</span>(<span class="hljs-params">
        <span class="hljs-keyword">uint</span> _a,
        <span class="hljs-keyword">uint</span> _b,
        <span class="hljs-keyword">uint</span> _c,
        <span class="hljs-keyword">uint</span> _d
    </span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">pure</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint</span>[] <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-comment">// Initialize an array to store the differences</span>
        <span class="hljs-keyword">uint</span>[] <span class="hljs-keyword">memory</span> results <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> uintUnsupported embed;        <span class="hljs-comment">// Calculate the absolute difference between each pair of integers and store it in the results array</span>
        results[<span class="hljs-number">0</span>] <span class="hljs-operator">=</span> _a <span class="hljs-operator">></span> _b ? _a <span class="hljs-operator">-</span> _b : _b <span class="hljs-operator">-</span> _a;
        results[<span class="hljs-number">1</span>] <span class="hljs-operator">=</span> _b <span class="hljs-operator">></span> _c ? _b <span class="hljs-operator">-</span> _c : _c <span class="hljs-operator">-</span> _b;
        results[<span class="hljs-number">2</span>] <span class="hljs-operator">=</span> _c <span class="hljs-operator">></span> _d ? _c <span class="hljs-operator">-</span> _d : _d <span class="hljs-operator">-</span> _c;        <span class="hljs-comment">// Return the array of differences</span>
        <span class="hljs-keyword">return</span> results;
    }    <span class="hljs-comment">/**
     * @dev Changes the base by the value of the modifier. Base is always >= 1000. Modifiers can be
     * between positive and negative 100.
     * 
     * @param _base The base value to be modified.
     * @param _modifier The value by which the base should be modified.
     * 
     * @return returnValue The modified value of the base.
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">applyModifier</span>(<span class="hljs-params">
        <span class="hljs-keyword">uint</span> _base,
        <span class="hljs-keyword">int</span> _modifier
    </span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">pure</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint</span> returnValue</span>) </span>{
        <span class="hljs-comment">// Apply the modifier to the base value</span>
        <span class="hljs-keyword">if</span>(_modifier <span class="hljs-operator">></span> <span class="hljs-number">0</span>) {
            <span class="hljs-keyword">return</span> _base <span class="hljs-operator">+</span> <span class="hljs-keyword">uint</span>(_modifier);
        }
        <span class="hljs-keyword">return</span> _base <span class="hljs-operator">-</span> <span class="hljs-keyword">uint</span>(<span class="hljs-operator">-</span>_modifier);
    }
    <span class="hljs-keyword">uint</span>[] arr;    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">popWithReturn</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint</span> returnNum</span>) </span>{
        <span class="hljs-keyword">if</span>(arr.<span class="hljs-built_in">length</span> <span class="hljs-operator">></span> <span class="hljs-number">0</span>) {
            <span class="hljs-keyword">uint</span> result <span class="hljs-operator">=</span> arr[arr.<span class="hljs-built_in">length</span> <span class="hljs-operator">-</span> <span class="hljs-number">1</span>];
            arr.<span class="hljs-built_in">pop</span>();
            <span class="hljs-keyword">return</span> result;
        }
    }    <span class="hljs-comment">// The utility functions below are working as expected</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">addToArr</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> _num</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        arr.<span class="hljs-built_in">push</span>(_num);
    }    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getArr</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint</span>[] <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-keyword">return</span> arr;
    }    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">resetArr</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-keyword">delete</span> arr;
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7a189706193d6f620b054f62848a0e4620b5924b84c87da2c69434ad8966d240.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, in the same manner, compile the file, deploy the contract, and validate the metamask transaction.</p><p>Then copy the contract code by scrolling down on the left sidebar.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7241ab586b68b0011607b2156184ebf691b967fdedb482f9c9757ad9b071353a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/error-triage/error-triage-exercise">here</a> and paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8a8855d16f344f8fa02f3fbdf7272ff6f164b0261f20e8d76ab35cf626694cf4.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Contract 10: AddressBook</strong></p><p>Make a new file called “AddressBook” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity ^0.8.8;

import &quot;@openzeppelin/contracts/access/Ownable.sol&quot;;contract AddressBook is Ownable(msg.sender) {
    // Define a private salt value for internal use
    string private salt = &quot;value&quot;;     // Define a struct to represent a contact
    struct Contact {
        uint id; // Unique identifier for the contact
        string firstName; // First name of the contact
        string lastName; // Last name of the contact
        uint[] phoneNumbers; // Array to store multiple phone numbers for the contact
    }    // Array to store all contacts
    Contact[] private contacts;    // Mapping to store the index of each contact in the contacts array using its ID
    mapping(uint =&gt; uint) private idToIndex;    // Variable to keep track of the ID for the next contact
    uint private nextId = 1;    // Custom error for when a contact is not found
    error ContactNotFound(uint id);    // Function to add a new contact
    function addContact(string calldata firstName, string calldata lastName, uint[] calldata phoneNumbers) external onlyOwner {
        // Create a new contact with the provided details and add it to the contacts array
        contacts.push(Contact(nextId, firstName, lastName, phoneNumbers));
        // Map the ID of the new contact to its index in the array
        idToIndex[nextId] = contacts.length - 1;
        // Increment the nextId for the next contact
        nextId++;
    }    // Function to delete a contact by its ID
    function deleteContact(uint id) external onlyOwner {
        // Get the index of the contact to be deleted
        uint index = idToIndex[id];
        // Check if the index is valid and if the contact with the provided ID exists
        if (index &gt;= contacts.length || contacts[index].id != id) revert ContactNotFound(id);        // Replace the contact to be deleted with the last contact in the array
        contacts[index] = contacts[contacts.length - 1];
        // Update the index mapping for the moved contact
        idToIndex[contacts[index].id] = index;
        // Remove the last contact from the array
        contacts.pop();
        // Delete the mapping entry for the deleted contact ID
        delete idToIndex[id];
    }    // Function to retrieve a contact by its ID
    function getContact(uint id) external view returns (Contact memory) {
        // Get the index of the contact
        uint index = idToIndex[id];
        // Check if the index is valid and if the contact with the provided ID exists
        if (index &gt;= contacts.length || contacts[index].id != id) revert ContactNotFound(id);
        // Return the contact details
        return contacts[index];
    }    // Function to retrieve all contacts
    function getAllContacts() external view returns (Contact[] memory) {
        // Return the array of all contacts
        return contacts;
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.8;</span>

<span class="hljs-keyword">import</span> <span class="hljs-string">"@openzeppelin/contracts/access/Ownable.sol"</span>;<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">AddressBook</span> <span class="hljs-keyword">is</span> <span class="hljs-title">Ownable</span>(<span class="hljs-params"><span class="hljs-built_in">msg</span>.sender</span>) </span>{
    <span class="hljs-comment">// Define a private salt value for internal use</span>
    <span class="hljs-keyword">string</span> <span class="hljs-keyword">private</span> salt <span class="hljs-operator">=</span> <span class="hljs-string">"value"</span>;     <span class="hljs-comment">// Define a struct to represent a contact</span>
    <span class="hljs-keyword">struct</span> <span class="hljs-title">Contact</span> {
        <span class="hljs-keyword">uint</span> id; <span class="hljs-comment">// Unique identifier for the contact</span>
        <span class="hljs-keyword">string</span> firstName; <span class="hljs-comment">// First name of the contact</span>
        <span class="hljs-keyword">string</span> lastName; <span class="hljs-comment">// Last name of the contact</span>
        <span class="hljs-keyword">uint</span>[] phoneNumbers; <span class="hljs-comment">// Array to store multiple phone numbers for the contact</span>
    }    <span class="hljs-comment">// Array to store all contacts</span>
    Contact[] <span class="hljs-keyword">private</span> contacts;    <span class="hljs-comment">// Mapping to store the index of each contact in the contacts array using its ID</span>
    <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">uint</span> <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">uint</span>) <span class="hljs-keyword">private</span> idToIndex;    <span class="hljs-comment">// Variable to keep track of the ID for the next contact</span>
    <span class="hljs-keyword">uint</span> <span class="hljs-keyword">private</span> nextId <span class="hljs-operator">=</span> <span class="hljs-number">1</span>;    <span class="hljs-comment">// Custom error for when a contact is not found</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">ContactNotFound</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> id</span>)</span>;    <span class="hljs-comment">// Function to add a new contact</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">addContact</span>(<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">calldata</span> firstName, <span class="hljs-keyword">string</span> <span class="hljs-keyword">calldata</span> lastName, <span class="hljs-keyword">uint</span>[] <span class="hljs-keyword">calldata</span> phoneNumbers</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title">onlyOwner</span> </span>{
        <span class="hljs-comment">// Create a new contact with the provided details and add it to the contacts array</span>
        contacts.<span class="hljs-built_in">push</span>(Contact(nextId, firstName, lastName, phoneNumbers));
        <span class="hljs-comment">// Map the ID of the new contact to its index in the array</span>
        idToIndex[nextId] <span class="hljs-operator">=</span> contacts.<span class="hljs-built_in">length</span> <span class="hljs-operator">-</span> <span class="hljs-number">1</span>;
        <span class="hljs-comment">// Increment the nextId for the next contact</span>
        nextId<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
    }    <span class="hljs-comment">// Function to delete a contact by its ID</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">deleteContact</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> id</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title">onlyOwner</span> </span>{
        <span class="hljs-comment">// Get the index of the contact to be deleted</span>
        <span class="hljs-keyword">uint</span> index <span class="hljs-operator">=</span> idToIndex[id];
        <span class="hljs-comment">// Check if the index is valid and if the contact with the provided ID exists</span>
        <span class="hljs-keyword">if</span> (index <span class="hljs-operator">></span><span class="hljs-operator">=</span> contacts.<span class="hljs-built_in">length</span> <span class="hljs-operator">|</span><span class="hljs-operator">|</span> contacts[index].id <span class="hljs-operator">!</span><span class="hljs-operator">=</span> id) <span class="hljs-keyword">revert</span> ContactNotFound(id);        <span class="hljs-comment">// Replace the contact to be deleted with the last contact in the array</span>
        contacts[index] <span class="hljs-operator">=</span> contacts[contacts.<span class="hljs-built_in">length</span> <span class="hljs-operator">-</span> <span class="hljs-number">1</span>];
        <span class="hljs-comment">// Update the index mapping for the moved contact</span>
        idToIndex[contacts[index].id] <span class="hljs-operator">=</span> index;
        <span class="hljs-comment">// Remove the last contact from the array</span>
        contacts.<span class="hljs-built_in">pop</span>();
        <span class="hljs-comment">// Delete the mapping entry for the deleted contact ID</span>
        <span class="hljs-keyword">delete</span> idToIndex[id];
    }    <span class="hljs-comment">// Function to retrieve a contact by its ID</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getContact</span>(<span class="hljs-params"><span class="hljs-keyword">uint</span> id</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params">Contact <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-comment">// Get the index of the contact</span>
        <span class="hljs-keyword">uint</span> index <span class="hljs-operator">=</span> idToIndex[id];
        <span class="hljs-comment">// Check if the index is valid and if the contact with the provided ID exists</span>
        <span class="hljs-keyword">if</span> (index <span class="hljs-operator">></span><span class="hljs-operator">=</span> contacts.<span class="hljs-built_in">length</span> <span class="hljs-operator">|</span><span class="hljs-operator">|</span> contacts[index].id <span class="hljs-operator">!</span><span class="hljs-operator">=</span> id) <span class="hljs-keyword">revert</span> ContactNotFound(id);
        <span class="hljs-comment">// Return the contact details</span>
        <span class="hljs-keyword">return</span> contacts[index];
    }    <span class="hljs-comment">// Function to retrieve all contacts</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getAllContacts</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params">Contact[] <span class="hljs-keyword">memory</span></span>) </span>{
        <span class="hljs-comment">// Return the array of all contacts</span>
        <span class="hljs-keyword">return</span> contacts;
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5ea540da876cb70653b2c20d874e3a39ed69f5cb9a67a233204e129ab5be49b5.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Again, Make a new file called “Other Contracts” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity ^0.8.8;

// Import the AddressBook contract to interact with it
import &quot;./AddressBook.sol&quot;;// Contract for creating new instances of AddressBook
contract AddressBookFactory {
    // Define a private salt value for internal use
    string private salt = &quot;value&quot;;    // Function to deploy a new instance of AddressBook
    function deploy() external returns (AddressBook) {
        // Create a new instance of AddressBook
        AddressBook newAddressBook = new AddressBook();        // Transfer ownership of the new AddressBook contract to the caller of this function
        newAddressBook.transferOwnership(msg.sender);        // Return the newly created AddressBook contract
        return newAddressBook;
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.8;</span>

<span class="hljs-comment">// Import the AddressBook contract to interact with it</span>
<span class="hljs-keyword">import</span> <span class="hljs-string">"./AddressBook.sol"</span>;<span class="hljs-comment">// Contract for creating new instances of AddressBook</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">AddressBookFactory</span> </span>{
    <span class="hljs-comment">// Define a private salt value for internal use</span>
    <span class="hljs-keyword">string</span> <span class="hljs-keyword">private</span> salt <span class="hljs-operator">=</span> <span class="hljs-string">"value"</span>;    <span class="hljs-comment">// Function to deploy a new instance of AddressBook</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">deploy</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params">AddressBook</span>) </span>{
        <span class="hljs-comment">// Create a new instance of AddressBook</span>
        AddressBook newAddressBook <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> AddressBook();        <span class="hljs-comment">// Transfer ownership of the new AddressBook contract to the caller of this function</span>
        newAddressBook.transferOwnership(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>);        <span class="hljs-comment">// Return the newly created AddressBook contract</span>
        <span class="hljs-keyword">return</span> newAddressBook;
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/19f8e3b6e1f8047a46f48ed7239102d4e8a11f30eb3c0017472dded061dab78e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, in the same manner while compiling the contract, change the “compiler” to 0.8.20 version, deploy contract and validate the metamask transaction.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/627fce23e03e4d7cb386fba0205c2fad6e2d66e51215cc6fc52ac98cecf4a6ef.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then copy the contract code by scrolling down on the left sidebar.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e4c2036f4c6c1df704eb0908a1671d5602bce4231eebc1437497ac4eb2d144b8.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/new-keyword/new-keyword-exercise">here</a> and paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/cf778008965a3ed63e7bb5539ce63545409920fd39c31596654aa6d2dd280a8a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Contract 11: Minimal token</strong></p><p>Make a new file called “Minimal Token” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// Contract for an unburnable token
contract UnburnableToken {
    string private salt = &quot;value&quot;; // A private string variable    // Mapping to track token balances of addresses
    mapping(address =&gt; uint256) public balances;    uint256 public totalSupply; // Total supply of tokens
    uint256 public totalClaimed; // Total number of tokens claimed
    mapping(address =&gt; bool) private claimed; // Mapping to track whether an address has claimed tokens    // Custom errors
    error TokensClaimed(); // Error for attempting to claim tokens again
    error AllTokensClaimed(); // Error for attempting to claim tokens when all are already claimed
    error UnsafeTransfer(address _to); // Error for unsafe token transfer    // Constructor to set the total supply of tokens
    constructor() {
        totalSupply = 100000000; // Set the total supply of tokens
    }    // Public function to claim tokens
    function claim() public {
        // Check if all tokens have been claimed
        if (totalClaimed &gt;= totalSupply) revert AllTokensClaimed();
        
        // Check if the caller has already claimed tokens
        if (claimed[msg.sender]) revert TokensClaimed();        // Update balances and claimed status
        balances[msg.sender] += 1000;
        totalClaimed += 1000;
        claimed[msg.sender] = true;
    }    // Public function for safe token transfer
    function safeTransfer(address _to, uint256 _amount) public {
        // Check for unsafe transfer conditions, including if the target address has a non-zero ether balance
        if (_to == address(0) || _to.balance == 0) revert UnsafeTransfer(_to);        // Ensure the sender has enough balance to transfer
        require(balances[msg.sender] &gt;= _amount, &quot;Insufficient balance&quot;);        // Perform the transfer
        balances[msg.sender] -= _amount;
        balances[_to] += _amount;
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.0;</span>

<span class="hljs-comment">// Contract for an unburnable token</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">UnburnableToken</span> </span>{
    <span class="hljs-keyword">string</span> <span class="hljs-keyword">private</span> salt <span class="hljs-operator">=</span> <span class="hljs-string">"value"</span>; <span class="hljs-comment">// A private string variable    // Mapping to track token balances of addresses</span>
    <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">address</span> <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">uint256</span>) <span class="hljs-keyword">public</span> balances;    <span class="hljs-keyword">uint256</span> <span class="hljs-keyword">public</span> totalSupply; <span class="hljs-comment">// Total supply of tokens</span>
    <span class="hljs-keyword">uint256</span> <span class="hljs-keyword">public</span> totalClaimed; <span class="hljs-comment">// Total number of tokens claimed</span>
    <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">address</span> <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">bool</span>) <span class="hljs-keyword">private</span> claimed; <span class="hljs-comment">// Mapping to track whether an address has claimed tokens    // Custom errors</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">TokensClaimed</span>(<span class="hljs-params"></span>)</span>; <span class="hljs-comment">// Error for attempting to claim tokens again</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">AllTokensClaimed</span>(<span class="hljs-params"></span>)</span>; <span class="hljs-comment">// Error for attempting to claim tokens when all are already claimed</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">UnsafeTransfer</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> _to</span>)</span>; <span class="hljs-comment">// Error for unsafe token transfer    // Constructor to set the total supply of tokens</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"></span>) </span>{
        totalSupply <span class="hljs-operator">=</span> <span class="hljs-number">100000000</span>; <span class="hljs-comment">// Set the total supply of tokens</span>
    }    <span class="hljs-comment">// Public function to claim tokens</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">claim</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-comment">// Check if all tokens have been claimed</span>
        <span class="hljs-keyword">if</span> (totalClaimed <span class="hljs-operator">></span><span class="hljs-operator">=</span> totalSupply) <span class="hljs-keyword">revert</span> AllTokensClaimed();
        
        <span class="hljs-comment">// Check if the caller has already claimed tokens</span>
        <span class="hljs-keyword">if</span> (claimed[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>]) <span class="hljs-keyword">revert</span> TokensClaimed();        <span class="hljs-comment">// Update balances and claimed status</span>
        balances[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>] <span class="hljs-operator">+</span><span class="hljs-operator">=</span> <span class="hljs-number">1000</span>;
        totalClaimed <span class="hljs-operator">+</span><span class="hljs-operator">=</span> <span class="hljs-number">1000</span>;
        claimed[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>] <span class="hljs-operator">=</span> <span class="hljs-literal">true</span>;
    }    <span class="hljs-comment">// Public function for safe token transfer</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">safeTransfer</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> _to, <span class="hljs-keyword">uint256</span> _amount</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-comment">// Check for unsafe transfer conditions, including if the target address has a non-zero ether balance</span>
        <span class="hljs-keyword">if</span> (_to <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-keyword">address</span>(<span class="hljs-number">0</span>) <span class="hljs-operator">|</span><span class="hljs-operator">|</span> _to.<span class="hljs-built_in">balance</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>) <span class="hljs-keyword">revert</span> UnsafeTransfer(_to);        <span class="hljs-comment">// Ensure the sender has enough balance to transfer</span>
        <span class="hljs-built_in">require</span>(balances[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>] <span class="hljs-operator">></span><span class="hljs-operator">=</span> _amount, <span class="hljs-string">"Insufficient balance"</span>);        <span class="hljs-comment">// Perform the transfer</span>
        balances[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>] <span class="hljs-operator">-</span><span class="hljs-operator">=</span> _amount;
        balances[_to] <span class="hljs-operator">+</span><span class="hljs-operator">=</span> _amount;
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/be73819cfbd2b53153847a3bc3aed75f7b7a8b614a5c85470b57c8e8831a6fec.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then change the values into “1234.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/aea0ae794878221d2670c0dd3fe4309f5370a65443a5505691b704869c3328a6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Next, in the same manner, compile the file, deploy the contract, and validate the metamask transaction.</p><p>Then copy the contract code by scrolling down on the left sidebar.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ab5f15deecb288dab8f1036967b811539e5b181ab38e7a0e79215592ba272615.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/minimal-tokens/minimal-tokens-exercise">here</a> and paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/505e29562eac637653ffb8dabbc1020d0a339911e1656cd4ec2aced9fb964131.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Contract 12: ERC20</strong></p><p>Make a new file called “ERC20” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

// Importing OpenZeppelin contracts for ERC20 and EnumerableSet functionalities
import &quot;@openzeppelin/contracts/token/ERC20/ERC20.sol&quot;;
import &quot;@openzeppelin/contracts/utils/structs/EnumerableSet.sol&quot;;// Contract for weighted voting using ERC20 token
contract WeightedVoting is ERC20 {
    string private salt = &quot;value&quot;; // A private string variable
    using EnumerableSet for EnumerableSet.AddressSet; // Importing EnumerableSet for address set functionality    // Custom errors
    error TokensClaimed(); // Error for attempting to claim tokens again
    error AllTokensClaimed(); // Error for attempting to claim tokens when all are already claimed
    error NoTokensHeld(); // Error for attempting to perform an action without holding tokens
    error QuorumTooHigh(); // Error for setting a quorum higher than total supply
    error AlreadyVoted(); // Error for attempting to vote more than once
    error VotingClosed(); // Error for attempting to vote on a closed issue    // Struct to represent an issue
    struct Issue {
        EnumerableSet.AddressSet voters; // Set of voters
        string issueDesc; // Description of the issue
        uint256 quorum; // Quorum required to close the issue
        uint256 totalVotes; // Total number of votes casted
        uint256 votesFor; // Total number of votes in favor
        uint256 votesAgainst; // Total number of votes against
        uint256 votesAbstain; // Total number of abstained votes
        bool passed; // Flag indicating if the issue passed
        bool closed; // Flag indicating if the issue is closed
    }    // Struct to represent a serialized issue
    struct SerializedIssue {
        address[] voters; // Array of voters
        string issueDesc; // Description of the issue
        uint256 quorum; // Quorum required to close the issue
        uint256 totalVotes; // Total number of votes casted
        uint256 votesFor; // Total number of votes in favor
        uint256 votesAgainst; // Total number of votes against
        uint256 votesAbstain; // Total number of abstained votes
        bool passed; // Flag indicating if the issue passed
        bool closed; // Flag indicating if the issue is closed
    }    // Enum to represent different vote options
    enum Vote {
        AGAINST,
        FOR,
        ABSTAIN
    }    // Array to store all issues
    Issue[] internal issues;    // Mapping to track if tokens are claimed by an address
    mapping(address =&gt; bool) public tokensClaimed;    uint256 public maxSupply = 1000000; // Maximum supply of tokens
    uint256 public claimAmount = 100; // Amount of tokens to be claimed    string saltt = &quot;any&quot;; // Another string variable    // Constructor to initialize ERC20 token with a name and symbol
    constructor(string memory _name, string memory _symbol)
        ERC20(_name, _symbol)
    {
        issues.push(); // Pushing an empty issue to start from index 1
    }    // Function to claim tokens
    function claim() public {
        // Check if all tokens have been claimed
        if (totalSupply() + claimAmount &gt; maxSupply) {
            revert AllTokensClaimed();
        }
        // Check if the caller has already claimed tokens
        if (tokensClaimed[msg.sender]) {
            revert TokensClaimed();
        }
        // Mint tokens to the caller
        _mint(msg.sender, claimAmount);
        tokensClaimed[msg.sender] = true; // Mark tokens as claimed
    }    // Function to create a new voting issue
    function createIssue(string calldata _issueDesc, uint256 _quorum)
        external
        returns (uint256)
    {
        // Check if the caller holds any tokens
        if (balanceOf(msg.sender) == 0) {
            revert NoTokensHeld();
        }
        // Check if the specified quorum is higher than total supply
        if (_quorum &gt; totalSupply()) {
            revert QuorumTooHigh();
        }
        // Create a new issue and return its index
        Issue storage _issue = issues.push();
        _issue.issueDesc = _issueDesc;
        _issue.quorum = _quorum;
        return issues.length - 1;
    }    // Function to get details of a voting issue
    function getIssue(uint256 _issueId)
        external
        view
        returns (SerializedIssue memory)
    {
        Issue storage _issue = issues[_issueId];
        return
            SerializedIssue({
                voters: _issue.voters.values(),
                issueDesc: _issue.issueDesc,
                quorum: _issue.quorum,
                totalVotes: _issue.totalVotes,
                votesFor: _issue.votesFor,
                votesAgainst: _issue.votesAgainst,
                votesAbstain: _issue.votesAbstain,
                passed: _issue.passed,
                closed: _issue.closed
            });
    }    // Function to cast a vote on a voting issue
    function vote(uint256 _issueId, Vote _vote) public {
        Issue storage _issue = issues[_issueId];        // Check if the issue is closed
        if (_issue.closed) {
            revert VotingClosed();
        }
        // Check if the caller has already voted
        if (_issue.voters.contains(msg.sender)) {
            revert AlreadyVoted();
        }        uint256 nTokens = balanceOf(msg.sender);
        // Check if the caller holds any tokens
        if (nTokens == 0) {
            revert NoTokensHeld();
        }        // Update vote counts based on the vote option
        if (_vote == Vote.AGAINST) {
            _issue.votesAgainst += nTokens;
        } else if (_vote == Vote.FOR) {
            _issue.votesFor += nTokens;
        } else {
            _issue.votesAbstain += nTokens;
        }        // Add the caller to the list of voters and update total votes count
        _issue.voters.add(msg.sender);
        _issue.totalVotes += nTokens;        // Close the issue if quorum is reached and determine if it passed
        if (_issue.totalVotes &gt;= _issue.quorum) {
            _issue.closed = true;
            if (_issue.votesFor &gt; _issue.votesAgainst) {
                _issue.passed = true;
            }
        }
    }
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: UNLICENSED</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.17;</span>

<span class="hljs-comment">// Importing OpenZeppelin contracts for ERC20 and EnumerableSet functionalities</span>
<span class="hljs-keyword">import</span> <span class="hljs-string">"@openzeppelin/contracts/token/ERC20/ERC20.sol"</span>;
<span class="hljs-keyword">import</span> <span class="hljs-string">"@openzeppelin/contracts/utils/structs/EnumerableSet.sol"</span>;<span class="hljs-comment">// Contract for weighted voting using ERC20 token</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">WeightedVoting</span> <span class="hljs-keyword">is</span> <span class="hljs-title">ERC20</span> </span>{
    <span class="hljs-keyword">string</span> <span class="hljs-keyword">private</span> salt <span class="hljs-operator">=</span> <span class="hljs-string">"value"</span>; <span class="hljs-comment">// A private string variable</span>
    <span class="hljs-keyword">using</span> <span class="hljs-title">EnumerableSet</span> <span class="hljs-title"><span class="hljs-keyword">for</span></span> <span class="hljs-title">EnumerableSet</span>.<span class="hljs-title">AddressSet</span>; <span class="hljs-comment">// Importing EnumerableSet for address set functionality    // Custom errors</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">TokensClaimed</span>(<span class="hljs-params"></span>)</span>; <span class="hljs-comment">// Error for attempting to claim tokens again</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">AllTokensClaimed</span>(<span class="hljs-params"></span>)</span>; <span class="hljs-comment">// Error for attempting to claim tokens when all are already claimed</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">NoTokensHeld</span>(<span class="hljs-params"></span>)</span>; <span class="hljs-comment">// Error for attempting to perform an action without holding tokens</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">QuorumTooHigh</span>(<span class="hljs-params"></span>)</span>; <span class="hljs-comment">// Error for setting a quorum higher than total supply</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">AlreadyVoted</span>(<span class="hljs-params"></span>)</span>; <span class="hljs-comment">// Error for attempting to vote more than once</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">VotingClosed</span>(<span class="hljs-params"></span>)</span>; <span class="hljs-comment">// Error for attempting to vote on a closed issue    // Struct to represent an issue</span>
    <span class="hljs-keyword">struct</span> <span class="hljs-title">Issue</span> {
        EnumerableSet.AddressSet voters; <span class="hljs-comment">// Set of voters</span>
        <span class="hljs-keyword">string</span> issueDesc; <span class="hljs-comment">// Description of the issue</span>
        <span class="hljs-keyword">uint256</span> quorum; <span class="hljs-comment">// Quorum required to close the issue</span>
        <span class="hljs-keyword">uint256</span> totalVotes; <span class="hljs-comment">// Total number of votes casted</span>
        <span class="hljs-keyword">uint256</span> votesFor; <span class="hljs-comment">// Total number of votes in favor</span>
        <span class="hljs-keyword">uint256</span> votesAgainst; <span class="hljs-comment">// Total number of votes against</span>
        <span class="hljs-keyword">uint256</span> votesAbstain; <span class="hljs-comment">// Total number of abstained votes</span>
        <span class="hljs-keyword">bool</span> passed; <span class="hljs-comment">// Flag indicating if the issue passed</span>
        <span class="hljs-keyword">bool</span> closed; <span class="hljs-comment">// Flag indicating if the issue is closed</span>
    }    <span class="hljs-comment">// Struct to represent a serialized issue</span>
    <span class="hljs-keyword">struct</span> <span class="hljs-title">SerializedIssue</span> {
        <span class="hljs-keyword">address</span>[] voters; <span class="hljs-comment">// Array of voters</span>
        <span class="hljs-keyword">string</span> issueDesc; <span class="hljs-comment">// Description of the issue</span>
        <span class="hljs-keyword">uint256</span> quorum; <span class="hljs-comment">// Quorum required to close the issue</span>
        <span class="hljs-keyword">uint256</span> totalVotes; <span class="hljs-comment">// Total number of votes casted</span>
        <span class="hljs-keyword">uint256</span> votesFor; <span class="hljs-comment">// Total number of votes in favor</span>
        <span class="hljs-keyword">uint256</span> votesAgainst; <span class="hljs-comment">// Total number of votes against</span>
        <span class="hljs-keyword">uint256</span> votesAbstain; <span class="hljs-comment">// Total number of abstained votes</span>
        <span class="hljs-keyword">bool</span> passed; <span class="hljs-comment">// Flag indicating if the issue passed</span>
        <span class="hljs-keyword">bool</span> closed; <span class="hljs-comment">// Flag indicating if the issue is closed</span>
    }    <span class="hljs-comment">// Enum to represent different vote options</span>
    <span class="hljs-keyword">enum</span> <span class="hljs-title">Vote</span> {
        AGAINST,
        FOR,
        ABSTAIN
    }    <span class="hljs-comment">// Array to store all issues</span>
    Issue[] <span class="hljs-keyword">internal</span> issues;    <span class="hljs-comment">// Mapping to track if tokens are claimed by an address</span>
    <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">address</span> <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">bool</span>) <span class="hljs-keyword">public</span> tokensClaimed;    <span class="hljs-keyword">uint256</span> <span class="hljs-keyword">public</span> maxSupply <span class="hljs-operator">=</span> <span class="hljs-number">1000000</span>; <span class="hljs-comment">// Maximum supply of tokens</span>
    <span class="hljs-keyword">uint256</span> <span class="hljs-keyword">public</span> claimAmount <span class="hljs-operator">=</span> <span class="hljs-number">100</span>; <span class="hljs-comment">// Amount of tokens to be claimed    string saltt = "any"; // Another string variable    // Constructor to initialize ERC20 token with a name and symbol</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _name, <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _symbol</span>)
        <span class="hljs-title">ERC20</span>(<span class="hljs-params">_name, _symbol</span>)
    </span>{
        issues.<span class="hljs-built_in">push</span>(); <span class="hljs-comment">// Pushing an empty issue to start from index 1</span>
    }    <span class="hljs-comment">// Function to claim tokens</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">claim</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-comment">// Check if all tokens have been claimed</span>
        <span class="hljs-keyword">if</span> (totalSupply() <span class="hljs-operator">+</span> claimAmount <span class="hljs-operator">></span> maxSupply) {
            <span class="hljs-keyword">revert</span> AllTokensClaimed();
        }
        <span class="hljs-comment">// Check if the caller has already claimed tokens</span>
        <span class="hljs-keyword">if</span> (tokensClaimed[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>]) {
            <span class="hljs-keyword">revert</span> TokensClaimed();
        }
        <span class="hljs-comment">// Mint tokens to the caller</span>
        _mint(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>, claimAmount);
        tokensClaimed[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>] <span class="hljs-operator">=</span> <span class="hljs-literal">true</span>; <span class="hljs-comment">// Mark tokens as claimed</span>
    }    <span class="hljs-comment">// Function to create a new voting issue</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">createIssue</span>(<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">calldata</span> _issueDesc, <span class="hljs-keyword">uint256</span> _quorum</span>)
        <span class="hljs-title"><span class="hljs-keyword">external</span></span>
        <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span></span>)
    </span>{
        <span class="hljs-comment">// Check if the caller holds any tokens</span>
        <span class="hljs-keyword">if</span> (balanceOf(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>) <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>) {
            <span class="hljs-keyword">revert</span> NoTokensHeld();
        }
        <span class="hljs-comment">// Check if the specified quorum is higher than total supply</span>
        <span class="hljs-keyword">if</span> (_quorum <span class="hljs-operator">></span> totalSupply()) {
            <span class="hljs-keyword">revert</span> QuorumTooHigh();
        }
        <span class="hljs-comment">// Create a new issue and return its index</span>
        Issue <span class="hljs-keyword">storage</span> _issue <span class="hljs-operator">=</span> issues.<span class="hljs-built_in">push</span>();
        _issue.issueDesc <span class="hljs-operator">=</span> _issueDesc;
        _issue.quorum <span class="hljs-operator">=</span> _quorum;
        <span class="hljs-keyword">return</span> issues.<span class="hljs-built_in">length</span> <span class="hljs-operator">-</span> <span class="hljs-number">1</span>;
    }    <span class="hljs-comment">// Function to get details of a voting issue</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getIssue</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _issueId</span>)
        <span class="hljs-title"><span class="hljs-keyword">external</span></span>
        <span class="hljs-title"><span class="hljs-keyword">view</span></span>
        <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params">SerializedIssue <span class="hljs-keyword">memory</span></span>)
    </span>{
        Issue <span class="hljs-keyword">storage</span> _issue <span class="hljs-operator">=</span> issues[_issueId];
        <span class="hljs-keyword">return</span>
            SerializedIssue({
                voters: _issue.voters.values(),
                issueDesc: _issue.issueDesc,
                quorum: _issue.quorum,
                totalVotes: _issue.totalVotes,
                votesFor: _issue.votesFor,
                votesAgainst: _issue.votesAgainst,
                votesAbstain: _issue.votesAbstain,
                passed: _issue.passed,
                closed: _issue.closed
            });
    }    <span class="hljs-comment">// Function to cast a vote on a voting issue</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">vote</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _issueId, Vote _vote</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        Issue <span class="hljs-keyword">storage</span> _issue <span class="hljs-operator">=</span> issues[_issueId];        <span class="hljs-comment">// Check if the issue is closed</span>
        <span class="hljs-keyword">if</span> (_issue.closed) {
            <span class="hljs-keyword">revert</span> VotingClosed();
        }
        <span class="hljs-comment">// Check if the caller has already voted</span>
        <span class="hljs-keyword">if</span> (_issue.voters.contains(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>)) {
            <span class="hljs-keyword">revert</span> AlreadyVoted();
        }        <span class="hljs-keyword">uint256</span> nTokens <span class="hljs-operator">=</span> balanceOf(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>);
        <span class="hljs-comment">// Check if the caller holds any tokens</span>
        <span class="hljs-keyword">if</span> (nTokens <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>) {
            <span class="hljs-keyword">revert</span> NoTokensHeld();
        }        <span class="hljs-comment">// Update vote counts based on the vote option</span>
        <span class="hljs-keyword">if</span> (_vote <span class="hljs-operator">=</span><span class="hljs-operator">=</span> Vote.AGAINST) {
            _issue.votesAgainst <span class="hljs-operator">+</span><span class="hljs-operator">=</span> nTokens;
        } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (_vote <span class="hljs-operator">=</span><span class="hljs-operator">=</span> Vote.FOR) {
            _issue.votesFor <span class="hljs-operator">+</span><span class="hljs-operator">=</span> nTokens;
        } <span class="hljs-keyword">else</span> {
            _issue.votesAbstain <span class="hljs-operator">+</span><span class="hljs-operator">=</span> nTokens;
        }        <span class="hljs-comment">// Add the caller to the list of voters and update total votes count</span>
        _issue.voters.add(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>);
        _issue.totalVotes <span class="hljs-operator">+</span><span class="hljs-operator">=</span> nTokens;        <span class="hljs-comment">// Close the issue if quorum is reached and determine if it passed</span>
        <span class="hljs-keyword">if</span> (_issue.totalVotes <span class="hljs-operator">></span><span class="hljs-operator">=</span> _issue.quorum) {
            _issue.closed <span class="hljs-operator">=</span> <span class="hljs-literal">true</span>;
            <span class="hljs-keyword">if</span> (_issue.votesFor <span class="hljs-operator">></span> _issue.votesAgainst) {
                _issue.passed <span class="hljs-operator">=</span> <span class="hljs-literal">true</span>;
            }
        }
    }
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7f19e68741ccc6e973ddf8cd8602a98b7de9fed23f043d20b8b431a471056517.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then change the values into “CHASE.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c7c9a914bc993986687b69f062b68994b27d29a3dbd7488e9830160781ccfa95.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then, compile the file in the same way, deploy the contract, fill in the following details, and validate the metamask transaction.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/60a1034be792e02e91472d554b3dffc430bd40dabd4f04123815aec8de158a56.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then click on “Transact.”</p><p>Then copy the contract code by scrolling down on the left sidebar.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/61f8bada4ebe59c07a2c001388f9fdb24c4f8fc66c30e78e1581a51c4a0c1005.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/erc-20-token/erc-20-exercise">here</a> and paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f132f40559bfcfd44b62b7d83a4120300aa304684281f040c67e4730dcc91626.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Contract 13: ERC721</strong></p><p>Make a new file called “ERC721” in the contracts folder.</p><p>Next, insert the code below on the code panel’s right side.</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// Importing OpenZeppelin ERC721 contract
import &quot;https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol&quot;;// Interface for interacting with a submission contract
interface ISubmission {
    // Struct representing a haiku
    struct Haiku {
        address author; // Address of the haiku author
        string line1; // First line of the haiku
        string line2; // Second line of the haiku
        string line3; // Third line of the haiku
    }    // Function to mint a new haiku
    function mintHaiku(
        string memory _line1,
        string memory _line2,
        string memory _line3
    ) external;    // Function to get the total number of haikus
    function counter() external view returns (uint256);    // Function to share a haiku with another address
    function shareHaiku(uint256 _id, address _to) external;    // Function to get haikus shared with the caller
    function getMySharedHaikus() external view returns (Haiku[] memory);
}// Contract for managing Haiku NFTs
contract HaikuNFT is ERC721, ISubmission {
    Haiku[] public haikus; // Array to store haikus
    mapping(address =&gt; mapping(uint256 =&gt; bool)) public sharedHaikus; // Mapping to track shared haikus
    uint256 public haikuCounter; // Counter for total haikus minted    // Constructor to initialize the ERC721 contract
    constructor() ERC721(&quot;HaikuNFT&quot;, &quot;HAIKU&quot;) {
        haikuCounter = 1; // Initialize haiku counter
    }    string salt = &quot;value&quot;; // A private string variable    // Function to get the total number of haikus
    function counter() external view override returns (uint256) {
        return haikuCounter;
    }    // Function to mint a new haiku
    function mintHaiku(
        string memory _line1,
        string memory _line2,
        string memory _line3
    ) external override {
        // Check if the haiku is unique
        string[3] memory haikusStrings = [_line1, _line2, _line3];
        for (uint256 li = 0; li &lt; haikusStrings.length; li++) {
            string memory newLine = haikusStrings[li];
            for (uint256 i = 0; i &lt; haikus.length; i++) {
                Haiku memory existingHaiku = haikus[i];
                string[3] memory existingHaikuStrings = [
                    existingHaiku.line1,
                    existingHaiku.line2,
                    existingHaiku.line3
                ];
                for (uint256 eHsi = 0; eHsi &lt; 3; eHsi++) {
                    string memory existingHaikuString = existingHaikuStrings[
                        eHsi
                    ];
                    if (
                        keccak256(abi.encodePacked(existingHaikuString)) ==
                        keccak256(abi.encodePacked(newLine))
                    ) {
                        revert HaikuNotUnique();
                    }
                }
            }
        }        // Mint the haiku NFT
        _safeMint(msg.sender, haikuCounter);
        haikus.push(Haiku(msg.sender, _line1, _line2, _line3));
        haikuCounter++;
    }    // Function to share a haiku with another address
    function shareHaiku(uint256 _id, address _to) external override {
        require(_id &gt; 0 &amp;&amp; _id &lt;= haikuCounter, &quot;Invalid haiku ID&quot;);        Haiku memory haikuToShare = haikus[_id - 1];
        require(haikuToShare.author == msg.sender, &quot;NotYourHaiku&quot;);        sharedHaikus[_to][_id] = true;
    }    // Function to get haikus shared with the caller
    function getMySharedHaikus()
        external
        view
        override
        returns (Haiku[] memory)
    {
        uint256 sharedHaikuCount;
        for (uint256 i = 0; i &lt; haikus.length; i++) {
            if (sharedHaikus[msg.sender][i + 1]) {
                sharedHaikuCount++;
            }
        }        Haiku[] memory result = new HaikuUnsupported embed;
        uint256 currentIndex;
        for (uint256 i = 0; i &lt; haikus.length; i++) {
            if (sharedHaikus[msg.sender][i + 1]) {
                result[currentIndex] = haikus[i];
                currentIndex++;
            }
        }        if (sharedHaikuCount == 0) {
            revert NoHaikusShared();
        }        return result;
    }    // Custom errors
    error HaikuNotUnique(); // Error for attempting to mint a non-unique haiku
    error NotYourHaiku(); // Error for attempting to share a haiku not owned by the caller
    error NoHaikusShared(); // Error for no haikus shared with the caller
}//CHASE
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.0;</span>

<span class="hljs-comment">// Importing OpenZeppelin ERC721 contract</span>
<span class="hljs-keyword">import</span> <span class="hljs-string">"https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol"</span>;<span class="hljs-comment">// Interface for interacting with a submission contract</span>
<span class="hljs-class"><span class="hljs-keyword">interface</span> <span class="hljs-title">ISubmission</span> </span>{
    <span class="hljs-comment">// Struct representing a haiku</span>
    <span class="hljs-keyword">struct</span> <span class="hljs-title">Haiku</span> {
        <span class="hljs-keyword">address</span> author; <span class="hljs-comment">// Address of the haiku author</span>
        <span class="hljs-keyword">string</span> line1; <span class="hljs-comment">// First line of the haiku</span>
        <span class="hljs-keyword">string</span> line2; <span class="hljs-comment">// Second line of the haiku</span>
        <span class="hljs-keyword">string</span> line3; <span class="hljs-comment">// Third line of the haiku</span>
    }    <span class="hljs-comment">// Function to mint a new haiku</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">mintHaiku</span>(<span class="hljs-params">
        <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _line1,
        <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _line2,
        <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _line3
    </span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span></span>;    <span class="hljs-comment">// Function to get the total number of haikus</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">counter</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span></span>)</span>;    <span class="hljs-comment">// Function to share a haiku with another address</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">shareHaiku</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _id, <span class="hljs-keyword">address</span> _to</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span></span>;    <span class="hljs-comment">// Function to get haikus shared with the caller</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getMySharedHaikus</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params">Haiku[] <span class="hljs-keyword">memory</span></span>)</span>;
}<span class="hljs-comment">// Contract for managing Haiku NFTs</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">HaikuNFT</span> <span class="hljs-keyword">is</span> <span class="hljs-title">ERC721</span>, <span class="hljs-title">ISubmission</span> </span>{
    Haiku[] <span class="hljs-keyword">public</span> haikus; <span class="hljs-comment">// Array to store haikus</span>
    <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">address</span> <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">uint256</span> <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">bool</span>)) <span class="hljs-keyword">public</span> sharedHaikus; <span class="hljs-comment">// Mapping to track shared haikus</span>
    <span class="hljs-keyword">uint256</span> <span class="hljs-keyword">public</span> haikuCounter; <span class="hljs-comment">// Counter for total haikus minted    // Constructor to initialize the ERC721 contract</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"></span>) <span class="hljs-title">ERC721</span>(<span class="hljs-params"><span class="hljs-string">"HaikuNFT"</span>, <span class="hljs-string">"HAIKU"</span></span>) </span>{
        haikuCounter <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; <span class="hljs-comment">// Initialize haiku counter</span>
    }    <span class="hljs-keyword">string</span> salt <span class="hljs-operator">=</span> <span class="hljs-string">"value"</span>; <span class="hljs-comment">// A private string variable    // Function to get the total number of haikus</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">counter</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">override</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span></span>) </span>{
        <span class="hljs-keyword">return</span> haikuCounter;
    }    <span class="hljs-comment">// Function to mint a new haiku</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">mintHaiku</span>(<span class="hljs-params">
        <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _line1,
        <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _line2,
        <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> _line3
    </span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">override</span></span> </span>{
        <span class="hljs-comment">// Check if the haiku is unique</span>
        <span class="hljs-keyword">string</span>[<span class="hljs-number">3</span>] <span class="hljs-keyword">memory</span> haikusStrings <span class="hljs-operator">=</span> [_line1, _line2, _line3];
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">uint256</span> li <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; li <span class="hljs-operator">&#x3C;</span> haikusStrings.<span class="hljs-built_in">length</span>; li<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
            <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> newLine <span class="hljs-operator">=</span> haikusStrings[li];
            <span class="hljs-keyword">for</span> (<span class="hljs-keyword">uint256</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&#x3C;</span> haikus.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
                Haiku <span class="hljs-keyword">memory</span> existingHaiku <span class="hljs-operator">=</span> haikus[i];
                <span class="hljs-keyword">string</span>[<span class="hljs-number">3</span>] <span class="hljs-keyword">memory</span> existingHaikuStrings <span class="hljs-operator">=</span> [
                    existingHaiku.line1,
                    existingHaiku.line2,
                    existingHaiku.line3
                ];
                <span class="hljs-keyword">for</span> (<span class="hljs-keyword">uint256</span> eHsi <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; eHsi <span class="hljs-operator">&#x3C;</span> <span class="hljs-number">3</span>; eHsi<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
                    <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> existingHaikuString <span class="hljs-operator">=</span> existingHaikuStrings[
                        eHsi
                    ];
                    <span class="hljs-keyword">if</span> (
                        <span class="hljs-built_in">keccak256</span>(<span class="hljs-built_in">abi</span>.<span class="hljs-built_in">encodePacked</span>(existingHaikuString)) <span class="hljs-operator">=</span><span class="hljs-operator">=</span>
                        <span class="hljs-built_in">keccak256</span>(<span class="hljs-built_in">abi</span>.<span class="hljs-built_in">encodePacked</span>(newLine))
                    ) {
                        <span class="hljs-keyword">revert</span> HaikuNotUnique();
                    }
                }
            }
        }        <span class="hljs-comment">// Mint the haiku NFT</span>
        _safeMint(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>, haikuCounter);
        haikus.<span class="hljs-built_in">push</span>(Haiku(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>, _line1, _line2, _line3));
        haikuCounter<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
    }    <span class="hljs-comment">// Function to share a haiku with another address</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">shareHaiku</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _id, <span class="hljs-keyword">address</span> _to</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">override</span></span> </span>{
        <span class="hljs-built_in">require</span>(_id <span class="hljs-operator">></span> <span class="hljs-number">0</span> <span class="hljs-operator">&#x26;</span><span class="hljs-operator">&#x26;</span> _id <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">=</span> haikuCounter, <span class="hljs-string">"Invalid haiku ID"</span>);        Haiku <span class="hljs-keyword">memory</span> haikuToShare <span class="hljs-operator">=</span> haikus[_id <span class="hljs-operator">-</span> <span class="hljs-number">1</span>];
        <span class="hljs-built_in">require</span>(haikuToShare.author <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>, <span class="hljs-string">"NotYourHaiku"</span>);        sharedHaikus[_to][_id] <span class="hljs-operator">=</span> <span class="hljs-literal">true</span>;
    }    <span class="hljs-comment">// Function to get haikus shared with the caller</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getMySharedHaikus</span>(<span class="hljs-params"></span>)
        <span class="hljs-title"><span class="hljs-keyword">external</span></span>
        <span class="hljs-title"><span class="hljs-keyword">view</span></span>
        <span class="hljs-title"><span class="hljs-keyword">override</span></span>
        <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params">Haiku[] <span class="hljs-keyword">memory</span></span>)
    </span>{
        <span class="hljs-keyword">uint256</span> sharedHaikuCount;
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">uint256</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&#x3C;</span> haikus.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
            <span class="hljs-keyword">if</span> (sharedHaikus[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>][i <span class="hljs-operator">+</span> <span class="hljs-number">1</span>]) {
                sharedHaikuCount<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
            }
        }        Haiku[] <span class="hljs-keyword">memory</span> result <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> HaikuUnsupported embed;
        <span class="hljs-keyword">uint256</span> currentIndex;
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">uint256</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&#x3C;</span> haikus.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
            <span class="hljs-keyword">if</span> (sharedHaikus[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>][i <span class="hljs-operator">+</span> <span class="hljs-number">1</span>]) {
                result[currentIndex] <span class="hljs-operator">=</span> haikus[i];
                currentIndex<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
            }
        }        <span class="hljs-keyword">if</span> (sharedHaikuCount <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>) {
            <span class="hljs-keyword">revert</span> NoHaikusShared();
        }        <span class="hljs-keyword">return</span> result;
    }    <span class="hljs-comment">// Custom errors</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">HaikuNotUnique</span>(<span class="hljs-params"></span>)</span>; <span class="hljs-comment">// Error for attempting to mint a non-unique haiku</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">NotYourHaiku</span>(<span class="hljs-params"></span>)</span>; <span class="hljs-comment">// Error for attempting to share a haiku not owned by the caller</span>
    <span class="hljs-function"><span class="hljs-keyword">error</span> <span class="hljs-title">NoHaikusShared</span>(<span class="hljs-params"></span>)</span>; <span class="hljs-comment">// Error for no haikus shared with the caller</span>
}<span class="hljs-comment">//CHASE</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/047609664ff77d0edf34a9687cf2093b6dedc9bb682e4a3459e035715aadc993.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then, compile the file in the same way, deploy the contract and validate the metamask transaction.</p><p>Then copy the contract code by scrolling down on the left sidebar.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b93575b34330f7969c25f521d20f40a4b34a9351675e8ef94dddb07ac3f1f800.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Then go over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.base.org/base-camp/docs/erc-721-token/erc-721-exercise">here</a> and paste your contract code, and click on “Submit.”</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5f9edeb81a89b7a45ae18dbcb963cbcafcac7cc04881824e6a8d41591371efa6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong><em>Congratulations! You’ve completed all the tasks, and you’re now a kind of developer. If you’ve made it this far, I’m proud of you.</em></strong></p><p>Now that you’ve collected all the badges/NFTs, head to the guild page and verify all the roles.</p><p>Guild link: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://guild.xyz/base/base-camp">https://guild.xyz/base/base-camp</a></p><p>Great! You can now check these roles by messaging in the base server.</p><p>Congratulations on dedicating your time on this. Your efforts will surely pay off.</p><p>If you run into any trouble, leave a comment and I’ll assist you.</p>]]></content:encoded>
            <author>abraham-chase@newsletter.paragraph.com (Abraham Chase.)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/58fddd6cb6826aee8c6abe35bc41defafee37dec2bcbc076cf25729b33465fb4.png" length="0" type="image/png"/>
        </item>
    </channel>
</rss>