Hello I wrote a smart contract for crowd funding
Actually I have two contracts One is create a campaign for donate funds and second is created campigns for crowd-funding and store all the campaigns address in one place when the user will create the campaign.
Now When I try to pass the stored campaign addresses as an endpoints in params in getStaticPaths.To filter the data in next js this error is coming
Error: network does not support ENS (operation=“ENS”, network=“maticmum”, code=UNSUPPORTED_OPERATION, version=providers/5.5.3 Network doesnot support
can anybody tell me why this error is coming?
Here is my Smart Contracts Code
pragma solidity >0.8.0;
contract campaignFactory{
Here is my address stored
address [] public deployedCampaigns;
event createdCampaign(
address indexed owner,
string indexed category,
uint indexed timestamp,
string title,
string storyUrI,
uint requireAmount,
string imageUrI,
address campaignAddress
);
function createCampaign(
string memory title,
string memory storyUrI,
uint requireAmount,
string memory category,
string memory imageUrI
)public{
Campaign newCampaign=new Campaign(title,storyUrI,requireAmount,msg.sender,imageUrI);
deployedCampaigns.push(address(newCampaign));
emit createdCampaign(msg.sender, category, block.timestamp, title, storyUrI, requireAmount, imageUrI,address(newCampaign));
}
this is my other smart contract to creat campaigns and donate function to send amount to owner who deployed campaigns.
contract Campaign{
event donated(address indexed owner,uint indexed amount,uint indexed timestamp);
string public campaignTitle;
string public story;
uint public requireAmount;
uint public receivedAmount;
address payable public campaignOwner;
string public image;
constructor(
string memory _campaignTitle,
string memory _story,
uint _requireAmount,
address _owner,
string memory _image
){
campaignTitle=_campaignTitle;
story=_story;
requireAmount=_requireAmount;
campaignOwner=payable(_owner);
image=_image;
}
function donate()payable public{
require(requireAmount>receivedAmount,"Require Amount is fullfilled");
campaignOwner.transfer(msg.value);
receivedAmount+=msg.value;
emit donated(msg.sender, msg.value, block.timestamp);
}
}
Here is my Next Js Code
export async function getStaticPaths(){
const provider=new ethers.providers.JsonRpcProvider(
AlchemyProvider
);
const contract=new ethers.Contract(
contractAddress,
CampaignFactory.abi,
provider
)
const getAllCampaigns=contract.filters.createdCampaign();
const allCampaigns=await contract.queryFilter(getAllCampaigns);
return{
paths:allCampaigns.map((e)=>({
params:{```
**The Problem is coming here**
**address:e.args.campaignAddress.toString()**
}
})),
fallback:true
}
};
if you calling function and your function require blackchin address but you pass wrong blockchain address than is error get