<?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 Temitayo on Medium]]></title>
        <description><![CDATA[Stories by Temitayo on Medium]]></description>
        <link>https://medium.com/@timidan?source=rss-672b68a25646------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*1SogPFxQ5G5eQNiH0AaXbg.jpeg</url>
            <title>Stories by Temitayo on Medium</title>
            <link>https://medium.com/@timidan?source=rss-672b68a25646------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 03:14:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@timidan/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[Witnet VRF  For Onchain NFTs on Conflux eSpace]]></title>
            <link>https://medium.com/conflux-network/witnet-vrf-for-onchain-nfts-on-conflux-espace-664424d0648?source=rss-672b68a25646------2</link>
            <guid isPermaLink="false">https://medium.com/p/664424d0648</guid>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[svg]]></category>
            <category><![CDATA[conflux]]></category>
            <dc:creator><![CDATA[Temitayo]]></dc:creator>
            <pubDate>Mon, 23 May 2022 01:23:50 GMT</pubDate>
            <atom:updated>2022-05-23T01:23:50.384Z</atom:updated>
            <content:encoded><![CDATA[<h3>Witnet VRF For Onchain NFTs on Conflux eSpace</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hQwtdO8TBUdr54CJmWQIaw.png" /><figcaption>Witnet+Conflux</figcaption></figure><blockquote>On-Chain Randomness</blockquote><p>Generating random values on the blockchain(primarily for use in smart contracts) has not been fairly easy because almost all parameters like blockNumber, blockTimestamp or even blockHash which are being used to increase entropy in randomness generation can be easily manipulated by network miners thus making them deterministic. Therefore, there is a need for a trusted, decentralized, and verifiable protocol that can provide random values to a client(in this case, a smart contract) asking for it, This is what decentralized oracles like <a href="http://winet.io/">witnet</a> provide among other services like Price Feeds and Web Oracles.</p><blockquote>Why is it needed?</blockquote><p>A lot of NFT projects have numerous traits that are assigned to each NFT in that collection, however, it would be disastrous to make the project developers give these traits manually to these NFTs, therefore a decentralized, random and verifiable way to distribute/assign these traits to NFTs is needed. This is where the <a href="https://docs.witnet.io/smart-contracts/witnet-randomness-oracle">witnet randomness oracle</a> comes in. The process is simple;</p><ul><li>NFT contract is written to integrate with witnet’s WitnetRandomness contract</li><li>Whenever a user comes to mint an NFT, the contract makes a random bytes request to the oracle</li><li>The contract then uses this 32 bytes random value to calculate the traits for the user’s NFT.</li></ul><blockquote>This article aims to dive into one of such contracts. Live code has been deployed <a href="https://github.com/Timidan/NFTLIL">here</a> if you want to follow through.</blockquote><blockquote>Note that the project uses foundry, you can check my previous article on foundry <a href="https://medium.com/conflux-network/foundry-conflux-for-smart-contract-development-3e3da83b2fb1">here</a></blockquote><p>We will be focusing on <a href="https://github.com/Timidan/NFTLIL/blob/master/src/NFTLIL.sol">NFTLIL.sol</a></p><p>First, we check out the structure of an NFT</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e547614d10c40511847ad9d0bb8be4e7/href">https://medium.com/media/e547614d10c40511847ad9d0bb8be4e7/href</a></iframe><p>L3 -L7 shows that each NFT has 3 main properties;</p><ul><li>A name which will either be a <strong>King</strong>, <strong>Warrior</strong>, <strong>Knight,</strong> or <strong>Steed</strong></li><li>A tag which is also equal to the random bytes32 value gotten from witnet</li><li>five props which contain 5 numbers between 0 and 100</li></ul><blockquote>Also note that all these metadata are stored onchain instead of something like ipfs</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd2564cd90e0d9946509883c5206f65d/href">https://medium.com/media/cd2564cd90e0d9946509883c5206f65d/href</a></iframe><ul><li>mintNFT()is the core function that allows users to mint an NFT, before minting, it calls fetchRandomness() which requests the witnet randomness oracle to finally fetch the ready random value. Note that you should only call fetchRandomness()after you have executed requestRandomness() and waited for some minutes. It then goes on to use this value to calculate the trait values of the NFT. The first requestRandomness() is called in the contract constructor.</li></ul><blockquote>Note that the witnet randomness oracle can either provide a random number(uint256) or a random bytes32 value, we are using a bytes32 value for this code since we will be using it to generate other traits.</blockquote><ul><li>genProp() is a function that takes in the random value gotten and resolves them to the 5 props property of the NFT</li><li>genName() also resolves the random value to a number between 0 and 3 and uses it to choose the name property of the NFT</li></ul><p>Finally, we mentioned that this is an onchain NFT where all the metadata is generated and stored onchain, the main function is located <a href="https://github.com/Timidan/NFTLIL/blob/b5ad8da536b6129f3584296f597a943829227f0b/src/NFTLIL.sol#L102">here</a>. All it does is take the traits of an NFT and wrap it into an SVG container and finally encode it with Base64 so it can be displayed onchain.</p><p>That’s all folks. If you want to play with the NFT, you can mint it <a href="https://evmtestnet.confluxscan.net/address/0x7737018f92a395fffe0866f6d8a26f58c1b02641?tab=transaction">here</a>. It has been deployed on the Conflux eSpace testnet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=664424d0648" width="1" height="1" alt=""><hr><p><a href="https://medium.com/conflux-network/witnet-vrf-for-onchain-nfts-on-conflux-espace-664424d0648">Witnet VRF  For Onchain NFTs on Conflux eSpace</a> was originally published in <a href="https://medium.com/conflux-network">Conflux Network</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying EIP2535 Diamond Proxy Contracts on Conflux]]></title>
            <link>https://medium.com/conflux-network/deploying-eip2535-diamond-proxy-contracts-on-conflux-6647dcf436f6?source=rss-672b68a25646------2</link>
            <guid isPermaLink="false">https://medium.com/p/6647dcf436f6</guid>
            <category><![CDATA[proxy-contract]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[conflux-network]]></category>
            <category><![CDATA[eip-2535]]></category>
            <dc:creator><![CDATA[Temitayo]]></dc:creator>
            <pubDate>Tue, 22 Mar 2022 02:17:18 GMT</pubDate>
            <atom:updated>2022-03-22T02:17:18.645Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*km_RosTMqbjzcV6vn7geIQ.png" /></figure><blockquote>What are EIP2535 Diamonds?</blockquote><p><a href="https://eips.ethereum.org/EIPS/eip-2535">EIP2535</a> Diamonds a.k.a <em>The Diamond Standard proposed by </em><a href="https://github.com/mudgen"><em>Nick Mudge</em></a><em> </em>is a new Upgradeable Proxy Pattern that aims to solve two pressing problems for solidity smart contracts;</p><ul><li>Modularity: This is the ability of a system to be functional even in smaller divisions. Most Traditional Smart contracts cannot be modular because they always depend on each other especially in larger systems. When a system is not modular, it makes it hard to isolate and nullify problems. The Diamond Proxy employs the use of <a href="https://eips.ethereum.org/EIPS/eip-2535#facets-state-variables-and-diamond-storage">facets</a> (these are just contracts connected to the Diamond Proxy itself but only contain logic and do not have any storage of their own).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/0*qSgb786eh3fZkRcD" /><figcaption>A Diamond with different facet contracts</figcaption></figure><ul><li>Contract Size Limit: Most EVM chains have a limit on how much bytecode a contract address can store (24kb max), this makes robust systems harder to build since all their code cannot all fit into one contract .The diamond standard addresses this through its facet structure, each facet is a different contract on its own that has logic, therefore there is an infinite number of facets that can be deployed which will all be connected to one Diamond proxy.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*Vm8c2TEb5AWuYtzf.png" /><figcaption>Different facets connected to one Proxy Contract</figcaption></figure><p>This way, the Logic Contracts (facets) all conform to the ≤24kb limit but you can simply deploy a new facet and add it to the diamond (through an upgrade) if any of them can’t take any more code.</p><p>To interact with any Logic Contract, you interact with the Diamond Proxy Contract which in turn does 3 things</p><ul><li>It searches for where your <a href="https://solidity-by-example.org/function-selector/">function selector</a> is stored and retrieves the facet address.</li><li>After retrieving the facet address where that function selector is implemented, it performs a <a href="https://solidity-by-example.org/delegatecall/">delegate call</a> to that address in the context of Diamond storage and returns any output to the caller(if any).</li><li>To upgrade a diamond, you can either <strong>Add</strong>,<strong>Remove</strong> or <strong>Replace</strong> existing functions.</li></ul><p>The Diamond templates all come with two pre-written facets that help to manage your diamond.</p><blockquote><strong>DiamondLoupeFacet</strong>: A Lopue is a magnifying glass used to inspect diamonds. This facet contains functions to help inspect the current state of your diamond, providing data about the current state of facets and function selectors.</blockquote><blockquote><strong>DiamondCutFacet</strong>: A facet which allows you to make upgrade changes to your diamond.</blockquote><p>At present, there are 3 diamond templates that can be used. More info on them <a href="https://github.com/mudgen/diamond">here</a>.</p><p>This article aims to deploy a Diamond compliant CRC20 token on Conflux Core(The same code can also be deployed on the C<a href="https://developer.confluxnetwork.org/v2-hardfork/evm_space_guide/">onflux eSpace</a>). The full code is located <a href="https://github.com/Timidan/Diamond-Conflux">here</a>. Note that it uses the diamond-3 template.</p><p>This code sample uses the <a href="https://dev.to/mudgen/appstorage-pattern-for-state-variables-in-solidity-3lki">AppStorage</a> pattern to store its variables</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc786a23ed264e18caf6a732b5823f7f/href">https://medium.com/media/dc786a23ed264e18caf6a732b5823f7f/href</a></iframe><p>The AppStorage struct slot in <a href="https://github.com/Timidan/Diamond-Conflux/blob/master/contracts/libraries/LibAppStorage.sol#L6">LibAppStorage.sol</a> stores data about the fungible token. This is because the facet contracts can not have storage but can contain logic which mutate and access storage.</p><p>The main facet is called <a href="https://github.com/Timidan/Diamond-Conflux/blob/master/contracts/facets/DiamondToken.sol">DiamondToken.sol</a> and contains the main logic of the full CRC20 diamond. Note that for a facet to mutate or access the AppStorage patterns it needs to explicitly define a struct variable like this</p><p>AppStorage internal varName</p><p>Then you can use varName to access or make changes as seen below</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/265036a31dc71646f510e4e7cb672dc6/href">https://medium.com/media/265036a31dc71646f510e4e7cb672dc6/href</a></iframe><p>To deploy a Diamond, you need to first deploy the DiamodCutFacet then bind it to the Proxy Diamond contract(Diamond.sol). The diamond can now be upgraded with the other facets(DiamondcutFacet, DiamondToken and DiamondloupeFacet) using the DiamondcutFacet .To make things easier a script is available to do this</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e81ab6934fc16169b0702409e0cb7c7c/href">https://medium.com/media/e81ab6934fc16169b0702409e0cb7c7c/href</a></iframe><p>A sample has been deployed and verified <a href="https://testnet.confluxscan.io/address/cfxtest:acar8r6ay4xebwgh5v4xj2x0h44xa4bzva960hb4pd?tab=contract-viewer">here</a></p><p>A lot of large and robust protocols have been developed easily thanks to the diamond standard, you can find a list <a href="https://eip2535diamonds.substack.com/p/list-of-projects-using-eip-2535-diamonds?s=r">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6647dcf436f6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/conflux-network/deploying-eip2535-diamond-proxy-contracts-on-conflux-6647dcf436f6">Deploying EIP2535 Diamond Proxy Contracts on Conflux</a> was originally published in <a href="https://medium.com/conflux-network">Conflux Network</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Foundry + Conflux for Smart Contract Development]]></title>
            <link>https://medium.com/conflux-network/foundry-conflux-for-smart-contract-development-3e3da83b2fb1?source=rss-672b68a25646------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e3da83b2fb1</guid>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[foundry]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <dc:creator><![CDATA[Temitayo]]></dc:creator>
            <pubDate>Fri, 04 Mar 2022 00:12:30 GMT</pubDate>
            <atom:updated>2022-03-04T00:12:30.912Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ExsJNEdoXrxAD7WLhA3v_g.png" /><figcaption>Foundry+Conflux</figcaption></figure><p>What is Foundry?</p><p><a href="https://www.paradigm.xyz/2021/12/introducing-the-foundry-ethereum-development-toolbox">Foundry</a> is a blazing fast blockchain development toolkit that was developed by <a href="https://www.paradigm.xyz/">Paradigm</a> to eliminate the need for external programming languages and complexities when dealing with core smart contract development with solidity. Foundry has two cli tools called <a href="https://github.com/gakonst/foundry/tree/master/cast">cast</a> and <a href="https://github.com/gakonst/foundry/tree/master/forge">forge</a> which help with network interactions/tooling and contract interactions/testing respectively.</p><blockquote>Since Foundry was built using rust, you need to install rust on your machine before installing foundry using <a href="https://github.com/gakonst/foundry">foundryup</a>.</blockquote><h3>Contract Deployment</h3><p>Use the <a href="https://github.com/Timidan/Foundry-Conflux">Foundry+Conflux</a> repo to have a boilerplate workspace which uses foundry, alternatively, running forge init in an empty folder will initialize that folder to use foundry cli tools.</p><blockquote>Remember to use the --recursiveflag while cloning so that all the gitmodules will be pulled too and also remember to run forge remappings&gt;remappings.txt to generate new remappings for the gitmodules</blockquote><p>The repository simply contains 2 distinct contracts;</p><ul><li>ERC20 tokens</li><li>A swapper contract which allows anyone to create an order/market for a particular amount of Token A to be swapped for another amount of Token B</li></ul><p>To deploy the Swapper.sol contract for example, you can use the forge create command</p><p>forge create Swapper --contracts /$USER/Foundry+Conflux/src/Swapper.sol --private-key $your_private_key --rpc-url <a href="https://evmtestnet.confluxrpc.com/">https://evmtestnet.confluxrpc.com</a> --legacy</p><blockquote>Note:</blockquote><blockquote>The path to the contract has to be the absolute path of where that contract is stored</blockquote><blockquote>We are using the — legacyflag because Foundry uses the EIP1559 transaction object structure which the eSpace testnet doesn’t support</blockquote><h3>Contract Tests</h3><p>To test your contracts in Foundry, you need to write your contract tests in solidity and save it with a .t.sol extension.</p><pre>contract Foo {<br>    uint256 public x = 1;<br>    function set(uint256 _x) external {<br>        x = _x;<br>    }<br><br>    function double() external {<br>        x = 2 * x;<br>    }<br>}<br><br>contract FooTest {<br>    Foo foo;<br><br>    // The state of the contract gets reset before each<br>    // test is run, with the `setUp()` function being called<br>    // each time after deployment.<br>    function setUp() public {<br>        foo = new Foo();<br>    }<br><br>    // A simple unit test<br>    function testDouble() public {<br>        require(foo.x() == 1);<br>        foo.double();<br>        require(foo.x() == 2);<br>    }<br>}</pre><p>👆🏿 Here is a very simple example of a contract and solidity test which can be executed by using the command forge test .</p><blockquote>Also note that foundry performs automatic fuzzing tests for functions that accept uint/int as inputs/arguments.</blockquote><p>To run the Swapper.t.sol test that can be found in this <a href="https://github.com/Timidan/Foundry-Conflux">template</a> repository, simply run</p><p>forge test</p><blockquote>Foundry contains a foundry.toml file where you can configure some environmental variables which are used when executing either forge or cast commands.</blockquote><p>To learn more about foundry, kindly refer to the Foundry handbook hosted <a href="https://onbjerg.github.io/foundry-book/forge/">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e3da83b2fb1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/conflux-network/foundry-conflux-for-smart-contract-development-3e3da83b2fb1">Foundry + Conflux for Smart Contract Development</a> was originally published in <a href="https://medium.com/conflux-network">Conflux Network</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a CRC721 token on Conflux]]></title>
            <link>https://medium.com/conflux-network/deploying-a-crc721-token-on-conflux-f0f3eaf03f52?source=rss-672b68a25646------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0f3eaf03f52</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[erc721-token]]></category>
            <category><![CDATA[sdk]]></category>
            <category><![CDATA[nft]]></category>
            <dc:creator><![CDATA[Temitayo]]></dc:creator>
            <pubDate>Fri, 04 Mar 2022 00:08:57 GMT</pubDate>
            <atom:updated>2022-03-11T03:11:10.050Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/407/0*zRPbwfRF0dbm9u-m" /></figure><p>Deploying a CRC721 token on the C<a href="https://confluxnetwork.org/">onflux</a> network is pretty much similar to deploying any smart contract to any other blockchain. However, a little twist comes when interacting with the Conflux blockchain since its rpc methods slightly differ from the conventional Eth JSON-RPC methods. Therefore, Conflux has a variety of tools which are developed for interacting with the Conflux chain in the most easiest ways. Examples include:</p><ul><li><a href="https://github.com/Conflux-Chain/conflux-truffle">Conflux + Truffle</a></li><li><a href="https://chainide.com/s/conflux">Conflux + ChainIde</a></li></ul><p>This tutorial focuses on using H<a href="https://hardhat.org/">ardha</a>t and <a href="https://confluxnetwork.gitbook.io/js-conflux-sdk/">js-conflux-sdk</a> to Write, Deploy and Interact with a CRC721 compliant smart contract on the Conflux Testnet.</p><p>Requirements:</p><ul><li>A Conflux wallet . You can get one <a href="https://fluentwallet.com/">here</a> and use the Conflux <a href="http://developer.confluxnetwork.org/guides/en/how_to_use_cfx_faucet">faucet</a> to get test CFX.</li><li>Clone this <a href="https://github.com/Timidan/CRC721">repo</a>sitory to have the skeletal template. Note that a similar folder structure can be generated by running <strong>npx hardhat init</strong> in an empty folder and selecting the advanced <em>Typechain</em> option.</li></ul><blockquote>Note that hardhat will install some files and modules like <em>hardhat.config.ts</em> and <em>ethersjs </em>which are not used in this tutorial, we can ignore them.</blockquote><blockquote>Also make sure to clone with the command<br>git clone --recurse-submodules <a href="https://github.com/Timidan/CRC721.git">https://github.com/Timidan/CRC721.git</a> so that all the submodules can be pulled too</blockquote><p>Let’s dive in!</p><p>First, a high level understanding of the smart contract is needed. To make things smoother, we have used the <a href="https://github.com/conflux-fans/conflux-contracts/tree/main/contracts/token/CRC721/extensions">CRC721Enumerable</a> standard from <a href="https://github.com/conflux-fans/conflux-contracts">Conflux-fans</a>, we create a new contract called CRC721 which directly inherits from Conflux-fan’s ready made <a href="https://github.com/conflux-fans/conflux-contracts/tree/main/contracts/token/CRC721/extensions">CRC721Enumerable</a> contract .</p><pre>import &quot;conflux-contracts/contracts/token/CRC721/extensions/CRC721Enumerable.sol&quot;;</pre><pre>contract CRC721 is CRC721Enumerable</pre><p>This means we can continue writing the extra features for our NFT without worrying about the basic functions. The contract has a constructor which sets the name and symbol of the NFT and also sets the URI of the token.</p><pre>constructor(string memory _globalURI) ERC721(&quot;Timidan&quot;, &quot;TMT&quot;) {</pre><pre>globalURI = _globalURI;</pre><pre>}</pre><p>Lastly, it allows anyone to mint a number of NFTs to an address tofor free</p><pre>function mintToken(address _to, uint256 _amount) external {</pre><pre>for (uint256 i; i &lt; _amount; i++) {</pre><pre>_mint(_to, tokenId);</pre><pre>tokenId++;<br>}</pre><pre>}</pre><p>Now, let’s dive into the deployment and contract interaction script.</p><p>To deploy the token contract, we’ll be using the <a href="https://github.com/Conflux-Chain/js-conflux-sdk">js-conflux-sdk</a> in place of ethersjs to create our contract and network objects. Since we are writing our deploy scripts in typescript, we need to import all needed modules, which includes the abi and bytecode of our compiled CRC721 contract and the Conflux module itself.</p><pre>import { abi, bytecode } from &#39;../artifacts/contracts/CRC721.sol/CRC721.json&#39;</pre><pre>import { Conflux } from &#39;js-conflux-sdk&#39;</pre><blockquote>The abi and bytecode of a contract are automatically generated whenever you run a hardhat script or compile a contract, they are saved in the <strong>artifacts</strong> folder.</blockquote><p>To interact with Conflux, you need to initialize a network instance using the Conflux sdk. In this example, we are initializing a testnet instance</p><pre>const testnet = &#39;https://test.confluxrpc.com&#39;</pre><pre>const cfx = new Conflux({</pre><pre>url: testnet,</pre><pre>networkId: 1,</pre><pre>logger: console,</pre><pre>})</pre><p>Then we can now use <strong>cfx </strong>to create a new contract instance and send the deployment transaction</p><pre>const contract = cfx.Contract({ abi, bytecode })</pre><pre>//deploy contract</pre><pre>const txReceipt = await contract.constructor(globalURI).sendTransaction({ from: acct }).executed()</pre><p>From the Transaction receipt, we can get the contract address of our newly deployed contract and go on to interact with it</p><pre>//get deployed contract instance</pre><pre>const nftContract = cfx.Contract({abi,address:txReceipt.contractCreated })</pre><pre>//call the mint function</pre><pre>const tx = await nftContract.mintToken(acct.toString(),5).sendTransaction({ from: acct.toString() })</pre><p>To run the script, we do</p><pre>npx hardhat run scripts/deploy.ts</pre><p>After deployment, Confluxscan shows the NFTs that an account has</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzw3qdoyo2Vq0NsZopICMA.png" /></figure><p>We have successfully deployed a CRC721 token to the Conflux testnet network using hardhat and js-conflux-sdk.</p><p>To understand and learn more about js-conflux-sdk methods, kindly check out the <a href="https://github.com/Conflux-Chain/js-conflux-sdk/tree/e0de8942dcb7fff8a3d5781a011d50e519ddf8a0/docs">documentation</a> on github.</p><p>A sample has been deployed <a href="https://testnet.confluxscan.net/address/cfxtest:acbuxz7ttenfa6t6thd21yy9ma32t40u3e035c05ff">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0f3eaf03f52" width="1" height="1" alt=""><hr><p><a href="https://medium.com/conflux-network/deploying-a-crc721-token-on-conflux-f0f3eaf03f52">Deploying a CRC721 token on Conflux</a> was originally published in <a href="https://medium.com/conflux-network">Conflux Network</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a CRC1155 token on Conflux]]></title>
            <link>https://medium.com/conflux-network/deploying-a-crc1155-token-on-conflux-29ef32787ab1?source=rss-672b68a25646------2</link>
            <guid isPermaLink="false">https://medium.com/p/29ef32787ab1</guid>
            <category><![CDATA[conflux]]></category>
            <category><![CDATA[conflux-network]]></category>
            <dc:creator><![CDATA[Temitayo]]></dc:creator>
            <pubDate>Mon, 21 Feb 2022 10:43:05 GMT</pubDate>
            <atom:updated>2022-03-06T13:32:10.813Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/407/0*zRPbwfRF0dbm9u-m" /></figure><p>A CRC1155 token is similar to a CRC721 token only with more features and gas efficient functions. Unlike CRC721, CRC1155 allows you to create multiple copies of multiple NFTs in a single transaction. This is also called batch minting and is very gas efficient. It is also known as the Multi token Standard as it can act both as a fungible and non-fungible token.</p><p>This tutorial focuses on using H<a href="https://hardhat.org/">ardha</a>t and <a href="https://confluxnetwork.gitbook.io/js-conflux-sdk/">js-conflux-sdk</a> to Write, Deploy and Interact with a CRC1155 compliant smart contract on the Conflux test Network.</p><p>Requirements:</p><ul><li>A Conflux wallet . You can get one <a href="https://fluentwallet.com/">here</a> and use the Conflux <a href="http://developer.confluxnetwork.org/guides/en/how_to_use_cfx_faucet">faucet</a> to get test CFX.</li><li>Clone this <a href="https://github.com/Timidan/CRC721">repo</a>sitory to have the skeletal template. Note that a similar folder structure can be generated by running <strong>npx hardhat init</strong> in an empty folder and selecting the advanced <em>Typechain</em> option.</li></ul><blockquote>Note that hardhat will install some files and modules like <em>hardhat.config.ts </em>and <em>ethersjs </em>which are not used in this tutorial, we can ignore them.</blockquote><p>Let’s dive in!</p><p>First, a high level understanding of the smart contract is needed. To make things smoother, we have used the ERC1155 standard from O<a href="https://github.com/OpenZeppelin/openzeppelin-contracts">penzeppelin</a>, we create a new contract called CRC1155 which directly inherits from Openzeppelin’s ready made ERC1155 contract.</p><pre>import &quot;@openzeppelin/contracts/token/ERC1155/ERC1155.sol&quot;;</pre><pre>contract CRC1155 is ERC1155</pre><p>This means we can continue writing the extra features for our ERC1155 NFT without worrying about the basic functions. The contract has a constructor which sets the base URI of the token.</p><pre>constructor(string memory _globalURI) ERC1155(_globalURI)</pre><pre>{}</pre><p>It allows anyone to batch mint NFTs to an address _tofor free</p><pre>function mintToken( address _to, uint256[] calldata _tokenIds, uint256[] calldata _amounts) <br>external {<br>_mintBatch(_to, _tokenIds, _amounts, &quot;0x00&quot;);<br>}</pre><p>It also contains two pure functions that return the name and symbol of the CRC1155 NFT</p><pre>function name() public pure returns (string memory) {</pre><pre>return &quot;Conflux 1155&quot;;</pre><pre>}</pre><pre>function symbol() public pure returns (string memory) {</pre><pre>return &quot;CFX1155&quot;;</pre><pre>}</pre><p>Now, let’s dive into the deployment and contract interaction script.</p><p>To deploy the token contract, we’ll be using the <a href="https://github.com/Conflux-Chain/js-conflux-sdk">js-conflux-sdk</a> in place of ethersjs to create our contract and network objects. Since we are writing our deploy scripts in typescript, we need to import all needed modules, which includes the abi and bytecode of our compiled CRC1155 contract and the Conflux module itself.</p><pre>import { abi, bytecode } from &#39;../artifacts/contracts/CRC1155.sol/CRC1155.json&#39;</pre><pre>import { Conflux } from &#39;js-conflux-sdk&#39;</pre><blockquote>The abi and bytecode of a contract are automatically generated whenever you run a hardhat script or compile a contract, they are saved in the <strong>artifacts</strong> folder.</blockquote><p>To interact with Conflux, you need to initialize a network instance using the Conflux sdk. In this example, we are initializing a testnet instance</p><pre>const testnet = &#39;https://test.confluxrpc.com&#39;</pre><pre>const cfx = new Conflux({</pre><pre>url: testnet,</pre><pre>networkId: 1,</pre><pre>logger: console,</pre><pre>})</pre><p>Then we can now use <strong>cfx </strong>to create a new contract instance and send the deployment transaction</p><pre>const contract = cfx.Contract({ abi, bytecode })</pre><pre>//deploy contract</pre><pre>const txReceipt = await contract.constructor(globalURI).sendTransaction({ from: acct }).executed()</pre><p>From the Transaction receipt, we can get the contract address of our newly deployed contract and go on to interact with it</p><pre>//get deployed contract instance</pre><pre>const nftContract = cfx.Contract({ abi, address: txReceipt.contractCreated })</pre><pre>//call the mint function</pre><pre>const tx = await nftContract.mintToken(acct.toString(), [0, 1, 2, 3, 4], [5, 4, 3, 2, 1]) .sendTransaction({ from: acct.toString() })</pre><pre>npx hardhat run scripts/deploy.ts</pre><p>We have successfully deployed a CRC1155 token to the Conflux Core testnet network using hardhat and js-conflux-sdk.</p><p>To understand and learn more about js-conflux-sdk methods, kindly check out the <a href="https://github.com/Conflux-Chain/js-conflux-sdk/tree/e0de8942dcb7fff8a3d5781a011d50e519ddf8a0/docs">documentation</a> on github.</p><p>A sample has been deployed and verified <a href="https://testnet.confluxscan.io/address/cfxtest:acd7jnutafn9nv53gvh5cdk9yayct94yzjrcpjvwgk">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29ef32787ab1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/conflux-network/deploying-a-crc1155-token-on-conflux-29ef32787ab1">Deploying a CRC1155 token on Conflux</a> was originally published in <a href="https://medium.com/conflux-network">Conflux Network</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Take Back the Web Virtual Hackathon]]></title>
            <link>https://medium.com/gitcoin-outreach/take-back-the-web-virtual-hackathon-641c131e8e55?source=rss-672b68a25646------2</link>
            <guid isPermaLink="false">https://medium.com/p/641c131e8e55</guid>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[gitcoin]]></category>
            <dc:creator><![CDATA[Temitayo]]></dc:creator>
            <pubDate>Wed, 15 Jan 2020 07:41:13 GMT</pubDate>
            <atom:updated>2020-01-15T07:41:13.177Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*TDAjNyXpJ9HjUPBe-S5d6A.png" /></figure><p>What are Virtual hackathons?</p><p>Well, this has the same definition as traditional hackathons that bring together members to form teams and tackle provided issues while creating solutions to identified problems. However, Virtual hackathons are way better in the sense that they allow people from any part of the world to participate in the hackathon<strong> remotely</strong> (from the comfort of their rooms)…Sounds interesting right? Interested hackers sign up for the hackathon and are immediately invited to an online community where they create or join teams. The projects can be built and managed by members from different geographic locations by using tools like <em>Discord </em>or <em>Slack </em>for effective team communication and <em>Github</em> as the version control system.</p><p>Virtual hackathons have gone on to increase teamwork spirit among individuals, encourage diversity both geographically and culturally and also significantly promote networking and greater bonds among hackers. Therefore virtual hackathons have gone on to increase the quality of products being built while also reducing costs incurred in traditional hackathons.</p><h3>Gitcoin Hackathons</h3><p>Gitcoin has reeled out the first virtual hackathon of the year titled “Take Back The Web”. This is as a succession to virtual hackathons that have been held in the past year including:</p><ul><li>Ethereal Virtual hackathon held in April,2019(<a href="https://gitcoin.co/hackathon/ethereal-virtual-hackathon/"><em>see prizes here</em></a>)</li><li>Beyond Blockchain hackathon held in June, 2019(<a href="https://gitcoin.co/hackathon/beyondblockchain/"><em>see prizes here </em></a><em>)</em></li><li>Grow Ethereum hackathon held in July,2019(<a href="https://gitcoin.co/hackathon/grow-ethereum/"><em>see prizes here</em></a><em>)</em></li><li>Ethereal Blocks hackathon held in August,2019(<a href="https://gitcoin.co/hackathon/ethereal-blocks/"><em>see prizes here</em></a><em>)</em></li><li>Road to Devcon hackathon held in October,2019 prior to the Devcon V conference in Osaka,Japan (<a href="https://gitcoin.co/hackathon/road-to-devcon/"><em>see prizes here</em></a><em>)</em></li><li>Web3 World hackathon held in November,2019(<em>see </em><a href="https://gitcoin.co/hackathon/web3-world/"><em>prizes</em></a><em> and </em><a href="https://gitcoin.co/hackathon/projects/web3-world/"><em>projects </em></a><em>here</em>)</li></ul><p>And now, Take Back the Web will run from 9th of January— 23rd of January,2020(2 weeks of intensive online hacking and collaboration) Check out the <a href="https://gitcoin.co/hackathon/take-back-the-web/?">prize explorer </a>to see the bounties posted by Status, MetaMask, ETC Labs, Infura, Blockstack, Kickback, and Sablier.</p><p>You can also see information about upcoming hackathons on gitcoin <a href="https://gitcoin.co/hackathon/"><em>here</em></a></p><p>Long Live the Web3 community!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=641c131e8e55" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gitcoin-outreach/take-back-the-web-virtual-hackathon-641c131e8e55">Take Back the Web Virtual Hackathon</a> was originally published in <a href="https://medium.com/gitcoin-outreach">Gitcoin Outreach</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introduction to the Ethereum blockchain through gitcoin]]></title>
            <link>https://medium.com/gitcoin-outreach/an-introduction-to-the-ethereum-blockchain-through-gitcoin-e2843f87d6ed?source=rss-672b68a25646------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2843f87d6ed</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Temitayo]]></dc:creator>
            <pubDate>Sun, 15 Dec 2019 02:35:27 GMT</pubDate>
            <atom:updated>2019-12-15T02:35:27.334Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/177/1*34nC2d_NlnaTK3EXZ6majg.png" /></figure><p>Practice makes perfect they say…but what if you have nothing to begin with..</p><p><a href="https://blockgeeks.com/guides/what-is-blockchain-technology/">Blockchain Technology</a> is fast becoming a very disrupting technology in all sectors and has proven to be very useful in all human and industrial endeavors, one of the most interesting feature is that it has no central authority — it is the very definition of a democratized system, and since it is a shared and immutable ledger, it supports transparency and record integrity.</p><p>Also, it supports the usage of <a href="https://www.bitdegree.org/tutorials/what-is-a-smart-contract/">smart contracts</a> — self-executing contract with the terms of the agreement between creator of the contract and those who will interact with it directly written into lines of code. The code and the agreements contained therein exist across a distributed, decentralized blockchain network. The code controls the execution, and transactions are trackable and irreversible.</p><p>However, with these awesome capabilities of this awesome technology, Adoption is still very low, especially in a country like Nigeria, this is why a strategic location has been chosen to introduce the Ethereum Blockchain to existing and aspiring developers in the Federal University of Technology, Akure to expose them the basic operations of the Ethereum developer ecosystem through <a href="http://gitcoin.co/">Gitcoin</a> — Gitcoin is a meeting place for open source project funders and bounty hunters and also the best place to grow open source projects and participate in web3 hackathons!! It couldn’t get better than this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*wpaRaL8E9qJpQrRqoCIAeQ.gif" /></figure><p><a href="http://futa.edu.ng/">Futa</a> was chosen as the event venue because it had the largest number of developers who had been exposed to technologies like Artificial Intelligence,Web Technologies,Data Science and IoT. The event will be targeted to an audience of approximately 150 attendees which will consist of both beginners and professionals in the tech world since this will be an exposition into Blockchain Technology. The event is set to take place in February,2020.</p><p>The event is aimed at adding to the pool of ethereum’s projected #onemilliondevs and from a local community too. A community will be created after the event to track and follow up with the new eth developers for growth and encouragement.</p><p>Long Live the Web3 Community!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2843f87d6ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gitcoin-outreach/an-introduction-to-the-ethereum-blockchain-through-gitcoin-e2843f87d6ed">An Introduction to the Ethereum blockchain through gitcoin</a> was originally published in <a href="https://medium.com/gitcoin-outreach">Gitcoin Outreach</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>