All Projects → AYIDouble → Simple-Game-ERC-721-Token-Template

AYIDouble / Simple-Game-ERC-721-Token-Template

Licence: MIT license
🔮 Very Simple ERC-721 Smart Contract Template to create your own ERC-721 Tokens on the Ethereum Blockchain, with many customizable Options 🔮

Programming Languages

solidity
1140 projects

Projects that are alternatives of or similar to Simple-Game-ERC-721-Token-Template

ethereum-dex
Decentralized exchange implementation for the 0xcert protocol on the Ethereum blockchain.
Stars: ✭ 18 (-78.31%)
Mutual labels:  smart-contracts, token, eth, nft, erc721, non-fungible, erc-721
erc721
The reference implementation of the ERC-721 non-fungible token standard.
Stars: ✭ 989 (+1091.57%)
Mutual labels:  smart-contracts, token, eth, erc721, non-fungible, erc-721
ethereum-erc20
Fungible token implementation for the Ethereum blockchain.
Stars: ✭ 27 (-67.47%)
Mutual labels:  smart-contracts, token, eth, erc
ethereum-crowdsale
0xcert protocol crowdsale contracts for Ethereum blockchain.
Stars: ✭ 15 (-81.93%)
Mutual labels:  smart-contracts, token, eth, erc
crowdsale-smart-contract
No description or website provided.
Stars: ✭ 39 (-53.01%)
Mutual labels:  smart-contracts, token, solidity-contracts
niftygate
Drop-in Access Control via NFT Ownership
Stars: ✭ 61 (-26.51%)
Mutual labels:  ethereum-contract, nft, erc721
etherbrite
🗓 Clone eventbrite on Ethereum, built in Solidity, TruffleJS, Web3js and React/Redux.
Stars: ✭ 19 (-77.11%)
Mutual labels:  smart-contracts, ethereum-contract, solidity-contracts
nft-contracts
Open-source NFT contracts used by buildship.dev
Stars: ✭ 60 (-27.71%)
Mutual labels:  smart-contracts, nft, erc721
ethereum-contracts
Knowledge Ethereum Smart Contracts
Stars: ✭ 41 (-50.6%)
Mutual labels:  smart-contracts, ethereum-contract, token
solidity-contracts
📦 Resources for the Ethereum Smart Contract Development tutorial series.
Stars: ✭ 64 (-22.89%)
Mutual labels:  smart-contracts, ethereum-contract, solidity-contracts
Ethereum Erc721
Non-fungible token implementation for Ethereum-based blockchains.
Stars: ✭ 253 (+204.82%)
Mutual labels:  smart-contracts, token, eth
Colonynetwork
Colony Network smart contracts
Stars: ✭ 351 (+322.89%)
Mutual labels:  smart-contracts, ethereum-contract, solidity-contracts
Awesome NFTs
A curated collection about NFTs - by bt3gl
Stars: ✭ 42 (-49.4%)
Mutual labels:  token, nft, erc721
Solidity
🔐 Ethereum smart contracts developed for the Hanzo Platform.
Stars: ✭ 46 (-44.58%)
Mutual labels:  smart-contracts, ethereum-contract, solidity-contracts
Smart-Contract-Security-Audits
Certified Smart Contract Audits (Ethereum, Hyperledger, xDAI, Huobi ECO Chain, Binance Smart Chain, Fantom, EOS, Tezos) by Chainsulting
Stars: ✭ 325 (+291.57%)
Mutual labels:  smart-contracts, solidity-contracts, nft
React Ethereum Dapp Example
A starter boilerplate for an Ethereum dapp using web3.js v1.0, truffle, react, and parity
Stars: ✭ 384 (+362.65%)
Mutual labels:  smart-contracts, ethereum-contract, blockchain-technology
Seriality
Seriality is a library for serializing and de-serializing all the Solidity types in a very efficient way which mostly written in solidity-assembly
Stars: ✭ 105 (+26.51%)
Mutual labels:  smart-contracts, ethereum-contract, solidity-contracts
gas-reporting
Reference documentation on every gas price API and all the different formats
Stars: ✭ 85 (+2.41%)
Mutual labels:  smart-contracts, nft
colonySale
Colony Token and Crowdsale Contracts
Stars: ✭ 27 (-67.47%)
Mutual labels:  smart-contracts, token
awesome-solidity-gas-optimization
Best resources for Solidity gas optimizations ⛽
Stars: ✭ 893 (+975.9%)
Mutual labels:  smart-contracts, solidity-contracts

🔮 Simple Game ERC-721 Token Template 🔮

🔮 Very Simple ERC-721 Smart Contract Template to create your own ERC-721 Tokens on the Ethereum Blockchain, with many customizable Options 🔮

💎 What is ERC-721? 💎

ERC-721 is a free, open standard that describes how to build non-fungible or unique tokens on the Ethereum blockchain. While most tokens are fungible (every token is the same as every other token), ERC-721 Tokens are all unique.

One of the most known examples for an ERC-721 Token is Crypto Kitties (https://www.cryptokitties.co/), where each Cat is an unique ERC-721 Token. 😺

⚙️ Setup ⚙️

Each Line of the Solidity Code has a comment that explains what is happening. 📝

The Setup is fairly easy, you just need to click on the Remix link or use the Gist link and you're done.
If you have problems with it, you can also do it the good old way and add each file separately. (Takes about 1 minute)

Remix IDE Link: https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=6dfc6f9a27c0e6220094943657e3d834

GitHub Gist Link: https://gist.github.com/AYIDouble/6dfc6f9a27c0e6220094943657e3d834

📝 Remix - Solidity IDE 📝

Remix Solidity IDE Ethereum erc 721 erc721 erc-721 item game blockchain

Explanation of the Code:

At Line 5–9: In the struct the Item with all his properties is defined (name, level, rarityLevel).

At Line 11: An Array is created, where all the Items of the contract owner are stored.

At Line 14–16: We define that the owner is the user of the contract.

At Line 18: We define a function createItem, where the name (_name) of the Item is a parameter and the Ethereum address (_to) where we want to send our Items.

At Line 19: We define that only the owner of the contract is able to create Items.

At Line 20: Each time we create an Item the current Length of the Item array is being used as the ID for the Item. (Each Item has a unique ID)

At Line 21: The Item gets created and added to our Items array

At Line 22: The _mint function from the ERC721 Libraries is used for sending our Items to the specific ethereum address. As an example, this is needed to send the created Item to your ethereum address or any other address.

⚔️ Item.sol ⚔️ (ERC-721 Token)

In this small example we are creating an ERC-721 Token, that could be used as an in-game Item. ⚔️

Example: a Sword as a Item saved in the Ethereum Blockchain.

pragma solidity ^0.4.24;

contract Item is ERC721{
    
    struct Item{
        string name; // Name of the Item
        uint level; // Item Level
        uint rarityLevel;  // 1 = normal, 2 = rare, 3 = epic, 4 = legendary
    }
    
    Item[] public items; // First Item has Index 0
    address public owner;
    
    function Item() public {
        owner = msg.sender; // The Sender is the Owner; Ethereum Address of the Owner
    }
    
    function createItem(string _name, address _to) public{
        require(owner == msg.sender); // Only the Owner can create Items
        uint id = items.length; // Item ID = Length of the Array Items
        items.push(Item(_name,5,1)) // Item ("Sword",5,1)
        _mint(_to,id); // Assigns the Token to the Ethereum Address that is specified
    }
    
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].