Coder Social home page Coder Social logo

Comments (1)

nidhhoggr avatar nidhhoggr commented on May 27, 2024

Most of the minting dapps using Moralis use the MoralisProvider function.
https://github.com/kjmczk/nextjs-nft-mint-dapp/blob/main/pages/_app.tsx#L8

The problem is that the latest version of Moralis doesnt seem to work with react-moralis which provides the useWeb3ExecuteFunction, or at least is an anti pattern by loading 2 versions of the same library.
https://github.com/kjmczk/nextjs-nft-mint-dapp/blob/main/components/Mint.tsx#L43

Further the most recent version of moralis doesn't provide any contract write functions.
So how I got my minting working using this boilerplate is by using an unwrapped Web3 dependency.

import Web3 from 'web3';
const web3 = new Web3(Web3.givenProvider);
const contract = new web3.eth.Contract(nftAbi, contractAddress);
        const response = await contract.methods
          .mint(mintAmount, autoManifest)
          .send({ from: user.address, value: mintPrice });

In conclusion, this repo is basically a readonly boilerplate. It would be nice to provide at least one write function in here for completeness. Otherwise consider renaming the repo: ethereum-readonly-boilerplate.

Closing for now.

from ethereum-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.