Please excuse this newbie in advance!
I am wondering if anyone would share their experiences on the cost of deploying a contract, be it in on the main net or on a test net or even remix.
I understand gas costs vary and depend on contract size and amount of computation etc. I am looking for actual experiences from which myself and others reading this post can get a reference point for our own contracts.
I'd also appreciate it if anyone can check my logic here:
Execution cost = based on the amount and size of computational operations of the transaction
Transaction cost = includes execution cost. depends on the size of the contract. Is the base cost (21000 gas) + contract deployment (32000 gas) + cost for ever zero and non-zero byte of data
Gas is based on market prices denominated in Gwei (10^-9 ETH or 0.000000001 ETH)
At the time of this writing, it is about 43 Gwei which is about $2.41 according to Etherscan.
(Sound right?)
I am asking because I have written a short contract on Remix. It's a simple ERC 1155 that I added a function to allow the public to add new tokens (NFT specifically, supply = 1). When I test deploy on remix, it says the tx cost = 8000000 and execution cost = 221309. Which seems extremely high, especially if I follow the logic above. Am I missing something here? Why is it so high? I'm guessing maybe it has to do with importing the OpenZeppelin contract libraries? Any help or guidance would be appreciated. Here is the code and snapshot of gas cost below.
> pragma solidity >=0.8.0 <0.9.0;
>
> import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
> import "@openzeppelin/utils/Counters.sol";
>
> contract ScratchCollective is ERC1155 {
> using Counters for Counters.Counter;
>
> uint256 public constant ICHIBAN = 0;
>
> Counters.Counter private _tokenIdTracker;
>
> constructor() ERC1155("https://thebourneoldtomato.github.io/data/test{id}.json") {
> _mint(msg.sender, ICHIBAN, 1, "");
> }
>
> // allow user or client to create NFT
> function addNewArt(bytes memory data) public {
> _mint(msg.sender, _tokenIdTracker.current(), 1, data);
> _tokenIdTracker.increment();
> }
> }