Website: cryptoaliens.netlify.app
Cryptoaliens is a ERC721 token, where you can buy, sell and clone your own aliens.
Part of Ivan on Tech Ivan on Tech Academy bootcamp.
- AlienToken (CAT): 0x7DE6d04EaEEF8989171d3686573938B47D0B1c84
- AlienFactory (NFT): 0xAF3677129Dceb13DB5Cb6115C9fD69beEfF4cA48
- AlienMarketPlace: 0xC7Bdf1b7dcb806b9aFD5b83C8BC2b0c4aDf2BcB7
Contracts are written in Solidity
- AlienFactory forms the basic of all aliens interactions. It is split into two(2) contracts, inheriting from eachother to make life more easy.
- AlienFactory is build in the following way
- AlienFactory: All logic to clone aliens and make new gen0
- AlienCore: All logic to make it ERC721 (Openzeppelin)
- MarketPlace is not inheriting from AlienFactory and is a standalone contract. It requires the interface of AlienCore to interact with.
- AlienFactory is build in the following way
The following standard allows for the implementation of a standard API for NFTs within smart contracts. This standard provides basic functionality to track and transfer NFTs.
A standard interface allows wallet/broker/auction applications to work with any NFT on Ethereum. We provide for simple ERC-721 smart contracts as well as contracts that track an arbitrarily large number of NFTs. Additional applications are discussed below.
ERC165’s solution is to define a standard for contracts to publish what interfaces they support, so that other contracts can follow the same standard to detect whether it supports certain interfaces, and only call the interface’s function if the interface is supported.
There is a limited amount of gen0 aliens available, defined by CREATION_LIMIT_GEN0
. Only the owner can mint new aliens (using createAlienGen0
)
Every alien has unique DNA, comprised of a 10 digits. When cloning 2 aliens, the child will have a mixture between the dna of its mom and its dad. It also has a chance to mutate a gene randomly
Randomness is simulated through using the timestamp of the mined block.
Must fill a .env
file with proper Key data, check .evn.example
- Have node installed (v10 or later)
- Have yarn installed
npm install -g yarn
(or npm) - Have hardhat installed
npm install --save-dev hardhat
- Install dependencies
yarn install // OR npm install
- Start up local blockchain (hardhat node)
- Deploy the contracts on your locak blockchain
npm run deploy
npm run test
yarn test
NOTE: unit test is mean for local blockchain, not testnet nor mainnet. (it will deploy a new contract)
npm run deploy-testnet
yarn deploy-testnet
NOTE: make sure to have Matic in your first account
Client is made with Html, css, jquery, javascript, bootstrap, web3.
- Have python installed
- Have a way to run a blockchain locally (via hardhat node)
- Have MetaMask installed
cd client
- Make sure that a local blockhain is running (via hardhat node).
- Start python webserver
python -m http.server
- Have all node_modules installed
- Have local blockchain network added in MetaMask
- Have local blockchain accounts added in MetaMask
- Start local development
NOTE: after deploying the contracts with alien_deploy.js
, it will return the addresses of each contract, make sure they match with alienFactory_adderss
and alienMarketplace_address
in index.js