简体   繁体   English

在测试网上部署 ERC-721 合约时,我得到了不切实际的低 gas 费

[英]I'm getting unrealistically low gas fee's when deploying an ERC-721 contract on testnet

I deployed my smart contract(ERC-721) on truffle (Rinkeby | Ropsten | local node) and again on Remix and I keep getting an average cost of 0.0165 ether.我在 truffle(Rinkeby | Ropsten | 本地节点)上部署了我的智能合约(ERC-721),然后又在 Remix 上部署了我的平均成本为 0.0165 以太币。 This gas fee seems unrealistic to me, even though my contract is pretty simple.尽管我的合同很简单,但这笔汽油费对我来说似乎是不现实的。

I finally tried deploying to MAINNET using Truffle and the transactions stopped due to a low gas value.我终于尝试使用 Truffle 部署到 MAINNET,但由于 gas 值低,交易停止了。 I switched over to REMIX and the new total gas fee is 0.65 ($2500) ether.我切换到 REMIX,新的总汽油费是 0.65(2500 美元)以太币。

Is this a realistic amount to deploy a smart contract?这是部署智能合约的现实数量吗? or do I need to change some setting on remix?还是我需要更改一些混音设置?

Do the testnet's give a good representation of what gas fee will cost on mainnet?测试网是否很好地说明了主网上的 gas 费用?

The amount of gas used from gas limit, not the gas price is going to be consistent between mainnet and testnets as the gas used from gas limit represents the amount of work that needs to be done to process the transaction logic in the EVM.从 gas limit 使用的 gas 量,而不是 gas 价格在主网和测试网之间将保持一致,因为从 gas limit 使用的 gas 代表了处理 EVM 中的交易逻辑需要完成的工作量。 Gas price (how much you pay for a unit of gas used) fluctuates as it is dependent on market economics/game theory, which is going to be very different on a test network vs live network.天然气价格(您为使用的单位天然气支付的费用)会波动,因为它取决于市场经济/博弈论,这在测试网络与实际网络上会有很大不同。

References参考

https://ethereum.org/en/developers/docs/gas/ https://ethereum.org/en/developers/docs/gas/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM