Skip to content

Commit

Permalink
added three images.
Browse files Browse the repository at this point in the history
  • Loading branch information
anupam-io committed Mar 28, 2021
1 parent 22b17c9 commit 7a03883
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 18 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,36 @@
- https://docs.opensea.io/docs/metadata-standards
- https://docs.openzeppelin.com/contracts/3.x/erc1155#constructing_an_erc1155_token_contract

## Helpful notes
- `Mushroom` is a contract which hold the ERC1155 Non fungible tokens
- `mint()` is supposed to be called from the owner and this will transfer the tokens to another smart contract
- In comparison to `ownerOf()` in ERC721, ERC1155 has `balanceOf()`

## How to run?
## Commands
- `yarn` : installation
- `yarn compile` : compilation
- `yarn test` : tests
- `yarn migrate` : migrating to rinkeby
- `yarn verify:m` : verifying **Mushroom** on etherscan
- `yarn verify:r` : verifying **MushroomReceiver** on etherscan

## How to deploy?
- Install using `yarn`
- Rename `.env.example` to `.env` and set the values of environment variables accordingly
- Set the `tokenURI` in **line 12** of `Mushroom.sol`
- Set the metadata in the `meta` directory
- Set the nfts in the `nfts` directory
- Run `yarn migrate` to deploy the contracts to rinkeby
- Run `yarn verify:m` to verify the contracts on etherscan
- Visit *https://testnets.opensea.io/* and enter the address of above deployed `Mushroom` contract
- **Enjoy with your NFTs!!!**

## How to test?
- Install using `yarn`
- Run `truffle dev`
- Run `migrate --reset`
- run `test`

## Notes for MushroomReceiver
- This contract is made to recieve ERC1155 tokens
- The admin of this contract can transfer tokens to anyone

## Deployments
- [Mushroom](https://rinkeby.etherscan.io/address/0xfA9d1298E22AFA3B5c46Db91424028857C10742A#readContract)
- [MushroomReceiver](https://rinkeby.etherscan.io/address/0x76D82D278dc9AbA8b4Bb63Dc9b7De1Ad8C454098#contracts)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "The mushroom company",
"description": "This mushroom can create other mushrooms.",
"image": "https://raw.githubusercontent.com/akcgjc007/erc1155-Mushroom/main/nfts/0.png"
"name": "The Raccoon",
"description": "The raccoon, sometimes called the common raccoon to distinguish it from other species, is a medium-sized mammal native to North America. It is the largest of the procyonid family, having a body length of 40 to 70 cm, and a body weight of 5 to 26 kg.",
"image": "https://raw.githubusercontent.com/akcgjc007/erc1155-Mushroom/main/nfts/1.jpeg"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "The Fox",
"description": "Foxes are small to medium-sized, omnivorous mammals belonging to several genera of the family Canidae. Foxes have a flattened skull, upright triangular ears, a pointed, slightly upturned snout, and a long bushy tail. Twelve species belong to the monophyletic `true foxes` group of genus Vulpes.",
"image": "https://raw.githubusercontent.com/akcgjc007/erc1155-Mushroom/main/nfts/0.jpeg"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "The Dino",
"description": "Dinosaurs are a diverse group of reptiles of the clade Dinosauria. They first appeared during the Triassic period, between 243 and 233.23 million years ago, although the exact origin and timing of the evolution of dinosaurs is the subject of active research.",
"image": "https://raw.githubusercontent.com/akcgjc007/erc1155-Mushroom/main/nfts/2.jpeg"
}
2 changes: 0 additions & 2 deletions migrations/2_all.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const Mushroom = artifacts.require("Mushroom");
const MushroomReceiver = artifacts.require("MushroomReceiver");

module.exports = function (deployer) {
deployer.deploy(Mushroom);
deployer.deploy(MushroomReceiver);
};
12 changes: 4 additions & 8 deletions migrations/3_send.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
const Mushroom = artifacts.require("Mushroom");
const MushroomReceiver = artifacts.require("MushroomReceiver");

module.exports = async function (deployer) {
let mush = await Mushroom.deployed();
let mushR = await MushroomReceiver.deployed();

const account = (await web3.eth.getAccounts())[0];
const amount = 100;
await mush.mint(mushR.address, amount);
await mushR.sendToWinners(mush.address, account, 0, (20).toString());
const amount = 10;

// await mush
// .balanceOf(account, 0)
// .then((d) => console.log("My balance: ", d.toString()));
await mush.mint(account, amount);
await mush.mint(account, amount);
await mush.mint(account, amount);
};
Binary file added nfts/0.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed nfts/0.png
Binary file not shown.
Binary file added nfts/1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added nfts/2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7a03883

Please sign in to comment.