Looks like your .env
file is outside the smartcontract folder. Try move it in rather
Hi Qudusayo,
Thank you so much for your help. I was able to move along and deployed my smart contract to Mumbai. Somehow, my smart contract is having problem with 4. voteOnProposal. I am not too sure what went wrong here.
is there anything I could do to make this smart contract works? or should I just start over again?
Thank you for taking your time to help me with this.
When you ran this function, it reverted due to this line.
The contract by default only allows voting within 100 blocks from when the proposal was created. So you need to create another proposal (createProposal
function).
Thank you glad,
I was just wondering if there is a way to increase the default limit of 100 blocks?
I am now @59:25 of this tutorial and I am not too sure how to sync Moralis to my smartcontract.
- Which Topic should I select in the below screenshot to replace âproposalCreated(unit256, string, unit256, address);â in the video?
- There seems to have no where that I could input the âfunctionsâ to âAbiâ
Thank you so for your helps
I was just wondering if there is a way to increase the default limit of 100 blocks?
Yes you will need to adjust and redeploy the contract. At this line you can change the number from 100.
I am now @59:25 of this tutorial and I am not too sure how to sync Moralis to my smartcontract.
You need to select âCustom Eventâ when you go to create a sync. From there, you copy in your contractâs ABI (the tutorial should cover where to get this) and then you will be able to select the proposalCreated
event.
I can see the proposal status when running the app locally, however, when I deployed the build version to the web server, I donât see the status. I can still click the staus. Not sure where to fix it.
however, when I deployed the build version to the web server, I donât see the status.
How have you deployed it? If it is live, can you post the link. Make sure it works locally first (npm run build
/ yarn build
and then serve the build folder from a local webserver).
I ran npm run build and drop the build folder to the webserver.
I ran npm run build and drop the build folder to the webserver.
I mean a local webserver that you run locally from your build folder e.g. npx serve, not deployed (Netlify).
running npx serve -s build also gets the same issue with the status column not displaying. the hyperlink works when you click.
This may be related to an issue with some versions of web3uikit where some components donât display correctly in production builds - another user had a similar issue with the Netflix project.
Try inspecting the element or area where the status is meant to show in your browser to see if thereâs another style overriding or hiding the text. I can try it as well if you bring back the Netlify deploy.
In App.css, I am seeing this style that is hiding the Status text, try getting rid of that.
color: white !important;
works!! thank you very much!
Hi, i have created a custom contract, so far its all working with the frontend. Done so that only nft holders can vote and they receive 0.5$ per vote. Would like to add another option so that holders holding 10,000 tokens can receive 0.5$ as well or of a holder has both, nft and >9,999 tokens can recieve 1$. Would this be something you can advise me on how to add this into the contract ?
voteReward = 5 * 10**5;
uint256 public constant voteRewardDistributionThreshold = 25 * 10**6;
uint256 public supportedTokenID = nftid;
IERC1155 public openSeaStorefront = IERC1155(nftcontract);
IERC20 public rewardToken = IERC20(0x10908fE3174b974B5457d92B916f91702a82FE44);
mapping(uint256 => Proposal) public proposals;
mapping(address => uint256) public accumulatedRewards;
function voteOnProposal(uint256 _id, bool _vote) public {
require(proposals[_id].deadline > 0, "This proposal does not exist");
require(block.number <= proposals[_id].deadline, "The deadline to vote has passed for this proposal");
require(checkVoteEligibility(_id, msg.sender), "You do not own an NFT to vote on this proposal or you have already voted with this NFT");
You can try posting in the #smart-contract-help channel on the Moralis Discord - I wouldnât be able to help with that specifically.
Hi, all sorted, works perfectly, now have a very simple question i believe, im not that great with frontend, how would i go about changing the css for the status info buttons. Would like to remove the background around the words
You can use styled components to override the styles for components:
import styled from 'styled-components';
const NewButton = styled(Button)`
// CSS
`;
<Button ...> // instead of <Button>
If itâs not Button, look at the code to see what component is being used and use that name instead.