在多边形上测试 NFT 合约

发布于 2025-01-10 14:49:01 字数 938 浏览 0 评论 0原文

我按照以下 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呆° 2025-01-17 14:49:01

如果您想测试智能合约,可以使用 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文