avatarDaniel Christian Wahl

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>

Towards a regenerative economy

Ultimately, we need to transform finance and shift the flow of investment capital to perpetuate a Regenerative Economy that serves humanity and is a steward of Earth’s ecosystems. […] The transition to a Regenerative Economy is about seeing the world in a different way — a shift to an ecological world view in which nature is the model. The regenerative process that defines thriving, living systems must define the economic system itself. — John Fullerton & Hunter Lovins (2013)

Redesigning our industrial system of production and consumption around the circular patterns of resource and energy use that we observe in mature ecosystems is only one part of redesigning our economy using the insights of ecology. To create a truly regenerative economy challenges us to ask deeper questions and initiate more far-reaching transformative change.

The stock-market crash of September 2008 shocked many mainstream economists into realizing that the current system is fundamentally dysfunctional. Some of them have since become effective change agents of the transition towards a regenerative culture. Rather than condemning these highly intelligent, well- connected, well-resourced, and extremely capable people for their roles in creating some of the mess of Horizon 1 (which we all had a part in), we should celebrate the new-found support of people who have access to, and the respect of, important decision-makers.

This map of the choices we have to make in bringing forth economies and a world together emerged in a conversation during the Masters in Holistic Science at Schumacher College in 2001 — a day after September 11th. In trying to create regenerative economies that serve all of humanity and all of life we do have to choose between living from love or living from fear — co-creating collaborative abundance or driving the vicious circle of fear, separation, and scarcity.

John Fullerton, a managing director at J.P. Morgan until 2002 and now a member of the Club of Rome and president of the Capital Institute, is one of the most active facilitators of the dialogue about how we might create a regenerative economy. He has published a list of principles that could be used to characterize a regenerative economy (Fullerton, 2015). If we turn the list of proposed qualities of a regenerative economy into guiding questions, they might sound like this:

How do we create an economy with its operations based on cooperative relationships (between each other and within the ecosphere)?

How would a regenerative economy nurture the entrepreneurial spirit?

How would a regenerative economy enable empowered participation?

How can we ensure that the economy promotes robust circular flows?

How would we design balancing mechanisms (feedback loops) into the economy?

How can we enrich the interactions in our economy by mimicking “the edge effect” (the point where two ecosystems and their diversity meet)?

How can we nurture regenerative economic activities that honour place by expressing the culture and ecology of place in their relationships?

What would an economy that views wealth holistically look like?

Questions like these can serve as activators of important conversations in your local community, a boardroom, or in the newly enlivened political dialogue about redesigning economics.

A regenerative economy would have “critical value adding exchanges” occurring within networks of reciprocal relationships “in contrast with commoditized transactions” (ibid). An important aspect of the transition to such a system is to encourage people to “discover their essence, innovate, and create anew across all sectors and activities of society, not just the business sector”. To stimulate participation, people need to feel empowered to contribute to a healthy human economy “negotiating in their own enlightened self-interest as they naturally promote the health of the whole” (ibid).

If we learn to understand wealth holistically rather than just in monetary terms, we will understand that by regenerating the health and wealth of our communities and ecosystems we are creating wealth for all.

The material flows of a regenerative economy will mimic “the metabolic process found in resilient living systems” with wastes being fully recycled or upcycled in an “ongoing, productive, circulatory and value enhancing flow” (see circular economy). The flow of information and money would follow similar patterns. Self-regulating processes and feedback loops maintain the dynamic balance in ecosystems; by analogy, “a regenerative economic and financial system seeks a balance between efficiency and resilience, global and local, big and little, diversity and uniformity, innovation and conservation, flexibility and constraint” (ibid).

Creative use of the ‘edge-effect’ nurtures the qualitative growth of all sub-systems rather than pushing the unbridled quantitative growth of one isolated sub-system. Designing to increase the ‘edge effect’ is biomimicry applied to economics. The regenerative economy at and between different scales will aim to create ‘edge effect’ conditions with rich interaction and high diversity, that can manifest in “intense collaboration across diverse sectors (public sector, private sector, NGO sector), cultures and demographics, increasing the possibility of value-adding wealth creation through these human exchanges that occur ‘in relationship’” (ibid).

Appropriately linking the local, regional and global scales of nested regenerative systems through collaboration will be a central achievement of a regenerative economy. Such a scale-linking design would nurture “healthy stable communities, locally, regionally and globally, both real and virtual, in a connected, place-centred mosaic” (ibid). Scale- linking collaboration between the different ‘local living economies’ (BALLE, 2012) and regional economies within a global context will be an important aspect of creating and maintaining greater equity locally and globally.

Wealth understood holistically is primarily expressed in the health of the whole system. Many aspects of healthy socio-ecological systems and a regenerative culture are not reducible to monetary values and numbers. They evade quantification since they are qualities rooted in being nurtured by and nurturing collaborative relationships.

A regenerative economy will redefine wealth in terms of multiple kinds of capital rather than just financial capital. Ethan Roland and Gregory Landua proposed a whole- systems map of economics which conceives of wealth as relying on eight forms of capital: living, cultural, experiential, intellectual, spiritual, social, material and financial capital (2011). We will revisit this model in more detail when we explore the role of regenerative enterprise.

The redirection of the flow of financial capital from the speculative to the real economy, and from exploitative and destructive to regenerative and for-benefit enterprises is also a crucial step towards creating a regenerative economy.

Ethical Markets Media, a social enterprise set up by Hazel Henderson, has been reporting success stories of the transition towards a green economy for over ten years. The organization’s ‘Green Transition Scoreboard’ monitors the amount of private green investment globally and has shown a steady increase over the last ten years to $US5.7 trillion by September 2014, predicting that the $10 trillion mark will be reached by 2020. Together with Biomimicry 3.8, Ethical Markets developed a set of “Principles of Ethical Biomimicry Finance” (Ethical Markets, 2012).

Henderson also offered a major step towards more qualitative and holistic ways of measuring economic success with a practical alternative to the dysfunctional success indicator GDP. Supported by the socially responsible investment firm Calvert, Henderson led the development of a new set of indicators, now called the Ethical Markets Quality of Life Indicators. This economic performance measure is based on education, employment, energy, environment, health, human rights, income, infrastructure, national security, public safety, recreation and shelter.

A regenerative economy will furthermore require us to redesign the role of the banking system. The Global Alliance for Banking on Values is an independent network of banks using finance to deliver sustainable development for “unserved people, communities and the environment”. The alliance includes pioneering, innovative banks on six continents which are all committed to i) “delivering social finance products”, ii) “financing community based development initiatives and social entrepreneurs”, iii) “fostering sustainable and environmentally sound enterprises and fulfilling human development potential including poverty alleviation”, while iv) “generating a triple bottom line for people, planet, and profit” (GABV, 2014).

We are not starting the transition towards a regenerative economy from scratch. Many important tools, processes and innovations are already at our disposal and the transition is already occurring.

All over the world, individuals, organizations and businesses are asking how we might transform our dysfunctional economic system. In the USA, the New Economy Coalition (NEC) unites many of these pathfinders aiming to co-create “an economy that is restorative to people, place and planet, and that operates according to principles of democracy, justice and appropriate scale” (New Economy Coalition, 2015). In the UK, the New Economics Foundation is equally determined “to transform the economy so that it works for people and planet” (New Economics Foundation, 2015).

We might not have worked out all the answers and solutions yet, but we are asking the questions that will allow us to take important steps towards a regenerative economy.

[This is an excerpt of a subchapter from Designing Regenerative Cultures, published by Triarchy Press, 2016. Please note that this excerpt cannot do justice to such a complex topic and that there are other subchapters painting a more nuanced map of the current attempts to redesign our economic system in alinement with creating a regenerative human presence on earth. ]

For more excerpts on economics:

Redesigning economics based on ecology

Life’s economy is primarily based on collaborative rather than competitive advantage

Thriving communities & the solidarity economy

If you liked this excerpt please clap and rememeber you can clap up to 50 times if you liked it a lot.

Would you consider becoming a patron of my ongoing work?

We all have to make a choice which wolf to feed, and that choice affects the world we bring forth with each other. We can choose collaborative abundance over competitive scarcity and co-create a better world for all of humanity and the wider community of life. See the old Cherokee legend of the Two Wolves.
Sustainability
Economy
Economics
Culture
Regeneration
Recommended from ReadMedium