Hi there,
We use Manifold to mint 1 of 1 ERC721 NFT contracts, and we’re shocked at the cost of the overall creation of the contract. We’re currently paying between 0.1 to 0.15ETH to create a contract. Here are some examples:
https://etherscan.io/address/0xd1792bdb7dc03bb9318b582b403441c20363d264
https://etherscan.io/address/0xBf15A64F41E81149c09C28CcAF1cEB76672c636a
Is this normal? I don’t think this is related to high gas costs as we have minted dozens of times across a range of different times when gas is not experience.
Can someone help?
Thanks
Is this is the normal to be expected cost - that’s also okay, but then at least we know.
Could someone please provide some feedback?
lyndo
May 11, 2023, 4:08am
3
gm! Can you give us a bit more info about how you’re trying to deploy the contract? Were the contracts deployed from Manifold Studio? Which address are you deploying from?
Hey,
We deploy the contrat using Hardhat.
They are not deployed with Manifold studio.
We deploy using our wallet.
We found a topic telling about the ERC721Core contract is pretty heavy.
Here is our contrat :
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@manifoldxyz/creator-core-solidity/contracts/ERC721Creator.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "hardhat/console.sol";
contract Contract is ERC721Creator {
// contractAddress
string private contractAddress;
// baseURI
string public baseURI;
constructor(string memory name, string memory symbol, string memory uri_) ERC721Creator(name, symbol) {
contractAddress = toString(address(this));
baseURI = string(abi.encodePacked(uri_, contractAddress, '/'));
}
function toString(bytes memory data) public pure returns(string memory) {
bytes memory alphabet = "0123456789abcdef";
bytes memory str = new bytes(2 + data.length * 2);
str[0] = "0";
str[1] = "x";
for (uint i = 0; i < data.length; i++) {
str[2+i*2] = alphabet[uint(uint8(data[i] >> 4))];
str[3+i*2] = alphabet[uint(uint8(data[i] & 0x0f))];
}
return string(str);
}
function toString(address account) public pure returns(string memory) {
return toString(abi.encodePacked(account));
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "Nonexistent token");
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, Strings.toString(tokenId))) : '';
}
}
How could we use in a different way the ERC721Creator contract ?