<?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 Jeffer1981 on Medium]]></title>
        <description><![CDATA[Stories by Jeffer1981 on Medium]]></description>
        <link>https://medium.com/@johandecoster1980?source=rss-aaa776eca97d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*M6aJRJ4-sHdecDqJ</url>
            <title>Stories by Jeffer1981 on Medium</title>
            <link>https://medium.com/@johandecoster1980?source=rss-aaa776eca97d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 15:10:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johandecoster1980/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[I made an AI DnD dungeon master]]></title>
            <link>https://johandecoster1980.medium.com/i-made-an-ai-dnd-dungeon-master-27eba3e3a2d8?source=rss-aaa776eca97d------2</link>
            <guid isPermaLink="false">https://medium.com/p/27eba3e3a2d8</guid>
            <category><![CDATA[dnd]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[dungeons-and-dragons]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[openai]]></category>
            <dc:creator><![CDATA[Jeffer1981]]></dc:creator>
            <pubDate>Fri, 17 Nov 2023 14:49:22 GMT</pubDate>
            <atom:updated>2023-11-17T14:49:22.534Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hu7qvD5tnEQLh-f0Li2zHQ.png" /></figure><h3>Why would you make something like this?</h3><p>Well, my son loves to play Dungeons and Dragons. It’s a great game, as it uses a lot of his imagination, but it takes a lot of preparation in creating the characters and planning an exciting campaign.</p><p>Something AI could really help with, right?</p><h3>How did I design the game?</h3><p>I used ChatGPT from OpenAI as my AI engine and by just using the public ChatGPT website, it’s clear that ChatGPT can serve as a dungeon master, except for the fact that ChatGPT has issues keeping history. Depending on which version you use (GPT 3 or 4), the web app is limited to a (short) memory. The API will not keep even any history.</p><p>So the solution is to save the progress (characters and adventure progress) in a MongoDB database.</p><p>However, storing all details of the adventure and every time sending those to ChatGPT as context would 1) break the limit of what ChatGPT accepts as context and 2) make every request to the API quite expensive. So instead of storing all details, we first have ChatGPT summarize the progress and we save the summary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BH_KkC1OFrD60LCjbtXStQ.png" /></figure><h3>We even did something extra</h3><p>I’ve added some functionality to have Dall-E generate images when creating your main hero or the current scene, just make things a bit more visual. It does work, though I personally find the images (using Dall-E 2) a bit underwhelming and expensive. Dall-E 3 does give very nice results.</p><h3>Looking to try it out?</h3><p>You can do so here: <a href="https://dndmaster-e8ki26ip8-jeffer1980.vercel.app/">https://dndmaster-e8ki26ip8-jeffer1980.vercel.app/</a></p><p>How to play this game?</p><p>The home page is your main page where you interact with the game.</p><p>1. Fill out a value for game id. The game will save any character and progress in this value and this allows you to pick up the adventure later on.<br>2. Press load character. If you have a saved game under that game id, it will load the previously created character, If it’s a new game id, you will get the create character page (more on this later).<br>3. Play the game by typing something in the ‘Ask the dungeonmaster’ box and then press ‘send to dungeonmaster’. Then keep on responding to what the dungeonmaster tells you.</p><p>Tip: Your first command can be something like ‘Start a scary adventury in a graveyard!’, but feel free to try stuff out.</p><p>Creating a character page</p><p>Select your race and class and press on ‘create character’. <br>When you get the character, press ‘save character’ and then ‘go back’</p><p>Note: the ‘get image’ buttons are disabled. Normally they allow the user to generate through AI a picture of the hero or scene, but since I’m using dall-e 2 is way to expensive for quite poor results.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27eba3e3a2d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an NFT dApp: how to visualize an NFT (no shortcuts)]]></title>
            <link>https://johandecoster1980.medium.com/building-an-nft-dapp-how-to-visualize-an-nft-no-shortcuts-3dba94a502f3?source=rss-aaa776eca97d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dba94a502f3</guid>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Jeffer1981]]></dc:creator>
            <pubDate>Fri, 06 Jan 2023 15:34:58 GMT</pubDate>
            <atom:updated>2023-01-06T15:34:58.147Z</atom:updated>
            <content:encoded><![CDATA[<p>NFTs have a lot of potential use cases, like e.g. games and identification. One thing you will always need to do when you build an app that makes use of NFTs, is visualizing them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZPjbySGskq3cCzDABE5cQ.png" /></figure><p>There are a number of javascript libraries out there that offer almost off the shelf functions to display NFTs on your app, but you might run into their limitations later on, especially when trying to build more complex functionality.</p><p>So let’s check out how to display NFTs … without shortcuts.</p><h3>Step 1: having an NFT contract and Metamask</h3><p>In this article I’m assuming you have an ERC721 deployed to an EVM enabled blockchain like Ethereum or Polygon. I’m also assuming you have Metamask installed as Metamask will be used as our gateway to the blockchain.</p><p>One of the key characteristics of using ERC721 is that the following function is implemented:</p><pre>function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory)</pre><p>Calling tokenURI with a specified tokenId (the number of the NFT) will return you that NFTs metadata.</p><h3>Step 2: get an NFTs metadata</h3><p>So basically we need to call the tokenURI function from our frontend. This can be done by using Metamask and the ethers.js javascript library.</p><p>The advantage of using Metamask, or rather one of the advantages, is that you can also use it as a user identification platform.</p><p>To connect to a smart contract you need the following:</p><h4>The contract address and its ABI</h4><pre>const NFTcontract=&quot;INSERT CONTRACT ADDRESS&quot;;<br>const myabi=[{<br>    &quot;inputs&quot;: [<br>        {<br>            &quot;internalType&quot;: &quot;uint256&quot;,<br>            &quot;name&quot;: &quot;tokenId&quot;,<br>            &quot;type&quot;: &quot;uint256&quot;<br>        }<br>    ],<br>    &quot;name&quot;: &quot;tokenURI&quot;,<br>    &quot;outputs&quot;: [<br>        {<br>            &quot;internalType&quot;: &quot;string&quot;,<br>            &quot;name&quot;: &quot;&quot;,<br>            &quot;type&quot;: &quot;string&quot;<br>        }<br>    ],<br>    &quot;stateMutability&quot;: &quot;view&quot;,<br>    &quot;type&quot;: &quot;function&quot;<br>} ];</pre><p>The NFTcontract is just the address, the ABI is the contract interface definition. You can easily get it through e.g. remix.</p><h4>Establishing a link to the contract with Metamask</h4><pre>const {ethers} = require(&#39;ethers&#39;);<br>var provider;<br>var MyContract;<br><br>//Metamask injects the ethereum object in window<br>const accounts = await window.ethereum.send(&quot;eth_requestAccounts&quot;)<br>//Get the current active address<br>const address = accounts.result[0];<br>//Link to the blockchain and the chosen address<br>provider = new ethers.providers.Web3Provider(window.ethereum);<br>MyContract = new ethers.Contract(NFTcontract, myabi, provider);<br><br>   </pre><p>Note that the blockchain to which you try to connect, is determined by the active blockchain in Metamask. E.g. if your Metamask is connected to Goerli testnet, this setup will look for the contract on the Goerli testnet.</p><h4>Request the metadata for an NFT</h4><pre>var myNFT;<br>myNFT = await MyContract.tokenURI(1);</pre><p>This will fetch the metadata for the first NFT in the contract. The data returned will look like this:</p><pre>data:application/json;base64,eyJuYW1lIjoiWW9zaGkiLCAiZGVzY3JpcHRpb24iOiJTdHJlZXRmaWdodGVycyEiLCJpbWFnZSI6ICJodHRwczovL2dhdGV3YXkucGluYXRhLmNsb3VkL2lwZnMvUW1RTk5NVHUzTlNqMVl5WEJGWmozR2dNNGk0N3ZKc01RdWI3TFcyb1U5NlcxQSIsICJhdHRyaWJ1dGVzIjogW3sidHJhaXRfdHlwZSI6ICJTdHJlbmd0aCIsInZhbHVlIjoiMiJ9LHsidHJhaXRfdHlwZSI6ICJTdGFtaW5hIiwidmFsdWUiOiI1In0seyJ0cmFpdF90eXBlIjogIlRlY2huaXF1ZSIsInZhbHVlIjoiMiJ9LHsidHJhaXRfdHlwZSI6ICJUb3VnaG5lc3MiLCJ2YWx1ZSI6IjIifV19</pre><p>Not really readable or usable, is it? So let’s transform it to a JSON.</p><pre>after_ = myNFT.substring(myNFT.indexOf(&#39;,&#39;) + 1);<br>buff = new Buffer(after_, &#39;base64&#39;);<br>      <br>var myNFTjson = JSON.parse(buff.toString());</pre><p>This will return a JSON file like this:</p><pre>{&quot;name&quot;:&quot;Yoshi&quot;, &quot;description&quot;:&quot;Streetfighters!&quot;,&quot;image&quot;: &quot;https://gateway.pinata.cloud/ipfs/QmQNNMTu3NSj1YyXBFZj3GgM4i47vJsMQub7LW2oU96W1A&quot;, &quot;attributes&quot;: [{&quot;trait_type&quot;: &quot;Strength&quot;,&quot;value&quot;:&quot;2&quot;},{&quot;trait_type&quot;: &quot;Stamina&quot;,&quot;value&quot;:&quot;5&quot;},{&quot;trait_type&quot;: &quot;Technique&quot;,&quot;value&quot;:&quot;2&quot;},{&quot;trait_type&quot;: &quot;Toughness&quot;,&quot;value&quot;:&quot;2&quot;}]}</pre><p>Ah, perfect! A nicely readable and usable JSON! An ERC721 contract needs to follow certain metadata standards (see <a href="https://docs.opensea.io/docs/metadata-standards">here</a>), giving you some standard and some optional info:</p><ul><li>Name</li><li>Description</li><li>Link to the image</li><li>Attributes</li></ul><p>Now you can use the info from the JSON in your front end rendering. E.g. using tailwindcss:</p><pre>&lt;img className=&quot;rounded-t-lg mx-auto max-w-xs object-scale-down h-20 w-20&quot; src={myNFTjson.image} alt=&quot;&quot; /&gt;<br>&lt;div className=&quot;p-5&quot;&gt;<br>                <br>    &lt;h5 className=&quot;mb-2 text-center text-xl font-bold tracking-tight text-gray-900 dark:text-white&quot;&gt;{myNFTjson.name}&lt;/h5&gt;<br><br> &lt;/div&gt;</pre><p>This will result in something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/238/1*fd-PgN8NJ8oLv27NQdPrrA.png" /></figure><h3>Conclusion</h3><p>I hoped you enjoyed this short walkthrough. Visualing an NFT in your front end is the first step in building your dApp. Now you can expand the front end to e.g. an NFT marketplace, an NFT game,…</p><p>Let me know in the comments if you have additional questions or remarks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dba94a502f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developing Dynamic NFTs]]></title>
            <link>https://medium.com/better-programming/developing-dynamic-nfts-9fb5dc9520e9?source=rss-aaa776eca97d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fb5dc9520e9</guid>
            <category><![CDATA[chain-link]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Jeffer1981]]></dc:creator>
            <pubDate>Thu, 16 Jun 2022 06:49:43 GMT</pubDate>
            <atom:updated>2022-08-05T15:47:35.794Z</atom:updated>
            <content:encoded><![CDATA[<h4>Ever wanted to create an NFT that reacts to real-world events and data? Now you can, with Chain Link Oracles. Let’s check out how this can be done!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rVfQFknUlNC3p-J6" /><figcaption>Photo by <a href="https://unsplash.com/@dengxiangs?utm_source=medium&amp;utm_medium=referral">Choong Deng Xiang</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Remark: unfortunately Chain Link Oracle is only set up on the Kovan testnet, while the OpenSea testnet is on Rinkeby. So developing and testing everything was done on over two networks, which was not ideal.</p><h3><strong>What’s a Chain Link Oracle?</strong></h3><p>The first generation of NFTs, like BAYC, CryptoPunks,… are in essence static. Their image and metadata are usually just stored in static files on eg IPFS or a (cloud) server. Some level of change in the NFT was sometimes developed by the ability to switch the NFT from one set of static files to another set.</p><p><a href="https://docs.chain.link/docs/request-and-receive-data/">Chain Link Oracles</a> provide a utility where you can interface from your Ethereum smart contract with any API. That’s very cool, it means you can get any data that are being offered through an API to your smart contract, and you can find APIs on just about anything: stock prices, sports data, weather,…</p><h3><strong>On-chain metadata</strong></h3><p>The second change we need to make is that our NFTs metadata can be dynamic. So instead of storing the metadata in an off-chain JSON file, we will now generate the metadata onchain.</p><h4><strong>Step 1: using the Chain Link Oracle</strong></h4><p>In this example, we will be retrieving the temperature of a city through an API from <a href="http://weatherapi.com/">WeatherAPI.com</a>.</p><p>Let’s see some code:</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.7;</pre><pre>import &quot;<a href="http://twitter.com/openzeppelin/contracts">@openzeppelin/contracts</a>/token/ERC721/ERC721.sol&quot;;<br>import &#39;<a href="http://twitter.com/chainlink/contracts">@chainlink/contracts</a>/src/v0.8/ChainlinkClient.sol&#39;;<br>import &#39;<a href="http://twitter.com/chainlink/contracts">@chainlink/contracts</a>/src/v0.8/ConfirmedOwner.sol&#39;;<br>import &quot;./Base64.sol&quot;;<br>import &quot;<a href="http://twitter.com/openzeppelin/contracts">@openzeppelin/contracts</a>/access/Ownable.sol&quot;;<br>import &quot;<a href="http://twitter.com/openzeppelin/contracts">@openzeppelin/contracts</a>/utils/Counters.sol&quot;;<br>import &quot;<a href="http://twitter.com/openzeppelin/contracts">@openzeppelin/contracts</a>/utils/Strings.sol&quot;;</pre><pre>contract DynamicNFT is ERC721, ChainlinkClient, Ownable {<br>    using Chainlink for Chainlink.Request;<br>    using Counters for Counters.Counter;</pre><pre>uint256 public temperature;<br>    bytes32 private jobId;<br>    uint256 private fee;<br>    Counters.Counter private _tokenIdCounter;<br>    bool public paused = false;</pre><pre>event RequestTemperature(bytes32 indexed requestId, uint256 temperature);</pre><pre>/**<br>     * <a href="http://twitter.com/notice">@notice</a> Initialize the link token and target oracle<br>     *<br>     * Kovan Testnet details:<br>     * Link Token: 0xa36085F69e2889c224210F603D836748e7dC0088<br>     * Oracle: 0x74EcC8Bdeb76F2C6760eD2dc8A46ca5e581fA656 (Chainlink DevRel)<br>     * jobId: ca98366cc7314957b8c012c72f05aeeb<br>     *<br>     */<br>    constructor() ERC721(&quot;Dynamic NFT&quot;, &quot;DNFT&quot;) {<br>        setChainlinkToken(0xa36085F69e2889c224210F603D836748e7dC0088);<br>        setChainlinkOracle(0x74EcC8Bdeb76F2C6760eD2dc8A46ca5e581fA656);<br>        jobId = &#39;ca98366cc7314957b8c012c72f05aeeb&#39;;<br>        fee = (1 * LINK_DIVISIBILITY) / 10; // 0,1 * 10**18 (Varies by network and job)<br>        temperature=0;<br>    }</pre><pre>function buildMetadata(uint256 _tokenId)<br>        private<br>        view<br>        returns (string memory)<br>    {<br>        return<br>            string(<br>                abi.encodePacked(<br>                    &quot;data:application/json;base64,&quot;,<br>                    Base64.encode(<br>                        bytes(<br>                            abi.encodePacked(<br>                                &#39;{&quot;name&quot;:&quot;Dynamic NFT&quot;, &quot;description&quot;:&quot;Dynamic NFT Test&quot;,&quot;image&quot;: &quot;<a href="https://gateway.pinata.cloud/ipfs/QmeAKDXvQyGUdvwRSvazCyj4CYeN6qrcpQr4Lmgf7Cc2UC">https://gateway.pinata.cloud/ipfs/QmeAKDXvQyGUdvwRSvazCyj4CYeN6qrcpQr4Lmgf7Cc2UC</a>&quot;, &quot;attributes&quot;: &#39;,<br>                                &quot;[&quot;,<br>                                &#39;{&quot;trait_type&quot;: &quot;Temperature&quot;,&#39;,<br>                                &#39;&quot;value&quot;:&quot;&#39;,<br>                                Strings.toString(temperature),<br>                                &#39;&quot;}&#39;,<br>                                &quot;]&quot;,<br>                                &quot;}&quot;<br>                            )<br>                        )<br>                    )<br>                )<br>            );<br>    }</pre><pre>function requestTempData() public returns (bytes32 requestId) {<br>        Chainlink.Request memory req = buildChainlinkRequest(jobId, address(this), this.fulfill.selector);</pre><pre>// Set the URL to perform the GET request on<br>        req.add(&#39;get&#39;, &#39;<a href="http://api.weatherapi.com/v1/current.json?q=Aartselaar&amp;Key=30e737e440484fd18a5134039221006&#39;">http://api.weatherapi.com/v1/current.json?q=Aartselaar&amp;Key=30e737e440484fd18a5134039221006&#39;</a>);</pre><pre>req.add(&#39;path&#39;, &#39;current,temp_c&#39;); <br>        // Multiply the result by 1000000000000000000 to remove decimals<br>        int256 timesAmount = 10;<br>        req.addInt(&#39;times&#39;, timesAmount);</pre><pre>// Sends the request<br>        return sendChainlinkRequest(req, fee);<br>    }</pre><pre>/**<br>     * Receive the response in the form of uint256<br>     */<br>    function fulfill(bytes32 _requestId, uint256 _temperature) public recordChainlinkFulfillment(_requestId) {<br>        emit RequestTemperature(_requestId, _temperature);<br>        temperature = _temperature;<br>    }</pre><pre>/**<br>     * Allow withdraw of Link tokens from the contract<br>     */<br>    function withdrawLink() public onlyOwner {<br>        LinkTokenInterface link = LinkTokenInterface(chainlinkTokenAddress());<br>        require(link.transfer(msg.sender, link.balanceOf(address(this))), &#39;Unable to transfer&#39;);<br>    }</pre><pre>//ERC721 functions<br>    function safeMint(uint minttimes) external payable {<br>  <br>  require(!paused);<br>     <br>        for(uint i=0;i&lt;minttimes;i++){<br>   _safeMint(msg.sender, _tokenIdCounter.current()); <br>   _tokenIdCounter.increment();<br>     <br>  }          <br>   <br>  <br> }</pre><pre>function tokenURI(uint256 tokenId)<br>    public<br>    view<br>    virtual<br>    override(ERC721)<br>    returns (string memory)<br> {<br>  require(<br>  _exists(tokenId),<br>  &quot;ERC721Metadata: URI query for nonexistent token&quot;<br>  );<br>  <br>        return buildMetadata(tokenId);<br> }<br> <br> //Return current counter value<br> function getCounter()<br>        <br>  external<br>        view<br>        returns (uint256)<br>    {<br>        return _tokenIdCounter.current();<br>    }</pre><pre>function setTemp(uint256 newTemp) external{<br>        temperature = newTemp;<br>    }<br>}</pre><p>First of all, we need to import the Chain Link client library and create our contract using this library.</p><p>Let’s look at the constructor:</p><pre>constructor() ERC721(“Dynamic NFT”, “DNFT”) {</pre><pre>setChainlinkToken(0xa36085F69e2889c224210F603D836748e7dC0088);</pre><pre>setChainlinkOracle(0x74EcC8Bdeb76F2C6760eD2dc8A46ca5e581fA656);</pre><pre>jobId = ‘ca98366cc7314957b8c012c72f05aeeb’;</pre><pre>fee = (1 * LINK_DIVISIBILITY) / 10; // 0,1 * 10**18 (Varies by network and job)</pre><pre>}</pre><p>Setting these variables (setChainlinkToken, setChainlinkOracle and jobid) links our contract with the Chain Link Oracle on Kovan.</p><p>The fee for using Oracle is 0.1 LINK per API call. So you’ll need to make sure your contract is always funded with enough LINK to make the expected number of API calls!</p><p>Two functions are defined to use the Oracle: requestTempData and fulfill.</p><pre>function requestTempData() public returns (bytes32 requestId) {</pre><pre>Chainlink.Request memory req = buildChainlinkRequest(jobId, address(this), this.fulfill.selector);</pre><pre>// Set the URL to perform the GET request on</pre><pre>req.add(‘get’, ‘http://api.weatherapi.com/v1/current.json?q=Aartselaar&amp;Key=30e737e440484fd18a5134039221006&#39;);</pre><pre>req.add(‘path’, ‘current,temp_c’);</pre><pre>// Multiply the result by 1000000000000000000 to remove decimals</pre><pre>int256 timesAmount = 10;</pre><pre>req.addInt(‘times’, timesAmount);</pre><pre>// Sends the request</pre><pre>return sendChainlinkRequest(req, fee);</pre><pre>}</pre><p>requestTempData builds the API request (get) and specifies which data from the JSON answer it will fetch (path). As we’re expecting an integer and the temperature is retrieved with one decimal, we multiply the answer by 10. Finally, the API call is made while paying the LINK fee.</p><p>Fulfill retrieves the API answer and stores it in the local temperature variable:</p><pre>function fulfill(bytes32 _requestId, uint256 _temperature) public recordChainlinkFulfillment(_requestId) {</pre><pre>emit RequestTemperature(_requestId, _temperature);</pre><pre>temperature = _temperature;</pre><pre>}</pre><p>Let’s try it out on Kovan:</p><p>Before the API call:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/223/1*vpXmNMLugf2VvzKgLJxeqQ.png" /></figure><p>After executing the API call:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/195/1*60yAMW0wLdCnygEVmog9Fg.png" /></figure><p>It actually is about 21C here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*qQvJhP6NA2hPEize_4Q2-w.png" /></figure><h4><strong>Step 2: NFT with on chain metadata</strong></h4><p>Making the NFT dynamic means we have to build the metadata on chain with the variables we get from the API. We do this by calling the following function in the tokenURI function:</p><p>function buildMetadata(uint256 _tokenId)</p><pre>function buildMetadata(uint256 _tokenId)<br>        private<br>        view<br>        returns (string memory)<br>    {<br>        return<br>            string(<br>                abi.encodePacked(<br>                    &quot;data:application/json;base64,&quot;,<br>                    Base64.encode(<br>                        bytes(<br>                            abi.encodePacked(<br>                                &#39;{&quot;name&quot;:&quot;Dynamic NFT&quot;, &quot;description&quot;:&quot;Dynamic NFT Test&quot;,&quot;image&quot;: &quot;<a href="https://gateway.pinata.cloud/ipfs/QmeAKDXvQyGUdvwRSvazCyj4CYeN6qrcpQr4Lmgf7Cc2UC">https://gateway.pinata.cloud/ipfs/QmeAKDXvQyGUdvwRSvazCyj4CYeN6qrcpQr4Lmgf7Cc2UC</a>&quot;, &quot;attributes&quot;: &#39;,<br>                                &quot;[&quot;,<br>                                &#39;{&quot;trait_type&quot;: &quot;Temperature&quot;,&#39;,<br>                                &#39;&quot;value&quot;:&quot;&#39;,<br>                                Strings.toString(temperature),<br>                                &#39;&quot;}&#39;,<br>                                &quot;]&quot;,<br>                                &quot;}&quot;<br>                            )<br>                        )<br>                    )<br>                )<br>            );<br>    }</pre><p>So let’s test this on Rinkeby:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*ovLg1ozfRaR39TiWlsTo1w.png" /></figure><p>After minting, before the API call, the value is initialized to 0. Now we run the API call and check the value again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*jJAKnMt9E7El6YvgJVOUWg.png" /></figure><p>Value is updated to the local temperature! Nice!</p><h3><strong>Conclusion</strong></h3><p>As shown, you can make your NFT dynamic by using the Chain Link Oracle external API call to get data and by generating your metadata on the chain.</p><p>Drawbacks are that every API call costs LINK and thus money and that dynamic contracts are more complex and thus cost more gas. No free lunch sadly. Really annoying that the Chain Link tools are available on Kovan for testing, but Opensea is on Rinkeby.</p><p>Chain Link also offers smart contract automation tools, so you could automate the API calls as well.</p><p>I hope you enjoyed this article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fb5dc9520e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/developing-dynamic-nfts-9fb5dc9520e9">Developing Dynamic NFTs</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating NFT’s for dummies]]></title>
            <link>https://medium.com/coinmonks/creating-nfts-for-dummies-65ec0b7d0e79?source=rss-aaa776eca97d------2</link>
            <guid isPermaLink="false">https://medium.com/p/65ec0b7d0e79</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Jeffer1981]]></dc:creator>
            <pubDate>Mon, 04 Oct 2021 18:56:06 GMT</pubDate>
            <atom:updated>2021-10-23T15:43:31.334Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m currently developing a crypto game and one of the first steps, is to create characters, or a way were players can create characters. Well, unique objects with a list of characteristics, that’s the definition of an NFT! So let’s see how we can create an NFT and trust me, if I can do this, you can too!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*Grds2Mxo5_-DbAbbc2HO_w.png" /></figure><h4>What do I need or need to know beforehand?</h4><ul><li>You need a wallet. There are a number of option, but I use Metamask.</li><li>Some understanding of solidity helps. You can find a bunch of tutorials <a href="https://ethereum.org/en/developers/tutorials/">here</a></li><li>You need some eth.</li></ul><p>Luckily, as long as we’re playing around on one of Ethereum’s test networks, you can get free eth at one of the faucets. For NFT’s, I recommend to use the Rinkeby test net, as e.g. OpenSea, the largest NFT marketplace, also has it’s test site on rinkeby. This will come in handy later on.</p><p>You can get free eth for Rinkeby <a href="https://faucet.rinkeby.io/">here</a>, but be aware that you need to post your wallet address on social media, like twitter and enter the post link in the faucet.</p><h4>Our working example</h4><p>As an example I’m going to make an NFT of an MMA fighter. The fighter will have:</p><ul><li>a name (duh!)</li><li>description: a free text field.</li><li>Image</li><li>Record: current pro record</li><li>Fighting style</li></ul><p>In an actual game, the list of characteristics will of course be much longer. Think about height, weight, age, stats on standup and ground abilities,…</p><h4>Onchain vs Offchain</h4><p>As a first step we need to determine which data to store onchain (so on Ethereum) and offchain (so, not on Ethereum). The choice on how you store your offchain data also influences how you go about this.</p><p>Storing data on the Ethereum blockchain is expensive, so you want to limit this as much as possible, especially for more sizable data like images and video.</p><p>You can store your offchain data on a server (e.g Google or AWS) and just refer this data through an URL that you put onchain when you mint your NFT.</p><p>Advantage:</p><ul><li>you can change your data inexpensively. E.g. say your game character upgrades, it’s easy to change character stats</li></ul><p>Disadvantages:</p><ul><li>You need to maintain the server. And you’re in trouble when the server host decides to stop the server.</li><li>You can change the data! Which means your users are not sure you aren’t altering their NFT. This actually happened by the way: an artist changes the image, stored on a server, to another image so he could sell the first image again.</li></ul><p>The solution: InterPlanetary File System or IPFS. An IPFS allows you to cheaply store offchain data while making sure you cannot alter the data. An example of IPFS is Pinata. The disadvantage is that you cannot alter any data. It’s basically a catch 22.</p><p>A lot of NFT’s use IPFS and that’s what we will be using too.</p><h4>The Smart Contract</h4><p>We’re shamelessly gonna stand on the shoulders of giants and use Openzeppeling’s contract wizard. You can find it <a href="https://docs.openzeppelin.com/contracts/4.x/wizard">here</a>.</p><p>We’re using the following configuration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*14S5VhPUsdnODvkI5fDarg.png" /></figure><p>ERC721 is the Ethereum standard for NFT contracts. Quite important if you want your NFT’s to integrate on Opensea.</p><p>URIStorage means we can link our IPFS to our NFT.</p><h4>The Mint function ain’t cutting yet</h4><p>The mint function, in this case safeMint, is not yet what we want. It’s not setting the tokenURI. The tokenURI is our link to the IPFS.</p><p>Let’s change it to:</p><pre>function safeMint(address to, uint256 tokenId, string memory tokenURI_) public onlyOwner {<br>        _safeMint(to, tokenId);<br>  _setTokenURI(tokenId, tokenURI_);<br>    }</pre><p>_setTokenURI is a function we’re inheriting from ERC721URIstorage contract. That’s why we’re building our contract on OpenZeppelin’s contracts, so we don’t have to write these common function ourselves.</p><h4>Deploy!</h4><p>Now we’re going to compile our contract using remix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ePqymRQ9mXYKak6A-s4-Ww.png" /></figure><p>Then we deploy the compiled contract.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c70PMhrnd8IwMp8re3zXcQ.png" /></figure><p>Using the injected Web3 means metamask will be used.</p><h4>IPFS</h4><p>So what exactly do we store on IPFS?</p><p>First we upload an image for our MMA fighter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/0*m5MhME76SQv-HkgN" /><figcaption>The Dragon</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jAdRTpyC8OEcDA8Q9H1JLQ.png" /></figure><p>Uploading the image will add an URI to the uploaded image.</p><p>Now we add the JSON:</p><pre>{<br>  &quot;attributes&quot;: [<br>    {<br>      &quot;trait_type&quot;: &quot;Style&quot;,<br>      &quot;value&quot;: &quot;Karate&quot;<br>    },<br>    {<br>      &quot;trait_type&quot;: &quot;Record&quot;,<br>      &quot;value&quot;: &quot;26-11-0&quot;<br>    }<br>  ],<br>  &quot;description&quot;: &quot;Lyoto Machida&quot;,<br>  &quot;image&quot;: &quot;<a href="https://gateway.pinata.cloud/ipfs/QmT3dnMwLkVLxTj9n9DKdh5an26LXo8rZU6aXGJ26CzJ1w">https://gateway.pinata.cloud/ipfs/QmT3dnMwLkVLxTj9n9DKdh5an26LXo8rZU6aXGJ26CzJ1w</a>&quot;,<br>  &quot;name&quot;: &quot;Lyoto Machida&quot;<br>}</pre><p>So in the JSON we have:</p><ul><li>the name</li><li>description</li><li>image with link to the URI of the uploaded image</li><li>Our extra attributes Style and Record.</li></ul><p>We now also upload the JSON to Pinata:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eA_1vj2bf65zmgVtGBbyJw.png" /></figure><h4>Now mint the NFT!</h4><p>Now we have everything ready to mint our MMA character! I’m going to use the remix UI to keep things simple:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*OgC9hvy7djG9bUcjA5JhoA.png" /></figure><p>Here you add the recipients address (e.g your metamask wallet), an ID for the token (e.g. 1) and the IPFS URI of the JSON file(see above). Then press safeMint.</p><h4>Did it work?</h4><p>An easy way to check if it worked, is to go to the OpenSea test site <a href="https://testnets.opensea.io/">here</a>.</p><p>Log in with your metamask and normally you immediately see your NFT :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2O6ta-k2KcsdRg-CJVR2g.png" /></figure><p>Including the attributes we’ve set when minting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*czW134qaiwPcST_xIs7bVA.png" /></figure><h4>The End</h4><p>I hope you’ve enjoyed this article and you succeeded in creating your very own NFT!</p><blockquote>Join Coinmonks <a href="https://t.me/coincodecap">Telegram Channel</a> and <a href="https://www.youtube.com/c/coinmonks/videos">Youtube Channel</a> learn about crypto trading and investing</blockquote><h4>Also Read</h4><ul><li><a href="https://blog.coincodecap.com/crypto-exchange">Best Crypto Exchange | Top 10 cryptocurrency exchanges 2022 | CoinCodeCap</a></li><li><a href="https://blog.coincodecap.com/crypto-lending">10 Best Crypto Lending Platforms 2022 | CoinCodeCap</a></li><li><a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">10 Best FREE Crypto Trading Bots in 2023</a></li><li><a href="https://medium.com/coinmonks/best-crypto-signals-telegram-5785cdbc4b2b">5 Best Crypto Telegram Channels 2024 (Trading Signals)</a></li><li><a href="https://blog.coincodecap.com/blockfi-review">BlockFi Review 2021: Pros, Cons and Interest Rates | CoinCodeCap</a></li><li><a href="https://medium.com/coinmonks/buy-bitcoin-in-india-feb50ddfef94">Top 6 Crypto Trading Apps in India — Best Exchanges</a></li><li><a href="https://medium.com/coinmonks/best-crypto-tax-tool-for-my-money-72d4b430816b">10 Best FREE Crypto Tax Software in 2024</a></li><li><a href="https://blog.coincodecap.com/best-hardware-wallet-bitcoin">Best Crypto Hardware Wallets to Store Bitcoin [2021] | CoinCodeCap</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65ec0b7d0e79" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/creating-nfts-for-dummies-65ec0b7d0e79">Creating NFT’s for dummies</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[So you want to build a Dapp]]></title>
            <link>https://johandecoster1980.medium.com/so-you-want-to-build-a-dapp-43edaef2f318?source=rss-aaa776eca97d------2</link>
            <guid isPermaLink="false">https://medium.com/p/43edaef2f318</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[dapps]]></category>
            <dc:creator><![CDATA[Jeffer1981]]></dc:creator>
            <pubDate>Fri, 06 Aug 2021 12:40:07 GMT</pubDate>
            <atom:updated>2021-08-06T12:40:07.291Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pOyzJ7yr3TAVc-vbB-4L6w.jpeg" /></figure><p>This article is the first article in a series where I want to provide some guidance on how to start creating your own Dapp.</p><p>If you’re reading this article, I’m going to assume you’re interested in blockchain, cryptocurrencies and Dapps.</p><p>Dapps (or Decentralized apps) are basically apps that use blockchain technology. Some famous and successful examples:</p><ul><li>Uniswap: the biggest (at least at the time of writing) decentralized cryptoexchange (or DEX)</li><li>Cryptokitties: the first example of NFT (non-fungible tokens).</li></ul><h3>What do you need to start out?</h3><p>Let’s go over the basics.</p><h4>A Dapp idea</h4><p>First of all, like with any app, you need a good idea for the purpose of your Dapp. This is quite obvious, but with a Dapp, you need to ask yourself if building your app on a blockchain truly adds value to your application vs building it like a more traditional app.</p><p>Advantages of using a blockchain:</p><ul><li>Trust &amp; transparency: your smart contract and data can be viewed and audited by anyone. This is a plus for any application that requires trust and transparency. E.g. proof of ownership.</li><li>Security: a blockchain line Ethereum is so big and distributed, it is very unlikely your data will be lost or corrupted by an attack</li><li>Ownership: something in your wallet, stays in your wallet (as long as you’re not hacked of course). Some applications or games have players investing huge amounts for buying items/weapons/…, only to discover later on that the game creators can alter their precious items at will. Not so with blockchain.</li></ul><p>Disadvantages of using a blockchain:</p><ul><li>Speed: transactions on a blockchain are slow. This varies from which chain you choose.</li><li>Cost: transactions on a blockchain are expensive. Again, this varies chain by chain.</li><li>Ownership / oversight: for some applications having no central app authority can be a negative. E.g. social media without oversight can devolve with e.g fake news, child pornography,…</li></ul><p>To summarize: only go for a dapp if using a blockchain adds value to your app, not because using a blockchain is trendy.</p><h4>Choose your technology stack</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CSOIuD0M1wGcsB9X" /></figure><p>Once you have a dapp idea, you need to choose on which technology stack you will develop the dapp.</p><p>To be brief, you will need to choose the tech for 3 layers:</p><ul><li>Front End : the UI or User Interface</li><li>Back End</li><li>Blockchain</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ITx8yARnlLuF24dPdqlKA.png" /></figure><p>Each technology option will have it’s advantages and drawbacks. Going with popular platforms will offer you the benefit of being well, or at least more, documented and having bigger communities. New tech might give you unique features.</p><p><strong>Example</strong></p><p>A popular tech choice (and one I have taken myself) is:</p><ul><li>Front End: <a href="https://reactjs.org/">React JS</a></li><li>Back End: <a href="https://www.djangoproject.com/">Django Python</a></li><li>Blockchain: <a href="https://ethereum.org/en/">Ethereum</a></li></ul><p>All of the technologies above are well documented and have huge user communities.</p><h4>Ethereum</h4><p>Ethereum is, at the moment of writing, by far the most popular smart contract blockchain platform. Smart contracts on Ethereumare programmed in Ethereum’s language, Solidity.</p><p>One of the most important design decisions will be what to put on chain and what not.</p><p>E.g. remember that on chain functions are expensive. This is quite literal: you need to pay for each transaction on the blockchain (reading data is free). This cost rises with the amount of data in the transaction. That’s why e.g. images, video etc are seldom stored on the blockchain itself.</p><p>Choosing ethereum has the benefit that ethereum has very handy web3 libraries for integrating with e.g python and JavaScript.</p><h3>Sample project</h3><p>In my next articles we’ll run through a sample project: setting up a NFT creation website. We’ll run through:</p><ul><li>creating a smart contract</li><li>creating a web interface</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43edaef2f318" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated catfishing: a dating site chat bot]]></title>
            <link>https://johandecoster1980.medium.com/automated-catfishing-a-dating-site-chat-bot-3c79866c4b8c?source=rss-aaa776eca97d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c79866c4b8c</guid>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Jeffer1981]]></dc:creator>
            <pubDate>Wed, 28 Jul 2021 10:46:37 GMT</pubDate>
            <atom:updated>2021-07-28T10:46:37.507Z</atom:updated>
            <content:encoded><![CDATA[<p>Ok, title is a little weird, but I’m quite interested in all things AI and chatbots. The challenge I made for myself was easy: how long can a bot keep a normal everyday conversation going before the other party realizes he or she is talking to a bot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*R0ldf-MXO7-UyhSU" /></figure><h3>Why a dating site chat bot?</h3><p>Because for this challenge I needed a large pool of actual people willing to chat. Dating sites provide this.</p><p>Is this unethical? In a sense it is, as I was tricking people into thinking they were talking to actual potential love interests. However, I never promised anything, sold anything etcetera. I just made light conversation. And in the end the bot always let the other party know that they were talking to a bot.</p><h3>Basic setup: the bot</h3><p>I’ve set up the bot in Python with Selenium. Selenium allows you to simulate a real user through Chromium, which is a headerless version of Google Chrome.</p><p>By using selenium, I could automate signing on to the dating site and reading and replying to messages, or even browsing profiles and initiating conversations. However, this process is site dependent. As every dating site is structured differently, with different HTML tags, you will need to custom write this part for every site you try out.</p><blockquote>from selenium import webdriver</blockquote><blockquote>driver = webdriver.Chrome(executable_path=EXE_PATH)<br>driver.get(url)</blockquote><p>Of course, you also need to create a profile on each site. As the number of men on dating sites outweigh the number of women, you’ll get a lot more traction when creating a female profile. And create one that is not obviously fake, like using a supermodel’s picture.</p><h3>Baseline strategy</h3><p>My baseline strategy was pretty easy: just ask random small talk questions: how was your day? Any fun plan for the weekend? Favorite country?</p><p>In this strategy I do no reply to any questions the other party asks, I just ask my next random question.</p><p>I do take care of the following rules, as they are a dead giveaway for being a bot:</p><ul><li>Do not ask the same question twice.</li><li>Only ask a new question when the other party has replied.</li><li>Do not reply immediately when the other party replies.</li><li>Try to include the other party’s name in the greeting. the name can be scraped from the user’s profile.</li></ul><h3>Chatterbot strategy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hORac3WKCZ-1dDYU.png" /></figure><p>Python has an AI chatbot library, called chatterbot. It’s pretty easy to set up:</p><ul><li>Initiate your chatterbot model</li><li>Train the model</li><li>Use the model to reply to questions.</li></ul><p>As with all AI applications, the key is in training the model. And to be able to do this, you need a file with questions and answers. The bigger this file, the better. You can find some training files online, especially in English.</p><p>The issue is that most chatbots are very context specific: every niche has it’s own lingo and so does the online dating world. So you will definitely need to supplement your training data with dating specific training data.</p><h3>The result</h3><p>I got the best results, by far, with the baseline strategy, much more than I anticipated.</p><p>The chatterbot did not hold up. If it gets a question that’s very close to one in its training data, it’s able to somewhat answer the question. Unfortunately, people do not write clean or standard English online: lots of abbreviations, certain lingo, typo’s, etc. Chatterbot was not able to deal with this, unless I would have vastly expanded the training data set.</p><p>On the other hand, the baseline strategy really held its own. I limited the bot to max 5 questions before the bot revealed itself and it often got to 5 questions without being detected as a bot.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c79866c4b8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build a Uniswap bot in python]]></title>
            <link>https://johandecoster1980.medium.com/how-to-build-a-uniswap-bot-in-python-ea1fe4eb1672?source=rss-aaa776eca97d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea1fe4eb1672</guid>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[uniswap]]></category>
            <dc:creator><![CDATA[Jeffer1981]]></dc:creator>
            <pubDate>Tue, 13 Apr 2021 16:51:06 GMT</pubDate>
            <atom:updated>2021-04-13T16:51:06.838Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*ODOT6gwpjSiMRy6E.jpg" /></figure><p>DeFi is all the rage these days in the crypto world and for good reason. Arguably the current king of DeFI platforms is Uniswap, with at the time of writing close to 2 million users.</p><p>Using Uniswap is super easy. Connect your MetaMask and you’re basically good to go to start trading. Uniswap conveniently also offers an API and SDK so you can build your own trading bot. So let’s get you started with setting one up in Python.</p><p><strong>Prerequisites in Python</strong></p><p>Obviously you need to have Python installed. The Uniswap SDK is actually designed for JavaScripts, but luckily other smart people have already made python libraries for Uniswap functions. You can find one here: <a href="https://pypi.org/project/uniswap-python/">https://pypi.org/project/uniswap-python/</a></p><p><strong>Prerequisites on blockchain</strong></p><p>When you interact with the Ethereum blockchain, upon which Uniswap is built, you need a wallet to pay for any transactions you want to make. One of the most straightforward ways is to create a MetaMask wallet and copy the address and private key into 2 variables. And of course put some ETH in the wallet as well to actually fund your transactions.</p><p>Do note that you can test your bot on the Ethereum test networks ropsten and rinkeby, with free ether from a faucet.</p><p>You also need access to a full Ethereum node. Theoretically you can set one up on your PC like in the old days, but Ethereum is currently a huge database and this will take up 100s of GB of hard disk space.</p><p>It’s much easier to use Infura. Create a free account and voila, you have access to Ethereum. Store the infura access link in a variable as well.</p><p><strong>Step 1: Connect to uniswap</strong></p><p>Remember the python uniswap library mentioned above?</p><pre>from uniswap import Uniswap</pre><pre>uniswap_wrapper = Uniswap(metamaskvar, privatekeyvar, infura_url, version=2)</pre><ul><li>metamaskvar = your metamask wallet address</li><li>privatekeyvar = the private key to your metamask wallet</li><li>infura_url = the link to your infura access</li><li>version=2 : we’re using uniswap v2.</li></ul><p>Now we have a uniswap object that we can use to interact with the Uniswap contract.</p><p><strong>Step 2: let’s get some useful info</strong></p><p>Uniswap allows users to trade to and from ETH (well, actually wETH) and other coins or between other coins directly, though in the background intermediate steps with ETH are made. Which means that all price quotes are referenced in ETH. To make it easier to calculate back to fiat, we can get a price quote from the coinmarketcap api. You do need to get your own free API key on coinmarketcap as well.</p><pre>import requests<br>from requests import Request, Session</pre><pre>#Coinmarketcap call<br>coinurl = &#39;<a href="https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest&#39;">https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest&#39;</a><br>coinparameters = {<br>  &#39;symbol&#39;:&#39;ETH&#39;,<br>  &#39;convert&#39;:&#39;USD&#39;<br>}<br>coinheaders = {<br>  &#39;Accepts&#39;: &#39;application/json&#39;,<br>  &#39;X-CMC_PRO_API_KEY&#39;: &#39;YOUR API KEY HERE&#39;,<br>}</pre><pre>session = Session()<br>session.headers.update(coinheaders)</pre><pre>try:<br>  response = session.get(coinurl, params=coinparameters).json()<br>  data = response[&#39;data&#39;]<br>  ethdata=data[&#39;ETH&#39;]<br>  pricedata=ethdata[&#39;quote&#39;]<br>  usdprice=pricedata[&#39;USD&#39;]<br>  ethprice=usdprice[&#39;price&#39;]<br>except (ConnectionError, Timeout, TooManyRedirects) as e:<br>  print(e)</pre><p>So in the end, the variable ethprice give you the current ETH price in USD.</p><p>Do note that the Coinmarketcap endpoint used above gives a lot of great data to use in your bot later on: volume, price changes,…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jjmV8M8sLn9ZOSpkIGTOwQ.png" /><figcaption>Great info for trading!</figcaption></figure><p>Secondly, Ethereum gas fees are currently very high. Ethereum v2 should lower them, but for now they can have a severe impact on your yield when trading.</p><p>So, how to calculate your gas fee? Gas fee = Gas used x Gas price.</p><p>Gas used depends on the complexity of a transaction on Ethereum. Unfortunately, a Uniswap trade is a fairly complex action and can require up to 250000 gas.</p><p>Gas price can be requested from sites like <a href="http://ethgasstation.info/">ethgasstation.info</a> Again, you’ll need to sign up for a key.</p><pre>gaspriceurl=&#39;<a href="https://ethgasstation.info/api/ethgasAPI.json?api-key=&#39;+datapulsekey">https://ethgasstation.info/api/ethgasAPI.json?api-key=&#39;+</a>YOURAPIKEY</pre><pre>gaslimit = 250000<br>TO_GWEI= 1 * 10 **10<br>gas = requests.get(gaspriceurl).json()[&#39;fast&#39;]<br>print(&#39;gas in GWEI = &#39;+str(gas/10))</pre><pre>gasprice = (gas / (TO_GWEI))*ethprice*gaslimit<br>print(&#39;Estimated max gas price (USD) = &#39;+str(gasprice))</pre><p>This will calculate the USD value of a uniswap fast transaction.</p><p><strong>Step 3: start trading on Uniswap</strong></p><p>First decide which tokens you want to trade in, because you will need to look up the contract addresses. You can look these up in Uniswap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q6R-0FrJCZCByALFPKla3Q.png" /><figcaption>Token addresses, ready to copy</figcaption></figure><p>E.g. ETH and BAT (basic attention coin) on Mainnet</p><pre>bat = &quot;0x0D8775F648430679A709E98d2b0Cb6250d2887EF&quot;<br>eth = &quot;0x0000000000000000000000000000000000000000&quot;</pre><p>The following code will give you</p><ul><li>your ETH balance</li><li>your bat balance</li><li>How many bat one ETH will buy you on Uniswap.</li></ul><pre>ONE_ETH = 1 * 10 ** 18<br>AMOUNTETH = 1</pre><pre>print(&#39;Eth balance in metamask = &#39;+str(uniswap_wrapper.get_eth_balance()/ONE_ETH))<br>print(&#39;Bat balance in metamask = &#39;+str(uniswap_wrapper.get_token_balance(bat)))<br>print(&#39;How many bat for 1 ETH = &#39;+str(uniswap_wrapper.get_token_eth_output_price(bat,AMOUNTETH)))<br>print(&#39;Price of purchase (USD) = &#39;+str(AMOUNTETH*ethprice))</pre><p>At this moment, you know:</p><ul><li>the ETH price quote in USD</li><li>the max gas fee</li><li>how much a trade will buy you</li></ul><p>The last step is to actually make the trade.</p><pre>tx = uniswap_wrapper.make_trade_output(eth,bat, AMOUNTETH)<br>print(tx)</pre><p>And that’s it!</p><p><strong>Conclusion</strong></p><p>Technically creating a bot that’s able to make trades on Uniswap is fairly straightforward and easy, thanks to the available libraries and API’s. Now comes the difficult part: implementing the trading strategy and alas, that one’s up to you, dear reader!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea1fe4eb1672" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Project Management in ERP projects: waterfall vs agile]]></title>
            <link>https://johandecoster1980.medium.com/project-management-in-erp-projects-waterfall-vs-agile-a8f11338a474?source=rss-aaa776eca97d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8f11338a474</guid>
            <category><![CDATA[waterfall-model]]></category>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[erp-software]]></category>
            <dc:creator><![CDATA[Jeffer1981]]></dc:creator>
            <pubDate>Mon, 21 Dec 2020 15:00:51 GMT</pubDate>
            <atom:updated>2020-12-21T15:00:51.256Z</atom:updated>
            <content:encoded><![CDATA[<p>ERP software, aka Enterprise Resource Planning software, is a software package that aims to support all business processes in a company in a single unified program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/0*52eC3EAf9iUbtik8.jpg" /><figcaption>Overview of common ERP functions.</figcaption></figure><p>An ERP system offers quite some advantages: a single source of truth, no spaghetti like mess of interlinked applications,…</p><p>Well-known ERP software developers are companies such as SAP, Microsoft, Salesforce, Odoo and many others.</p><h3>Project Management Triangle</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*fTq_SAoaSqGpWP8j.jpg" /></figure><p>Project management is about balancing scope, time and budget. If one changes, so does one or both of the others.</p><h3>Project management implementing ERP software</h3><p>This article isn’t about ERP softwareitself, but about implementing it. ERP implementations are often large projects, especially if they’re green field projects.</p><h4>The waterfall method</h4><p>Traditionally they are managed in a classic waterfall way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*4qEGsSjP95yp0aXg5QFk8w.png" /></figure><p>The project will more or less go through the following phases:</p><ul><li>Analysis: the as-is and to-be business processes are analyzed. The outcome is a blueprint of the to-be business processes.</li><li>Implementation: The agreed blue print is implemented.</li><li>Training: (Key) users are trained on the implemented solution.</li><li>Validation: the key (users) validate the implemented solution.</li><li>Go live: after a successful validation phase, the company goes live with the ERP solution, meaning the business processes are run on the new ERP system.</li></ul><p>In a waterfall managed project, the scope is agreed and fixed and the timing and budget depend on the agreed scope. The advantage is that a company knows what it will get in the end.</p><p>The biggest drawback of this, is that user validation comes quite late in the project. Which means if something is not analyzed or implemented correctly, it is only known quite late and rework often is extensive.</p><h4>Scrum or Agile</h4><p>Scrum or agile project management aims to validate implemented functionality as soon as possible and aims to add functionality in an step-wise manner through so-called sprints. These sprints have a fixed length (4 weeks) and the scope of each sprint is determined based on priority and workload of the desired functionality (the so-called backlog).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5clAcfi-PsI37ULb.png" /></figure><p>In scrum, the timing and budget is fixed and the scope is flexible. The big advantage is that user validation comes very early.</p><p>The big disadvantage is that the scope isn’t fixed. In e.g app development this is less of an issue when adding features to a product, but in ERP this can be a huge issue: a company cannot go live with half of an order-to-cash process.</p><h3>So, what now?</h3><p>Though the waterfall tends to be the default method for ERP projects, a lot of projects will be run by a hybrid approach: overall the project will still be managed in a waterfall, but the implementation will be done through scrum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*mg1ALAwyPMAko0BAZFG3rg.png" /></figure><p>This hybrid model counters the biggest drawback of the waterfall model through getting user validation early in the process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8f11338a474" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>