avatarChristopher Madsen

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

3786

Abstract

arison operators, and bitwise operators on this type too.</p><p id="c4da">It’s important to note that there is another type, called <code>bytes</code> which is different from the above in that it is a dynamically sized array, and not a value type but a reference type. It is basically shorthand for <code>byte[]</code>.</p><p id="ad39">When you can limit the length of your data to a predefined amount of bytes, it is always good practice to use some of <code>bytes1</code> to <code>bytes32</code> because it is much cheaper.</p><h2 id="0118">Enums</h2><p id="aea7"><b>Enums</b> in Solidity are a way to create user-defined types. Enums are explicitly convertible to integer types, but not implicitly. Enum values are numbered in the order they are defined, starting from 0.</p><p id="ed00">Enums are not part of the ABI (Application Binary Interface — more on this in a later lesson, but it’s basically how you encode Solidity code for the Ethereum Virtual Machine, and how you get data back). This means that if your function returns an <code>enum</code> for example, it will be automatically converted to a <code>uint8</code> behind the scenes. The integer returned is just large enough to hold all enum values. With more values, the size gets increased too (<code>uint16</code> and up).</p><p id="cdb6">The below code, taken from the <a href="https://docs.soliditylang.org/en/v0.4.24/index.html">Solidity docs</a>, defines an enum with four possible values, creates a variable of that enum named <code>choice</code> and a constant called <code>defaultChoice</code>that will hold a default value.</p><div id="cf29"><pre><span class="hljs-keyword">enum</span> <span class="hljs-title class_">ActionChoices</span> { GoLeft, GoRight, GoStraight, SitStill } ActionChoices choice; ActionChoices <span class="hljs-type">constant</span> <span class="hljs-variable">defaultChoice</span> <span class="hljs-operator">=</span> ActionChoices.GoStraight;</pre></div><p id="66a9">Now we can define some functions to interact with our <code>enum</code>.</p><div id="c0bb"><pre><span class="hljs-title function_"><span class="hljs-keyword">function</span> <span class="hljs-title">setGoStraight</span></span>() <span class="hljs-keyword">public</span> { choice = ActionChoices.GoStraight; }

<span class="hljs-title function_"><span class="hljs-keyword">function</span> <span class="hljs-title">setChoice</span></span>(ActionChoices <span class="hljs-keyword">new</span><span class="hljs-type">Choice</span>) <span class="hljs-keyword">public</span> { choice = <span class="hljs-keyword">new</span><span class="hljs-type">Choice</span>; }</pre></div><p id="6bc2">The first one simply sets the <code>choice</code> to <code>GoStraight</code> while the second one sets it to the choice that the caller passes into the function. As we can see after deployment, the <code>setChoice</code> function expects a <code>uint8</code> value, which corresponds to the <code>enum</code> value declared at that number.</p><figure id="e997"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*1pKNPVy4UUBCSLi2-SIckg.png"><figcaption>Testing enums in Remix</figcaption></figure><p id="7917">If we want to get the value of <code>choice</code> and <code>defaultChoice</code>, we can define the following functions:</p><div id="1f02"><pre><span class="hljs-keyword">function</span> <span class="hljs-title">getChoice</span>() public view returns (ActionChoices) { <span class="hljs-keyword">return</span> <span class="hljs-type">choice</span>; }</pre></div><div id="43e7"><pre><span class="hljs-function">function <span class="hljs-title">getDefaultChoice</span>() <span class="hljs-keyword">public</span> pure <span class="hljs-title">returns</span> (<span class="hljs-params"><span class=

Options

"hljs-built_in">uint</span></span>)</span> { <span class="hljs-keyword">return</span> <span class="hljs-built_in">uint</span>(defaultChoice); }</pre></div><p id="c2f2">As we can see if we try this out in Remix, the first function returns a <code>uint8</code> while the second returns a <code>uint256</code>.</p><figure id="e514"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*jmaOFb9GhXz7FWC4ONMa_A.png"><figcaption>Testing enums in Remix</figcaption></figure><h2 id="3c7c">Fixed point numbers</h2><p id="2ecc"><b>Fixed point numbers </b>represent fractional numbers by storing a fixed number of digits of their fractional part. No matter how large or small the fractional part is, it will always use the same number of bits.</p><p id="cdcd" type="7">Fixed point numbers are not fully supported by Solidity yet. They can be declared, but cannot be assigned to or from.</p><p id="f872">We can differentiate between signed fixed point numbers, declared with the <code>fixed</code> keyword, and unsigned fixed point numbers, declared with the <code>ufixed</code> keyword.</p><p id="3c1c">It can also be declared as <code>fixedMxN</code> or <code>ufixedMxN</code> where <code>M</code> represents the number of bits the type takes, and <code>N</code> represents the number of decimal points. <code>M</code> has to be divisible by 8 and a number between 8 and 256. <code>N</code> has to be a number between 0 and 80.</p><p id="96e1">They function with the following operators:</p><ul><li>Comparisons: <code><=</code>, <code><</code>, <code>==</code>, <code>!=</code>, <code>>=</code>, <code>></code> (evaluate to <code>bool</code>)</li><li>Arithmetic operators: <code>+</code>, <code>-</code>, unary <code>-</code>, unary <code>+</code>, <code>*</code>, <code>/</code>, <code>%</code> (remainder)</li></ul><h2 id="09b7">Conclusion</h2><p id="bd3a">In this lesson, we looked at what value types are available in Solidity and how each one works.</p><p id="28de">Thank you for staying with us till the end. If you enjoyed reading this piece please keep in touch and follow Solidify to keep up with our lessons on Solidity. In the upcoming articles, we will deep dive into the intricacies of the language, progressing from beginner to advanced level.</p><p id="067c">If you are new to Solidity, check out the previous lessons about setting up a local development environment and writing your first smart contract.</p><div id="6b76" class="link-block"> <a href="https://readmedium.com/how-to-setup-your-local-solidity-development-environment-c4c8195810f3"> <div> <div> <h2>How to Setup Your Local Solidity Development Environment</h2> <div><h3>Get started with smart contract development</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*HHko-o9m1sVngmTeRVYgKA.jpeg)"></div> </div> </div> </a> </div><div id="3ad1" class="link-block"> <a href="https://readmedium.com/lesson-1-your-first-solidity-smart-contract-1ba7e641f9a3"> <div> <div> <h2>Lesson 1: Your First Solidity Smart Contract</h2> <div><h3>In the previous lesson, we looked at how to set up your local Solidity development environment. Here we will continue…</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*7r7HSYkbn73NrmR_skvh5w.jpeg)"></div> </div> </div> </a> </div></article></body>

How to Create a Nothing Date Through the Art of Surrender

Follow the Bread Crumbs Don’t Feed the Birds!

Photo by Matthew Smith on Unsplash

Date nights have evolved with my girlfriend from simply going to a local micro-brewery for a blackberry cider over a game of cribbage to pitting our wits against a Gypsy in a quest to obtain a healing potion. This transformation from the mundane, I credit to our ability to surrender control over events throughout our date. We call these “bread crumbs”. Let me show you how when followed they have provided unforeseeable adventures enriching our relationship with stories and memories captured.

Rules for the Flow (I know, here’s an article about the art of surrender that starts with rules. But, trust me, some structure is required.)

Number 1 Rule: Start with a General Destination

Our first experiment in surrendering during a sunny summer afternoon. We got in our car, and nothing. We needed a destination to start. After deciding on where to go we discovered there needs to be a way to kick start our intention in allowing the date to develop organically along the way.

The simplicity of a “nothing date” is in allowing for the events and ideas to unfold without being rejected along the way. There seems to be only one rule and that is to have a general destination to begin the journey. As places of interest appear along with suggestions of “going there” or “not” keep following and consciously state before each “Nothing Date”.

“There is nothing to do once we begin and vow to surrender to all detours and decisions guiding us to our best possible date”.

Number 2 Rule: Follow Your Intuition (Surrender to the Flow)

An inability to control the flow of our date was the most difficult part. By surrendering to change of plans as hints nudged the date toward better experiences was difficult for me to embrace. Each event begged us to follow their “bread crumbs” and the signs could be as simple as a curious voice in your head wondering “what is that place like inside” or “I’ve always wanted to hike that trail we just passed”. Then with practice your intuition will became easier to follow as you find yourself, like us, swept along a path towards an unforeseeable event.

Number 3 Rule : Start Again at Rule 1 Until Your Date is Done

Once your unforeseeable event has come to its conclusion there may still be more date time left. No need to waste the momentum from the date just create another destination. Alright, so technically there are only 2 rules, well really on 1 hard rule and some advice I labeled a rule, but there’s something special about the trinity.

We have come to call our dates of surrendering to the flow of events “Nothing Dates” because we plan absolutely nothing, yet so much occurs.

The Nothing Date

Taking the road out of Monroe through the farmlands to the small town of Carnation was our first predetermined destination. “Along the way if you spot a place you really want to stop let me know” I announced losing myself among our summer drive, “even if we’ve passed the place, I will turn around and make sure we stay true to our desire” I added.

Photo by Simon Rae on Unsplash

The peaceful backroad into Redmond came up and urged me to turn right. With a renewed sense of relaxation mixed with adventure the idea of dropping in for a visit with my parents, I ignored rule number 2 as we continued towards Carnation. I had become subdued by our sunny evening drive looking forward to a walk along the Tolt River. Then just a few blocks after the turn off to my parents apartment I noticed the gas light guide us into a gas station, a detour that allowed me to catch sight of barriers a few feet down the road signaling that the route to Carnation was closed “not to be reopened for a week”.

This “bread crumb” caused us to back track after refueling to the choice of heading into Redmond. I confessed to my girlfriend about ignoring the voice urging me to visit my parents and then threw my own “loaf of bread” out the window for the birds to eat.

I FORGOT MY COMPLETE SURRENDER TO THE DATE

“After visiting with your parents lets grab a pizza” she offered as we pulled into the apartment complex.

I knocked and after a few minutes my Dad appeared with his messed white hair just having woken from a nap. “Well, hello there,” he greeted. “Marsha, Chris and Jess stopped in to visit” he announced to my Mom who was wearing an oversized gaming headset shouting commands while her level 85 “toon” (she innocently called her WarCraft characters) unloaded brimstone and fire upon a host of monsters.

“We were on our way to grab some dinner and thought to stop in for a quick visit” I said as we walked into the apartment. My mom who was immersed in a dungeon raid snapped back into her elderly body and smiled up at us with surprise in her eyes. “Something has come up. I’ve got to go. I’ll be back on later tonight” she quickly informed her guild members, while still allowing them to assume her age somewhere between 32 and 40.

Our visit with my parents became one of the most pleasant ones with them and showed me how much an unexpected drop in had lifted their mood. It was always a mixed bag of subjects when spending time my parents but their interactions with one another has always been entertaining. They banter back and forth as if filming an old black and white episode of “The Honeymooners”.

The conversation circled around to our dinner plans, “You can order on your phone and have it delivered here” my mom suggested wanting to extend our stay. When we graciously declined and said our good-byes my mom suggested The Matador in Redmond as a great place to dine. Well, here was another “bread crumb” we must follow leading us into downtown Redmond to find a line extending out the door for this popular restaurant. “I’m just not feeling it,” Jess said. “Lets just go to Kirkland, pizza still sounds good”.

I watched her throw out some bread crumbs from her own bag, but could the line at the Matador also be a message. I turned her request for pizza into a general point of interest as we drove over the hill to Kirkland passing car dealerships and fast food options. When we passed by a white rambler yielding to commercialism with its glowing neon sign “Open” Jess grabbed my hand.

Photo by Prateek Katyal on Unsplash

“I’ve always wanted to check out the Psychic’s house,” I heard her offer as I caught a glimpse of the advertisement for psychic readings in my rearview mirror.

“Alright, then that’s what we will do!” I replied making a quick u-turn cutting through a confused car salesman’s lot before pulling into the driveway of the psychics home.

We sat feeling the energy of our night build within us like a storm about to burst over a desert field. Jess looked at me with her wide green eyes, “You knock on the door and see if they’re home, I’m scared”. I found this funny coming from a career energy worker herself, but I obliged.

I knew they were home as I looked at their front window glowing “Open” in bright neon colors. I stepped up Jess at my back and we walked to the door announcing our arrival. A blond woman with deep brown eyes greeted us with a smile as her two small white fluffy dogs ran out for a sniff.

“You available for a reading,” I asked as she examined us.

“You two married, dating, or friends?”

“We’re dating,” Jess answered.

“How’d you two meet?”

“Online,” I replied awaiting some sort of judgment from her older generation.

“You two are lucky to have found each other. You have had many lifetimes together,” she answered to my surprise.

“How much is a reading?” inquired Jess as one of the dogs circled around her legs.

“The two of you together $125 for a full reading, or $95 for short reading. However I only take cash. I am not taking cards or checks at this time.”

I hadn’t any cash on me and for that matter didn’t know of too many people these days who would be walking around with any cash. “I think I may have just the right amount,” Jess announced to my surprise as she pulled out a wad of bills. I later discovered she had gotten this money that day by returning an unnecessary item to the store and had not yet deposited the cash into her bank account. “I have $121, is that enough?”

“That will work,” agreed the fortune teller, “I am Duda,” she said leading us into her home decorated with statues of Jesus, Buddha and a few Hindu Gods waving multiple arms.

We were led into a dining room tucked off to the side from the entry. Her family were quickly hidden from sight in the kitchen as the gypsy sat at the head of the table shuffling through her deck of tarot cards.

She handed Jess half the deck and when their hands touched the gypsy’s eyes widened. “What is it you do to make money?” she asked.

Jess who is usually pretty secretive about her profession due to interactions with people unfamiliar with energy work, Chakras and intuitive reads found herself at ease in the Gypsy’s home.

I am a Reiki practitioner and Energy Intuitive,” Jess proudly answered.

Photo by Shreyas shah on Unsplash

The fortune teller smiled and laid out her tarot cards before us. This is when I was given an opportunity to compare Jess’s modernized profession from the Gypsy’a old world origin. Duda, who rarely looked at the cards she set upon the table only glanced over the pictures for brief clarification of what she was actually reading within her guests. I could observe the Gypsy’s intuitive craft to obtain information from our auric field. The type of work I’ve witness Jess perform in her own ritualistic manner.

The exchanges we had with the Gypsy evolved as we shared answers to her questions. She then stopped my read and looked at Jess with intense curiosity. “You work with crystals?” she asked her.

“I don’t. I only use them sometimes during guided meditations. I often go into a place called the Crystal Cavern that represents our seven Chakras”.

“You need to use a white crystal during your Reiki. The negative energy from your work on others is building up inside you. You’re not clearing them out”. The Gypsy looked at the cards before Jess. “How is your health?”

“I’ve been weak for months with brain fog and completely drained. I’ve been to doctors but no one seems to have the answers.”

“That’s because it has to do with negative energy. I bet you feel you need even more sleep after waking in the morning”. The Gypsy read recognition on Jess’s face. “I have a ritual for you to do and if I can open a file on you we could start working on cleansing out this unwanted energy.”

“How much would this cost?” Jess asked sensing the hook.

“I may get you into a spot that’s available for $1100”.

This was a bit more of an expensive detour than we had planned but I was also intrigued to learn what such an expensive ritual entailed. The Gypsy saw our hesitation, “How about $600, what can you afford for a price on your health?” I was silent, but Jess calmly asked for her card as we learned she had only come for the day.

“The house is my sisters. I live in Seattle and only came here to have my dogs see their vet who is nearby, otherwise I am usually not here. But you call this number and let my sister know you want to set up an appointment so I can meet with you here.” Then she sat down and looked at Jess, “Now, you read me. Is there someone for me in my future?” She laughed. “Always, everyone asks about a future love. As you know you can’t read accurately yourself, but I read for you, so you can read for me.”

I’ve witnessed Jess work a few times and am always amazed by her supernatural guidance with those she has been called to work upon. “There is already someone you are seeing,” Jess began.

“Nope, not him, I am not attracted to him. He doesn’t do it for me,” the fortune teller insisted.

We soon learned that the man she was seeing is a very good friend. A friend who’s wife had been cheating on him consistently and that his brother had just departed. We also learned she had been with a man prior who wanted to marry her, but when she rejected his offer she later discovered he soon married another woman.

“In two years your relationship with you friend will develop into a more romantic connection. He needs to deal with the grief of his wife’s betrayal and his brothers death. When his grief is met and he no longer views himself as a victim you will see him as a more attractive man” Jess read as the gypsy smiled.

“He is attractive. He is tall, slender, with a great smile”. We watched her heart open to a possible future, but Jess saw something more.

“You’re afraid of being hurt. Your work is to love yourself by self partnering you will be able to allow him into your heart,” Jessica said.

When we began to leave she stopped us at the door quietly she spoke, “I usually do not do this, but I tell you what you’ll need to cleanse out your body and protect yourself against curses,” she informed us as she began to spout off a grocery list of items to purchase accompanied by instructions to follow. “You must buy these ingredients new because what you have now in the home is contaminated,” she finished as we departed eager to write down a Gypsy’s healing potion from memory.

We departed from our new fortune teller friend and backed onto the road towards Kirkland. The day had given way to night and as we kept on the path towards Kirkland, we felt a call to “A Taste of India” and had a lively discussion from the recent encounter.

“It felt like we were in one of my moms video games. We were given a quest to find you a cure, but could only accomplish the task by proving ourselves worthy. You did that by showing her your talent and she repaid you with a $600 ritual,” I said as we pulled into the parking lot.

Our meal was pleasant out on the patio under the stars sharing rice and beef vindaloo. The waiter asked if we needed anything else, I had stated we didn’t, but Jess inquired about the chocolate mousse as he walked away. When our bill came she inquired about adding the dessert to the check, but he insisted that this delicacy would be on the house.

The night had brought us full circle as we drove home reminiscing about our days events. This was a date full of surprises driven by coincidence and intuition, a nothing date of perfection.

I would love to hear about your adventures from having a nothing date. Please respond with links to your story or just comment about your experience.

Additional articles written by Christopher Madsen published on Medium

Poetry published on Medium

Relationships
Spirituality
Dating
Illumination
Romance
Recommended from ReadMedium