-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tutorial: Cross-chain NFT marketplace #1634
Conversation
Signed-off-by: salaheldinsoliman <[email protected]>
a00ca3c
to
cdf6271
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, could use a few hardhat tests and not just manual testing with scripts, but it's quite nice 👍
In this series of tutorials, we will be building a cross-chain NFT marketplace using IOTA Smart Contracts (ISC). The marketplace will allow users to trade NFTs on ShimmerEVM Testnet, BNB Testnet, and Shimmer Testnet. | ||
|
||
Part I will cover the setup of the project and the deployment of the NFT marketplace contract on the ShimmerEVM Testnet. | ||
In part II, we will bridge NFTs from BNB Testnet and Shimmer Testnet to the ShimmerEVM Testnet and list them on the marketplace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will bridge NFTs from BNB Testnet and Shimmer Testnet to the ShimmerEVM Testnet
this is confusing. I think we should make it clear that we're talking about "L1 Shimmer testnet NFTs", maybe moving it into a separate sentence. Or dropping the L1 part in this tutorial entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In part II, we will bridge NFTs from BNB Testnet and Shimmer Testnet to the ShimmerEVM Testnet and list them on the marketplace. | |
The second part of the series will focus on bridging NFTs from Layer 1 networks, like the Shimmer and BNB Testnets, to the ShimmerEVM Testnet and listing them on the marketplace you created in part I. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start :) Please use references for the imports, and explain the contracts and scripts step by step. The idea for tutorials is to teach the user how to do this, more than how to clone the repo and run the scripts. So we need to walk them step by step so they can build their own implementation, while using the repository as an example.
config/tutorials.js
Outdated
@@ -249,4 +249,24 @@ module.exports = [ | |||
], | |||
}, | |||
], | |||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it may be a good idea to move this tutorial into the ISC docs directly, under a new folder called tutorials. There are currently no links pointing to the tutorial section, as lots are outdated.
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the other tutorials are outdated it would be a good idea to separate them yes, until they are given a review to refresh them
@@ -0,0 +1,572 @@ | |||
# Cross-chain NFT Marketplace: Part I | |||
|
|||
In this series of tutorials, we will be building a cross-chain NFT marketplace using IOTA Smart Contracts (ISC). The marketplace will allow users to trade NFTs on ShimmerEVM Testnet, BNB Testnet, and Shimmer Testnet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this series of tutorials, we will be building a cross-chain NFT marketplace using IOTA Smart Contracts (ISC). The marketplace will allow users to trade NFTs on ShimmerEVM Testnet, BNB Testnet, and Shimmer Testnet. | |
This is the first part of a three-part series that will guide you as you build a cross-chain NFT marketplace using IOTA Smart Contracts (ISC). The marketplace will allow users to trade NFTs on the ShimmerEVM Testnet, BNB Testnet, and Shimmer L1 Testnet. |
In this series of tutorials, we will be building a cross-chain NFT marketplace using IOTA Smart Contracts (ISC). The marketplace will allow users to trade NFTs on ShimmerEVM Testnet, BNB Testnet, and Shimmer Testnet. | ||
|
||
Part I will cover the setup of the project and the deployment of the NFT marketplace contract on the ShimmerEVM Testnet. | ||
In part II, we will bridge NFTs from BNB Testnet and Shimmer Testnet to the ShimmerEVM Testnet and list them on the marketplace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In part II, we will bridge NFTs from BNB Testnet and Shimmer Testnet to the ShimmerEVM Testnet and list them on the marketplace. | |
The second part of the series will focus on bridging NFTs from Layer 1 networks, like the Shimmer and BNB Testnets, to the ShimmerEVM Testnet and listing them on the marketplace you created in part I. |
|
||
Part I will cover the setup of the project and the deployment of the NFT marketplace contract on the ShimmerEVM Testnet. | ||
In part II, we will bridge NFTs from BNB Testnet and Shimmer Testnet to the ShimmerEVM Testnet and list them on the marketplace. | ||
Finally, in part III, we will deploy another instance of the marketplace on the BNB Testnet, making the marketplace truly cross-chain by making the contract handle cross-chain transactions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, in part III, we will deploy another instance of the marketplace on the BNB Testnet, making the marketplace truly cross-chain by making the contract handle cross-chain transactions. | |
Finally, in part III, you will deploy another instance of the marketplace on the BNB Testnet, making the marketplace truly cross-chain. |
}); | ||
``` | ||
This will deploy the MyERC721 contract to the ShimmerEVM Testnet and save the contract address to a file. | ||
run it by executing: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run it by executing: | |
You can run the script by executing the following command: |
|
||
### mint_nft.js | ||
|
||
After deploying the MyERC721 contract, let's mint an NFT by running the following script: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After deploying the MyERC721 contract, let's mint an NFT by running the following script: | |
After you have deployed the `MyERC721` contract, you are ready to mint an NFT using the following script: |
```javascript | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
async function createNFT(myERC721Address) { | ||
|
||
const MyERC721 = await ethers.getContractFactory("MyERC721"); | ||
const myERC721 = MyERC721.attach(myERC721Address); | ||
|
||
const tx = await myERC721.mint(); | ||
await tx.wait(); // Wait for the transaction to be mined | ||
} | ||
|
||
async function main() { | ||
// Read the contract address from the file | ||
const addressPath = path.join(__dirname, 'addresses', 'MyERC721.txt'); | ||
const myERC721Address = fs.readFileSync(addressPath, 'utf8').trim(); | ||
|
||
await createNFT(myERC721Address); | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error); | ||
process.exit(1); | ||
}); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```javascript | |
const fs = require('fs'); | |
const path = require('path'); | |
async function createNFT(myERC721Address) { | |
const MyERC721 = await ethers.getContractFactory("MyERC721"); | |
const myERC721 = MyERC721.attach(myERC721Address); | |
const tx = await myERC721.mint(); | |
await tx.wait(); // Wait for the transaction to be mined | |
} | |
async function main() { | |
// Read the contract address from the file | |
const addressPath = path.join(__dirname, 'addresses', 'MyERC721.txt'); | |
const myERC721Address = fs.readFileSync(addressPath, 'utf8').trim(); | |
await createNFT(myERC721Address); | |
} | |
main() | |
.then(() => process.exit(0)) | |
.catch((error) => { | |
console.error(error); | |
process.exit(1); | |
}); | |
``` | |
```javascript reference | |
https://github.com/iota-community/ISC-Cross-Chain-NFT-Marketplace/blob/main/scripts/mint_nft.js | |
``` |
process.exit(1); | ||
}); | ||
``` | ||
execute the script by running: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
execute the script by running: | |
You can run the script by executing the following command: |
|
||
|
||
### approve_myERC721_for_marketplace.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### approve_myERC721_for_marketplace.js | |
### approve_myERC721_for_marketplace.js |
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing improvement !!! Last batch of comments on my end :) Btw, you don't need to add the suggestions manually; if you go to the Files
tab, hit Add suggestion to batch
to the ones you'd like to include and then commit them all at once.
docs/build/isc/v1.1/docs/tutorials/cross-chain-nft-marketplace-part-1.md
Outdated
Show resolved
Hide resolved
docs/build/isc/v1.1/docs/tutorials/cross-chain-nft-marketplace-part-1.md
Outdated
Show resolved
Hide resolved
docs/build/isc/v1.1/docs/tutorials/cross-chain-nft-marketplace-part-1.md
Outdated
Show resolved
Hide resolved
docs/build/isc/v1.1/docs/tutorials/cross-chain-nft-marketplace-part-1.md
Outdated
Show resolved
Hide resolved
docs/build/isc/v1.1/docs/tutorials/cross-chain-nft-marketplace-part-1.md
Outdated
Show resolved
Hide resolved
docs/build/isc/v1.1/docs/tutorials/cross-chain-nft-marketplace-part-1.md
Show resolved
Hide resolved
docs/build/isc/v1.1/docs/tutorials/cross-chain-nft-marketplace-part-1.md
Show resolved
Hide resolved
docs/build/isc/v1.1/docs/tutorials/cross-chain-nft-marketplace-part-1.md
Show resolved
Hide resolved
docs/build/isc/v1.1/docs/tutorials/cross-chain-nft-marketplace-part-1.md
Show resolved
Hide resolved
docs/build/isc/v1.1/docs/tutorials/cross-chain-nft-marketplace-part-1.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Lucas Tortora <[email protected]>
@lucas-tortora All thanks to your comments! |
Description of change
A cross-chain NFT marketplace: Part I
Links to any relevant issues
fixes #1625
Type of change
Change checklist
Tick the boxes that are relevant to your changes, and delete any items that are not.