[SOLVED] I have a problem with ethers! any can help please

hello please can you help me with this function the correct way to mint the smart contract I have tried everything and I don’t know what I am doing wrong I follow the documentation and nothing attached the abi bytecode and the abi code

> first funtion:

async function createCollectionEmail(values: any) {

    console.log('userRender', userRender)

    try{

     

      const ethers = Moralis.web3Library;

      console.log("πŸš€ ~ file: MintState.tsx:204 ~ createCollectionEmail ~ ethers", ethers)

      const privateKey = userRender.attributes?.privateKey ? userRender.attributes.privateKey : "";

      const mnemonic = userRender.attributes?.mnemonic ? userRender.attributes.mnemonic : "";

      console.log("πŸš€ ~ file: MintState.tsx:205 ~ createCollectionEmail ~ privateKey", typeof mnemonic)

      const userAddress = userRender.attributes?.ethAddress ? userRender.attributes.ethAddress : "";

      const rpc = auth.rpcUrl;

       

      // const provider = new ethers.providers.JsonRpcProvider("https://polygon-mumbai.g.alchemy.com/v2/F1K_GUpFYDTcyNtye1IA7kPc_ant5-EH");

      const provider = new ethers.providers.WebSocketProvider("wss://polygon-mumbai.g.alchemy.com/v2/F1K_GUpFYDTcyNtye1IA7kPc_ant5-EH")

      // const wallet = ethers.Wallet.fromMnemonic(mnemonic);

      const wallet = ethers.Wallet.fromMnemonic(mnemonic);

      const account = wallet.connect(provider);

      const price = ethers.utils.formatUnits(await provider.getGasPrice(),'gwei')

      // const account = signer.connect(provider)

      console.log('Transaction Hash');

      const payload = {

        // data: byteCodeCollectionWallet,

        gasLimit: 9000000,

        gasPrice: ethers.utils.parseUnits(price, 'gwei')

        // arguments: [values.nameCollection, values.symbol],

        // signer: account

      }

   

      console.log('Transaction Hash2');

      console.log('Transaction Hash2');

      const myContract = new ethers.ContractFactory(abiCollectionWallet, byteCodeCollectionWallet, account).attach(values.nameCollection, values.symbol);

     

      console.log('Transaction Hash2');

      const contract = await myContract.deploy(payload);

      const result = await contract.value();

      // const finalContract = contract.deployTransaction(account);

      console.log("πŸš€ ~ contract", contract);

      console.log("πŸš€ ~ result", result);

      // console.log('contract.address', contractDeploy.address);

      // console.log('contract.deployTransaction', contractDeploy.deployTransaction);

     

      console.log('πŸš€ ~ finished process')

    }catch(e: any) {

      console.log("no entro e", e.message)  

      console.log("no entro e2", e)  

    }

  }

abiCollectionWallet:

export const abiCollectionWallet = [

{

"inputs": [

  {

    "internalType": "string",

    "name": "name",

    "type": "string"

  },

  {

    "internalType": "string",

    "name": "symbol",

    "type": "string"

  }

],

"stateMutability": "nonpayable",

"type": "constructor"

},

{

"anonymous": false,

"inputs": [

  {

    "indexed": true,

    "internalType": "address",

    "name": "owner",

    "type": "address"

  },

  {

    "indexed": true,

    "internalType": "address",

    "name": "approved",

    "type": "address"

  },

  {

    "indexed": true,

    "internalType": "uint256",

    "name": "tokenId",

    "type": "uint256"

  }

],

"name": "Approval",

"type": "event"

},

{

"anonymous": false,

"inputs": [

  {

    "indexed": true,

    "internalType": "address",

    "name": "owner",

    "type": "address"

  },

  {

    "indexed": true,

    "internalType": "address",

    "name": "operator",

    "type": "address"

  },

  {

    "indexed": false,

    "internalType": "bool",

    "name": "approved",

    "type": "bool"

  }

],

"name": "ApprovalForAll",

"type": "event"

},

{

"anonymous": false,

"inputs": [

  {

    "indexed": true,

    "internalType": "address",

    "name": "previousOwner",

    "type": "address"

  },

  {

    "indexed": true,

    "internalType": "address",

    "name": "newOwner",

    "type": "address"

  }

],

"name": "OwnershipTransferred",

"type": "event"

},

{

"anonymous": false,

"inputs": [

  {

    "indexed": true,

    "internalType": "address",

    "name": "from",

    "type": "address"

  },

  {

    "indexed": true,

    "internalType": "address",

    "name": "to",

    "type": "address"

  },

  {

    "indexed": true,

    "internalType": "uint256",

    "name": "tokenId",

    "type": "uint256"

  }

],

"name": "Transfer",

"type": "event"

},

{

"inputs": [

  {

    "internalType": "uint256",

    "name": "",

    "type": "uint256"

  }

],

"name": "Items",

"outputs": [

  {

    "internalType": "uint256",

    "name": "id",

    "type": "uint256"

  },

  {

    "internalType": "address",

    "name": "creator",

    "type": "address"

  },

  {

    "internalType": "string",

    "name": "uri",

    "type": "string"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "address",

    "name": "to",

    "type": "address"

  },

  {

    "internalType": "uint256",

    "name": "tokenId",

    "type": "uint256"

  }

],

"name": "approve",

"outputs": [],

"stateMutability": "nonpayable",

"type": "function"

},

{

"inputs": [],

"name": "artist",

"outputs": [

  {

    "internalType": "address",

    "name": "",

    "type": "address"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "address",

    "name": "owner",

    "type": "address"

  }

],

"name": "balanceOf",

"outputs": [

  {

    "internalType": "uint256",

    "name": "",

    "type": "uint256"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "string",

    "name": "uri",

    "type": "string"

  },

  {

    "internalType": "uint256",

    "name": "price",

    "type": "uint256"

  },

  {

    "internalType": "address",

    "name": "to",

    "type": "address"

  }

],

"name": "createItem",

"outputs": [

  {

    "internalType": "uint256",

    "name": "",

    "type": "uint256"

  }

],

"stateMutability": "payable",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "address",

    "name": "",

    "type": "address"

  }

],

"name": "excludedList",

"outputs": [

  {

    "internalType": "bool",

    "name": "",

    "type": "bool"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "uint256",

    "name": "tokenId",

    "type": "uint256"

  }

],

"name": "getApproved",

"outputs": [

  {

    "internalType": "address",

    "name": "",

    "type": "address"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [],

"name": "getArtist",

"outputs": [

  {

    "internalType": "address",

    "name": "",

    "type": "address"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "address",

    "name": "owner",

    "type": "address"

  },

  {

    "internalType": "address",

    "name": "operator",

    "type": "address"

  }

],

"name": "isApprovedForAll",

"outputs": [

  {

    "internalType": "bool",

    "name": "",

    "type": "bool"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [],

"name": "name",

"outputs": [

  {

    "internalType": "string",

    "name": "",

    "type": "string"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [],

"name": "owner",

"outputs": [

  {

    "internalType": "address",

    "name": "",

    "type": "address"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "uint256",

    "name": "tokenId",

    "type": "uint256"

  }

],

"name": "ownerOf",

"outputs": [

  {

    "internalType": "address",

    "name": "",

    "type": "address"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [],

"name": "renounceOwnership",

"outputs": [],

"stateMutability": "nonpayable",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "address",

    "name": "from",

    "type": "address"

  },

  {

    "internalType": "address",

    "name": "to",

    "type": "address"

  },

  {

    "internalType": "uint256",

    "name": "tokenId",

    "type": "uint256"

  }

],

"name": "safeTransferFrom",

"outputs": [],

"stateMutability": "nonpayable",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "address",

    "name": "from",

    "type": "address"

  },

  {

    "internalType": "address",

    "name": "to",

    "type": "address"

  },

  {

    "internalType": "uint256",

    "name": "tokenId",

    "type": "uint256"

  },

  {

    "internalType": "bytes",

    "name": "data",

    "type": "bytes"

  }

],

"name": "safeTransferFrom",

"outputs": [],

"stateMutability": "nonpayable",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "address",

    "name": "operator",

    "type": "address"

  },

  {

    "internalType": "bool",

    "name": "approved",

    "type": "bool"

  }

],

"name": "setApprovalForAll",

"outputs": [],

"stateMutability": "nonpayable",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "bytes4",

    "name": "interfaceId",

    "type": "bytes4"

  }

],

"name": "supportsInterface",

"outputs": [

  {

    "internalType": "bool",

    "name": "",

    "type": "bool"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [],

"name": "symbol",

"outputs": [

  {

    "internalType": "string",

    "name": "",

    "type": "string"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "uint256",

    "name": "tokenId",

    "type": "uint256"

  }

],

"name": "tokenURI",

"outputs": [

  {

    "internalType": "string",

    "name": "",

    "type": "string"

  }

],

"stateMutability": "view",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "address",

    "name": "from",

    "type": "address"

  },

  {

    "internalType": "address",

    "name": "to",

    "type": "address"

  },

  {

    "internalType": "uint256",

    "name": "tokenId",

    "type": "uint256"

  }

],

"name": "transferFrom",

"outputs": [],

"stateMutability": "nonpayable",

"type": "function"

},

{

"inputs": [

  {

    "internalType": "address",

    "name": "newOwner",

    "type": "address"

  }

],

"name": "transferOwnership",

"outputs": [],

"stateMutability": "nonpayable",

"type": "function"

}

]

> byteCodeCollectionWallet:

export const byteCodeCollectionWallet = "60806040523480156200001157600080fd5b5060405162001d1e38038062001d1e833981016040819052620000349162000249565b8151829082906200004d906000906020850190620000f0565b50805162000063906001906020840190620000f0565b505050620000806200007a6200009a60201b60201c565b6200009e565b5050600880546001600160a01b0319163317905562000303565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620000fe90620002b0565b90600052602060002090601f0160209004810192826200012257600085556200016d565b82601f106200013d57805160ff19168380011785556200016d565b828001600101855582156200016d579182015b828111156200016d57825182559160200191906001019062000150565b506200017b9291506200017f565b5090565b5b808211156200017b576000815560010162000180565b600082601f830112620001a7578081fd5b81516001600160401b0380821115620001c457620001c4620002ed565b604051601f8301601f19908116603f01168101908282118183101715620001ef57620001ef620002ed565b816040528381526020925086838588010111156200020b578485fd5b8491505b838210156200022e57858201830151818301840152908201906200020f565b838211156200023f57848385830101525b9695505050505050565b600080604083850312156200025c578182fd5b82516001600160401b038082111562000273578384fd5b620002818683870162000196565b9350602085015191508082111562000297578283fd5b50620002a68582860162000196565b9150509250929050565b600281046001821680620002c557607f821691505b60208210811415620002e757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b611a0b80620003136000396000f3fe60806040526004361061012a5760003560e01c806370a08231116100ab578063b562d2c01161006f578063b562d2c014610326578063b88d4fde14610339578063c87b56dd14610359578063e094826b14610379578063e985e9c51461038e578063f2fde38b146103ae5761012a565b806370a082311461029a578063715018a6146102c75780638da5cb5b146102dc57806395d89b41146102f1578063a22cb465146103065761012a565b806323b872dd116100f257806323b872dd1461020557806342842e0e1461022557806343bc1612146102455780635600d2fa1461025a5780636352211e1461027a5761012a565b806301ffc9a71461012f57806306fdde0314610165578063081812fc14610187578063095ea7b3146101b457806317b47cc4146101d6575b600080fd5b34801561013b57600080fd5b5061014f61014a3660046113a1565b6103ce565b60405161015c919061150e565b60405180910390f35b34801561017157600080fd5b5061017a610416565b60405161015c9190611519565b34801561019357600080fd5b506101a76101a2366004611441565b6104a8565b60405161015c91906114a4565b3480156101c057600080fd5b506101d46101cf36600461135c565b6104cf565b005b3480156101e257600080fd5b506101f66101f1366004611441565b610570565b60405161015c939291906118e8565b34801561021157600080fd5b506101d4610220366004611272565b610625565b34801561023157600080fd5b506101d4610240366004611272565b61065d565b34801561025157600080fd5b506101a7610678565b34801561026657600080fd5b5061014f61027536600461121f565b610687565b34801561028657600080fd5b506101a7610295366004611441565b61069c565b3480156102a657600080fd5b506102ba6102b536600461121f565b6106d0565b60405161015c91906118df565b3480156102d357600080fd5b506101d4610714565b3480156102e857600080fd5b506101a7610728565b3480156102fd57600080fd5b5061017a610737565b34801561031257600080fd5b506101d4610321366004611326565b610746565b6102ba6103343660046113d9565b61075c565b34801561034557600080fd5b506101d46103543660046112ad565b61088f565b34801561036557600080fd5b5061017a610374366004611441565b6108ce565b34801561038557600080fd5b506101a7610996565b34801561039a57600080fd5b5061014f6103a9366004611240565b6109a5565b3480156103ba57600080fd5b506101d46103c936600461121f565b6109d3565b60006001600160e01b031982166380ac58cd60e01b14806103ff57506001600160e01b03198216635b5e139f60e01b145b8061040e575061040e82610a0d565b90505b919050565b6060600080546104259061194a565b80601f01602080910402602001604051908101604052809291908181526020018280546104519061194a565b801561049e5780601f106104735761010080835404028352916020019161049e565b820191906000526020600020905b81548152906001019060200180831161048157829003601f168201915b5050505050905090565b60006104b382610a26565b506000908152600460205260409020546001600160a01b031690565b60006104da8261069c565b9050806001600160a01b0316836001600160a01b031614156105175760405162461bcd60e51b815260040161050e90611841565b60405180910390fd5b806001600160a01b0316610529610a4b565b6001600160a01b031614806105455750610545816103a9610a4b565b6105615760405162461bcd60e51b815260040161050e90611882565b61056b8383610a4f565b505050565b600a6020526000908152604090208054600182015460028301805492936001600160a01b03909216926105a29061194a565b80601f01602080910402602001604051908101604052809291908181526020018280546105ce9061194a565b801561061b5780601f106105f05761010080835404028352916020019161061b565b820191906000526020600020905b8154815290600101906020018083116105fe57829003601f168201915b5050505050905083565b610636610630610a4b565b82610abd565b6106525760405162461bcd60e51b815260040161050e9061152c565b61056b838383610b1c565b61056b8383836040518060200160405280600081525061088f565b6008546001600160a01b031681565b60096020526000908152604090205460ff1681565b6000806106a883610c59565b90506001600160a01b03811661040e5760405162461bcd60e51b815260040161050e9061180a565b60006001600160a01b0382166106f85760405162461bcd60e51b815260040161050e90611708565b506001600160a01b031660009081526003602052604090205490565b61071c610c74565b6107266000610cb3565b565b6006546001600160a01b031690565b6060600180546104259061194a565b610758610751610a4b565b8383610d05565b5050565b6000610766610c74565b73139fd2aacc2f93a1d2f3c231f9703b52c07931c063a9059cbb610788610728565b856040518363ffffffff1660e01b81526004016107a69291906114f5565b602060405180830381600087803b1580156107c057600080fd5b505af11580156107d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f89190611385565b506108036007610da8565b600061080f6007610db1565b905061081b3382610db5565b604080516060810182528281523360208083019182528284018981526000868152600a8352949094208351815591516001830180546001600160a01b0319166001600160a01b03909216919091179055925180519293919261088392600285019201906110f9565b50919695505050505050565b6108a061089a610a4b565b83610abd565b6108bc5760405162461bcd60e51b815260040161050e9061152c565b6108c884848484610dcf565b50505050565b60606108d982610e02565b6108f55760405162461bcd60e51b815260040161050e906117bb565b6000828152600a6020526040902060020180546109119061194a565b80601f016020809104026020016040519081016040528092919081815260200182805461093d9061194a565b801561098a5780601f1061095f5761010080835404028352916020019161098a565b820191906000526020600020905b81548152906001019060200180831161096d57829003601f168201915b50505050509050919050565b6008546001600160a01b031690565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6109db610c74565b6001600160a01b038116610a015760405162461bcd60e51b815260040161050e906115cb565b610a0a81610cb3565b50565b6001600160e01b031981166301ffc9a760e01b14919050565b610a2f81610e02565b610a0a5760405162461bcd60e51b815260040161050e9061180a565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610a848261069c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080610ac98361069c565b9050806001600160a01b0316846001600160a01b03161480610af05750610af081856109a5565b80610b145750836001600160a01b0316610b09846104a8565b6001600160a01b0316145b949350505050565b826001600160a01b0316610b2f8261069c565b6001600160a01b031614610b555760405162461bcd60e51b815260040161050e90611611565b6001600160a01b038216610b7b5760405162461bcd60e51b815260040161050e9061168d565b610b888383836001610e1f565b826001600160a01b0316610b9b8261069c565b6001600160a01b031614610bc15760405162461bcd60e51b815260040161050e90611611565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a461056b83838360016108c8565b6000908152600260205260409020546001600160a01b031690565b610c7c610a4b565b6001600160a01b0316610c8d610728565b6001600160a01b0316146107265760405162461bcd60e51b815260040161050e90611786565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415610d375760405162461bcd60e51b815260040161050e906116d1565b6001600160a01b0383811660008181526005602090815260408083209487168084529490915290819020805460ff1916851515179055517f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190610d9b90859061150e565b60405180910390a3505050565b80546001019055565b5490565b610758828260405180602001604052806000815250610ea7565b610dda848484610b1c565b610de684848484610eda565b6108c85760405162461bcd60e51b815260040161050e90611579565b600080610e0e83610c59565b6001600160a01b0316141592915050565b60018111156108c8576001600160a01b03841615610e65576001600160a01b03841660009081526003602052604081208054839290610e5f908490611933565b90915550505b6001600160a01b038316156108c8576001600160a01b03831660009081526003602052604081208054839290610e9c90849061191b565b909155505050505050565b610eb18383610ff5565b610ebe6000848484610eda565b61056b5760405162461bcd60e51b815260040161050e90611579565b6000610eee846001600160a01b03166110ea565b15610fea57836001600160a01b031663150b7a02610f0a610a4b565b8786866040518563ffffffff1660e01b8152600401610f2c94939291906114b8565b602060405180830381600087803b158015610f4657600080fd5b505af1925050508015610f76575060408051601f3d908101601f19168201909252610f73918101906113bd565b60015b610fd0573d808015610fa4576040519150601f19603f3d011682016040523d82523d6000602084013e610fa9565b606091505b508051610fc85760405162461bcd60e51b815260040161050e90611579565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610b14565b506001949350505050565b6001600160a01b03821661101b5760405162461bcd60e51b815260040161050e90611751565b61102481610e02565b156110415760405162461bcd60e51b815260040161050e90611656565b61104f600083836001610e1f565b61105881610e02565b156110755760405162461bcd60e51b815260040161050e90611656565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46107586000838360016108c8565b6001600160a01b03163b151590565b8280546111059061194a565b90600052602060002090601f016020900481019282611127576000855561116d565b82601f1061114057805160ff191683800117855561116d565b8280016001018555821561116d579182015b8281111561116d578251825591602001919060010190611152565b5061117992915061117d565b5090565b5b80821115611179576000815560010161117e565b600067ffffffffffffffff808411156111ad576111ad61199b565b604051601f8501601f19908116603f011681019082821181831017156111d5576111d561199b565b816040528093508581528686860111156111ee57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b038116811461041157600080fd5b600060208284031215611230578081fd5b61123982611208565b9392505050565b60008060408385031215611252578081fd5b61125b83611208565b915061126960208401611208565b90509250929050565b600080600060608486031215611286578081fd5b61128f84611208565b925061129d60208501611208565b9150604084013590509250925092565b600080600080608085870312156112c2578081fd5b6112cb85611208565b93506112d960208601611208565b925060408501359150606085013567ffffffffffffffff8111156112fb578182fd5b8501601f8101871361130b578182fd5b61131a87823560208401611192565b91505092959194509250565b60008060408385031215611338578182fd5b61134183611208565b91506020830135611351816119b1565b809150509250929050565b6000806040838503121561136e578182fd5b61137783611208565b946020939093013593505050565b600060208284031215611396578081fd5b8151611239816119b1565b6000602082840312156113b2578081fd5b8135611239816119bf565b6000602082840312156113ce578081fd5b8151611239816119bf565b6000806000606084860312156113ed578283fd5b833567ffffffffffffffff811115611403578384fd5b8401601f81018613611413578384fd5b61142286823560208401611192565b9350506020840135915061143860408501611208565b90509250925092565b600060208284031215611452578081fd5b5035919050565b60008151808452815b8181101561147e57602081850181015186830182015201611462565b8181111561148f5782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906114eb90830184611459565b9695505050505050565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6000602082526112396020830184611459565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b60208082526029908201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616040820152683634b21037bbb732b960b91b606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526018908201527f4552433732313a20696e76616c696420746f6b656e2049440000000000000000604082015260600190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b6020808252603d908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60408201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606082015260800190565b90815260200190565b8381526001600160a01b038316602082015260606040820181905260009061191290830184611459565b95945050505050565b6000821982111561192e5761192e611985565b500190565b60008282101561194557611945611985565b500390565b60028104600182168061195e57607f821691505b6020821081141561197f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610a0a57600080fd5b6001600160e01b031981168114610a0a57600080fdfea26469706673582212206dfa00459d6424ac503af6edf8acdbf75400397519be1bd2fe8bd8b8e355b72a64736f6c63430008010033"

What happens when it doesn’t work?

hahaha thanks cryptokid after so much digging I was able to solve the problem by starting the smart contract it told me that something was wrong with the arguments and the solution that worked for me was to pass the arguments in this way this is the new function and everything is going well I leave it in Comments in case anyone finds it useful:

async function createCollectionEmail(values: any) {

    console.log('userRender', userRender)

    try{

     

      const ethers = Moralis.web3Library;

      const mnemonic = userRender.attributes?.mnemonic ? userRender.attributes.mnemonic : "";

      console.log("πŸš€ ~ file: MintState.tsx:205 ~ createCollectionEmail ~ privateKey", typeof mnemonic)

      const userAddress = userRender.attributes?.ethAddress ? userRender.attributes.ethAddress : "";

      const provider = new ethers.providers.WebSocketProvider("wss://polygon-mumbai.g.alchemy.com/v2/F1K_GUpFYDTcyNtye1IA7kPc_ant5-EH")

      const wallet = ethers.Wallet.fromMnemonic(mnemonic);

      const account = wallet.connect(provider);

      const myContract = new ethers.ContractFactory(abiCollectionWallet, byteCodeCollectionWallet, account);

      const contract = await myContract.deploy(values.nameCollection, values.symbol );

      console.log(contract.address);

      console.log(contract.deployTransaction);

   

      console.log('πŸš€ ~ finished process')

    }catch(e: any) {

      console.log("no entro e", e.message)  

      console.log("no entro e2", e)  

    }

  }

note: It should be noted that whenever I’m on the verge I ask for help, they had spent 4 days trying to solve the problem and every time I copy the problem in the forum, I can always fix the problem minutes before, thanks for your attention.

1 Like