{"repo":"vgrichina/web4-min-contract","free":true,"listed":false,"github":"https://github.com/vgrichina/web4-min-contract","clone":"git clone https://github.com/vgrichina/web4-min-contract.git","description":"Minimal useful Web4 contract. Can be used together with web4-deploy to deploy static websites","language":"Zig","stars":11,"topics":["ipfs","nearprotocol","web3","web4","zig"],"license":null,"category":"blockchain-web3","readme_excerpt":"web4-min-contract Minimal useful Web4 contract. Can be used together with web4-deploy to deploy website tied to your .near account, with static content hosted on IPFS. Building from source Install Zig. Below command uses v0.13.0. Then run: You should get zig-out/bin/web4-min file. Deploying smart contract Install near-cli-rs first. Then run: See more on how to deploy NEAR smart contracts. Deploying website Run web4-deploy using npx : How it works web4-deploy will upload your website to IPFS and then call web4 setStaticUrl method in this smart contract to set IPFS hash of your website. Then you can access your website using https:// .near.page Web4 gateway. Contract Functions - web4 get : Serves static content from IPFS, with SPA support (redirects to index.html) - web4 setStaticUrl : Updates the IPFS URL for static content - web4 setOwner : Updates the contract owner account SPA Support The contract automatically redirects paths without file extensions to index.html , making it suitable for Single Page Applications (SPAs). For example: - /about - serves /index.html - /style.css - serves directly Storage The contract uses two storage keys: - web4:staticUrl - IPFS URL for static content - web4:owner - Optional owner account that can manage the contract Default Content When no static URL is set, the contract serves content from: This contains instructions for getting started. Access Control The contract can be managed by: - The contract account itself - An owner account (if set ","default_branch":null,"files":null,"tree":[],"storefront":"/r/vgrichina","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/vgrichina/web4-min-contract/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}