Step 5 – Utility Modules & Environment Variables
Authentication screens compile now, but they reference several helper files we haven’t created yet. In this step we’ll:
Add ABIs and helper code under
/common/utilsDeclare any missing
.envkeysVerify that
/sign-upand/loginpages render without red import errors
5.1 Folder Structure
common/
└─ utils/
├─ MagmarSimpleAccountFactory.json
├─ NFTContract.json
├─ client.ts
└─ Loader.tsx5.2 Magmar SimpleAccountFactory ABI
common/utils/MagmarSimpleAccountFactory.json
[
{ "inputs":[{ "internalType":"contract IEntryPoint","name":"_entryPoint","type":"address"}], "stateMutability":"nonpayable","type":"constructor" },
{ "inputs":[], "name":"accountImplementation", "outputs":[{ "internalType":"contract SimpleAccount","name":"","type":"address"}], "stateMutability":"view","type":"function" },
{ "inputs":[{ "internalType":"address","name":"owner","type":"address" },{ "internalType":"uint256","name":"salt","type":"uint256" }], "name":"createAccount", "outputs":[{ "internalType":"contract SimpleAccount","name":"ret","type":"address"}], "stateMutability":"nonpayable","type":"function" },
{ "inputs":[{ "internalType":"address","name":"owner","type":"address" },{ "internalType":"uint256","name":"salt","type":"uint256" }], "name":"getAddress", "outputs":[{ "internalType":"address","name":"","type":"address"}], "stateMutability":"view","type":"function" }
]Address (Sepolia) —
0x9406Cc6185a346906296840746125a0E44976454Store it in.envfor easy edits later.
5.3 RPC Helper (viem)
common/utils/client.ts
5.4 DaisyUI Loader
common/utils/Loader.tsx
5.5 Demo NFT Contract ABI
common/utils/NFTContract.json
(abbreviated for brevity – include full ABI in your repo)
5.6 Environment Variables
Add or update .env.local:
5.7 Compile Check
Navigate to:
http://localhost:3000/sign-uphttp://localhost:3000/login
Both pages should load without import errors. Submitting the forms will still fail because /api/get-signer is not implemented yet—that’s intentional.
Last updated