<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Caio Sá on Medium]]></title>
        <description><![CDATA[Stories by Caio Sá on Medium]]></description>
        <link>https://medium.com/@caiosa?source=rss-fa17b0f9776f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lw22XWV5tb3ct2z3AW8ElA.png</url>
            <title>Stories by Caio Sá on Medium</title>
            <link>https://medium.com/@caiosa?source=rss-fa17b0f9776f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 12:33:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@caiosa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Tracking My Blockchain Career Journey: Daily Insights of 2023]]></title>
            <link>https://medium.com/@caiosa/tracking-my-blockchain-career-journey-daily-insights-of-2023-987a70299600?source=rss-fa17b0f9776f------2</link>
            <guid isPermaLink="false">https://medium.com/p/987a70299600</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[success]]></category>
            <category><![CDATA[journey]]></category>
            <category><![CDATA[consistency]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Caio Sá]]></dc:creator>
            <pubDate>Thu, 14 Dec 2023 16:22:12 GMT</pubDate>
            <atom:updated>2023-12-14T16:28:32.779Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tracking My Career Journey: Daily Insights of 2023</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qe0VbDH3CepSRn2EyDKkIA.jpeg" /></figure><p>This was an honest attempt to track my daily career lessons of 2023. I tried to make it in a way so that it would have the technical — or sometimes non-technical — insights from my yearlong professional life in 2023 — mostly centered around smart contracts, where I consider myself a junior at the beginning of the year and now I consider myself a mid-level. I was not able to record my lessons every day, since I did not work every day — I gotta have some rest as well, please😆 — and some of the months I barely recorded anything because I had surgery, hospitalizations, and lots of medical appointments due to an accident I had in 2022. Also, I did not record any Sundays since I regard it as sacred, therefore, it is not a day where I work on or study secular materials. The rest has been recorded to the best of my ability. Each date mentioned is the day that I recorded the insight I took from that day. If you wanna skip over the hard, consistent work, there’s a section at the end of the article where I summarize the life lessons I took by doing this. Enjoy😇!</p><h3>Journey</h3><p>02/01/2023:</p><p>Today I wrote an <a href="https://medium.com/@caiosa/de-hex-a-buffer-o-que-%C3%A9-importante-saber-d89416b230b2">article </a>talking about bytes, hex and buffers. The audience is for beginners in blockchain development. Finished now at 23:34.</p><p>03/01/2023:</p><blockquote>Posted a <a href="https://ethereum.stackexchange.com/questions/142253/how-to-connect-to-goerli-console-on-geth">question </a>on the forum to understand why Geth isn’t working as I’d expected and learn about the fundamentals of c# at BYUI.</blockquote><p>04/01/2023:</p><p>Today I didn’t have much time, but I was able to use the GETH console in the Goerli testnet and I was able to sync in light mode and get the correct balance of my Metamask account in there.</p><p>09/01/2023:</p><p>Learnt a bit about NestJs framework and was able to FINALLY add data to MongoDB and retrieve it from there! A day to be remembered!</p><p>10/01/2023:</p><p>Lots of reading about NestJs authentication system, but didn’t end up learning it. Learnt how to create functions in C#.</p><p>11/01/2023:</p><p>Learnt how to validate entity’s fields.</p><p>I intend tomorrow to start the CTFs using Geth.</p><p>12/01/2023:</p><p>Learnt about signing in, signing up and signing out a user using a DB.</p><p>13/01/2023:</p><p>Completed the level 1,2,3,4,5 Challenge from Ethernaut. Learnt that the receive function in a contract is activated whenever the contract receives a tx without any data, like a transfer, for example.</p><p>14/01/2023:</p><p>Learnt how the <strong>delegatecall </strong>function works! Isn’t it cool that a contract can call the function of another contract and have its own variables set in storage? Super cool! Also, sent application to Proof of Learn.</p><p>17/01/2023:</p><p>Learned about the importance of dependency array in useEffect to move a page to another using the Stepper component in React.</p><p>18/01/2023:</p><p>Completed level 6,7 and 8 (I think) of Ethernaut. Got the chance to get to know the alchemy API that works like GETH, at least the getStorageAt() function. Learned that the <strong>selfdestruct </strong>function sends its balance to another contract whenever is called.</p><p>19/01/2023:</p><p>Did level 9 of Ethernaut! Learnt that the transfer function throws an error if there’s no fallback or receive functions in the _to contract. Learnt about Reentrancy Hack and how to do it. I’ll test it tomorrow and see the magic.</p><p>20/01/2023:</p><p>Did something using React I thought I’d never be able to: Followed the example from <a href="https://github.com/caiosabarros/react-course/commit/9cf704094323ebd1f599fa0685d3e607fe3da49d#diff-29819454f367632d6b11da82b30c72dce6f168b30bfff09369a86353ad37dba5">this </a>where I use only one handleChange function to change the state of individual field values in an object! Fantastic! Also, completed the level on reentrancy attack! I needed some help with that, so shout out to the channel <a href="https://www.youtube.com/@smartcontractprogrammer">Smart Contract Programmer</a>! Ethernaut is becoming more challeging each day xD!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1zptMiR4kYLLyn29NbzkiQ.png" /><figcaption>Reentrancy transactions</figcaption></figure><p>21/01/2023:</p><p>Learned about innerHTML on BYUI tasks.</p><p>22/01/2023:</p><p>Learned the introduction to the hymn: “<a href="https://www.churchofjesuschrist.org/music/library/hymns/there-is-a-green-hill-far-away?lang=por">No monte do Calvário</a>&quot; no teclado 😊.</p><p>27/01/2023:</p><p>Learned with Darlon that I should use useCallback hook for handling API requests</p><p>09/01/2023:</p><p>Aprendi o básico sobre como usar uma Merkle Tree para fazer airdrop!! Achei sensacional!!! Mas ainda requer que o receptor faça uma tx 😕. Estava procurando por alguma coisa gas efficient para fazer airdrop, mas parece que um for loop é a única saída…</p><p>10/01/2023:</p><p><a href="https://www.linkedin.com/in/phejda/">Petr </a>from LinkedIn helped me think that for a gas efficient airdrop, I only need to pass in the account as a parameter to the Merkle Tree function!!!</p><p>11/01/2023:</p><p>Today I learned that I need to plan my weeks and days!</p><p>(Spent the whole day trying to solve a simple problem in c# 😕)</p><p>13/01/2023: C# has been difficult, but inheritance flowed like a charm ;)</p><p>14/02/2023:</p><p>Stumbled into the error: “stack is too deep&quot; in Remix! It’s been hard to get rid of it. Learned also that I can pass an struct as argument to a function in solidity. Cool stuff!</p><p>15/02/2023:</p><p>Got rid of the error “stack too deep&quot;. God’s been helping me to develop the current FTK smart contract. It’s been challenging. I also learned how to use a mapping in another mapping. It’s kind of weird, but useful if I need it someday.</p><p>16/02/2023:</p><p>Almost finished the COPF!</p><p>Learned in a quick reading that now in the proof of stake system, validators get randomly assigned to mine a block.</p><p>17/02/2023: Got to know about UI.dev. I intend to do some of his courses.</p><p>18/02/2023: After being stuck for almost two months on the gas estimation error in remix , I was successfully able to get rid of it.</p><p>19/02/2023: Completed level 11 and 12 of Ethernaut.</p><p>21/02/2023: Even a bit sick, I was FINALLY able to install HUFF! I needed to delete my past iso and download a new one. Now it’s running on ubuntu 22.10! Also, I found again the thread at Twitter that explains all the steps to become a smart contract auditor! Excited for the year!</p><p>22/02/2022: Many issues on my VMBox Linux Machine, so I started using WSL. It’s kinda fun, but Idk how to use it properly, I believe.</p><p>Downloaded then the huffc compiler at the WSL and ran the AddTwo.huff contract.</p><p>23/02/2023: Custom hooks are crazily good! Learned that for a function retrieving data or posting data, the function needs to be defined inside the services folder and files (nestjs), not in the file I’ll use the data.</p><p>24/02/2023: Nothing crazy today… learned how to find the index of an obj in an array of objs using IndexOf and mapping (javascript).</p><p>06/03/2023:</p><p>Learned that `calldata` data location is immutable in solidity. Also, learned about all the ways to get a function signature inside a smart contract: encodeWithSignature, encodeWithSelector, msg.sig, etc. Also, learned that hex&quot;9…” pads a bytesN type on the right to make it a bytes32. I think so, it’s kinda late, so I needed to check it out. But that’s about it.</p><p>07/03/2023:</p><p>Learned the difference between runtime code and creation code where code means bytecode. Runtime code is basically the code that can be called by other contracts or EOAs. Creation code is the code that deploys the runtime code onto the Network.</p><p>09/03/2023: Learned how to create a function in a service in the nestjs framework and use this service in another service. Pretty cool stuff! It feels like the back-end hat 🤠 is being placed on me!</p><p>13/03/2023:</p><p>Learned how to deploy a contract from the back-end. Pretty cool! Thanks to <a href="https://www.linkedin.com/in/rodolfopatane/">Rodolfo </a>for doing all the web3Service I’ve used.</p><p>15/03/2023:</p><p>Sending two txs at the same time doesn’t work in our back-end.</p><p>Wait for one to get mined.</p><p>16/03/2023:</p><p>Catch will only catch an error if an error is thrown inside the `then` part.</p><p>17/03/2023:</p><p>Await is basically what it says: a.wait…so that the code below it can be run after a.wait is done and a Promise fulfilled.</p><p>22/03/2023:</p><p>Has a card outside a mapping that doesn’t — in anyway match the size of the cards within a mapping (js)? Time for the paddingBottom to come in!</p><p>23/03/2023:</p><p>Inheritance in Solidity works as follows: a contract inheriting from the Ownable.sol doesn’t need to set the owner as the msg.sender in the constructor. Rather, it’s set up is done by the Ownable.sol itself. The child contract inherits even the constructor of the Ownable.sol, even though it’s not explicitly declared in the child contract because it doesn’t need any arguments…🫡</p><p>24/03/2023:</p><p>Our backend journey continues with learning what’s a webhook today: basically is a listener to events sent by a server and it uses those events to update the database where it’s connected to.</p><p>28/03/2023: Painfully learned that I should commit my code to remote on GitHub every time I finish a subtask of a bigger task. I’ve lost all the work from last week because I hadn’t put my branch on remote. 😪</p><p>29/03/2023: Putting the — or ++ (increment or decrement) before the expression costs less gas than putting it after. Ex:</p><p>— solidity&lt;(less expensive than) solidity--;</p><p>30/03/2023: Currently in my last week of the course in C# and I spent probably 2 hours learning how to run .cs code using vs code. As the teacher said: “You should’ve asked that a long time ago&quot; haha. Also, solidity is pretty similar to C# — at least inheritance.</p><p>31/03/2023:</p><p>Needing to build a body for an API request? Well, sometimes it’s better to build it at the back-end. UseEffect may not always work as I’d like.</p><p>04/04/2023: Learned that God is good. It seems like these last 2 weeks I’ve been having the workload of 2 months. It’s been hard, but praying to find solutions to problems has always helped me.</p><p>05/04/2023:</p><p>This is obvious, but I was well remembered of it today: Time is the most important commodity I’ll ever have. So, I should think twice before commiting to something — even if I’ll get lots of money. In the current case, I didn’t get lots of money, but lots of problems/stress. #airdrop</p><p>11/04/2023:</p><p>I was reminded of a principle I’ve taken for granted many times:</p><p>Solve a problem logically before diving into code. It makes the journey much more rewarding and fun!</p><p>12/04/2023:</p><p>Taking notes while testing a feature is super useful!</p><p>13/04/2023:</p><p>Very subtle knowledge learned through ChatGPT. When I have a variable that receives the increased value from another variable in solidity, I do:</p><p>variableA = ++variableB; rather than variableA = variableB++. That’s because the, in the second scenario, the variableB is first assigned, then increased, rather than increased and then assigned as shown by the first expression.</p><p>14/04/2023:</p><p>Learned that the way to compile accents in Solidity is by passing the Unicode representation of the character. For example: the word “é” in Unicode is represented by: `\u00e9`. This will be formatted again to “é” in plataforms like OpenSea.</p><p>17/04/2023:</p><p>Learned that using VIM as my code editor requires courage.</p><p>18/04/2023:</p><p>Two days to the delivery deadline of the project I’m working on with the team at GoBlockchain: Forestoken. I’ve learned today that to handle well requests in the front made to the back-end, a good approach is to make an useEffect with a conditional inside it to only show the data coming in the request once the status of the request is successfully brought.</p><p>27/04/2023:</p><p>I learned what’s the ApiProperty is for in the nestJs framework. It’s used when I want to define a dto that uses others dtos inside it.</p><p><strong>Surgery Time</strong></p><p>20/05/2023: Long time no see! Basically I learned that a mapping I solidity can have a value (in the key-value context) of basically anything (struct, contract, interface, etc).</p><p>22/05/2023:</p><p>Unchecked blocks in versions of solidity ^0.8… means that the built-in checks for under/overflow aren’t checked. The internal functions can be called in derived contracts (a huge security issue), whereas the private functions can only be called internally within the smart contract.</p><p>23/05/2023:</p><p>Today I learned a lot about reentrancy. Basically follow the Checks-Effects-Interactions convention in your contract to not have this problem. But the biggest thing was that I was inspired to separate the math principles into subjects rather than trying to abstract every problem.</p><p>24/05/2023: Reentrancy is impressive: if there’s a function that doesn’t follow the CEI pattern, an attack is almost certain somehow.</p><p>30/05/2023: Well, I learned that I should set goals while auditing and focus on each one at a time instead of going through the code trying to find any kind of errors. This latter approach is basically trying to find a “agulha no palheiro“. Also, focus each day on a task, rather than jumping through materials.</p><p>31/05/2023: Today I learned what is slippage in DeFi. It’s basically the difference of tokens I get by paying some amount of money. For example, If I pay 1 WETH and get 1000 tokens A, and then if I pay the same 1 WETH and get instead 997 tokens A, this difference 1000–997=3 was the slippage.</p><p>03/06/2023: These past three days I’ve learned about replay attacks, what are flash loans, flash swaps, and how to find them.</p><p>05/06/2023: Learned what is CAST, a great tool for querying on-chain data, and much more by Paradigm! Also, learned the attack vectors of DoS in smart contracts and sensitive on-chain data.</p><p>06/06/2023: Learned about unchecked-returns attack vectors and how DAOs are pretty fun. BTC is considered the first DAO.</p><p>16/06/2023: Learned well what are price oracles and the beginning theory of how they can be manipulated after more than a week without studies due to a trip to an appointment with a doctor.</p><p>19/06/2023: Learned what are call attacks. DelegateCall is very dangerous if used improperly. Got the ownership of a contract just by using it.</p><p>20/06/2023: A function that has a specific name may not do exactly what its name stands for.</p><p>21/06/2023: Learned what the minimal proxy pattern means: There is a factory (clone) and an implementation contract. From the factory I may deploy many proxies (which will have minimal code in them). The minimal proxies will DelegateCall to the implementation contract.</p><p>22/06/2023: Struggled a lot to understand gas griefing, but I think I got it. I also learned that EIP-150 introduced the 63/64 gas forwarding to the called contract and keeps 1/64 of the available gas in the caller contract.</p><p>23/06/2023: Today I finally finished part II of the <a href="https://johnnytime.xyz/courses/smart-contract-hacking-part-2/">Smart Contract Hacking course</a>. From now on it’s gonna be a fun adventure. Tomorrow I’ll think about and pray about what my next steps should be.</p><p>28/06/2023: Today I’ve read many articles — about 10 — about findings on Immunefi. Also, I’ve established a structured auditing process I’ll begin to follow asap as I get my computer back because it had memory problems.</p><p>29/06/2023: I officially completed my first audit on Immunefi platform. I used an audit process I’ve developed yesterday. Though I had no finding, I thought of cool ways to exploit the protocol. It was an audit on the STP protocol. Had lots of fun!</p><p>30/06/2023: I was selecting a project to audit and I decided to audit one which seemed fun and rewarding. The bounty is up to 2M. Of course, If I get only 1K is a lot already for me. But as much, better haha. Well, after 6hrs and 18min of straight focus — with relaxing breaks, of course — I was able to almost — yes, almost- understand the full project. I didn’t understand the DAO mechanism, however. I think it’s because they’ve third-partied it to the Snapshot platform. Auditing big projects is HARD! Let’s make it!</p><p>04/07/2023: I was missing coding — because auditing has been pretty much lots of reading — so I decided to go through some challenges of the DamnVulnerableDeFi CFT. I did about 6–7 challenges in one sitting. I learned where SCH took some of his exercises from haha. I also thought about making videos on YouTube for that or creating a course with those challenges, etc.</p><p>06/07/2023:</p><p>These past two days have been insane! I’ve got the chance to start auditing Hakka Finance and I think I’ll get some finding out of it. I’m developing a local exploit just to be certain there is truly a bug in the code.</p><p>10/07/2023: First vulnerability found sent out to Immunefi! They regarded it as an out-of-scope vulnerability. It was a function that would make it easy for phishing attacks to happen with the tokens of the protocol. The only thing I thought was: Cool! But an attacker’s scope is funds…But it was great to go through the process.</p><p>15/07/2023: I spent the last two days just on phase 1 of my auditing process for a new project I’ll be auditing. Phase 1 is concerned with understanding the protocol and drawing its main functionalities. The protocol is a fork of MakerDAO and it adds other new functionalities. The cool thing is that I’ll spend as much time as needed to find a bug in this protocol — I got tired of getting out-of-scope bugs: It’s been already two in a roll.</p><p>17/07/2023: I have so much more to learn! What a flip! Haha, it’s overwhelming sometimes, some of these projects I bug hunt for are really complex. That doesn’t mean I can’t understand them, but it means it will take time.</p><p>18/07/2023: Today I’ve read a bunch (15) of bridge kinds of exploits. I’ve learned that there’s a need to understand the protocol and I was prompted by the Spirit to learn the protocols by interacting on-chain with them: of course, through forking the mainnet and impersonating accounts.</p><p>19/07/2023: It was a fun day! I’d thought initially I’d found a bug, but it turned out that it was functioning the way it was supposed to. (it’s the second time this kind of thing happens). But it was fun getting to know the protocol. Also, ChatGPT is really good for helping answer questions when code is provided to it.</p><p>24/07/2023: It’s frustrating! Bug hunting is incredibly hard, what a flip! I thought of going through audit contests today, but something told me to keep on. I learned a new attack vector — that may not work anymore due to updates on EVM compilers. But, it was fun, the ONLY productive part of the day. Flip! I’ll start researching the Decentraland project tomorrow. It seems less DeFi loaded, so I believe that’s good. Also, today I’ve had the first class of the <a href="https://www.encode.club/expert-solidity-bootcamp">Expert Solidity Bootcamp</a>. It was fun, but only introductory. It’s gonna be amazing!</p><p>26/07/2023: Well, learned about an attack vector related to malicious swaps done on Uniswap pair pool contracts. It’s fun that I’m getting to understand the basics of Web3 finance.</p><p>27/07/2023: Didn’t have much time today to hack, but I’m continuing to develop a PoC for a possible (I hope not false positive) attack that uses the harvest() attacking vector I learned yesterday. Also, I need to start building things myself. The first will be a web scraping app that will be built probably using Ruby (language that <a href="https://www.youtube.com/@DecypherMedia">DecipherMedia</a> has his tutorials on) and that will enable me to automate my work — especially searching for specific words or function names in <a href="https://immunefi.com/">Immunefi</a>, C4 &amp; Sherlock. I’m actually pretty excited about it.</p><p>29/07/2023: Well, today I was able to PoC the finding I had been looking at. It’s a malicious swap() before calling the public harvest() function in yield Farming protocols. The thing is: the attacker would need $9K+ to make this attack profitable. The damage to the protocol, however, even without the $9K+, would be around $60K. Well, so I gotta make this much better than it is and there’s a similar vulnerability in order liquidity pools with less liquidity. So throughout the next week, I’ll be working on making this bug substantially cheaper for the attacker.</p><p>30/08/2023: I searched the other contracts in the same Protocol that were like the one I’ve described yesterday, but it turned out that all of them — except for two I still need to check on — are of tokens which market values are almost $0, so there’d not even damage to the protocol in question had someone made that malicious swap.</p><p>01/08/2023: Worked on the development of the Bluebell token smart contract as a freelancer. I noticed I also have much fun developing things. So, hacking something’s been created is fun, but creating it is also super fun! Hope I’ll have a job where I can balance both tasks.</p><p>02/08/2023: Well, I actually worked more on the development of the Bluebell token. It was fun because I implemented a multi-signature scheme that used mapping, msg.sig and abi.encode(), and modifiers. I think it will work great!</p><p>03/08/2023: Super fun day! I actually got to begin my first individual project I’m building myself. It’s been fun because I know it’ll have applicability for me — and a lot! May be I’ll share the idea in the future, but for now it’s a secret haha.</p><p>04-05/08/2023: I worked with AI assistants to get right a regex to match solidity functions. The AI did a great job, but an insufficient one. So, after getting help from the AI, I studied regex myself, especially the ruby regex, since the AI assistants were helping me with regex that’d be parsed really well using js, but I’m in a ruby environment.</p><p>07/08/2023: Lots of learning about regex patterns to match functions in general, functions with or without modifiers, etc. Regex on ruby is super fun!</p><p>08/08/2023: Lots of trial and error to get the scraper part of our project to work.</p><p>09/08/2023: Great day! Successfully finished our scraper (it’s scraping right now 😉). I tried lots of different solutions, including one using autopygui after finding out python can be rendered in ruby’s environment, but after failing with Watir and autopygui, I was thinking about iframes, but a guy on discord — there’s no such helpful machine as another human brain — suggested me a clever solution! I turned out to use the built-in online code editor functionality, aka, command pallet! Great day!</p><p>10/08/2023: Super awesome day! I woke up with my scraping project having stopped due to an error due to how many times it was requesting the web pages in the same domain consecutively haha. Well, I spent the whole day trying to work out a way to solve the problem. The problem itself was easy to solve but the thing is that I tried then to find out a better way to be more efficient in my scraping. At the end of the day, thankfully, I’ve learned about “ferrum” gem! What a blazing fast gem! It’s now doing the scraping. I hope tomorrow I won’t wake up with only 73/329 projects downloaded! Hope we’ll get 329/329!</p><p>11/08/2023: Well, almost there: 222/329 projects! Well, there were still a lot that I’ve missed but those projects to be scraped will require each of them to be handled individually. Lots of projects though! Good to start with!</p><p>12/08/2023: Today I spent as little time as only to be able to handle three more projects individually to scrape them. Browser.css(‘a’) [Ferrum] is powerful for finding the link (a) tags on a page ;)</p><p>15/08/2023: Well, these past three days I’ve been working hard on my downloader and integrating with Slither what I’ve been developing. It turned out that the solidity files I’ve got can’t be compiled with solc, therefore they can’t with Slither as well, so it’s very frustrating. Tomorrow, I’ll try tostart integrating with other tools though.</p><p>16/08/2023: Well, I spent the whole day doing something I love: developing in solidity. Most of the code was already developed, so I spent most of the time actually testing. 67/67 tests passing at the end of the day with ~1008 lines of hardhat code. Yes, I prefer foundry, but for the client’s understanding, I used hardhat.</p><p>21/08/2023: <a href="https://www.linkedin.com/in/brendaloya/">Brenda</a>, <a href="https://tellor.io/">Tellor’s </a>CEO said a phrase I hope I’ll never forget: “Don’t get into debt by trying to develop your product. If the product is good enough, VCs and so on will pay you to develop your product. Otherwise, it might be the time to think back and enhance your product!” Perfectly stated!</p><p>22/07/2023: Generated my first ever natspec json file out of the comments in a smart contract I’d made. It feels nice 🙂👍.</p><p>23/07/2023: Today was a day of hitting my head against the wall! I tried, tried, and tried again, but I wasn’t able to download (and therefore compile) the contracts I wanted to analyze with slither and myth analyze because contracts have imports and those imports are hard to download and if they’re downloaded correctly from Sourcify, it’s require more complex stuff to make @openzeppelin-like imports to be correctly handled. Well, let’s move on with our regex searcher, right?!</p><p>24/08/2023: Finished the Expert Solidity Bootcamp! Super amazing! Also, I tried very much to find a way again a way to download contracts (problem from yesterday) and God gave me the answer almost right now (2 a.m.) : “SOMEONE already DID IT!” I, for sure, forked the project and will begin integrating it tomorrow!</p><p>28/08/2023: AWESOME, AWESOME! Our first vulnerability that was escalated! I’m so happy! It should’ve been 2, but the second one, I’m waiting on the Immunefi team to review it again. I should’ve described it exactly as the BBP’s on-scope impact’s says. Anyways, tomorrow I’ll try a bit more to explore more the second one in order to produce a better, more impactful finding. Thanks for God and <a href="https://dedaub.com/">Dedaub’s </a>articles and the tool we’ve been building!!!</p><p>29/08/2023: I reported a bug report with 12 implementation contracts, from which 8 are listed as in scope directly and the other 4 indirectly. The bug seems to have a very low likelihood of actually happening, but it’s vulnerable <strong>if</strong> the implementation contract, at any time, holds any asset.</p><p>30/08/2023: After sending the bug report, I was told by the project’s admin that the BBP does not take responsibility for any tokens sent to their implementation contracts, because the project’s focus is only on the proxy contracts. This is controversial since there are tons of implementation contracts shown as part of the BBP assets on-scope.</p><p>31/08/2023: Well, after 5 hours, my personal project was able to download all the solidity files from all the projects I wanted. I used a vercel app from a guy — he seems like he’s Brazilian too u.u. For some chains, the app’s APIs are outdated, but there’s a quick fix for that: I only need to get the repo myself and build it locally with a fresh API. Open source is one of the greatest things ever!</p><p>01/09/2023:</p><p>It’s crazy we’ve gone 9 months already! Well, today I worked on the bluebell project for the GoBlockchain. I was mainly overriding some of the functions from AccessControl from OpenZeppelin. It turned out that overriding them makes it so that the token contract is much more concise — which was what I intended to simplify its functions and reduce its size.</p><p>02/09/2023: I continued the contract development and test adjustments for the bluebell token contract. I didn’t manage to finish the docs about running the deployment and verifying the contract online. I also started working on making a markdown file that’ll have all the deployed contracts made by myself.</p><p>04/09/2023: Awesome! Today I had the chance to contribute to finding/solving some problems on the back-end for the COPF project. If you’ve been reading since the start of the article, you’ll remember it. I helped Darlon to find out that a number should’ve been a string in a .env file. Haha flipping funny!</p><p>08/09/2023: Learned a new attack vector through God’s inspiration! Basically, I realized there’s a way to get a FlashLoan and repay it by depositing the asset on the Flashloaner contract — if it supports it! It’s incredible! Will test on AAVE and Uniswap!</p><p>11/09/2023: After spending the whole day checking for contracts that might’ve been vulnerable to the same vulnerability I mentioned — the reentrancy on a deposit-like function from a FlashLoan callback — I found out it doesn’t work on Uniswap (they’ve got a lock modifier. AAVE doesn’t fall into this attack because it forcibly pulls the flash loaned tokens from the borrower through a safeTransferFrom. However, I think I’ve found a vulnerable protocol! Will implement the PoC tomorrow!</p><p>12/09/2023: I’ve tried really hard to makeour reentrancy through a flashloan on a protocol work. The thing is that I can’t get past the require for the balance remaining unchanged or being updated with the fees for the flashloans. But I’ll try to work it out tomorrow! The thing is that it seems they do not check the balance through an ordinary balanceOf function, it seems like a state variable that keeps track of the balance. Anyways, wish me success!</p><p>13/09/2023: Yeah, here we are, another false positive on our way! Well, at least I think this is the best false positive we’ve got so far. It’s a reentrancy on a FlashLoan callback. Luckily the protocol is safe, at least it seems like it. It’s funny because during the morning you think you’re gonna be a millionaire, but at the disclosure of a false positive, you’re then back to Earth! Let’s keep going!</p><p>14/09/2023: Today I’ve learned about Sweden in the world’s student Expo that happened here in Brasília. I plan to take a master’s in cybersecurity over there. Well, let’s see what the future holds. About Bug Hunting, I had the idea to analyze the other contracts of the protocol of which vulnerability we’ve been talking about to check whether there’s any waywe can maliciously use the protocol.</p><p>15/09/2023: Well, I’ve been thinking about migrating unto the field of cybersecurity. I’m into Web3, of course, and I intend to continue, but I want also to join the cybersecurity space. It feels right and thinking about it, it’s an area that requires creativity, thinking, math, etc. Everything I like. Plus, in a possible apocalyptical scenario, it’s the field of IT that will survive — as a weapon, for attacks or defense. So, everything seems to direct me in this direction.</p><p>16/09/2023: Yeah, I’ve decided to move into cybersecurity. I watched a video from a guy and got the roadmap of what he’d do if he’d start over his journey in cybersecurity. It’s awesome! I’ll be on Coursera doing NYU courses as intro into Cyber. That sounds fun!</p><p>18/09/2023: I did more research into the cyber field. It seems there are many branches on it and this is the right time to join it, since there are and there will be many jobs on it.</p><p>19/09/2023: I did start my courses on NYU on Coursera. Learned: Software can’t be trusted. Even if a code review is made, the compiler might introduce malicious code. That’s impressive! Also, Uniswap reentrancy on a flash swap doesn’t work because the swap function called on the pair contract reenters the mint function in the same contract — making the lock modifier stop the cross-contract reentrancy.</p><p>20/09/2023: Learned that some swap functions do not enforce the transferring from the user to the swapper contract. Well, the uniswap pair contract doesn’t too, but it enforces it through the constant product formula, i.e. K. Also, learned that nowadays worm malwares have been replaced by an easier way to replicate malware: botnet zombies. That’s kind of dangerous: any device might have been infected and we don’t actually know.</p><p>21/09/2023: The project really doesn’t have a K AMM constant. It’s more a formula that’s defined on an equation that fetches the current prices from the assets being swapped. Well, the other thing is that the swap function has never been used because — if it does, it will be frontrun! Well, I tried making a PoC on it, but it hasn’t worked yet on Foundry. Tomorrow I’ll check SCH classes about frontrun to see what I’m doing wrong in the hardhat setup — where I’m sure the problem is.</p><p>22/09/2023: Finished the first course of the 4-course specialization from NYU. I’ve realized it’s pretty much a theoretical introduction to cybersecurity. It’s fun because it covers a lot though, but definitely will need to do lots of labs on the field.</p><p>25/09/2023: Right now is 1:48 (a.m.), and I just finished reporting a frontrunning vulnerability in a swap-like function in a protocol.</p><p>30/09/2023: Since it’s been a work week I’ve not written here, I’ll write a huge summary then. Basically, I’ve found other false positives on Immunefi. It’s been tough to find real vulnerabilities. It’s even more disappointing when I see some Joe on Twitter saying they’ve spent 4hrs on bug hunting on Immunefi and have found a critical already. The good side of things is that I’ve decided to do DESEC cert. Also, I’ve concluded today the Cyber Intro Specialization from NYU. It’s only introductory, no hands-on, but very foundational. Next week I intend to investigate the swap functions, explore a flashloan() function with no reentrancy guard and check how it goes.</p><p>11/10/2023: Well it’s been 11 days! Well, today and yesterday I’ve been trying to uncover a vulnerability in a project. The thing is that the reentrancy is reverting. The reason? There’s no revert message whatsoever and lots of reverts. So, I’m thinking of replicating the whole system locally and finding out what’s going on. Hope not having another false positive. Actually, the same reentrancy I’ve seen before in the SCH course, but the thing is that it now it uses delegatecall. Well, we’ll see!</p><p>12/10/2023: Well, today we had not time to actually do what I love: bug hunting! It’s so fun, but we spent the day learning — for the first time — rust! It’s an interesting language. It seems cool, but I haven’t experimented much with it, only the basics. I also had the chance to restudy what I’d learned earlier this week in the <a href="https://www.encode.club/zksync-zkevm-bootcamp">Zk Bootcamp</a>: Zokrates! Basically, in ZK, there’s the witness — the answer — and an algorithm. The prover generates a proof out of the algorithm he writes. This algorithm generates an output. The output is checked to pass a verifier contract or not — it returns either true or false. Well, lots to say about that as it is a new topic for me, but it’s really interesting that it’s truly Zk (zero knowledge): the verifier can make sure the prover knows the answer without the verifier knowing the answer himself. Isn’t this so useful?</p><p>16/10/2023: Lots of trying to disclose a vulnerability. I tried all my ideas on this reentrant flash loan, but I couldn’t get past a reverting DelegateCall(). Well, I sent a message to @pashov so that he might help me but no success in getting a good response so far.</p><p>17/10/2023: Well, today has been a great day actually: lots of ups and downs. Downs because I’ve been very much frustrated of being 6 months into the security of smart contracts and I haven’t been able to actually disclose a non-false positive vulnerability in a live smart contract. I know it’s hard, but I’m also pretty sure it’s possible. The ups were mostly because I found out about more attack vectors — like the unchecked array length- and I have much fun inspecting the whole database of solidity code trying to disclose a true positive. It requires creativity, thinking, exploring, curiosity, etc. Though I’m quite sad I couldn’t get a good result so far, I’m very glad I have the chance to work with this thing! Also, got introduced to Cairo! Well, things are beginning to get hard as the languages approach more low-level stuff. But I also feel like: “There’s gotta exist a good product out of all these languages, protocols and ZKP related stuff!”</p><p>18/10/2023: Finished the Cairo intro exercises, but the biggest thing is that I learned an attack vector for a contract that does use GSN to allow gas-free txs for the users of a protocol (aka meta-txs).</p><p>19/10/2023: We did a good job today! No vulns found, I believe — I suspect I found one, but I’ll try to make a PoC tomorrow. It’s tough, but I have faith!</p><p>20/10/2023: Yeah, my suspicion was ANOTHER FALSE POSITIVE! Dang it, I’m already getting tired of those. Well, I learned why the last vuln before this one was also a false positive. Statements of the kind (book ok, ) = to.call(data) revert if in a reentrancy. The thing is: After all these false positives I felt and decided I can’t continue doing the same thing. I can’t continue looking for vulnerabilities in the way I’m doing right now. As Einsten said, I can’t get different results doing the same thing repeatedly. So, my plan now is to pick a protocol — rather than only searching at the surface — and then DEVELOP it from scratch. My new model will have its slogan called: “DEVELOP to EXPLOIT!” Let’s see how it goes: I’m excited!</p><p>31/10/2023: Well, finally I’ve been able to write again! Last week, I didn’t have a single time to work/study on my Web3 journey. Well, driver’s license classes and BYUI have taken all of my time. This week I got back today. I tried the dev to exploit strategy. The paths that the code has are much clearer with this approach. I have hypothesized a good attack surface, but there was a safeguard against it. However, I learned that low-level calls also return success if the callee contract equals the caller contract. Also, really proud to say we’ve bought the Desec course! Hope we’ll take the most out of it!</p><p>01/11/2023: I was able to understand the main idea of SNARKs. Of course, it follows the idea of a prover and a verifier that’s the core of ZKP. What’s more is that a trusted setup is used in the protocol at its beginning, where a proving key and a verifier key are produced — to later be used by the provers and verifiers of the protocol. A prover wants to prove a public statement (he has more than 10 BTC, for example. This is the public input). For such, he uses a witness (private input). In this case, it might be his public address. The proof follows the protocol’s compiler rules to check the balance of that address. The verifier receives the proof and verifies it is true (it follows the rules of the protocol, to make sure a false proof isn’t accepted). That’s the basis of it. In this small example, the prover needs also to prove that the public address is his own, of course.</p><p>03/11/2023: I learned about shifting bits to the left on a calldata, which makes the word in memory have leading zeros at its beginning. However, dirty bits refer to non-zero bits placed where the leading zeros would be. Also learned more about the 0x critical signature vulnerability: basically, the EVM returns the minimum in between the length of the returned bytes and the expected returned bytes, which means that this is safe for calls that return a huge amount of data (like the returnbomb attack vector, because we’d get only the expected length of returned bytes, instead of the huge malicious bytes returned), but unsafe for calls where the actual returned is smaller than the expected, yet malicious.</p><p>06/11/2023: Here we go again! Today I received some instructions from heaven when it comes to my professional pursuits: 1) I’m good (really good) at replicating stuff. So, I must watch an expert doing a bug hunting/auditing, then apply what he applies to be successful. 2) I need people to succeed. Trying everything on my own won’t work. 3) I shouldn’t abandon completely Web3 as I learn Web2 security. 4) I must continue learning. Possible learning experiences: CTFs ( the hard ones will teach me to be detailed ), Owen Videos ( to keep learning new stuff) and go through each solodit attack vector and reproduce it. It feels amazing to receive so much inspiration from God today. Let’s do it!</p><p>07/11/2023: Well, started implementing the 4 learnings from yesterday and it went quite well. I learned a very good new attack vector: same elements in an array that’s an input parameter! Yay! I then spent the whole day basically trying to find vulnerable contracts. I inspected over 30K lines of code, but found nothing. Well, that’d about it! I also started a new checklist on my Trello card: developer assumptions. Basically, most of the vulnerabilities come from developer’s assumptions. When those get past the eyeballs of auditors, there we have the bounties! Keep working, that’s the aim of the game!</p><p>08/11/2023: Worked on my personal scraper project today, setting up its integration with arbitrum one and optimistic roll-up. Pending: set its connection with moonbeam network. I tried doing it today but I wasn’t able to find out why it is not working with moonbeam :/</p><p>09/11/2023: I did so much stuff today. It’s 1:03 (a.m.) of November 10th. The best thing though was that Henrique and I chatted about a product prototype he wanted to present to Visa and wanted me to develop. I’m not gonna lie that I got really amazed at the idea — and thinking more about it, I had the chance to extend it a bit so that it can be even more awesome! I felt God helping me to have great ideas about the project. The other thing is that I’ve officially started the hackathon team we’ve built. Today was the organization of the team. Let’s see what’s gonna happen! ☺</p><p>10/11/2023: Today I started planning more on the Smart Account project. It was cool! However, the best thing was cloning the UniswapV2 in solidity version ^0.8 for the hackathon. Of course, I had to change some stuff. However, Uniswap is great! I learned they even support tokens with a fee on transfer. This might be very useful for the government by the way. Haven’t seen any other institution that loves fees more than them :|</p><p>13/11/2023: Lots of learning today! <a href="https://www.linkedin.com/in/julianosales/">Juliano</a>, the guy who is developing the smart contracts for the hackathons with me is super smart when it comes to knowing the current execution of Brazil’s direct treasury. We’ve voted today and the team has decided to continue developing a fork of Uniswap that will serve as a way for our government and other governments to execute swaps on debt positions from the government (Títulos Públicos) and CDBCs. Also, I’ve gone through some yield farming techniques to try to generate profit for the companies that will adhere to the product I’m developing for GoBlockchain. I came to know that yield farming is something that depends on price fluctuations across the different existing tokens in the DeFi market. This is good, but not so good as it could be: there’s no profit in only holding a token unless there’s a price movement in the market — which is the definition of a market anyway, I believe. MakerDAO also is great! What an amazing project!</p><p>14/11/2023: It’s 3:29 a.m. and I’m very very tired. I spent these hours since midnight trying — alone — to converge the Uniswap protocol into a ERC1155&lt;-&gt;ERC20 exchange. It’s been tough! I believe it’s because I’m tired! I was talking to my mom today about how I wished the day had 40hrs. There’s so much stuff I gotta do — and I wouldn’t like to do them all atm, to be honest. But these are the things that have been allotted to me. So, I must be grateful. Well, the interesting thing is that I’ve added an initial balance in the “Uniswap” protocol that pool creators may use as a way to determine the pool’s initial price. This seems to add lots of complexity to the project — and that’s not what I’d like to do, but it’s the solution to what we’re trying to achieve though! Let’s succeed!</p><p>16/11/2023: Well, another day and another cool day! It’s been very very hot, but I was able to have a great development in solidity today. Got my ZK course NFT and continued both in the TDrex and Smart Account projects. It’s been fun and I love it! Hope tomorrow I’ll have more time to dive into each of them!</p><p>17/11/2023: TDD is great for when you don’t know how to develop anymore. Just start doing it and you’ll see what’s not well implemented. That was my situation at the Hackathon and then this thought came divinely into mind: “use TDD”!</p><p>20/11/2023: Today I spent the whole time wiring the Factory.sol contract for the SmartAccount project Henrique’s planning to launch! It’s gonna be super cool! Every day I write more on it I realize how impressive it is.</p><p>21/11/2023: Now, at 2:03 a.m. writing this! Lots of solidity today, which I found very fun! One big takeway? Tx pends both on Remix and also on Foundry for a long, long time — but it reverts quickly on Mumbai testnet. What’s the tx? Well, it seems like the EVM (at least of Remix and Foundry) doesn’t handle well yet a call to function which copies all the elements of an array A to an array B, but it doesn’t copy the elements of A, making it so that there’s a jump from the element of index `i-1` to element of index `i+1`, where the element `i` in B is not set whatsoever. Fun stuff, check out my <a href="https://x.com/caiosapy/status/1726996209297133770?s=20">tweet </a>at @caisapy to learn more! Cheers!</p><p>22/11/2023: I was able to finish the swap function that supports swaps of CDBCs per titles and titles per CDBCs. Idk whether `title` is the correct name for the public debt of a country, but in Portuguese it’s called título público. I also learned that probably Synthetix is the way to go for a staking protocol we can put our deposits from GoBlockchain’s current project on — it’s safe and profitable.</p><p>23/11/2023: TIRED! That’s how I feel like right now! Of course it’s not the most tiring day of the month, but I sat in my computer’s chair and spent my whole day trying to implement the meta-tx contracts (ERC2771Forwarder &amp;&amp; Context). I’m not gonna lie that I’ve thought many times this contract is buggy, that’s why I’m not being successful. But my other side says that I’m the dumb one and tell me to trust OZ’s team. Henrique called me today saying next week we’ll have a meeting with VISA! That’s cool! For that, I MUST prepare things for them to see it working right there, in front of them! Ofc, this meta-tx thing now becomes second-plan as it seems I’ll have to develop the front end as well (is there a borer thing to do as a programmer?). So, wish me luck, and let’s make it happen! Also, I had the chance to glance over a summary of the KyberSwap protocol — it got rekt for 40M (that’s millions, yeah). The exploit was so mathematically precise that the guy who gave the summary said something along the lines: “the attacker was able to reach a point that make the hack possible in 0.000001%”. What a flip!!! These blackhats already make me look so dumb and now they come up with this? I wouldn’t be surprised if the next Einstein turned out to be an ex-web3-blackhat…</p><p>24/11/2023: Got it! Well, almost actually 🙃! The thing that I learned: when I don’t understand how to use a contract from OZ, just look at the tests. I was able to realize yesterday I was making a silly mistake (ForwardRequest is different than ForwardRequestData, doooh). Spent the day working on the product showcase for Visa next Thursday. The smart contract side (simplified from what I’d working on) is fully complete 🫡.</p><p>25/11/2023: The biggest takeaway is that after being tired because of school, waking up early to attend the temple, etc. I got out of my comfort zone to inspect the vulnerabilities of duplicate elements inside an array as param on Immunefi projects. Well, it turned out that this wasn’t an issue at all — at least of everything I had a look at. But the real issue was an empty array passed as param. I’ll validate it on Monday! Pray for me!</p><p>27/11/2023: it’s 2am of the 28th. After hours of searching for vulnerabilities, I think I’ve finally found one. There are no funds at risk at all — which will make it not be critical, for sure. But it’s a thing though already! Well, worked hard on scaffold-eth-2 today for the Smart Account project. Later, read a blog post from Samcsuz — I guess that’s his name because I always get that wrong. One thing I learned: samcsuz is the GOAT of Web3 security, no doubt! Address(this).DelegateCall + msg.value somewhere isn’t a combination and CTFs are more fun than videos and help me be a better developer as well, so planning on starting on those actually instead of looking stuff around</p><p>28/11/2023: Well, remember the vulnerability I thought I’d found yesterday? ANOTHER FALSE POSITIVE! This time though it was exactly what I was looking for, but there wasn’t a way of exploiting it, since the contract was a fork of UniswapV2Router02 contract, which is incredibly prepared against the easy attacks I try. I learned even more that I should dig into CTFs! I’ve thought I’d known solidity, but as I read more about CTFs, I get to know I know NOTHING! I think now I’m prepared to read the Yellow paper of Ethereum. Sometimes things need to be done when you’re prepared. I’ve done it very much as instructed by Henrique, my great mentor in my Web3 career, but I did that while learning to do a for loop in solidity, so I wasn’t prepared to really understand the EVM! Let’s see what we get now!</p><p>29/11/2023: Cool! Started <a href="https://nodeguardians.io/">NodeGuardians </a>(a cool CTF that will prepare me for Paradigm and the Curta ones). I learned that I can find out whether a function is being delegatecalled if I check the value of `address(this)` against an immutable variable, since the delegator will not be able to modify immutable or constant variables since they’re saved to the bytecode of the delegatecalled contract. Awesome solution!</p><p>30/11/2023: Well, hahahaha! Lots of coding, testing, and preparation for the VISA meeting. I learned that if you test things before meetings, they’ll probably not work at all 😕</p><p>02/12/2023: Did some CTF challenges today! It was fun! I love doing CTFs: a quick way to learn! I learned about a way to remove elements from an array without having to do a for loop (in which time complexity is dependent on the size of the array). However, there’s a much more efficient way if I only create a mapping to store where the position of an element is in the array. I don’t know how that escalates though. Solidity hasn’t the built-in function remove() for arrays as python has for lists.</p><p>04/12/2023: Shoot! Today was the last day for sending the hackathon project for the government. When did I learn it? At about 22pm! We worked hard but we weren’t successful in performing a good job of finishing everything up. Well, lessons learned for the Ripple Hackathon that need to be delivered in a couple of days! Also, today I started to implement the v0 of the SmartAccount project. The new thing I learned? Well, modularity is great! I learned that, like today, as I develop, I naturally feel the need to modularize, it’s not only a must but a necessity. That’s cool!</p><p>05/12/2023: Lots of work on the last day to make a presentation for the government’s hackathon! The big news: the swap function DOESN’T WORK! Guess why? Well, Idk whether your guess is correct ‘cause I DON’T WHY it’s not working 😭 But the good thing is that we’ll fix it to work in the Ripple’s hackathon. (and yes, the swap function works on tests, but not on the testnet 🥹).</p><p>06/12/2023: Multicall pattern or batch function? I chose the second approach to develop a feature for Bluebell smart contracts. They want, at least at first, to interact with the contracts on block explorers. So, I decided to make a batch function. Encoding the data for a multicall could be done through a view function or on `cast`, but let’s see the first approach. I think it’s more user-friendly.</p><p>07/12/2023: Most important part of the day? My brother’s birthday! Professional lesson: `it.only()` is the coolest thing in hardhat tests. Almost 2k lines in hardhat tests for the Bluebell token. Well, another thing: tested the swap function from the same code from the hackathon last week and it worked super well now. I noticed that some of the txs that were reverting had a wrong ID, that’s why! For example: 123456 was being given but 12345 was the right one 🙃</p><p>08/12/2023: Listening to DeGatich’s Scraping Bits podcast episode where there’s the participation of Riptide on it! Two legends right there talking about bug hunting! Incredible! I learned that I’m not the only one who’s been 6 months without making a buck by bug hunting, but I also learned that I’m not the only one who thinks this is the coolest kind of work ever!</p><p>09/12/2023:</p><p>Learned how to do ripple stuff today! Deployed contracts and verified them. The trickiest part was trying to verify the ones with viaIR-enabled settings. Luckily foundry is good enough to generate the Input JSON file from the solidity file!</p><p>11/12/2023: Guess who’s won the STN Hackathon in the category of the challenge #2? Yep, that’s Apollo 9, my team! ❤️ We also submitted our solution to the Ripple hackathon, BUT we later saw Brazil wasn’t allowed to participate on it though 😕 BUT later we found they’ve got a Brazilian hackathon coming up this week! Yay!</p><p>12/12/2023: Biggest takeaway was that zkSync is written in Rust it seems like, and also that there’s a way to efficiently remove elements from an array in solidity by assigning the last element to the index to be deleted in the array, making the last element a duplicate in the array and, therefore, silently having deleted the target element. Then, I just pop the last element from the array and everything is good to go! Quick sort seems to be the most efficient sorting algorithm in solidity in time complexity.</p><p>13/12/2023: Lots of learnings today! 1) I (almost) implemented a verify function for a merkle tree correctly from scratch — just missed a small detail! Implementing a voting algorithm to support multiple rounds if there’s a tie in solidity is not trivial — hope I’ll finish it tomorrow! It was cool to give nestjs another try, but web development definitely isn’t my thing 😑 Last, but not least, it’s 2:08 a.m. 🙃 Good times!</p><h3><strong>Lessons Learned This Year</strong></h3><p>Of course, there is much that I learned by just reviewing this blog post I have daily dedicated some minutes to. Lessons: 1) Focus brings success: by focusing on doing this everyday, it is clear the amount of text that I would type at the beginning of the year when compared to the end of the year. Focus has made me succeed in this task that it has been transformed from being a burden (like at the beginning) and it became something part of me. 2) Habit requires repetition: Again, doing this repeatedly has become a habit that I like very much and intend to continue next year. It is something I don’t forget anymore at the end of the day! 3) People are crucial for someone to develop skills: Sometimes I have mentioned some people, but out of the all small details I remember I learned, the ones that come to mind quicker are the ones where I have been helped by someone. 4) Having God in my life has directed me to make the right decisions on my professional life! 5) Tracking progress this year has helped me with 1. avoiding comparison to someone else, 2. recognize the big growth I had and 3. the feeling of knowing that the things that I was learning at the beginning of the year are super natural and easy at the end of the year brings the sense of success and achievement.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=987a70299600" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Como Deus fez 19 milagres em um acidente]]></title>
            <link>https://medium.com/@caiosa/como-deus-fez-19-milagres-em-um-acidente-d1de663cb53f?source=rss-fa17b0f9776f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1de663cb53f</guid>
            <category><![CDATA[health]]></category>
            <category><![CDATA[dogs]]></category>
            <category><![CDATA[miracles]]></category>
            <category><![CDATA[healing]]></category>
            <category><![CDATA[accident]]></category>
            <dc:creator><![CDATA[Caio Sá]]></dc:creator>
            <pubDate>Fri, 21 Apr 2023 13:01:55 GMT</pubDate>
            <atom:updated>2023-04-21T14:20:12.457Z</atom:updated>
            <content:encoded><![CDATA[<h3>Como Deus fez 21 milagres em um acidente</h3><p>O que você estava fazendo no dia 21 de Abril? Se não lembrou, não se preocupe. Eu também não me lembraria se nesse dia eu não estivesse lutando entre a vida e a morte.</p><p>Quer ouvir a história de milagre gigantesco na minha vida? Então vem comigo:</p><blockquote>Dia 21 de Abril de 2022:</blockquote><p>Eu estava em casa no bairro Butantã-SP. Naquela região, há as missionárias da igreja que eu frequento: A Igreja de Jesus Cristo dos Santos dos Últimos Dias. No dia, elas me ligaram e me convidaram para ter um bate-papo com elas e o Miguel, um excelente moço que estava conhecendo mais sobre a igreja, mas ainda não era membro da igreja.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pvR7q-JXACk0WdyUL6QwaQ.jpeg" /></figure><p>Por volta das 15–17 hrs, eu saí de casa de bicicleta a fim de ir encontrá-los numa praça do bairro. Fui de bike, algo que era normal para mim, pois eu amava andar de bicicleta naquela região. Todos os dias às 5–6hrs da manhã, era o meu exercício predileto: andar de bicicleta até cansar.</p><p>Naquele dia, no entanto, depois de um ótimo bate-papo com Miguel e as missionárias, subi na bicicleta e comecei o caminho de volta para casa.</p><p>No entanto, por incrível que pareça, naquele dia eu não chegaria em casa. Meus pais receberam uma ligação por volta das 21hrs, dizendo que eu havia me acidentado — tinha batido a cabeça. Pelo que foi visto nas câmeras do bairro, a teoria mais provável é que eu estava descendo de bicicleta numa ladeira e voei em um quebra-mola, batendo a cabeça no meio-fio ao cair. As câmeras não mostraram a minha queda, apenas eu caído tendo convulsão. A rua não era tão movimentada, mas, felizmente, (1) um motoqueiro ao ver minha situação dirigiu-se até os bombeiros do bairro (que, por sinal, ficavam apenas a uma esquina de distância)(2).</p><p>Um fisioterapeuta amigo meu, enquanto conversávamos sobre o assunto depois de minha alta no hospital, disse-me que a partir do momento da queda, meu tempo de vida era mínimo (3–5min, mais precisamente), pois meu cérebro não estava conseguindo respirar já que ele inchou devido à pancada e o crânio impedia ele de se esticar. E aí que entra um outro milagre: fui levado pelos bombeiros ao hospital mais próximo. Devido ao hospital não ter o porte necessário para executar uma cirurgia tão complexa, eles procuraram por algum outro hospital que pudesse me atender. Mas os médicos do hospital de porte menor quiseram pelo menos avisar meus pais sobre o acidente. E aí que vêm mais milagres:</p><p>Meus celular não sofreu um arranhão (3). Imagina se meu celular tivesse quebrado todinho, como eles avisariam meus pais? Mesmo com o milagre de o celular não ter quebrado, havia ainda um empecilho: Como eles saberiam a senha do meu celular para poder ligar para os meus pais? E aí que vem outro milagre:</p><p>Depois de os atendentes na recepção tentarem todas as combinações possíveis que eles tinham em mente (1234, 4321, 2022, etc), uma médica inspirada (4) disse: “Por que não tentamos a data de nascimento dele?” Não sei como eles descobriram minha data de nascimento, pois eu não lembro se eu estava com minha carteira de identidade no dia (5). Eles então tentaram minha data de nascimento: 1410 e CONSEGUIRAM desbloquear o celular e ligaram para os meus pais. Ao receberem a ligação, minha mãe pensou que fosse algum <strong><em>amigo </em></strong>meu passando trote (que tipo de amigo minha mãe pensou que eu tinha?? kkk). Depois de conseguirem convencer meus pais de que eu realmente tinha tido um acidente e estava entre a vida e a morte, meu irmão, na época, de 15 anos pesquisou um vôo e encontrou um com destino a SP naquela mesma madrugada (6) — e aí vem mais outro milagre: O preço do vôo estava baratíssimo! Quem já comprou vôo em cima da hora sabe que os preços tendem a ser enormemente caros, com um preço mínimo geralmente de 1–2 mil reais. Minha mãe pegou um avião pagando cerca de R$250,00! (7)</p><p>Encontrando a vaga em outro hospital maior (8), os bombeiros me levaram até o outro hospital, o HC de SP, que fica no centro de SP. Não tenho a mínima ideia de quanto tempo se passou entre a queda e o momento em que cheguei ao HC, mas tenho certeza que foram mais que 3–5 minutos (9).</p><p>A cirurgia foi bem sucedida, sem complicações que tirassem a minha vida. Depois de ficar em coma e na UTI num total de 3 semanas, saí da UTI e fui para a enfermaria. Na enfermaria, minha mãe podia ficar comigo.</p><p>Enquanto ainda na UTI, um dos médicos chegou a me dar 1% de chances de vida. Ela não comunicou a minha mãe aquela pequena possibilidade, mas falou com minha tia, que disse à minha prima. O que minha prima respondeu à minha tia é sensacional. Minha prima é evangélica e tem uma fé poderosa e foi uma das forças que ajudou minha família a ter um pensamento mais positivo diante daquela situação desesperadora.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*8HL5CNI-qdpQuekW2RBGeg.jpeg" /><figcaption>Dia em que fui dado 1% de vida</figcaption></figure><p>Minha prima com sua grande fé disse à minha tia: 1% para os médicos era 100% para Deus. Nem eu conseguiria conceber tal ideia de forma tão poderosa.</p><p>Ainda na UTI, umas das coisas que mais me emociona de <strong><em>toda</em></strong> a jornada de 1 ano desde o dia do acidente é o fato de que minha mãe disse que certo dia chegou a UTI para me visitar. Eu ainda estava inconsciente, sem falar, abrir os olhos ou com qualquer sinal de vida. Ela disse que ao entrar na sala, percebeu que os meus olhos estavam lacrimejando. De alguma forma, eu estava chorando, mas não sei o motivo. Talvez devido à dores, ou à situação. Ela se compadeceu de mim e me falou várias palavras de ânimo. Não lembro de nada do que ela disse, inclusive não me lembro nem desse dia, mas ela me conta que depois de conversar comigo — ainda que essa conversa fosse unilateral-eu simplesmente parei de chorar (10). Fico MARAVILHADO com isso! Para você que está lendo esse artigo, gostaria de dizer que existe alguma coisa que transcende o entendimento humano quando se trata da relação entre uma mãe e um filho seu. Simplesmente incrível!</p><p>De volta à enfermaria, percebi um certo dia que algo estava estranho ao olhar para a minha barriga. Então disse a minha mãe:</p><p>“Nossa! Eu bati a barriga no chão na queda? Ela está muito inchada no lado direito. Minha mãe replicou: “Não, é que eles removeram um pedaço do seu crânio e colocaram na sua barriga para conservar o crânio a fim de posteriormente colocar de volta na sua cabeça a parte que foi retirada do crânio.” Eu fiquei chocado sem saber até mesmo o que pensar em aprender sobre essa técnica milagrosa que a medicina é capaz de fazer(11). Peguei na minha barriga e realmente senti algo rígido, como um osso mesmo. Fiquei boquiaberto! Mesmo estando começando a melhorar, minha mãe me pediu certa vez para eu fazer uma oração, algo que eu estava habituado a fazer todos os dias, começando a oração com: “Querido Pai Celestial”. Naquela ocasião, comecei dizendo: “Querido irmão Neto”. Não sei de onde saiu esse irmão Neto, pois não conheço nenhum e ao que me lembro, também nunca conheci algum. No entanto, aquela oração, depois de eu tê-la ouvido muitas vezes ultimamente, é como se não tivesse sido feita por mim. Simplesmente considero aquela oração a mais bonita que já fiz. Nunca eu havia orado antes para que “todos nós pudéssemos nos dar bem, mesmo com nossas diferenças.” Achei sensacional aquilo!</p><p>As coisas foram melhorando até que consegui voltar a andar novamente, sem perder o equilíbrio. Voltei para minha casa no Butantã. Estava lá com meu pai, que cuidava de mim. Praticamente virei um bebê novamente. Meu pai me dava banho, ajudava-me a fazer minhas necessidades e tudo que era necessário para que eu ficasse bem. Sou muito grato por ele e tudo que fez por mim naquela época. Também tínhamos nossos momentos de brincadeira, como no dia em que percebi, ao me olhar no espelho pela primeira vez depois de muito tempo, que minha cabeça estava torta. Um lado estava mais fundo que o outro, devido à retirada de parte do crânio. Ríamos muito desse tipo de situação à medida que eu ia notando as diferenças entre o eu naquele momento e o eu antes do acidente. Certo dia, eu estava conversando com meu pai no meu quarto sobre algum assunto. Percebi que meu olho direito estava diferente. Era como se tivesse algo atrapalhando minha visão. Pensei comigo mesmo: meus óculos ou o meu olho estão sujos. Lavei meus óculos, mas a sujeira ainda continuava. Coloquei colírio lubrificante no meu olho para limpar qualquer restígio de sujeira, mas ainda a sujeira continuou. Foi então que pensei: “Vou fechar o olho esquerdo e deixar apenas o direito aberto para ver o que acontece.” No momento desse pensamento, meu pai estava na minha frente. Conforme pensei, fechei o olho esquerdo ao colocar minha mão sobre ele e deixei o direito aberto. Tomei um grande susto: eu não conseguia ver meu pai que estava literalmente na minha frente! Estava tudo embaçado e à medida que eu mexia o olho, uma nuvem interna ao meu olho também se mexia. Era como se existisse um líquido interno que impedia minha visão de processar o que eu via na minha frente. Naquela época eu sentia dores de cabeça diariamente. Elas eram insuportáveis a ponto de não me deixar ler algo que eu gostaria de ler a fim de que o tempo passasse o mais rápido possível. Na verdade, naquela época, eu pensava no acidente de 5 em 5 minutos: eu tentava lembrar o que tinha acontecido, já que esse detalhe foi completamente apagado da minha memória. É a mesma coisa de eu perguntar a você: O que você lembra da sua vida pré-mortal? Você pode fazer o máximo esforço mental possível — e eu fazia — mas você não vai conseguir lembrar. Então a minha maior preocupação era o tempo passar o mais rápido possível, pois, dessa forma, eu poderia passar pelo processo de tratamento/acompanhamento o mais rápido possível e voltar a fazer o que eu tanto gostava: exercício, jogar futebol, ler, voltar a fazer minha faculdade, etc. Dessa forma, eu tentava realizar qualquer atividade que gostava a fim de não ficar com a mente voltada ao acidente e suas consequências. Mas, como falei, eu não conseguia nem ler. Ter um novo normal era a minha maior ambição naquela época. Mas naquela época aprendi algo. Como disse o Elder Maxwell: “the only way is through” (O único caminho é por/pelo meio). Existem coisas pelas quais vou ter que PASSAR na vida. E não há como evitá-las, fugindo para um canto ou outro. A única maneira é PASSAR por elas, ter realmente uma imersão no momento pelo qual estarei passando.</p><p>E isso é fácil quando a situação e circunstâncias estão de acordo com os meus desejos. Mas é muito difícil quando a situação e circunstâncias não são as que eu desejo.</p><p>Enfim, embora estivesse me recuperando, meu processo de recuperação foi milagrosamente muito, muito rápido (12). Lembro que depois de umas duas semanas em casa, fui à igreja. Estava ainda andando devagarinho, segurando em tudo que fosse possível ao meu redor. Não é difícil de acreditar que as pessoas pareciam ter dó de mim ao olhar para elas. Depois de mais uns 2 domingos, voltei à igreja. Um grande amigo meu chamado Raul disse:”Caramba! Você já tá quase correndo! Você tava andando devagarinho duas semanas atrás e agora tá andando como se nada tivesse acontecido.” Realmente, Deus foi muito misericordioso comigo nessa parte. Tive que trancar a faculdade — pois obviamente eu não consegui acompanhar o ritmo das quatro matérias que havia, com muita disposição mas pouca saúde, pegado naquele semestre.</p><p>Bem, as coisas foram evoluindo até que meu pai precisava voltar para Brasília a fim de trabalhar. Dessa forma, eu voltei com ele para ficar perto da minha família e também tê-los por perto para cuidar de mim, já que eu não conseguiria fazê-lo por mim mesmo morando sozinho em SP.</p><p>Em Brasília, a perca quase completa da visão do olho direito me atormentava muito. Nessa época percebi que MUITAS das experiências na vida têm significado porque as conseguimos ver. Imagine, por um momento, que você seja cego. O que mais importaria para você na vida? Será que seria a cor do seu carro? O muro da sua casa que não está rebocado e pintado? O que realmente importaria? Eu estava muito triste na época, embora não deixasse isso transparecer, porque eu tinha medo de aquilo ser irreversível e eu ficar cego do olho direito. Dessa forma, eu teria que viver a vida toda tendo muito cuidado para que nada acontecesse com o olho esquerdo a fim de eu conseguir ainda manter minha visão, mesmo que parcial. Aprendi, no entanto, uma coisa com essa situação: “O campo de visão de apenas um único olho é extremamente amplo: simplesmente um milagre (13). Mesmo vendo só com o olho esquerdo, parecia que eu conseguia ver tudo que precisava. Claro que tinham alguns pequenos empecilhos ao fazer alguma coisa que exigisse movimento, como, por exemplo, jogar ping-pong, atravessar a rua ficou um pouco mais perigoso, etc. Mas apenas mexer a cabeça me ajudava a ver tudo ao meu redor. Tanto é que existe um membro da minha igreja aqui no meu bairro no Distrito Federal que não enxerga muito bem com um dos olhos, mas ele dirige muito muito bem. Na verdade, uma dra disse que é possível tirar carteira de motorista sendo monocular. Impressionante o poder de visão que apenas um olho tem.</p><p>Bem, fui então ao médico com meu pai para saber sobre o que estava acontecendo com meu olho. Eles fez os exames e disse: “Sua retina desta parcialmente descolada&quot;. A última vez que tinha ouvido o nome &#39;retina&#39; foi no ensino médio e eu nem lembrava o que era. Ao perguntar ao Dr., ele deu uma aula de biologia básica para mim e o meu pai dizendo que a retina era simplesmente a parte do olho responsável por pegar os sinais vindos do cérebro e converter em imagem. Ela fica conectada a milhões de neurônios a fim de fazer com que enxerguemos de forma correta. Basicamente, ele prosseguiu dizendo que provavelmente a pancada com a cabeça ou o inchaço no cérebro tinha feito a retina se descolar desse milhões de neurônios. Até aí eu já percebi que o negócio não estava muito bom pro meu lado. Ele continuou dizendo que era possível colar a retina novamente, mas que fazer a visão voltar a ser como era antes exigia conectá-la em cada neurônio dos quais ela foi desconectada — o que é, de forma prática, impossível. Até ali eu estava tentando me conformar com a notícia de que a visão no meu olho direito jamais voltaria a ser como era antes. Enquanto estava pensando nos impactos que isso teria na minha vida, pois até aquele momento, por exemplo, eu não sabia que era possível ser um motorista monocular. Então enquanto pensava silenciosamente, e tendo o médico acabado suas explicações e depois de um breve silêncio na sala. Ele olhou para mim e me perguntou: “Você ainda tem esperança?”. Essa pergunta me penetrou até o âmago. Fiquei em silêncio por mais um breve momento e o que saiu de dentro de mim sem eu pensar muito foi: “Sim, ainda tenho esperança, doutor.” Quando eu e meu pai saímos do consultório naquele dia, eu estava destruído por dentro. Não me lembro bem, mas acredito que até chorei naquele dia — o que raramente acontece. Fiquei pensando como eu levaria a vida sem um olho. Como eu estaria muito mais vulnerável ao atravessar uma rua, caso me envolvesse em alguma discussão, e, mais importante, como eu serviria na igreja sem poder dirigir pelo resto da minha vida, principalmente nos momentos de urgência e necessidade.</p><p>Não satisfeito com a respostas do doutor em relação ao meu olho, fiz um plano de saúde a fim de ir também em vários outros doutores, se necessário, a fim de saber se existia alguma outra possibilidade em relação ao meu olho. Algum tempo depois lá estava eu dentro de outro consultório, com uma médica me avaliando a fim de me dar mais informações sobre o que tinha acontecido. Ao terminar os exames, ela me disse exatamente a mesma coisa: “É, sua retina está parcialmente descolada&quot;. Ela também disse para que eu voltasse depois de um mês a fim de fazer uns exames específicos da retina, salientando que caso os exames específicos confirmassem o diagnóstico dela, ela me encaminharia para a cirurgia, mas ela já me avisou: “Não espere que sua visão fique como antes, pois a cirurgia pode ajudar a melhorá-la apenas.” Bem, eu já estava começando a aceitar a ideia de que Deus realmente não queria que eu ficasse com a visão dos dois olhos mesmo. Eu me sentia impotente, pois eu não conseguia fazer absolutamente nada naquela situação que me ajudasse a ter minha visão de volta.</p><p>Meses depois, volter na mesma médica a fim de fazer exames ainda mais específicos sobre a retina. Enquanto os exames eram feitos, permanecia a mesma teoria do descolamento da retina. Fui fazer então a ultrasonografia do olho — descobri nesse dia que isso existia! Enquanto a médica realizava a ultrasonografia, ela disse bem baixinho: “Hum! Estranho, sua retina não parece estar descolada.” No exato momento, arregalei os meus dois olhos pensando: “Não é possível”. Aguardei até ela terminar o exame para perguntar. Quando ela terminou o exame, estávamos voltando ao consultório quando ela me perguntou: “A nuvem que fica na frente da sua visão no olho direito é fixa ou ela se mexe à medida que você mexe o olho?”. “Ela se mexe” — repliquei. Ela então, com um sorriso sútil disse: “Acho que sei o que é, mas não é a retina!”. Uau! Eu não sabia o que era, mas já estava feliz o suficiente só de saber que não era a retina. Isso porque a médica havia dito a mim e a à minha mãe que, caso fosse mesmo a retina, já havíamos perdido o “timing” certo para fazer a cirurgia de colá-la. Ela nos disse que quando a retina descola, é recomendado que se passe no máximo 3 meses sem colá-la novamente. Depois disso, o quadro fica praticamente irreversível — e, naquele dia, já se faziam uns 8 meses que ocorrera o acidente.</p><p>Depois, quando chegamos no consultório e já estávamos todos juntos, eu e minha mãe e a médica, a médica nos disse o seguinte: “Você não está com a retina descolada…Quando você teve a hemorragia interna na época do acidente, provavelmente parte do sangue foi para a região interna do olho e, dessa forma, você está incapaz de ver normalmente. O bom é que isso pode ser feito uma cirurgia para limpeza desse resíduo sanguíneo — mas essa cirurgia iria me deixar com catarata, o que acontece em (70%) dos casos. MAS, disse ela, você pode ficar vindo aqui de 3 em 3 meses para irmos avaliando se o seu corpo irá, com o tempo, absorvendo esse resíduo sanguíneo. E desde o dia em que descobri que meu olho estava “estranho”, a minha visão no mesmo melhorou significativamente (13).</p><p>Bem, durante esse 1 ano também fiquei na UTI novamente, num total de duas vezes. Nessa segunda vez foi devido à uma cefaleia pós-hack. Caso você não seja um médico e, assim como eu quando ouvi esse nome pela primeira vez, não saiba o que isso significa, vou explicar. Basicamente, depois de colocarem o osso na minha barriga, exatamente 3 meses depois, eu fui ao hospital pois estava com dores fortes na barriga. Sentia como se o osso tivesse rasgando minhas tripas internamente, o que fazia muito sentido já que ele era pontudo.</p><p>Fui ao hospital e lá eles me disseram que possivelmente era uma infecção. Comecei então a ficar na fila para fazer a cirurgia — pois já haviam vários outros pacientes esperando por salas disponíveis para terem suas cirurgias feitas. Foi nesse hospital público que vi coisas que nunca eu pensaria que veria. Conheci e virei amigo de muitos outros pacientes por lá. Cada um tinha uma história e cada um tinha uma necessidade diferente. Por exemplo, fiquei chocado ao conhecer uma mulher de apenas 28 anos com o mesmo câncer no intestino que outro homem que conheci, porém esse tinha por volta de 70 anos. Ficava pensando naquelas pessoas que não tinham escolhido estar ali, mas, de alguma forma, estavam — e eram todos, assim como eu, imponentes em relação às suas necessidades. Bem, um dia que me tocou bastante foi que depois de uns 5 dias de jejum diurno, eu era considerado o próximo para fazer a cirurgia. Estava feliz e apenas esperando minha orar chegar, afinal cessaria toda aquela medicação pesada de morfina e tramol — os dois remédios mais potentes contra dores pelo que soube. No entanto, nesse hospital, caso alguém chegue na emergência, o que é muito comum, essa pessoa passava na frente de todas as pessoas na fila, e a cirurgia dela era feita. Então, enquanto eu era considerado o primeiro da fila, não fui chamado no dia seguinte e fiquei me perguntando o motivo. Falamos com os enfermeiros e médicos e eles disseram que uma menina de 12 anos havia chegado na emergência e passado na minha frente na fila. Egoísta como sou, fiquei discontente, pois já estava há vários dias na expectativa e o meu desejo não se realizava. Minha mãe estava mais decepcionada do que eu. Mais tarde, eu e minha mãe ficamos sabendo que a menina que havia entrado na minha frente faleceu em cima da mesa de cirurgia pois ela estava com pûs no cerébro. Não sei exatamente o motivo de ela ter aquilo, mas, ao saber da notícia, eu e minha mãe ficamos muito pesarosos por aquela menina. Fiquei pensando comigo mesmo: “Como sou egoísta! Tanto aqui dentro, quanto lá fora no conforto de casa. Uma coisa dessas acontece diariamente nos hospitais Brasil afora e eu apenas fico pensando nos meus desejos e minhas vontades”. Foi algo tocante. Daquele dia em diante, decidi que iria confiar em Deus e que a hora que minha vez chegasse seria o momento que Ele quisesse — e eu estaria feliz com isso. Enfim, chegou o meu dia e fiz a cirurgia. Ocorreu tudo bem. Foi muito interessante porque na sala de cirurgia, eu deitei na mesa como a médica mandou. Ela então aplicou uma injeção em mim — anestesia. A minha visão foi ofuscando e meus olhos lentamente fechando. Ouvi ela dizer:”Alô, você está aí?”. De alguma forma, mesmo entendendo, não consegui falar nada. Meus olhos fecharam e, ao acordar, já se havia passado a cirurgia. É impressionante o conhecimento da medicina! É impressionante o milagre da invenção da anestesia (14), que nos oferece o conforto de não sentir dor quando nosso corpo está sendo dolorosamente manipulado.</p><p>Enfim, mas voltando aqui sobre o assunto da cefaleia pós-hack…Basicamente, voltei para casa e estava de repouso. Quando estava tranquilamente em casa, de repente, comecei a sentir MUITA MUITA dor de cabeça! Minha mãe me disse que provavelmente era porque tinha mexido a cabeça depois da cirurgia. Tomei a decisão de nunca mexer mais a cabeça depois de uma cirurgia kk. Mas, sem dúvidas alguma, foi a dor de cabeça mais potente e dolorosa que já tive. Quem tem enxaqueca sabe que dor de cabeça faz com que tudo pare. Você não consegue pensar, ler, focar, concentrar-se, etc. A minha era tão forte, que eu não conseguia nem comer — mesmo com fome. Minha mãe tinha que me dar comida na boca — que bonitinho kk. Eu não conseguia levantar a cabeça para que a colher viesse na minha boca de tanta dor, então eu ficava com a cabeça abaixada e minha mãe me dava comida assim. Pensei que fosse momentânea aquela dor de cabeça. No dia seguinte, decidi ir no hospital. Meu pai me levou de carro e, durante a viagem, ao continuar sentindo MUITA dor, e, ao ficar desconfortável dentro do carro por não encontrar alguma posição que me fizesse aliviar a dor — mesmo com um travesseiro —vomitei 3 vezes dentro do carro, no caminho de casa até o hospital — cerca de 25 minutos! Ao chegar no hospital e ao passar pela triagem, a enfermeira me perguntou: o que você tem? Consegui apenas apontar para a minha cabeça. “Dor de cabeça?” — perguntou ela. Dei um beleza! Depois ela me disse:”de 0 a 10, quão forte é sua dor de cabeça?” Levantei as duas mãos, ainda de cabeça baixa e mostrei os 10 dedos — mostraria até os dedos do pé se pudesse, mas estavam calçados kkk. Fui diretamente para a UTI! Lá, os médicos ficaram uns 2/3 dias tentando entender o que estava acontecendo. Depois de minha mãe lhes contar sobre minha cirurgia recente na barriga, os médicos começaram a perguntar mais sobre a cirurgia. Até que depois de uns 5 dias na UTI, saiu o diagnóstico: cefaleia pós-hack! Basicamente é uma dor de cabeça horrível — como você pôde perceber — que acontece devido à anestesia “hack” que me haviam dado durante a cirurgia da barriga. De alguma forma, a anestesia hack que me foi dada nas costelas abriu um orifício na pele da costela por onde a injeção entrou e esse orifício não havia fechado — fazendo gás interno ao meu corpo vazar. Enfim, não sou médico, mas foi mais ou menos isso que consegui ouvir da conversa dos médicos. Fui medicado bastante vezes até encontrarem um medicamento que conseguiu aliviar minha dor de cabeça (15). Até hoje o tomo, mas não sei nem pronunciar o nome, quanto mais escrever o nome dele. Fiquei sabendo recentemente — minha mãe não queria me contar — que o remédio é um anti-depressivo também. Acho que por isso não tenho tido depressão ultimamente — haha nunca tive, graças a Deus (16).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K3FT-Balp5bjNVUpKdtX1g.jpeg" /><figcaption>Eu na UTI — claramente a dor de cabeça já havia passado nesse momento.</figcaption></figure><p>Durante o tempo em que fiquei em casa me recuperando, recebi todo o apoio da empresa na qual atualmente trabalho (16). Eles foram totalmente pacientes e compreensíveis com minha recuperação, não me pressionando a voltar a trabalhar, deixando eu tomar a decisão de quanto me sentiria melhor para voltar ao trabalho. Certo dia, depois de muitos dias de repouso, eu estava com sede de trabalho. Não era de trabalho especificamente, mas sede de fazer alguma coisa de valor, importante e que eu gostava. Eu não curtia ficar o dia todo na cama. Foi então que eu comecei a trabalhar. Pensei que teria tudo fresco na memória, mas logo percebi que não lembrava de algumas coisas que eu conseguia fazer com simplicidade e velocidade antes do acidente. Mas mesmo assim, consegui encontrar significado no que estava fazendo, e isso me fazia ficar satisfeito. Um outro milagre que percebi então foi o de o acidente, ao contrário de muitos outros pacientes que conheci pelos hospitais que também tiveram traumatismo craniano, não ter deixado NENHUMA sequela física, cognitiva ou motora em mim (17). Meus pensamentos continuavam claros como eram antes, meu raciocínio continuava afiado como antes, e meus movimentos das mãos (principal parte motora para um programador como eu) continuavam a funcionar muito bem.</p><p>Nesssa época, eu estava enfrentando alguns problemas motores, como, por exemplo, quando levantava da minha cama ao acordar, eu automaticamente caía no chão e começava a ter mini-convulsões. Teve um dia que tive uma no banheiro e é muito interessante: Quando eu olhava antigamente para alguém que tivesse convulsão, eu ficava pensando:”Como é possível essa pessoa não conseguir controlar o próprio corpo dela?” Entendi isso bem kkk. Ao ter minhas convulsões eu não conseguia de jeito nenhum controlar o que estaja acontecendo. Foi mais um milagre não ter tido nenhuma convulsão que me fizesse bater minha cabeça em algum lugar rígido ou pontiagudo (18).</p><p>O interessante é que todos os médicos pelos quais passei disseram que eu poderia ter ficado vegetando para o resto da vida. Isso não é incomum para pessoas que sofrem traumatismos cranianos. Por exemplo, meu pai, quando recebeu a ligação sobre meu acidente e soube da batida da cabeça, achou que eu ficaria assim como o Michael Schumacher, que hoje em dia está vegetando, devido ao traumatismo craniano que teve ao bater a cabeça numa pedra enquanto descia de ski numa ladeira grande. Dessa forma, vamos aos últimos dois milagres. Sou muito MUITO grato pelo milagre da CONSCIÊNCIA (19). Acredito que uma outra coisa que contribuiui de forma fundamental para eu que tivesse ainda minha consciência foi uma bênção que meu líder eclesiástico me deu com o poder de Deus quando eu estava terminando meu serviço como voluntário por A Igreja de Jesus Cristo dos Santos dos Últimos Dias. Ao ter minha última entrevista com ele, o Presidente Oldham, ele pediu autorização para me dar uma bênção. A primeira coisa que ele disse foi: “Eu te abençoo para que você tenha a lembrança das pessoas que conheceu durante esses dois anos e para que você se lembre da fisionomia delas”. (20) Na época pensei que isso tinha sido citado pois me considero uma pessoa muito esquecida. Mas olhando para trás agora, faz muito sentido de eu ter sido abençoado como uma lembrança e consciência suficiente para lembrar de momentos tão importantes da vida, como o foi minha missão. Imagina se não tivéssemos a nossa consciência…Eu fico triste só de pensar nessa possibilidade. Você nem conseguiria ler e processar as informações nesse artigo. Eu nem conseguiria escrevê-lo. Isso me levou a perceber o último milagre, e o mais importante de todos, acredito eu: a VIDA (21). Nós temos um corpo super complexo, com uma máquina simplesmente única dentro da nossa cabeça chamada cérebro, que é conectada aos diferentes sistemas do corpo e faz com que tenhamos consciência e a vida, principalmente. Por isso eu sempre digo: “Vida para o resto da sua vida&quot;. Se você não tem vida, você não tem. O que adianta viver muitos anos sem ter consciência e vida. É uma vida triste. Sou muito grato pela vida! Para finalizar, recentemente fiquei pensando naquele motoqueiro que viu eu convulsionando e foi até a outra esquina chamar os bombeiros. Fiquei pensando: “O que eu diria a ele se o visse hoje?”. Comecei a lacrimejar, foi um momento de muita emoção para mim. Não sei nem como agradeceria. O Espírito Santo então logo me disse: “Teve alguém, além do motoqueiro, que não só salvou sua vida, mas também morreu por ti!”. Não poderia deixar de expressar minha imensa gratidão a Deus e a Jesus Cristo, seu Filho. Por terem acredito em meu potencial nessa Terra a fim de me permitirem viver mais um pouco. E não só viver na cama de um hospital, vegetando, inconsciente do que acontece ao meu redor, mas sou grato por terem me dado a CONSCIÊNCIA e VIDA novamente. Toda a glória de todos esses milagres feitos são Deles, com certeza.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1de663cb53f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hex, Bytes e Buffers: Fundamentos de Blockchain]]></title>
            <link>https://medium.com/@caiosa/de-hex-a-buffer-o-que-%C3%A9-importante-saber-d89416b230b2?source=rss-fa17b0f9776f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d89416b230b2</guid>
            <category><![CDATA[buffer]]></category>
            <category><![CDATA[hexadecimal]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[bytes-for-all]]></category>
            <dc:creator><![CDATA[Caio Sá]]></dc:creator>
            <pubDate>Tue, 03 Jan 2023 02:28:58 GMT</pubDate>
            <atom:updated>2023-01-03T12:11:58.289Z</atom:updated>
            <content:encoded><![CDATA[<h3>Motivação:</h3><p>Existem diversas formas de representação de um número. Existem, por exemplo, as representações binárias (2), decimais (10), hexadecimais (16), etc. Cada uma delas é a representação do número na base especificada. Por exemplo: os números na base 2 — binários-são aqueles que são compostos por 0 ou 1. Exemplos: 01010101, 11110000, 1111, etc. Vamos agora a alguns conceitos importantes:</p><ul><li>bit: um dígito binário: 0 ou 1.</li><li>byte: é uma unidade que consiste de 8-bits. Então todos os números da sequência 00000000, incluindo as alternações 01010101 até 11111111 são cada individualmente <strong>um byte.</strong></li></ul><p>No entanto, só as máquinas estão acostumadas a essa representação. Por exemplo: você sabe qual número 1010 representa? Ora, é muito fácil descobrir. O número 156, por exemplo, está na base 10 e pode ser representado por 6*10⁰+5*10¹+1*10² = 156. Pode fazer as contas e você verá.</p><p>Seguindo o mesmo raciocínio, o número 1010 representa na base decimal o número 0*2⁰+1*2¹+0*2²+1*2³ = 0+2+0+8 = <strong>10! </strong>Pronto, entendemos como converter um número de base 2 para a base 10. O mesmo raciocínio será usado para converter um hexadecimal para um decimal.</p><p>Os hexadecimais não têm apenas (2) ou (10) dígitos possíveis, mas realmente (16): 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f. Sim, depois do 9 é utilizado letras como dígitos para a representação dos algarismos restantes.</p><p>Vamos converter?</p><p>Qual o número ff na base decimal?</p><p>Fácil! Como aprendemos mais acima: ff = f*16⁰+f*16¹ = 255! Lembrando que f representa o 15 na base decimal.</p><p>Lembrando também que em hexadecimais, usamos o “0x” antes do número para simbolizar que o número está na base (16). “0x” ficou tão famoso que virou até nome de <a href="https://www.0x.org/">empresa</a>.</p><p>Lei Geral:</p><p>Existe uma lei geral da conversão entre bytes para hexadecimais:</p><ul><li><strong>1 byte em decimal = 2 caracteres em hexadecimal</strong></li></ul><p>Isso se dá porque o maior byte possível é 1111111 = 255 em decimal = “0xff” em hexadecimal. Logo, o maior byte possível em decimal, tirando o “0x”, tem apenas dois caracteres em hexadecimais.</p><h3>Analisando uma Transação da rede Ethereum</h3><p>O Ethereum usa várias representações na base (16). Então é comum encontrar vários números começando com “0x” na rede, desde a identificação das transações, nomes dos métodos das funções no Etherscan e também o calldata das transações.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zUCeF-CLt-m5Wr9dv8e9g.png" /><figcaption>Identificação da Imagem</figcaption></figure><p>O exemplo acima foi retirado de uma <a href="https://etherscan.io/tx/0xf60e8517873dec8d58882130ddee06db0ec5b9dc1e534f9fb288bbfce8fc6ba7">transação</a> no Etherscan. O <a href="https://degatchi.com/articles/reading-raw-evm-calldata">artigo </a>do <a href="https://twitter.com/DeGatchi">DeGatchi</a> sobre o assunto é muito útil para o entendimento de como entender o que o calldata de uma transação siginifica. Farei aqui, em português, uma breve explicação do que é explicado no artigo.</p><p>A primeira coisa que já chama a atenção é a representação da função withdrawUSDC(uint 256 _amount) como “0xdb81f99b”. De onde vem isso?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*_Mnxjka-CE7OF5FVd_ylfQ.png" /></figure><p>Usando a biblioteca web3 no ambiente Node.js, conseguimos perceber que ao pegar os 8 primeiros caracteres do sha3 de withdrawUSDC(uint 256), obtemos exatamente o <strong>MethodID </strong>como na figura da <a href="https://etherscan.io/tx/0xf60e8517873dec8d58882130ddee06db0ec5b9dc1e534f9fb288bbfce8fc6ba7">transação</a>. É importante notar que os 8 primeiros caracteres, usando a regra geral, correspondem a <strong>4 bytes</strong>. Usando o mesmo raciocínio, um endereço público da rede ethereum possui 20-bytes, ou, _ caracteres. Sim _ = 42 caracteres, pois há 20x2=40 caracteres mais o “0x”.</p><p>Você já deve ter então se perguntado que os endereços públicos representam números gigantescos. De fato, se formos fazer a conversão de um hex de 42 caracteres para um decimal, será algo gigantesco.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*uzCIH5FqhcuNqMSl3wWxOg.png" /></figure><p>Tão grande que dá um erro já que o objeto Number pode apenas armazenar no máximo 53 bits, que são cerca de 6 ou 7 dígitos, aproximadamente, como mostra a imagem abaixo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*QGG1c1ezxR44ADQVY4CLrA.png" /><figcaption>1 byte = 8 bits</figcaption></figure><p>Para termos uma ideia, o MethodID acima que usamos corresponde ao número 3682728347 na base (10).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*hXJ0mM7Y99H_tzEqkMbNAQ.png" /><figcaption>3682728347</figcaption></figure><p>Mesmo não conseguindo converter de primeira o número a que corresponde o meu endereço público, pelos logs do seguinte erro, consegui entender que é algo de magnitude de 1⁰⁴⁸. Isso é muito grande. Imagina se o Ethereum usasse a base (10). Seria muito louco!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a5qYX9faE2-aUvscFU9TKA.png" /><figcaption>Número para o qual corresponde meu endereço público</figcaption></figure><p>Na seguinte <a href="http://0x3d069d08a9cf6c9a82d828f841fe4d065277433cdeae8bf1113798302096ec04">transação</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y6B6hGpsMUx8ULds0Xv2QA.png" /></figure><p>Percebemos que há dois parâmetros: <em>address to</em> e <em>uint256 value. </em>Os valores de cada parâmetro é mostrado dentro de [0] ou [1]. A princípio, o [0] representa address to e o [1] representa o <em>uint256 value. </em>Mas aí você se pergunta: como a pessoa passou o valor de:<em> “</em>00000000000000000000000000000000000000000000000000000001a13b8600”</p><p>como value? Ela teve a paciência de digitar todos esses zeros? Bem pensado, mas detalhes como esse são automaticamente resolvidos pela EVM.</p><p>Vamos ver como funciona?</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*eFvlHxC-FvU5fi-_cRgYcw.png" /></figure><p>Todos os dados passados no calldata das transações devem estar no formato de 32 bytes, que são 64 caracteres em hexadecimal!</p><p>Removendo dois zeros e adicionando o “0x” no início, obtemos que o número corresponde a:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*byXaE0mgXN510eJxXgOYIQ.png" /></figure><p>Logo, o value colocado pelo usuário que chamou essa função foi: “7000000000”. Isso claro não é 7000000000 ETH, mas sim 7000000000 WEI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*RzGuQ-as26KaOPhT4xXoGQ.png" /><figcaption>in ETH</figcaption></figure><p>O valor em ETH corresponde a “0.000000007” ETH!</p><h3>Buffers</h3><p>Continuando nossa conversa sobre bytes, chegamos até Buffers.</p><p>Um <em>buffer </em>é um espaço em memória (geralmente RAM) que armazena dados binários. Em Nodejs, podemos acessar estes espaços de memória com a classe Buffer. Buffers armazenam um sequência de inteiros, sendo similares aos arrays em Javascript. Diferente de arrays, não há como mudar o tamanho de um buffer uma vez já criado.</p><p>Vamos ver em exemplos:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PFgdTw5zocm2xBcO7aIHaA.png" /><figcaption>Criar um buffer com 1024 bytes do número 1.</figcaption></figure><p>Como dito acima, buffers contém dados binários. Então ao criarmos um buffer de 1024 bytes, ou 1kB, temos que todos os inteiros são salvos na base (2). 01 na base (10) é 0*²¹ + 1*²⁰ = 1, exatamente o que dizemos o comando alloc para fazer.</p><p>O interessante é que ao ver minha chave pública na função Buffer.from, vejo o seguinte:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NZvJOpWMEO-E9fQ1HvGwIA.png" /><figcaption>Buffer Byte-array</figcaption></figure><p>Esse é um <em>byte-array. </em>Como o nome já disse, é um array de bytes. Mas ao que corresponde cada um desses números?</p><p>Ao salvar esse byte-array numa variável e checar se o primeiro valor do byte-array é um hexadecimal, a resposta é “true”, ou seja, verdadeiro!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SVpWuadSG1KFE3RpbKdibg.png" /></figure><p>Ao converter para string o Buffer que temos, voltamos a ter minha chave pública!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*Sk8H1_v8a7OVTCdHrtoqHg.png" /></figure><p>É isso, pessoal! Espero que tenham aprendido algo. O conceito mais importante do artigo era realmente destacar que:</p><ul><li><strong>1 byte em decimal = 2 caracteres em hexadecimal</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d89416b230b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Religião é uma Fonte de Verdade assim como a Ciência.]]></title>
            <link>https://medium.com/@caiosa/a-religi%C3%A3o-%C3%A9-uma-fonte-de-verdade-assim-como-a-ci%C3%AAncia-543b2862f5af?source=rss-fa17b0f9776f------2</link>
            <guid isPermaLink="false">https://medium.com/p/543b2862f5af</guid>
            <category><![CDATA[truth]]></category>
            <category><![CDATA[religion]]></category>
            <category><![CDATA[prayer]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[logic]]></category>
            <dc:creator><![CDATA[Caio Sá]]></dc:creator>
            <pubDate>Mon, 15 Aug 2022 15:43:20 GMT</pubDate>
            <atom:updated>2022-08-15T15:44:12.938Z</atom:updated>
            <content:encoded><![CDATA[<p>Assim como ciência é uma fonte verdade, a religião também o é. Assim como existe fé na religião, existe fé na ciência. O que fazer então quando as duas divergem?</p><h3><strong>Construção da Verdade Por Meio das Diferentes Fontes de Verdade</strong></h3><p>Embora a religião e a ciência sejam comumente colocadas como adversárias entre si — cada uma competindo em determinar o que é verdade — na verdade, elas podem ser muito bem colocadas lado a lado — colaborando uma com a outra.</p><h4>Ciência</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y9legzmEMqOHnF05YUuM-A.jpeg" /><figcaption>Nuâncias de Um Lagarto Verde</figcaption></figure><p>Conhecer as coisas como realmente foram, como realmente são e como realmente serão é a verdade. Para tal, existem três fontes amplas de conhecimento que fornecem verdades: descoberta, revelação e razão. Para ser mais simples, cada uma delas representa respectivamente: ciência, religião e lógica. Cada uma delas têm seus <strong><em>próprios métodos de alcançar</em></strong> verdades e seus <strong><em>próprios métodos para validar</em></strong> o conhecimento recebido como verdade.</p><p>Começando pela ciência, sabemos que o <em>método </em>científico inclui em essência a observação da natureza, a hipotetização e os <strong><em>testes </em></strong>das hipóteses a fim de descobrir qual hipótese corresponde melhor às observações do que acontece na natureza. A ciência, portanto, é uma excelente ferramenta quando o conhecimento está relacionado à descobrir <em>como</em> as coisas funcionam: como podemos conseguir mais energia do sol? Como curar o câncer? NP = P? Qual a fórmula que encontra todos os números primos? Estamos sozinhos no universo? Por que sonhamos?</p><p>A ciência é uma fonte de verdade excelente para descobrir o <strong><em>mecanismo </em></strong>pelo qual as coisas funcionam, os padrões que se repetem no funcionamento de diferentes sistemas e como podemos tirar proveito disso para ter um mundo mais eficiente. Por meio da ciência, atingimos grandes feitos como humanidade: automóveis, telefone, inteligência artificial, anestesia e foguetes são apenas alguns exemplos.</p><h4>Religião</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5E6wi29C9gua7nDeblF-0g.jpeg" /><figcaption>Castelo Verde e Branco em Osaka, Japão</figcaption></figure><p><a href="https://en.wikipedia.org/wiki/John_S._Lewis">Dr. John S. Lewis</a>, renomado cientista orientador de programas espaciais europeus e da NASA, <a href="https://www.youtube.com/watch?v=JR8qIrJcJh4">disse</a>: “Enquanto cientistas, nós podemos entender muitas coisas sobre quando coisas aconteceram, onde aconteceram, quanto tempo duraram, mas a ciência é completamente silenciosa sobre <strong><em>quem</em></strong> e sobre o <strong><em>porquê</em> </strong>da criação.”</p><p>A melhor forma de se aprender como a religião é uma fonte de informação é recorrendo à mesma. Na Bíblia, em Tiago 1:5–6, o seguinte mostra como é esse processo: “E, se algum de vós tem falta de sabedoria, peça-a a Deus, que a todos dá liberalmente, e o não lança em rosto, e ser-lhe-á dada. Peça-a, porém, com fé, em nada duvidando; porque o que duvida é semelhante à onda do mar, que é levada pelo vento, e lançada de uma para outra parte.”</p><p>Fica claro que o processo de revelação envolve a verdade fluindo do Divino e chegando em nós, a humanidade. Esse foi o padrão usado para definir o que conhecemos hoje como escrituras: profetas, devido às necessidades da sociedade da época ou por espontânea revelação divina, conseguiram capturar a vontade de um Ser divino e escrevê-la a fim de que essas verdades fossem passadas de geração em geração. Existem diversos livros aceitos como escrituras por várias religiões diferentes: a Bíblia, o Alcorão, o Livro de Mórmon, Talmude, Apócrifos, etc.</p><p>O <strong><em>teste </em></strong>para saber se algo revelado é verdadeiro é simples e bem definido:</p><p>“Eis que desejo exortar-vos, quando lerdes estas coisas…eu vos exorto a perguntardes a Deus, o Pai Eterno, em nome de Cristo, se estas coisas não são verdadeiras; e se perguntardes com um coração sincero e com real intenção, tendo fé em Cristo, ele vos manifestará a verdade delas pelo poder do Espírito Santo.”</p><p>Dessa forma, a religião difere da ciência na confirmação do que é verdade, pois a ciência se baseia na correspondência da observação da natureza com a melhor hipótese aprovada depois de testes que incluem tentativa, erro e análise. A religião é uma fonte de verdade cujo teste de confirmar a veracidade de um conhecimento se baseia na manifestação de um sentimento e poder identificável e singular. É por isso que orações são feitas a fim de o indivíduo conseguir sentir e experimentar o que é o certo a ser feito em determinada situação.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DQB3DOZ6eGxl-T8T" /><figcaption>Photo by <a href="https://unsplash.com/@benwhitephotography?utm_source=medium&amp;utm_medium=referral">Ben White</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A religião, portanto, geralmente é uma ferramenta não eficiente como a ciência para descobrir verdades sobre o funcionamento das coisas, mas é superior quando o âmbito é de questões sobre o <strong><em>porquê </em></strong>da existência humana e do universo e fornece uma quantidade abundante de verdades que guiam o <strong><em>caráter </em></strong>humano e as relações de uma sociedade. Dessas forma, pessoass excepcionais foram protagonistas no mundo por meio de uma base de verdades advindas do campo religioso: Jesus Cristo, Dalai Lama, Confucius, Joseph Smith Jr., Isaías, etc.</p><h4>Lógica</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iiSj8faomdjou4tPLnTBHA.jpeg" /><figcaption>Cavaloss Adversários no Xadrex</figcaption></figure><p>A terceira fonte de verdade é a lógica. Ela é a fundação de sistemas governados por regras: como a metamática, linguagem e o direito, por exemplo. Dentro de um sistema que usa de lógica, algumas premissas devem ser aceitas a fim de que novas verdades dentro do sistema sejam encontrados. Por exemplo: a prova da existência de infinitos números primos na matemática infere que axiomas como a * b = b * a são verdadeiros. Não há provas para tais axiomas. Eles, no entanto, são amplamente aceitos como verdade para que a partir dos mesmos novos argumentos e regras sejam obtidos. O teste para saber se os axiomas são realmente verdadeiros é uma pendência dentro dessa fonte de conhecimento.</p><h3><strong>Fé Existe na Religião — e Também na Ciência.</strong></h3><p>Dado estas três fontes de conhecimento, focarei aqui nos dois primeiros e a relação entre eles: a ciência e a religião. A definição de fé no dicionário é: completa confiança em algo ou alguém. Obviamente, um dos argumentos mais usados a fim de invalidar as verdades obtidas pelo campo religioso é: “Não consigo ver Deus, logo Ele não existe.” No mundo atual no qual a visão é o sentido mais <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6777262/">valorizado</a>, um religioso é ridicularizado por acreditar em algo que ele não consegue ver. No entanto, este argumento é tão fútil quanto uma pessoa dizer: “Eu não acredito em quarks, pois não os vejo.” Assim como o religioso defende a existência de Deus baseado — entre outros argumentos — nas <strong><em>experiências </em></strong>com o Divino, da mesma forma os cientistas defendem a existência de quarks baseados nos <strong><em>experimentos </em></strong>com a matéria.</p><p>Uma outra interessante coisa a se notar é que a ciência e religião ainda tem muitas verdades a trazer para a humanidade. Na ciência, a teoria da gravidade de Newton considera a massa como fonte de gravidade, ideia refutada pela teoria geral da relatividade de Einsten que assume que fonte da gravidade é energia. Numa construção contínua da verdade, a teoria de Einsten previu corretamente a precessão do periélio de Mercúrio, enquanto que Newton não as previu exatamente como são. Assim como a teoria do geocentrismo foi refutada, outras teorias aceitas universalmente atualmente estão suscetíveis ao mesmo destino. Todas elas, no entanto, fazem parte da busca pela verdade absoluta e perfeita.</p><p>Um outro argumento comumente utilizado a fim de ridicularizar os fieis religiosos é insinuar que todo o dinheiro dado como dízimo é usado em corrupção interna nas igrejas devido aos escandâlos de corrupção que vieram à tona. No entanto, a ciência também está à mercê de cientistas que podem ser antiéticos em seus procedimentos em relação a como tratam os organismos — incluindo animais e humanos — sendo utilizados em experimentos e também em relação à veracidade dos artigos publicados devido a falsificação, omissão ou fabricação de dados. Sendo assim, a confiança é requerida não só no aspecto religioso, mas também no científico. Ambos são prejudicados com a disseminação de <em>fake news</em>.</p><h3><strong>O Que Fazer Quando Ciência e Religião Divergem?</strong></h3><p>Algumas teorias certamente colocam religiosos e cientistas frente a frente em relação aos seus argumentos sobre os mesmos fenômenos. O surgimento da espécie humana por meio de Adão e Eva e a origem da Terra por meio da Criação no Cristianismo são diferentes da teoria do evolucionismo de Darwin e da teoria do Big Bang.</p><p>Dar um passo atrás e perceber que ambos os lados são fontes de verdade e que <strong>ambos </strong>estão procurando a verdade absoluta os coloca lado a lado a ponto de percebermos que a divergência é real e <em>natural. </em>A busca pela verdade absoluta é um esforço contínuo de ambos os lados e mostra que, em meio à divergência, há espaço para novas descobertas e revelações a fim de ambos os lados se convergerem um pouco mais para alcançarem o objetivo comum.</p><p>Uma resposta colaborativa — e não competitiva— é necessária para que as diferentes verdades até então aceitas permitam à humanidade dar um passo à frente, acolhendo ambos os campos a fim de construir a verdade como é.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YyJaRwveQoQrrWN5" /><figcaption>Religião e Verdade Podem Caminhar Juntas</figcaption></figure><p>Dado o que foi dito acima, basta um olhar minucioso nas redes sociais para perceber que o Brasil não está seguindo nenhuma das duas fontes de verdade: parece que a opinião dos influencers — e páginas de influência — é que dominam o que é verdade.</p><p>Mas pode ser que você seja diferente! Comente aí qual fonte de verdade você mais utiliza e o porquê.</p><p>Até mais!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=543b2862f5af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lessons from Pandemic]]></title>
            <link>https://medium.com/@caiosa/lessons-from-pandemic-69d4b658a1f2?source=rss-fa17b0f9776f------2</link>
            <guid isPermaLink="false">https://medium.com/p/69d4b658a1f2</guid>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[lessons-learned]]></category>
            <category><![CDATA[new-york-city]]></category>
            <category><![CDATA[lessons]]></category>
            <category><![CDATA[pandemic]]></category>
            <dc:creator><![CDATA[Caio Sá]]></dc:creator>
            <pubDate>Thu, 13 Jan 2022 09:24:15 GMT</pubDate>
            <atom:updated>2022-01-13T09:24:15.340Z</atom:updated>
            <content:encoded><![CDATA[<h4>After some reflection on my life experiences in the period of the pandemic, I came to some conclusions.</h4><h3>Brief Overview</h3><p>I split the lessons I learned and explained them under their respective titles. My goal with it is to remind myself of what’s important for me and help you on your journey to find out the same for you.</p><h3>Relationships with other people are happiness</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ale7275ngSd-FX7g" /><figcaption>Photo by <a href="https://unsplash.com/@miinyui?utm_source=medium&amp;utm_medium=referral">Duy Pham</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Everyone probably has already thought about what you’d do if you were the only person in the world. I used to talk about that as a child with my friends. It turned out that sometimes during the pandemic I felt like I was the only person in the world.</p><p>To give some context, when the pandemic hit in the USA in February 2020, I was in New York City, one of the biggest epicenters of COVID-19. At the time, I was in Manhattan being a volunteer missionary for the Church of Jesus Christ of Latter-day Saints. So, our daily routine was focused on talking to people around the city inside buses, trains or approaching them on their doors so that we could help them to have a better life through God.</p><p>I remember we started seeing some people wearing masks publicly and we weren’t sure about what was going on, because we didn’t have TV or Google on our smartphones to be updated through the news. Our only source of information was the church — and at that time, we were told masks were optional and that we should take care, but that nobody in the world was sure of what was happening.</p><p>And as the days went by, we realized that more and more people weren’t on the streets, but still there were many people out there since it’s a very populated city.</p><p>But in mid-February, as we went out from our apartment to go to church because we didn’t have a WiFi connection at home, we walked through 5th avenue and we saw NOBODY! We saw some trucks passing by and cars rarely. But everything was closed and we could count the number of people on the streets. That was mind-blowing: how can the biggest city in the world be empty?</p><p>All the crazy flux of people, cars, noise, conversations, yells, laughs, dogs, and so on: they were all gone!</p><p>The good thing is that I was with my volunteer companion. I wasn’t alone, but we were astonished and surprised.</p><p>We called some people and stopped talking to people in person, because of the imposed restrictions. Our day became sadder. We had lots of free time and didn’t know where we could talk to someone.</p><p>The church was responsible for taking care of me and sent me back home to Brazil. I stayed 14 days isolated in my bedroom. The only thing I’d do is to read the Old Testament in the Bible, watch some YouTube videos about goal-setting, and — think. I thought a lot about the good moments I had in New York and how they were gone so quickly! I was SO bored! Nothing seemed to be worth my time since the only thing I could do at the quarantined time was to be on my cell phone. I couldn’t go outside and play soccer, go for a run, swim, go to a fast-food restaurant with my friends, or anything. Even local church meetings were shut down because of the imposed restrictions. I was able to get much closer to my family when they’d come home from work but I was lonely the whole day. Life seemed very limited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mCvjsM-JlCm7-chM" /><figcaption>Photo by <a href="https://unsplash.com/@sammoqadam?utm_source=medium&amp;utm_medium=referral">Sam Moqadam</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I would learn a lot but had no one to tell it to. I then had no motivation to learn anything.</p><p>I realized then that no matter what I did in life, the happiest moments I had were when I was surrounded by people: meeting people from different countries and cultures as a missionary, making jokes in classes at school, playing soccer tournaments, and having a fun conversation after winning or after losing it, going out to the shopping mall with my family and finding by accident a friend of ours there. All these simple things became so valuable as I had no one to talk to, to joke with, to play with, to dance with, to go out with, to do anything with.</p><p>I was determined I would give much more value to those ordinary relationships when the pandemic was over, even though I didn’t know when that’d happen.</p><p>No doubt, this is the biggest lesson I’ve learned in the pandemic: people move this world and move my life. Relationships with them are what determine true happiness.</p><h3>Purposelessness and loneliness are the biggest problems of today</h3><p>After everything I said, it turned out that I became much more compassionate about lonely people. I was enforced by the world’s circumstances to be in that lonely situation, but some people had been like that for years! The motives vary, but it’s not good for anyone—either for the orphan child or the lonely prisoner. No matter who we are, we always, always want to be with someone–not all the time, but we want to have friends even if we’re timid, introspective, anti-social, etc.</p><p>I became much more interested in emotional problems and I see that many of them come because of loneliness. I always thought that suicide is the worst idea to solve problems, but I became more aware of the circumstances that made people do that. Loneliness also makes people do the extraordinary to impress others so that they can get attention. That’s why I believe we have so much garbage on social media platforms. Everyone wants to have friends, but they think they need to be funny or crazy to achieve that–rather than being themselves and finding true friends who will like them for who they truly are. So, we can see that so many problems follow when loneliness comes in: emotional problems, denial of one’s self, and purposelessness.</p><p>And now I want to spend some time on this last one. When confined at home–which initially would last 14 days, but it actually lasted 2 months–I had no purpose. I wasn’t doing any volunteer service, any education–college or any free course–and I didn’t have a job either. Basically, I had no objective. I was waiting for the pandemic to end so that I could go back to being a volunteer for the church in my own country. The uncertainty of how long it’d take for that to happen drove me crazy. Having nothing to aim for was absolutely mind-consuming. I had 24 hours and yet I had no motivation to do anything–because I had nothing to do. I would exercise, eat, read, write down my on my journal, talk to my family about COVID updates, and nothing else. It’s horrible to not have a goal, an objective, a dream.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PJjmJ33kxV2l8-s9" /><figcaption>Photo by <a href="https://unsplash.com/@fakurian?utm_source=medium&amp;utm_medium=referral">Fakurian Design</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So, the biggest lesson I learned here is that I need people in my life and that I should do something that makes me happy–for studies and as a profession. But it’s important to note also that these are means to an end, but not ends on themselves. Instead of asking: “what do you want to work with?”, I think the right question would be:” what is your dream? What do you want to accomplish in this life?”, and then decide the means to get there, including studies, profession, goals, habits, etc.</p><h3>Education needs to be applied</h3><p>As I said, I spent my time usually reading when at home quarantined in my room. I read almost the whole Old Testament. I learned many principles about being a better person socially so that I could have a better character and make people happier. The thing is: Where were the people I could apply those learning with? There was nobody. So, I expanded this view not only to be limited into self-mastery but to anything: anything that you learn, if you don’t apply it, there’s no value. You’ll vanish and so the learning you have with you in this world. So, that’s why we should share, apply, and create with the knowledge we have. For example, I loved Chemistry in High School, but I couldn’t be in a lab doing reactions because I was confined. I asked myself: “How does knowing how to identify the different organic functions will help me right now?”</p><h3>World’s biggest trap: you’re busy, you’re happy.</h3><p>So, all of that circumstances led me to a specific profound question: “Am I happy because of what I have with my life?” I realized that having a busy life doesn’t mean that I’m happy. It means I am busy! It means I am trying to achieve something. But, we have so many things to do nowadays that we even don’t think about it: “Does it help me to be happy?” I love how Steve Jobs used to say that every day for 33 years he’d ask a question in front of the mirror for himself: “If today would be the last day of my life, would I be going to do what I am about to do today?” Whenever the answer was no for many days in a roll, he’d change something in his life.</p><h3>God is all-powerful</h3><p>He’s all-powerful to change situations in the twinkling of an eye, like making everyone in one of the most populated city to go inside their house and be there for weeks.</p><p>He’s all-powerful to protect those who honor Him. I’ve been much blessed to not get COVID-19 and continue living. I guess that’s a new chance to spend time well on what truly matters. I’m so thankful for His protecting hand. I can’t finish it without acknowledging the last lesson: He is the ultimate source of happiness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tzTVLPwbhSTKpnXD" /><figcaption>Photo by <a href="https://unsplash.com/@pabloheimplatz?utm_source=medium&amp;utm_medium=referral">Pablo Heimplatz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69d4b658a1f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A 21-Year Old’s Perspective to a Successful 2022]]></title>
            <link>https://medium.com/@caiosa/a-21-year-olds-perspective-to-a-successful-2022-54a69c812a79?source=rss-fa17b0f9776f------2</link>
            <guid isPermaLink="false">https://medium.com/p/54a69c812a79</guid>
            <dc:creator><![CDATA[Caio Sá]]></dc:creator>
            <pubDate>Sat, 25 Dec 2021 15:19:52 GMT</pubDate>
            <atom:updated>2021-12-25T15:19:52.273Z</atom:updated>
            <content:encoded><![CDATA[<h3>2022 is coming and what will you do with it?</h3><p>We usually set goals, dream again, have new hopes and become willing to try new things as the new year approaches, even though we could do it every day. Some people think about what they can accomplish materially: buy a new car, a new house, attend specific concerts, make a trip to an unknown place, etc. Others focus instead on goals that are relevant for themselves personally: wake up early in the morning every day, stop drinking, dedicate more time to family, read one book per week, acquire self-control, etc. As everyone has a different goal for next year — or there are those without any goals at all — a question comes into my mind: What determines if a person will be successful next year? What determines if a person on December, 31st of 2022 will look back and affirm to her or himself: “I succeeded this year!”?</p><h3>The Final Judgement</h3><p>Well, looking back and asking the question: “Was I successful in this year of 2021?” can be considered the final judgment of the year. It is a question I invite everyone that is reading to ponder about. Consider what changes you’ve made in life. Consider the routine you had throughout the year and see if that helped you accomplish something that you wanted to. For sure, we can personally determine if we were successful or not, but I cannot compare myself to others or determine if another person succeeded from the outside. Each person has different goals! Maybe you have appeared as a cover on a Forbes edition this year, and I have not. But that does not mean I wasn&#39;t successful, because this truly isn&#39;t my goal. The same thing for people we see outside. Perhaps, the dream of that individual that passes by you on the street every day is just to have health and continue enjoying good movies on Netflix when he or she goes back home from work. If he’s done it throughout the year, that’s it! He had what he wanted! And these different goals and perspectives on what makes someone happy make up our very diverse world! And I love it! Getting to know new people is like getting to know a new universe — governed by different physical laws, purposes, colors, shapes, and peculiar characteristics.</p><h3>Agency and Proactivity</h3><p>It was allowed us to act, and not to be acted upon only — like a rock. So, without my desire and action to have a better life next year, this will make it unlikely that I will achieve my goals. I must strongly fight for what I believe is worth my time and effort.</p><p>A principle comes to mind when I realize how much responsibility I have for the success I want. When Jesus Christ was talking to Joseph Smith and Oliver Cowdery on April 1829, he said the following: “Fear not to do good, my sons, for whatsoever ye sow, that shall ye also reap; therefore, if ye sow good ye shall also reap good for your reward.”</p><p>And the opposite is also true as the same Jesus Christ declared approximately 121 B.C. to people here in the Americas: “If my people shall sow filthiness they shall reap the chaff thereof in the whirlwind; and the effect thereof is poison.”</p><p>It becomes apparent that I am the master of my destiny — as declared by James E. Talmage.</p><p>This is true for the next year as it is also true for <strong>today</strong>! I determine today if I will go through what is needed to achieve what I want.</p><p>Surely, there are many different circumstances in our different lives. Some people are sick in hospitals while others read this article while sunbathing in front of their swimming pool. Inequality is a reality in the 21st century. But that should not let me give up on my focus.</p><h3>Focus is Success</h3><p>Years ago, a wise old man and good friend of mine told me in a conversation we’re having at his house: “Success isn&#39;t measured by the claps or boos you receive throughout your life. It’s measured by your focus.”</p><p>I thought about it a big deal. And that’s very important to remember when I receive claps or boos because, in those moments, I am tempted to think that my success is being determined right there, at that spot. But as my personal goals shouldn&#39;t be determined by someone from the external, my success shouldn&#39;t be also — it comes from the internal. It’s that feeling of peace of mind and heart saying:” You did your best.”</p><p>Again, have you felt that feeling this year? Was there anything on your way that prevented you from getting that feeling?</p><p>Well, in my case there was. The biggest barrier this year that prevented me to achieve even more in these days I’ve lived already is called <em>distraction</em>. Technological distraction, thought-distraction, and even being distracted on giving effort for things that weren’t important at all when compared to the most important things of life — God, family, friends, knowledge, taking care of my body, etc.</p><p>I’ve made a plan and I’ll stick with it. I’ve already started implementing it even though I’m not in 2022 — I want to see how I will adapt to it. And I may change my plans in the future, or I may achieve only 80% of what I’d planned — or 50%, 30%, etc. But the important thing is that I am focused on being a better person: less distracted, more prepared and that adds value to the people around me and society through the internet.</p><p>Russel M. Nelson, a religious leader, once said: “The joy we feel has little to do with the <em>circumstances </em>of our lives and everything to do with the <em>focus </em>of our lives.” For many years in my life, I believed the opposite. Now, I try to change this mindset and think that focus determines the joy I feel. I know that I am trying to apply it in my life. It’s not easy to change this mindset because we’re bombarded with mass media that gives us the notion that the guy sitting in front of a beach in the Bahamas drinking coconut water is happier than me. But to affirm it again: The joy I feel has everything to do with the <em>focus </em>of my life.</p><p>So, let me change the question a little bit: “Have you focused on what you love this year?”. “Have you focused on what truly gives <em>joy</em> to you?”</p><p>Even though I didn’t achieve everything I wanted this year, I know I focused on what was most important. I made my family a bit happier, I made myself a bit happier and I tried very much. As the next year approaches, I will try even more — focusing on things that matter for me: people, creativity, education, health, writing, and getting to know as many people as I can — getting to know other universes.</p><h3>He that Is Righteous Is Favored of God.</h3><p>As I’ve lived life, I’ve realized that many aspects of my life could have gone the wrong way. Early in life, I had no opportunity for an education of quality, and the community I lived in was really dangerous. I had many bad examples and could have gone together with many of my friends to unknown paths — and become lost. Despite all these circumstances, my focus was always to have a better life — to explore the world, have a good profession in which I’d have fun with it, eat good food and be able to get to know as many people as possible — yes, I love people! And that has become true, little by little. I live somewhere else now, I’ve traveled to some cool places and I’ve met people in life I thought I’d never meet — outstanding people that make this world better, even though they’re not recognized for it. And I was saying, I sow what I plant — but that is not the only principle in life. I couldn’t do this on my own, really. I have seen so many opportunities arrive out of nowhere, many coincidences happening at the exact time they should, and so on. I firmly know that all of this was due to God. Without Him in my life, I wouldn’t be where I am today and wouldn’t be the person I am today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sCHLzkWUSB0YN3CS8Wi7Qg.jpeg" /></figure><p>In the Book of Mormon, it’s said: “Behold, the Lord esteemeth all flesh in one; he that is righteous is favored of God.” I try to live a life according to God’s principles. I’m not perfect, but I’ve been rightly favored by doing that. Whenever I feel like my hope is dying because of the many bad news we face every day, I remind myself of Him and acquire strength and hope in His promises.</p><p>Indeed, He’s all-powerful! So, why wouldn’t He have the power to change my life? To change your life?</p><p>And this is the last principle I’d like to remind myself of for the upcoming year: He that is righteous is favored of God.</p><h3>Focus is Consistency</h3><p>Jeffrey R. Holland once said: “once that the future is waiting to be seized, and if we do not grasp it firmly, then other hands, more determined and bloody than our own, will wrench it from us and follow a different course.” Yes, determination comes in when we talk about succeeding!</p><p>As I’ve lived these 21 years in my life, I’ve had my plans already, many goals and many of them went away because I gave up on them, or because I found better plans and goals. For example: at the beginning of 2021 I wanted to record a second of my life every day so that I could get to this point in December, get together all the seconds and make a video about my year! That’s it: a second! Man, I’ll tell you I wasn’t able to! I was doing pretty good in January, but then, things began changing in my life, I went to a new place, new people and then, forgot about it. It does not matter the plan you have, if you stick to it and have consistency on it: you will change and your life as well!</p><p>And I’ve seen that through a goal that I have during the mornings: I always begin my day by reading the scriptures. It’s something I love learning from! But I won’t lie that some days are hard to get something out of it or to concentrate on what I’m doing: but I did it, every day! Maybe, there were a few days where I wasn’t able to do it as the first thing of my day or even wasn’t able to do it on my whole day at all. But I’m sure I’ve tried my best and did it on more than 90% of the days of this year. How was it then? It’s fulfilling! It has opened my mind to have a better day, each day I would do it. And a combination of better days produced a better year — and, surely, a better life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PAJNKnsdwMNGJK705RAhfg.jpeg" /></figure><h3>Wrapping Up</h3><p>I may get into December of 2022 and look back on the next year and realize that I wasn’t perfect — and I’m sure that will happen haha. But I hope I will be focused enough to achieve the goals I think would make my life and other people’s lives better. It is good to live — think, act, joke around, eat, imagine, and be with our loved ones. That doesn’t eliminate injustice, inequality, and exploitation in the world. But I’ll tell you what a friend of mine told me the following this last week. He said something along the lines of: “I’m grateful for the steep street we walk through every day to go to work.” And as his eyes became teary, he continued:” Because I know there are many people that are not able to. There are many people that think:’I’d love to be able to walk this steep street, but I can’t.”</p><p>I’m grateful for this year that is almost at its end. I’m grateful for having the chance to try again to improve next year — and today! That’s it: consistency through focusing on what I love is what I think will help me feel successful the next year. And all of that can’t be done without the help of my God. Wish you all a better 2022! ⛅️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54a69c812a79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interação entre Remix e Ganache]]></title>
            <link>https://medium.com/goblockchain-colabs/intera%C3%A7%C3%A3o-entre-remix-e-ganache-d6eec3c1f884?source=rss-fa17b0f9776f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6eec3c1f884</guid>
            <category><![CDATA[ganache]]></category>
            <category><![CDATA[ganache-cli]]></category>
            <category><![CDATA[blockchain-development]]></category>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[remix-ide]]></category>
            <dc:creator><![CDATA[Caio Sá]]></dc:creator>
            <pubDate>Thu, 25 Nov 2021 12:38:39 GMT</pubDate>
            <atom:updated>2021-11-25T13:57:26.637Z</atom:updated>
            <content:encoded><![CDATA[<p>Artigo da série de como se tornar um desenvolvedor em blockchain.</p><p>Este é o terceiro artigo da série e é mais uma complementação do segundo do que um novo tema. Para ler este, não é necessário ter lido os outros, porque o que vamos aprender é bem fácil. Entretanto, é preciso ler os outros dois caso você queira realmente se tornar um desenvolvedor em blockchain.</p><ul><li><a href="https://medium.com/goblockchain-colabs/primeiros-passos-com-geth-860607031c43">Primeiros passos com Geth</a></li><li><a href="https://medium.com/goblockchain-colabs/fazendo-o-deploy-com-geth-no-modo-dev-45ae8a942ab5">Fazendo o Deploy com Geth no modo Dev</a></li></ul><p>Não usaremos o Geth hoje, apenas Remix e Ganache. Nosso objetivo é conectar a Ganache — que é um emulador de uma blockchain local — com o Remix — uma IDE que permite a criação de contratos e também que transações aconteçam numa determinada blockchain. A blockchain em questão será justamente a criada pelo Ganache.</p><p>Visite o site: <a href="https://www.trufflesuite.com/ganache">https://www.trufflesuite.com/ganache</a> para baixar a Ganache. O site reconhecerá o seu sistema operacional e dará a opção para que você baixe a Ganache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2_gdwlzqud6TRxOK0Pcpyg.png" /><figcaption>Página Inicial da Truffle: Baixando Ganache</figcaption></figure><p>Clique em download para baixá-la e depois abra-a no seu computador. Uma tela como exibido na imagem abaixo aparecerá na sua tela. Para o presente momento, criaremos uma blockchain temporária, mas você pode criar uma permanente também ao clicar em <em>New Workspace. </em>Para criar uma temporária apenas para aprendermos a fazer a interação, clique em <em>Quickstart </em>como sinalizado abaixo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oGLDZHIvqQmgRgXKspsJXA.png" /></figure><p>Você vai perceber que uma lista de muitas contas vai aparecer na sua tela. Vamos analisar alguns elementos importantes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e4a0Vk5wI2KTvrskIeRmag.png" /><figcaption>Tela ao abrir a Ganache</figcaption></figure><p>Cada cor representa algo útil:</p><p><strong>laranja</strong>: quantos blocos a nossa blockchain já possui.</p><p><strong>verde</strong>: o endereço das contas.</p><p><strong>azul</strong>: o saldo da conta.</p><p><strong>vermelho</strong>: a chave privada da conta.</p><p><strong>amarelo</strong>: o endereço que permite a blockchain ter comunicação com a rede.</p><p>Muito bom! Agora a tarefa é fazer transações usando estas contas. A primeira transação que faremos será a criação de um contrato, para que depois interajamos com ele.</p><p>Onde está o contrato? Como fazer tal transação de criação?</p><p>Agora é a hora que o Remix vem para brilhar!</p><p>Abra o <a href="https://remix.ethereum.org/">Remix</a>, clique em <em>contracts </em>e depois em no contrato 1_Storage.sol. Este contrato já está desenvolvido pelo Remix. Vamos apenas colocá-lo na nossa blockchain no Ganache e fazer transações com ele. Você pode criar seu próprio contrato no Remix também para fazer o processo que faremos adiante. Caso queira aprender a criar um contrato, há um excelente artigo <a href="https://goblockchain.io/desenvolvedor-blockchain/">aqui</a>. No entanto, vou seguir adiante usando este contrato aqui mesmo para ganharmos tempo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*f6QrHFye770SMWvpboHYzQ.png" /></figure><p>Depois basta clicar no segundo ícone no menu à esquerda para compilarmos o contrato:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/54/1*JNeAKyJ3T0UjVxkSo-1-fg.png" /></figure><p>O meu está com este check verde porque eu já o compilei. Para compilar, clique agora em compile como mostrado abaixo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*0TP_9ZHcJKxlYje0gc7aKw.png" /><figcaption>Compilando Smart Contract</figcaption></figure><p>Agora que nosso contrato está pronto para ser colocado na nossa blockchain, precisamos dizer ao Remix onde está e qual é nossa blockchain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*xEwOCYdkUqnor6PFM6aQPQ.png" /></figure><p>Clique no ícone de deploy e depois selecione Web3 Provider como mostrado acima. Estamos falando para o Remix que vamos fazer o deploy do nosso contrato e vamos fornecer a ele uma provedor Web3 — que nada mais é que fornecer o local onde nossa blockchain está.</p><p>Na sua Ganache, como mostrado em amarelo lá em cima, está o endereço que precisamos. Copie-o e cole-o aqui nessa janela que abre no Remix ao selecionarmos Web3 Provider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*4DPcqVOB_9FZODBCX7PTuw.png" /><figcaption>Coloque o Endereço do RPC Server da Ganache</figcaption></figure><p>Depois de clicar em ok, olha só o que acontece:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*vJGjfM8MUVbbkUtxq-oKvQ.png" /></figure><p>Houve um sucesso! O Remix agora reconhece, em vermelho, o id da nossa blockchain no Ganache, assim como:</p><p><strong>em verde</strong>: o endereço da nossa primeira conta da Ganache. Ao clicar na setinha ao lado do saldo, você vê que o Remix reconhece todas as contas da Ganahce, que obviamente, possuem mesmo endereço que as contas que foram criadas automaticamente pelo Ganache.</p><p><strong>em azul</strong>: O balanço da conta selecionada.</p><p><strong>em laranja</strong>: O nome do contrato o qual vamos fazer o deploy.</p><p>Clique em amarelo para fazer o deploy!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXVvZh2erNNq3zwXdSrGfQ.png" /><figcaption>Contrato Criado com Sucesso!</figcaption></figure><p>Voltando na Ganache e indo no menu superior, podemos ver que em <em>transactions </em>há uma transação feita no primeiro bloco. Esta transação é justamente uma <em>contract creation </em>(criação de um contrato) na nossa blockchain. Algumas informações são mostradas, como o hash da transação (<em>tx hash</em>), qual o endereço que criou o contrato (<em>from address</em>) e o endereço criado do contrato criado (<em>created contract address</em>).</p><p>Voltando no Remix, podemos fazer uma transação de interação com o contrato.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*lkh323QCjmYk54g0v4CVJg.png" /></figure><p>Clique na setinha para baixo para que as funções do contrato sejam exibidas. Vou fazer o <em>store </em>do número 7888 (escolhi aleatoriamente). Lembrando que este contrato armazena um número por nós escolhido e também permite que qualquer pessoa resgata-o (<em>retrieve</em>) a fim de vê-lo. É um contrato bem simples e útil apenas para aprendizado. Depois de clicar em <em>store </em>e voltando no Ganache, vemos o seguinte:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_PcYfUv1QGm_r3RxsMw3Fg.png" /><figcaption>Transação Utilizando Função do Contrato</figcaption></figure><p>Uma nova transação foi feita, adicionando um novo bloco, o bloco 2 (<em>current block</em> no canto superior esquerdo). O que aconteceu nessa nova transação? Nós armazenamos (<em>store) </em>a um número no contrato, pagando uma taxa pequena como incentivo para os mineradores validarem essa transação. Assim, supondo ser uma blockchain real, todos os outros computadores (<em>nodes) </em>da blockchain teriam a informação de que aquele contrato possui agora o número 78888. Voltando no Remix, podemos ver que o saldo de nossa conta diminuiu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/218/1*82_PpuAr0n8M_LhafJWF9w.png" /></figure><p>Agora o saldo não é mais 100 ETH devido à taxa paga. Se clicarmos em <em>retrieve, </em>veremos que nada será descontado como taxa, pois não fizemos uma alteração na blockchain fazendo com que todos os computadores da blockchain tivessem de alterar a cópia que possuem dela. Apenas lemos uma informação que está em um contrato da blockchain — o que é de graça pois não exige poder computacional de ninguém da blockchain.</p><p>É isso pessoal! Podem continuar interagindo com este contrato usando a mesma conta selecionada no Remix ou alternando contas. Vocês podem também usar um contrato próprio além deste fornecido pela Remix para brincar com o seu contrato.</p><p>Até a próxima! 🚀👋 👊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6eec3c1f884" width="1" height="1" alt=""><hr><p><a href="https://medium.com/goblockchain-colabs/intera%C3%A7%C3%A3o-entre-remix-e-ganache-d6eec3c1f884">Interação entre Remix e Ganache</a> was originally published in <a href="https://medium.com/goblockchain-colabs">GoBlockchain</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fazendo o Deploy com Geth no modo Dev]]></title>
            <link>https://medium.com/goblockchain-colabs/fazendo-o-deploy-com-geth-no-modo-dev-45ae8a942ab5?source=rss-fa17b0f9776f------2</link>
            <guid isPermaLink="false">https://medium.com/p/45ae8a942ab5</guid>
            <category><![CDATA[blockchain-development]]></category>
            <category><![CDATA[dapps]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ethereum-testnet]]></category>
            <category><![CDATA[geth]]></category>
            <dc:creator><![CDATA[Caio Sá]]></dc:creator>
            <pubDate>Wed, 24 Nov 2021 15:25:35 GMT</pubDate>
            <atom:updated>2021-12-03T11:32:57.790Z</atom:updated>
            <content:encoded><![CDATA[<p>Segundo artigo da série da jornada para se tornar um desenvolvedor em Blockchain.</p><p>O <a href="https://medium.com/goblockchain-colabs/primeiros-passos-com-geth-860607031c43">artigo</a> anterior é essencial para o que vamos fazer hoje. Sem seguir ele, você não conseguirá acompanhar este.</p><p><a href="https://medium.com/goblockchain-colabs/primeiros-passos-com-geth-860607031c43">https://medium.com/goblockchain-colabs/primeiros-passos-com-geth-860607031c43</a></p><p>Vamos rodar um nó com Geth local em modo desenvolvedor e fazer o deploy do nosso primeiro <a href="https://goblockchain.io/entendendo-blockchain-terminologia-e-como-funciona/#iprogrammer">smart contract</a> nela.</p><p>Fazer o deploy significa enviar este contrato para a blockchain e este ficar visível nela. O seu código para o mundo! Neste caso, faremos o deploy local para fim de estudo e mostrar o processo da criação até a transação chegar no Blockchain.</p><p>Lembrando que o ambiente dev é um ambiente de teste. Assim, você não precisa se preocupar pois não usaremos dinheiro real.</p><p>Vamos lá :)</p><pre>geth --dev --datadir /path/para/pasta/que/voce/quer</pre><p>O código acima, como explicado no último artigo, diz que queremos criar uma blockchain local de test (--dev) no nosso pc em uma pasta. Você escolhe sua pasta onde deseja salvar a blockchain. Para isso, use “--datadir” e logo após o diretório de sua escolha.</p><p>Não precisa executar o código acima, é apenas para recapitular o que foi dito no último artigo.</p><p>Nosso objetivo é:</p><ol><li>Criar a blockchain</li><li>Criar uma conta</li><li>Transferir ETH para esta conta</li><li>Conectá-la com o Remix</li><li>Fazer o deploy usando a conta criada.</li></ol><p>Criando blockchain:</p><p>Executando o código abaixo:</p><pre>geth --http --http.corsdomain=”*” --http.api web3,eth,debug,personal,net --datadir /home/caiosa/go1/eth --dev console</pre><p>Obtemos o resultado como mostrado abaixo. Lembrando que o código depois de “--datadir” e antes de “--dev” vai ser o local onde você armazenará a blockchain, que será diferente do caminho que digitei acima, pois estava usando o meu pc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dYMhoZruYDQnIy6uKHhBPQ.png" /><figcaption>Resultado do Código</figcaption></figure><p>Vamos analisar os comandos separadamente:</p><pre>geth --http --http.corsdomain=”*” --http.api web3,eth,debug,personal,net --vmdebug --datadir /sua/pasta --dev console</pre><p>Os comandos “--http” , “--http.corsdomain=’*’” ,“--http.api web3,eth,debug,personal,net”,”--vmdebud” e “console” significam respectivamente:</p><ol><li>Habilite o servidor HTTP-RPC</li><li>Lista de domínios dos quais vamos aceitar solicitações de informações. “*” significa que permitimos qualquer domínio solicitar informações da nossa blockchain, inclusive o servidor do Remix. Estamos usando este asterisco apenas no modo dev (desenvolvimento). Usá-lo na vida real é muito perigoso e arriscado. Geralmente especifique o domínio para o qual você aceita solicitações.</li><li>Autoriza o uso de todas aquelas APIs para uso entre os servidores conectados.</li><li>Registre informações importantes para a Virtual Machine e debug dos contratos</li><li>Inicia um ambiente interativo em Javascript para fazermos transações, criar contas, saldos, etc. Super importante!</li></ol><p>Abaixo temos destacados o console e o endpoint no qual o Remix vai se conectar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LOxG9c8RaaYJBsp5Wf38cw.png" /></figure><p>No console, digite “eth.accounts” e dê um enter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*uJfSAH91mJFUh05DjObJ1g.png" /></figure><p>Logo, há apenas uma conta criada automaticamente. Mas queremos ter a nossa própria conta com algum saldo de ETH. Vamos criar uma!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UyHqQDtrUPC3uzW6dfrPLw.png" /></figure><p>Usando o comando acima e passando uma senha dentro das aspas, criamos nossa conta com saldo de 0 ETH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*SzcaPASWffrLrNj0Tu2iHg.png" /><figcaption>checando saldo da conta criada — conta 1</figcaption></figure><p>Você pode usar o mesmo comando para ver o saldo da conta 0, que é gigantesco. Conseguimos mandar ETH de uma conta para a outra usando o código abaixo:</p><pre>eth.sendTransaction({from:eth.accounts[0],to:eth.accounts[1],value:web3.toWei( <strong>quantidade que você quer transferir</strong> ,&quot;ether&quot;)})</pre><p>Como mostrado abaixo, transferi 0.5 ETH. A transação foi bem sucedida, um hash foi criado para representá-la e algumas outras informações são mostradas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FiNwXdabb8R_9rvKzmKQPw.png" /><figcaption>transação de ETH entre contas da blockchain</figcaption></figure><p>Pronto! Agora você tem uma conta em uma blockchain no seu computador com alguns ETH imaginários que podemos gastar. ETH imaginários são também chamados de faucets. Deixamos claro que qualquer servidor pode se conectar com essa blockchain. Vamos então para o <a href="https://remix.ethereum.org/">Remix </a>.</p><p>Lá no Remix, você pode criar seu próprio contrato em Solidity e fazer o deploy. Para aprender a criar um contrato em Solidity personalizado, clique <a href="https://goblockchain.io/desenvolvedor-blockchain/">aqui</a>. Eu vou usar o contrato criado pelo Remix — e também aconselho você — para não perdemos tempo. Depois crie o seu próprio e repita o processo para fazer o deploy do seu próprio contrato.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPo2kuHeeGbCyheccFzEgA.png" /><figcaption>contrato que vamos fazer o deploy</figcaption></figure><p>Vamos compilar. Basta clicar no segundo ícone na barra vertical de ícones à esquerda e depois no botão azul.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*CjuTS-y8iLtojNuVqAS7UQ.png" /></figure><p>Agora vamos selecionar o provedor da blockchain na qual vamos fazer o deploy do nosso contrato. Clique no terceiro ícone à esquerda no menu e depois na setinha em <em>enviroment. </em>Haverá algumas opções. Vamos escolher Web3 Provider pois nós temos uma blockchain pessoal e o provedor dela é dado por nós. As outras opções estão relacionadas a provedores já fornecidos pelas blockchain utilizadas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*EALdrsVYA2GQf7NpSP5_ag.png" /><figcaption>clique no icone em losango, enviroment e Web3 Provider</figcaption></figure><p>Essa janelinha vai aparecer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*RJunWDPL1sRbxov83vpLNQ.png" /></figure><p>Tenha certeza que o endereço ali em Web3 Provider Endpoint é o mesmo endereço que destacado em amarelo lá em cima no artigo, logo depois de executarmos o primeiro comando. No nosso caso, o nosso é exatamente este aí: <a href="http://127.0.0.1:8545/">http://127.00.1:8545</a>. Clique em OK :).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*D_oRXfUhB1J0XX4b_kfvrg.png" /></figure><p>Vualá! Você está conectado ao Remix. Ao clicar ali nas duas setinhas para cima ou baixo, você pode trocar a conta e usar a que criamos:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*4jknWg2TzuLf1lQwF9bPjQ.png" /><figcaption>saldo de 0,5 ETH como esperado</figcaption></figure><p>Clique em deploy e seu contrato será deployado!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*vBumDXbjHHl3KlTPOm84DQ.png" /></figure><p>Agora vamos lá no terminal e ver o que aconteceu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_O0sz8ABoi1MWki9J3Ny0Q.png" /></figure><p>Ops, parece que algo deu errado, não é?! Esse erro acontece devido a precisarmos desbloquear nossa conta que criamos. Dessa forma, o contrato ainda não foi deployado. Para resolver este problema, vamos segurar CTRL+D. Assim a blockchain será <em>stopped, </em>ou seja, vai sofrer um pausa por agora.</p><p>Bem, não se preocupe. A nossa conta criada ainda está lá pois tudo que fazemos na blockchain é registrado e estes registros estão salvos no mesmo diretório que havíamos usados antes.</p><p>O problema ali descrito é que nossa conta recentemente criada está bloquada para fazer a transação de criação de um contrato. Para resolver o problema, vamos permitir que o desbloqueio de nossa conta seja feito mesmo que estejamos conectados em um servidor HTTP, como o Remix. Para isso, passamos o parâmetro “--allow-insecure-unlock”, pois o Geth considera liberar uma conta mesmo conectada ao HTTP como algo inseguro. Não se preocupe, entretanto, pois estamos apenas no ambiente dev, fazendo simulações do mundo real.</p><p>Dessa forma, execute o comando abaixo — similar ao primeiro, mas com a adição do novo parâmetro destacado em negrito, lembrando de colocar o diretório que você está usando depois de “--datadir”:</p><pre>geth --http --http.corsdomain=&quot;*&quot; --http.api web3,eth,debug,personal,net --vmdebug --datadir /sua/pasta/ --dev <strong>--allow-insecure-unlock</strong> console</pre><p>A blockchain novamente aparecerá no terminal. Agora, vamos fazer o desbloqueio da conta, usando o comando abaixo no console:</p><pre>personal.unlockAccount(endereço, senha, tempo)</pre><p>O tempo é em segundos, então usaremos 15000 segundos — este é o tempo que estamos habilitando nossa conta criada para estar disponível e desbloqueada para ser usada em servidores HTTP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*e2xa5-7pTmrN50oxKjRQnQ.png" /></figure><p>Voltamos lá no Remix, novamente vamos compilar, conectar nosso provedor e fazer o deploy assim como foi mostrado anteriormente no artigo. Depois disso vamos ao terminal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tbRvW9UB_UBXt7-gijJpFQ.png" /></figure><p>Vualá! “<strong><em>Submitted contract creation</em></strong>” quer dizer que nosso contrato foi disponibilizado na blockchain com sucesso! Também é possível perceber lá no Remix ou usando <em>eth.getBalance </em>que nossa conta perdeu alguns ETH devido ao gas usado na criação do contrato. Você agora pode ir no Remix, e interagir com o contrato e ver como aparecerá lá no terminal todas as mudanças que você está fazendo. Por exemplo, vou fazer o <em>store</em> do número 155555 (escolhi aleatoriamente):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*6CocGOwx-JJBwMIxOIX8zA.png" /></figure><p>Quando clico em <em>store</em>, essa transação irá para a blockchain e será exibida lá no meu terminal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0KtH0CIn9S22OFoXFl7RRA.png" /><figcaption>Transação submetida com sucesso!</figcaption></figure><p>Assim, você pode ficar brincando com seu contrato e testando as funcionalidades dele na blockchain criada localmente.</p><p>Como exercício, deixo aí para vocês fazer os mesmos passos! Como desafio fazer o mesmo com um contrato criado por você. Para aprender mais sobre os contratos em Solidity, visite o final deste <a href="https://goblockchain.io/desenvolvedor-blockchain/">artigo </a>no nosso blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45ae8a942ab5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/goblockchain-colabs/fazendo-o-deploy-com-geth-no-modo-dev-45ae8a942ab5">Fazendo o Deploy com Geth no modo Dev</a> was originally published in <a href="https://medium.com/goblockchain-colabs">GoBlockchain</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Free Up Space From sda1 on Linux]]></title>
            <link>https://medium.com/@caiosa/how-to-free-up-space-from-sda1-on-linux-962eaaf52473?source=rss-fa17b0f9776f------2</link>
            <guid isPermaLink="false">https://medium.com/p/962eaaf52473</guid>
            <category><![CDATA[terminal-commands]]></category>
            <category><![CDATA[ubuntu-18]]></category>
            <category><![CDATA[anaconda]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ncdu]]></category>
            <dc:creator><![CDATA[Caio Sá]]></dc:creator>
            <pubDate>Fri, 24 Sep 2021 03:05:01 GMT</pubDate>
            <atom:updated>2021-09-24T03:05:01.083Z</atom:updated>
            <content:encoded><![CDATA[<h4>After being stuck the whole day trying to free up space on Ubuntu, I finally solved it using many resources across the web: and here’s the summary.</h4><h3>Background Story</h3><p>When trying to install Anaconda, I couldn&#39;t move on because of the issue “No space left on device” as you can see in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*NGYY5wWs1cWhfoLMXiPjhA.png" /></figure><p>I was pretty sure I had enough space to install it, but actually — as computers usually do not lie — I was wrong. Running the command df -h on the Linux terminal, I got that /dev/sda1 has used 100% of its available memory as shown below — so it is full!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*7KVdIosjQIL8V7u5NTomPA.png" /></figure><h3>Solution</h3><p>After trying many different methods that may work for you, such as running the commands sudo apt autoremove or sudo apt autoclean , the solution is:</p><p>Run du -hs * | sort -h and the terminal will output all the directories and files of your current directory in ascending order so that you can see which files or directories are taking so much storage. The output will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*lB-nmhCEUFD-w5OmwLhA1A.png" /></figure><p>Now you can see which files or directories are taking much space and delete them using rm -rf filename or rm -rf directory_name . I did it and after running df -h again, I now had 88% — instead of 100% — of memory used from the dev/sda1 directory. Even though I had deleted <strong>many </strong>files and directories, it seemed strange to me that something was still occupying so much space. And here comes a powerful tool that solved my problems and of which I knew nothing before running into this issue.</p><h3><strong>NCDU</strong></h3><p>NCDU shows you which files and directories are taking the most space on the directory you run it — but it shows even the <strong>hidden</strong> files and directories that the other commands we used so far are unable to show. I did show you the other commands though because finding the big files and deleting them manually helped me to get some space — even if it was only a bit — so that I could install ncdu by running the command sudo apt-get install ncdu . Now, running the command ncdu path will show you what you need to find out — path being the directory you want to inspect, which on my case path was equal to /home/myusername . You will see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*xeepCgVgiq7in2L8V3cYfg.png" /></figure><p>Here we go! After I solved the issue, you can see that anaconda3 takes up the most space, but before solving the issue, .local took about 4GiB of my memory — that is a lot. Also, .cache was a big part of the problem.</p><p>You now only need to remove the biggest files in these directories. I do not recommend removing all of the content inside them at once, but there are different opinions about it over the internet. But make some research so that you will not be doing something damageable for your computer. So, now, just run cd .cache and run du -hs * | sort -h to find which applications’ caches are unnecessarily big. Then, run rm -rf filename where the filename will be the name of the file you want to remove. Also, if .local is taking much space too, run rm -rf ~/.local/share/Trash to remove all the trash that has been saved — if you don&#39;t care about them, of course. If the .thumbs/ file is also taking much space, run rm -rf ~/.thumbs/* .</p><p>After doing all of this and removing the anaconda files I had before and trying running its installer again, the installation succeed, and now I can use it without any problems.</p><p>Credits to this helpful article on NCDU that was a light for me:</p><p>https://www.vivaolinux.com.br/dica/Usando-o-NcDU-(Ncurses-Disk-Usage)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=962eaaf52473" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Experience with Andrew Ng Machine Learning Course As a Beginner]]></title>
            <link>https://medium.com/@caiosa/my-experience-with-andrew-ng-machine-learning-course-as-a-beginner-8c8d60a04c42?source=rss-fa17b0f9776f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c8d60a04c42</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[coursera]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[andrew-ng]]></category>
            <category><![CDATA[machine-learning-engineer]]></category>
            <dc:creator><![CDATA[Caio Sá]]></dc:creator>
            <pubDate>Wed, 22 Sep 2021 23:57:35 GMT</pubDate>
            <atom:updated>2021-09-22T23:57:35.397Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you beginning your journey in Machine Learning? I am also like you! So, here is an honest review of the introductory course — that you have probably heard of - given by Andrew Ng on Coursera on Machine Learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*e7G4P0jYqzOYxazTYCZEKA.png" /><figcaption>Representative Image of Course Completion</figcaption></figure><h3>My Background with Programming</h3><p>Yes, I have some — but little — experience with programming. The most incredible things I had done with programming till I began the course were: solving some easy problems from the Brazilian Olympics of Informatics in 2018 using C++ and after two years without any programming experience, learning how to build a simple Twitter clone using Ruby. No experience with Data Science and Artificial Intelligence.</p><h3>How hard was it?</h3><p>The course is not hard. Its purpose is to get your foot wet on the different algorithms of Machine Learning systems. You won&#39;t be able to get out of the course and be the next Andrew Ng right away, but you’ll learn that Machine Learning is doable, how the process of learning from data happens under the hood for any programming language, and many practical tips from an expert that will save you tons of time when building your Machine Learning systems by yourself.</p><p>Yes, you will be learning a new programming language — which I love now — called Octave/Mathlab. It is very simple and very powerful. If you have never coded yourself, I would tell you to look at some tutorials on Youtube about programming with Octave so that you can learn a bit about what programming is all about and how it works. If you have coding experience, you can take the course easily.</p><p>Once you have gotten your feet wet on coding, then surely you can go ahead and start the course. The course takes 11 weeks to complete, but I finished in 9 weeks— and I know I could have finished in about less than 21 days by giving 2 hours of my everyday life to it. The thing is that I started, then got busy with other stuff and came back. As a reference, I finished the last 3 weeks in 4 days by applying myself 3 hours a day to it. So, don’t worry about timing, too. It is pretty doable.</p><p>What about the math? This is the hardest part of the course. It had been 2 years since I touched on math. He uses graphs really well in the course for us to see how the models are performing on the data. If you know what is x-axis and y-axis are in a graph, that is enough for the graphs. You will also be seeing some Calculus here and there <strong>to explain </strong>where all the formulas come from, but you will not be using Calculus in the programming assignments. And here you might ask: I want to learn Machine Learning, how will I become an expert in Machine Learning if I can’t figure out where the formulas come from? Well, that is a good time to say that the course is <strong>introductory</strong>. Andrew Ng explicitly says many times that you will need to just accept some formulas and models he shows in the course. And that happened to me. I tried to understand all he taught, but also knew that I don&#39;t have the needed background to prove some of the formulas from the fields of Statistics, Probability, and Linear Algebra. Even Andrew Ng would come with the formula without proving it in many instances. It is totally unnecessary to take long courses of Linear Algebra, Probability, Calculus, etc, before jumping into the course. The only thing you will need is to be familiar with matrices multiplication — that’s all for math. Believe me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*tNL1D6ODwpDT_PKJ0_uGog.png" /><figcaption>Graph of Decision Boundaries On Data of Week 7</figcaption></figure><h3>What Does the Course Teach?</h3><p>After knowing that you can handle going through the curse without rigorous math, you will be amazed at what you learn. The course usually covers an algorithm each week. You will get your feet wet in Linear and Logistic Regression, Gradient Descent, Neural Networks, SVM, K-Means, and Anomaly Detection. If these names sound complex for you, don&#39;t worry, they&#39;ll be taught simply in the course. He explains things in a clear and practical — very practical way. He gives some valuable advice for even experts in the field about how to improve on a model, quantity vs quality of data, and what to do when you encounter an issue in a Machine Learning system. Seriously, his course is worth it!</p><p>The highlights of the course for me were:</p><p>Learning how to compress an image using the most common colors in the original image to get a similar one and learning how to build a Machine Learning System using Neural Networks in order to recognize hand-written digits in Week 5. This was the assignment I spent more time on but was able to see the majesty of Machine Learning.</p><figure><img alt="Hand-written Digits Classifier" src="https://cdn-images-1.medium.com/max/357/1*mGcFToxTxAwjdYiiJYkcPg.png" /><figcaption>Hand-Written Digits Classifier</figcaption></figure><h3><strong>Last Important Comments</strong></h3><p>If you have wondered why he uses the Octave/Mathlab programming language instead of the well-known Python and R languages, here is why: In his experience as a teacher, he saw that students learned best the <strong>concepts</strong> of Machine Learning by learning it through Octave/Mathlab — since it shows most of the math under the hood. I feel like if he used Python — let’s say — people would be restricted to continue their path on ML only using Python. He then uses a language that is very simple and shows how things work, instead of importing a library that does all the dirty work for you.</p><p>The only thing that could be improved in the course is the audio. But the course is still doable anyways.</p><p>Hope you’ll love it too! I will continue my path in ML using the Python language. I feel very confident now to approach ML in the Python environment and will continue doing some more advanced courses to master it well.</p><p>As Andrew Ng says in the last video of the course, I hope we’ll be able to use ML in a way that will help you, me, and all the people in the world to have a better life.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c8d60a04c42" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>