0
//SPDX-License-Identifier: MIT License
pragma solidity ^0.8.15;

import "./ERC721Creator.sol";

contract MockNFT is ERC721Creator {
    constructor() ERC721Creator("name", "symbol", msg.sender) {}
}

How do i wrap to make instances of this through a factory contract? I want to make a solidity factory contracts that takes just these 2 strings as arguments and mints a new NFT contract

1 Answer 1

0

You have to do two things to create factory:

  1. Create Factory Contract with such function:

    function newServiceOffer(string memory text0, string memory text1) external { NewContract newContract = new NewContract(text0, text1); }

  2. Create Template Contract:

Template smart contract has to have constructor if you want to give template smart contract arguments. In this case template smart contract name has to be NewContract.

constructor(string memory _text0, string memory _text1) {
        text0 = _text0;
        text1 = _text1;
    }

I think you just have to put few arguments inside of constructor, and then replace "name" and "symbol" with arguments given to constructor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.