Website NFT
- What is WNFT
- Requirements
- Setting Environment Variables
- Deploy
- Test
- Gas Cost
- Getting help
- Getting involved
- License
- Credits and references
A WNFT is a concept of a website, where some areas of the website are controlled by an NFT.
Before WNFT, We always thought of websites as "one object", with all the pages belonging to one person (or one company), and each webpage is seen as one object.
However, in WNFT we look at websites as a collection of independent objects, each object is owned by a different person. In WNFT, not only that each webpage is a separate object, but even each area in a webpage is an object.
In our implementation of WNFT, we represent each area in each webpage by an NFT token. The person who owns this token controls what is shown in this area. To create harmony in the website, all the holders of the tokens will govern the website together.
The main thing the WNFT contract does is handle the creation and management of the token and website.
Find more information about WNFT in this article.
You can set the environment variables in the.env
file if you're unfamiliar with how environmentvariables work. Check out our .env example. If you wish to use this method to set these variables, update the values in the .env.example file, and then rename it to '.env'
WARNING
Do not commit and push any changes to .env files that may contain sensitive information, such as a private key! If this information reaches a public GitHub repository, someone can use it to check if you have any Mainnet funds in that wallet address, and steal them.
.env
example:
# only needed for the specific networks you intend to deploy on
KOVAN_RPC_URL='https://kovan.infura.io/v3/1231234567890'
GOERLI_RPC_URL='https://eth-goerli.alchemyapi.io/v2/your-api-key'
RINKEBY_RPC_URL='https://eth-rinkeby.alchemyapi.io/v2/your-api-key'
PRIVATE_KEY='abcdefg'
# Optional wil show gas cost
# COINMARKETCAP_API_KEY=[MY_GAS_COST]
Then you can install all the dependencies
yarn
The deployment script is in the deploy directory. If required, edit the desired environment specific variables or constructor parameters in the script.
This will deploy to a local hardhat network
npx hardhat deploy
To deploy to localhost:
- Start a local node
npx hardhat node
- Open a new terminal and deploy the smart contract in the localhost network
npx hardhat --network localhost deploy
To deploy to a network:
npx hardhat --network <your-network> deploy
Tests are located in the test directory. Test should only be run on local environments.
To run tests:
npx hardhat test
To display gas cost you must add to the .env file your Coinmarketcap api key, can be found here.
COINMARKETCAP_API_KEY=[MY_GAS_COST]
If you have questions, concerns, bug reports, etc, please open an issue in this repository's Issue Tracker, send us an email to contact@esteroids.xyz or come to our Discord.
We encourage you to be involved. You can either contact us in email contact@esteroids.xyz, Twitter or Discord, or simply from the project, add features, and do a PR for us to look at it.
The code in this repository is published under MIT license. The content in this repository is published under CC-BY-SA 3.0 license.
WNFT was created by Tomer Leicht and Eyal Ron.