Skip to content

FhenixProtocol/smart-wallet-poc

Repository files navigation

Fhenix Smart Wallet POC

url: https://smart-wallet-poc-nine.vercel.app/

View your confidential balances using an alchemy LightAccount smart wallet. Built using the new Fhenix Permit V2 system (not provided by fhenix.js) on top of scaffold-eth.

! NOTE: The mock tokens are deployed on Sepolia, and don't use FHE operations for the encrypted data. This will be fixed when the alchemy account-kit contracts have been deployed on Fhenix Nitrogen. See FHERC20.sol for more.

! NOTE: Logging in with an EOA does not work, the existing rainbowkit connection logic has been removed, only smart wallets will work.

Relevant Links:

Defaults that should be changed:

  • Google oauth in Alchemy Account Kit config
  • Arch Alchemy Api Key
  • Need a WalletConnect api key
  • Add deployed site url to alchemy account kit config

Current issues

  • Handles only smart accounts, no support for eoa accounts

Task List

  • Remove standard wallet connection

  • Add Alchemy's account-kit sdk

  • Login / logout with account-kit

    • Email
    • Oauth (Google)
    • EOA
  • UI for login / logout

  • Add PermitV2 class from fhenix.js PermitV2 PR

  • Sign PermitV2 with smart wallet

  • Deploy Mock FHERC20s with encryption removed on Sepolia

  • Fetch smart wallet data from Sepolia

  • Pass PermissionV2 from user's permit to fetch mock encrypted balances

    • Current bug: PermissionInvalid_IssuerSignature
    • Bug Fixed: viem's hashTypedData will only return the correct value if chainId is a number.
  • Minting FHERC20 balance or encBalance (forces deployment of wallet)

  • Indicator in permit modal that it is invalid because not deployed

  • PermitV2 Modal for create / import permit

    • Permit explanation and link to docs
    • Create permit option (for me / for sharing)
    • Importing shared permit - sign and populate recipientSignature
    • Selecting permit from list of available permits
    • Checking satisfies project requirements
    • Add status indicator row to modal
  • Add status indicator to permit button

  • Hook PermitV2 Modal into UnsealableDisplay

  • Focused Permit Display

    • Update name
    • Copy permit data
      • Button
      • Copy only relevant data in JSON format
    • See full info of permit
  • Import permit blob

    • Validate (check issuer / recipient matches user address)
    • Sign if necessary (recipientSignature)
  • Not able to login with oauth - Error: enablePopupOauth must be set in configuration or signer.preparePopupOauth must be called before using popup-based OAuth login

    • FIXED: Missing env var
  • - Not able to login with email - 400 Bad Request / https://api.g.alchemy.com/signer/v1/lookup / error: You have not signed the Alchemy Accounts terms of service. Please sign at https://dashboard.alchemy.com/accounts before using this API.

    • FIXED: Missing env var

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published