在多边形上测试 NFT 合约
我按照以下 OpenSea 教程中的教程步骤进行操作:
https://docs.opensea.io/docs/setting-up-your-smart-contract-project
看起来这是基于以太坊的,需要一些付款。脚本hardhat.config.js如下:
/**
* @type import('hardhat/config').HardhatUserConfig
*/
require('dotenv').config();
require("@nomiclabs/hardhat-ethers");
const { ALCHEMY_KEY, ACCOUNT_PRIVATE_KEY } = process.env;
module.exports = {
solidity: "0.8.0",
defaultNetwork: "rinkeby",
networks: {
hardhat: {},
rinkeby: {
url: `https://eth-rinkeby.alchemyapi.io/v2/${ALCHEMY_KEY}`,
accounts: [`0x${ACCOUNT_PRIVATE_KEY}`]
},
ethereum: {
chainId: 1,
url: `https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_KEY}`,
accounts: [`0x${ACCOUNT_PRIVATE_KEY}`]
},
},
}
我只是想测试这个解决方案而不付任何钱。要进行哪些更改,或者是否有任何来源可以阅读有关免费测试的替代实现的更多信息?
I am following the steps of the tutorial in the OpenSea tutorial below:
https://docs.opensea.io/docs/setting-up-your-smart-contract-project
It looks like this is based on Ethereum and requires some payment. The script hardhat.config.js is as follows:
/**
* @type import('hardhat/config').HardhatUserConfig
*/
require('dotenv').config();
require("@nomiclabs/hardhat-ethers");
const { ALCHEMY_KEY, ACCOUNT_PRIVATE_KEY } = process.env;
module.exports = {
solidity: "0.8.0",
defaultNetwork: "rinkeby",
networks: {
hardhat: {},
rinkeby: {
url: `https://eth-rinkeby.alchemyapi.io/v2/${ALCHEMY_KEY}`,
accounts: [`0x${ACCOUNT_PRIVATE_KEY}`]
},
ethereum: {
chainId: 1,
url: `https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_KEY}`,
accounts: [`0x${ACCOUNT_PRIVATE_KEY}`]
},
},
}
I just wanted to test this solution without paying any money. What are the changes to make or is there any source where to read more about an alternative implementation that is free for testing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想测试智能合约,可以使用 Rinkeby Testnet 进行测试。您可以将合约部署到 Rinkeby 链并在此处检查交易状态:https://rinkeby.etherscan.io/
为了进行测试,您需要测试以太币,您可以从以下位置获取这些以太币:https://faucet.rinkeby.io/
但是,如果你想将其部署到主网,则需要支付 Gas 费。
如果是这种情况,您可以尝试部署在多边形链上以降低汽油费。请查看这篇文章,以便在多边形链上部署您的合约:
https://coinsbench.com/erc-721-nft-smart-contract-deployment-using-hardhat-97c74ce1362a
If you are looking to test the Smart Contract, you may use Rinkeby Testnet to test. You could deploy the contract to Rinkeby chain and check the status of the transaction here: https://rinkeby.etherscan.io/
In order to test, you would need test ethers and you could get these ethers from: https://faucet.rinkeby.io/
However, if you want to deploy it to mainnet, you would have to pay gas fees.
You may try to deploy on polygon chain for lower gas fee if that's the case. Take a look at this article in order to deploy your contract on polygon chain:
https://coinsbench.com/erc-721-nft-smart-contract-deployment-using-hardhat-97c74ce1362a