<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Steve Gerrad</title>
    <description>The latest articles on DEV Community by Steve Gerrad (@stvgerrad).</description>
    <link>https://dev.to/stvgerrad</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F884683%2Fbfb66ee2-02c2-4947-8aeb-d3a396fdea43.png</url>
      <title>DEV Community: Steve Gerrad</title>
      <link>https://dev.to/stvgerrad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stvgerrad"/>
    <language>en</language>
    <item>
      <title>I started journey on Stack Overflow</title>
      <dc:creator>Steve Gerrad</dc:creator>
      <pubDate>Tue, 23 Aug 2022 05:18:14 +0000</pubDate>
      <link>https://dev.to/stvgerrad/i-started-journey-on-stack-overflow-4d4b</link>
      <guid>https://dev.to/stvgerrad/i-started-journey-on-stack-overflow-4d4b</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PYd_pfv9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9a87a8kp9t7bgjv8396.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PYd_pfv9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9a87a8kp9t7bgjv8396.png" alt="Image description" width="700" height="274"&gt;&lt;/a&gt;&lt;br&gt;
A few days ago, I joined &lt;a href="https://stackoverflow.com/users/19730236/steve-gerrad"&gt;Stack Overflow&lt;/a&gt;.&lt;br&gt;
Now, I already get &lt;strong&gt;6&lt;/strong&gt; badges (&lt;code&gt;Scholar&lt;/code&gt;, &lt;code&gt;Autobiographer&lt;/code&gt;, &lt;code&gt;Supporter&lt;/code&gt;, &lt;code&gt;Teacher&lt;/code&gt;, &lt;code&gt;Editor&lt;/code&gt;, &lt;code&gt;Informed&lt;/code&gt;) and earn about &lt;strong&gt;200&lt;/strong&gt; reputation. And also about &lt;strong&gt;400&lt;/strong&gt; people reached on my profile.&lt;/p&gt;

&lt;p&gt;I'm going to become top &lt;strong&gt;1 %&lt;/strong&gt; in few months. Please support me :)&lt;br&gt;
&lt;a href="https://stackoverflow.com/users/19730236/steve-gerrad"&gt;https://stackoverflow.com/users/19730236/steve-gerrad&lt;/a&gt;&lt;/p&gt;

</description>
      <category>intro</category>
    </item>
    <item>
      <title>Is ML powerful to predict lottery numbers on pancakeswap?</title>
      <dc:creator>Steve Gerrad</dc:creator>
      <pubDate>Wed, 13 Jul 2022 07:55:21 +0000</pubDate>
      <link>https://dev.to/stvgerrad/is-ml-powerful-to-predict-lottery-numbers-on-pancakeswap-2cn5</link>
      <guid>https://dev.to/stvgerrad/is-ml-powerful-to-predict-lottery-numbers-on-pancakeswap-2cn5</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--trIj-gFX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l2j3ho56qc8p65y7qyq7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--trIj-gFX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l2j3ho56qc8p65y7qyq7.png" alt="Image description" width="880" height="623"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Can I see the strength of ML, is it possible to predict pancakeswap lottery numbers using ML?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As a full stack blockchain developer, I have more than 5 years experience. So it's a piece of cake to fetch the lottery data.&lt;br&gt;
Here is the script I used for the fetching the history of pancakeswap lottery.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const ethers = require('ethers')
const reader = require('xlsx')
const abi = require('./abi.json') // Lottery
const mcAbi = require('./multicall.json')
const file = reader.readFile('./lottery.xlsx')

const address = "0x5aF6D33DE2ccEC94efb1bDF8f92Bd58085432d2c"
const mcAddress = "0xfF6FD90A470Aaa0c1B8A54681746b07AcdFedc9B"
const rpc = "https://bsc-dataseed.binance.org"
const provider = new ethers.providers.JsonRpcProvider(rpc)

const mcContract = new ethers.Contract(
    mcAddress,
    mcAbi,
    provider
)

const fetch = async () =&amp;gt; {
    const itf = new ethers.utils.Interface(abi);
    const calldata = [];

    for (let index = 1; index &amp;lt; 593; index++) {
        calldata.push({
            target: address.toLowerCase(),
            callData: itf.encodeFunctionData('viewLottery', [index])
        })
    }

    const { returnData } = await mcContract.aggregate(calldata)

    const res = returnData.map((call, i) =&amp;gt; {
        const result = itf.decodeFunctionResult('viewLottery', call)
        const finalNumber = result[0].finalNumber.toString();
        const date = new Date(Number(result[0].endTime.toString()) * 1000)

        return {
            timestamp: result[0].endTime.toString(),
            year: date.getFullYear(),
            month: date.getMonth() + 1,
            day: date.getDate(),
            hour: date.getHours(),
            minute: date.getMinutes(),
            second: date.getSeconds(),
            'number 1': finalNumber[6],
            'number 2': finalNumber[5],
            'number 3': finalNumber[4],
            'number 4': finalNumber[3],
            'number 5': finalNumber[2],
            'number 6': finalNumber[1]
        }
    })

    const ws = reader.utils.json_to_sheet(res);
    reader.utils.book_append_sheet(file, ws, "Sheet2")
    reader.writeFile(file, './lottery.xlsx')
}

fetch();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I was wondered that pancakeswap start the lottery every 12 ~ 36 hours and every prize pots are more than 70k.&lt;br&gt;
It means there are chances to earn 25k in every 2 days.&lt;br&gt;
Oh, what a surprise!!!&lt;/p&gt;

&lt;p&gt;I want to know the possibility of predict lottery numbers using ML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note that pancakeswap lottery uses Chainlink's implementation of VRF for secure randomness.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can find more details about the pancakeswap lottery here.&lt;br&gt;
&lt;a href="https://docs.pancakeswap.finance/products/lottery"&gt;https://docs.pancakeswap.finance/products/lottery&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>When the crypto winter finish?</title>
      <dc:creator>Steve Gerrad</dc:creator>
      <pubDate>Thu, 07 Jul 2022 09:39:19 +0000</pubDate>
      <link>https://dev.to/stvgerrad/when-the-crypto-winter-finish-4nd8</link>
      <guid>https://dev.to/stvgerrad/when-the-crypto-winter-finish-4nd8</guid>
      <description></description>
    </item>
    <item>
      <title>How hackers steal MetaMask seed? And how to protect it from their attack?</title>
      <dc:creator>Steve Gerrad</dc:creator>
      <pubDate>Tue, 05 Jul 2022 18:13:13 +0000</pubDate>
      <link>https://dev.to/stvgerrad/how-hackers-steal-metamask-seed-and-how-to-protect-it-from-their-attack-3nah</link>
      <guid>https://dev.to/stvgerrad/how-hackers-steal-metamask-seed-and-how-to-protect-it-from-their-attack-3nah</guid>
      <description></description>
      <category>discuss</category>
      <category>security</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
