adrianhajdin / project_crowdfunding

With a stunning design, connected to the blockchain, metamask pairing, interaction with smart contracts, sending Ethereum through the blockchain network, and writing solidity code.
https://jsmastery.pro
693 stars 375 forks source link

Updated Implementation with NextJS 13 #18

Open 1qh opened 1 year ago

1qh commented 1 year ago

Hello everyone,

I'm excited to share my updated implementation of this Crowdfund Dapp using NextJS 13 with the new app directory. While I didn't add any new features, I wanted to give the project a fresh look that reflects my personal taste.

You can find my implementation of the project here: 1qh/third

I want to take a moment to thank the creator of the original project for his hard work and for sharing his code with the community. His project served as a great starting point for my own work, and I appreciate his willingness to make his code open source.

I also want to thank the creator for his video tutorial, which was incredibly helpful in understanding how the project works. While I didn't make any major changes to the functionality of the project, the tutorial helped me gain a deeper understanding of how it was put together.

If you have any feedback or suggestions, please feel free to leave a comment on my repository. I'm always looking for ways to improve my code and make it more useful for others.

Thank you for your time, and I hope you find it useful!

Best regards, Huy

A-Pradeep commented 1 year ago

Hi,@1qh ! excited to see your project and congrats on your new step. Im just a regular developer and exploring as you. Currently facing issue with code and hope your project can solve. 😄

deliriant commented 1 year ago

I just took a quick look at your code and it addressed something I felt was off in the original code which is the require statement in the function that creates campaigns

require(
            _deadline > block.timestamp,
            "Deadline should be date in the future."
        );

This here requires the parameter entered as deadline to be greater than the current block timestamp (which is what should be done)

In the original code

require(campaign.deadline < block.timestamp, "The deadline should be a date in the future.");

The condition of the require statement is flipped and it is checking the value of a variable that hasn't been assigned a value yet (0) which is why it doesn't give ay errors.