I created a site with the help of ipfs, my goal is to create a smart contract with the ipfs CID of this site. but i have no idea about this, can anyone help?

  • The question doesn't make much sense, a contract lives on the blockchain, it doesn't need ipfs. What are you trying to accomplish with ipfs and the contract? What would be the contract functionality?
    – Ismael
    Nov 5, 2022 at 5:27

1 Answer 1


You can reference the site using a string variable inside of a smart contract. I'm not sure what you mean by "create a smart contract with the ipfs CID of the site". Smart contracts have no native way of interacting with ipfs and no notion of CIDs, but you can put a public variable into the site to reference the smart contract if you want.

If what you mean is you want to connect your ipfs website to a smart contract, you have it backwards. The ipfs site will need to connect to a blockchain through a web3 provider, and can then launch transactions on behalf to users to that smart contract/blockchain using the web3 provider.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.