- Try the demo without SSO:https://zk-polls.netlify.app/
- Try the demo with SSO: https://zk-polls-sso.netlify.app/
This is a demo app for a ZKsync-based poll application. Connected accounts can create polls with two options and vote on them.
The contracts folder contains the smart contract powering this app. Build with Foundry-zksync.
forge build --zksync: compiles contratsforge test -vv --zksync: runs the testsforge create --rpc-url zksync_era_sepolia --account myKeystore src/Poll.sol:PollContract --zksync: deploys the contract on ZKsync Sepolia testnetforge verify-contract 0xe888F8eDfd68F66c2a10AB1da561Cacb99AD9293 src/Poll.sol:PollContract --zksync --verifier zksync --verifier-url https://explorer.sepolia.era.zksync.dev/contract_verification: verifies the contract on the ZKsync Sepolia testnet explorer.
Contract is already deployed on ZKsync Sepolia testnet in the address 0xe888F8eDfd68F66c2a10AB1da561Cacb99AD9293
The webapp folder contains the frontend powering this app. Built with Vue 3 and Nuxt 3.
npm run dev: starts the development server.
It uses wagmi to manage account and contract interactions. The logic to interact with the contract is in the composables/usePollContract.ts file.
The default main brach contains a basic setup with only the injected browser connector. Switch to the feat/sso branch to enable connetion using ZKsync SSO (git checkout feat/sso). Learn more about ZKsync SSO here
Esta es una demostración para una aplicación de encuestas en ZKsync. Las cuentas conectadas pueden crear encuestas con dos opciones y votar en ellas.
La carpeta contracts contiene el contrato inteligente utilizado esta aplicación. Construido con Foundry-zksync.
forge build --zksync: compila contratosforge test -vv --zksync: ejecuta los testsforge create --rpc-url zksync_era_sepolia --account myKeystore src/Poll.sol:PollContract --zksync: despliega el contrato en la red de prueba ZKsync Sepoliaforge verify-contract 0xe888F8eDfd68F66c2a10AB1da561Cacb99AD9293 src/Poll.sol:PollContract --zksync --verifier zksync --verifier-url https://explorer.sepolia.era.zksync.dev/contract_verification: verifica el contrato en el explorador de la red de prueba ZKsync Sepolia.
El contrato ya está desplegado en la red de prueba ZKsync Sepolia en la dirección 0xe888F8eDfd68F66c2a10AB1da561Cacb99AD9293
La carpeta webapp contiene el frontend que impulsa esta aplicación. Construido con Vue 3 y Nuxt 3.
npm run dev: inicia el servidor de desarrollo.
Utiliza wagmi para gestionar las interacciones de cuenta y contrato. La lógica para interactuar con el contrato está en el archivo composables/usePollContract.ts.
La rama main predeterminada contiene una configuración básica con solo el conector del navegador inyectado. Cambie a la rama feat/sso para habilitar la conexión usando ZKsync SSO (git checkout feat/sso). Aprende más sobre ZKsync SSO aquí