Skip to content

Add gating#9

Closed
steven-tomlinson wants to merge 14 commits into
mainfrom
add-gating
Closed

Add gating#9
steven-tomlinson wants to merge 14 commits into
mainfrom
add-gating

Conversation

@steven-tomlinson
Copy link
Copy Markdown
Collaborator

Basic (insecure) token-gating.

steven-tomlinson added 14 commits November 22, 2025 17:47
- Created a new HTML page for minting the Lockb0x Sigil NFT, including wallet connection and minting instructions.
- Added redirect pages for chapters 1 to 6 and chapter 1a of The Whispering Code, directing users to the corresponding Keya chapters.
…checks, and improve UI elements for minting tiers and design options.
- Updated contract address in contract-address.json.
- Modified index.html to improve wallet connection checks and PoH verification.
- Refactored mint.js to streamline PoH signature retrieval and minting logic.
- Enhanced utils.js for better PoH verification handling and localStorage management.
- Introduced Lockb0xSigil.sol contract with minting functionality and SVG metadata generation.
- Added agent instructions for implementing wallet-compatible SVG JSON metadata without altering existing CBOR logic.
…for SEO

- Added a carrier detection notification in the header.
- Updated meta title and description for better clarity and SEO.
- Improved Open Graph and Twitter card metadata for enhanced sharing.
- Refactored hero image section and adjusted visibility logic.
- Enhanced user guidance for Proof of Humanity verification.
- Updated footer information for project attribution.
- Improved wallet connection checks and error handling in lockb0x.
- Added new styles for kaleidoscope effect and Web3Auth error overlay.
- Implemented Web3Auth integration for MetaMask login.
- Created contract interaction helpers for NFT ownership checks.
- Developed interstitial page for Lockb0x Sigil NFT checks.
- Added parameter validation and price table for minting.
- Enhanced session management for Proof of Humanity verification.
- Implemented network switching logic for Linea Mainnet and Sepolia.
- Updated configuration for Web3Auth client ID.
- Created chapter1a-game-test.html for testing the interactive fiction game.
- Implemented chapter1a-game.js containing the game logic, scenes, and state management.
- Added header-logic.js for carrier detection and cookie consent management.
- Introduced lockb0x-utils-global.js to load lockb0x utilities as a global module.
- Configured contract-config.js to expose contract address and ABI for the dapp.
- Included backup.txt with carrier detection logic and PoH/NFT badge handling.
…ty with lockb0x utilities

- Updated script tags in artefacts, fragments, keya, lockb0x, and primer HTML files to include anime.js and lockb0x utility scripts.
- Removed deprecated header logic scripts and replaced them with a more streamlined approach for utility initialization.
- Modified content in keya chapters to indicate upcoming development status.
- Ensured backward compatibility checks for lockb0x utilities are in place across all updated files.
…cription of token-gating and contribution processes
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lockb0x/utils.js
Comment on lines +153 to +158
export async function getTokenGatingState() {
let connected = false, wallet = null, poh = false, error = null;
try {
connected = await isMetaMaskConnected();
wallet = getWalletConnected();
poh = await isPohVerified();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve undefined isPohVerified in gating state

getTokenGatingState calls isPohVerified() but that function is never defined or exported in utils.js (only isPohVerifiedForAddress exists). As soon as this code runs it will throw a ReferenceError, so the gating state computation and any dependent redirects will always fail. Define the function or call the existing address-aware helper instead.

Useful? React with 👍 / 👎.

Comment thread lockb0x/web3.js
Comment on lines +63 to +67
if (network.chainId !== 59141n) {
try {
await window.ethereum.request({
method: "wallet_switchEthereumChain",
params: [{ chainId: "0xe708" }], // 59141 hex
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Switch to Linea Sepolia using correct chainId

ensureLineaSepolia requests wallet_switchEthereumChain with chainId 0xe708, which is 59144 (Linea mainnet) even though the check above is looking for 59141. On Sepolia this call will try to switch to the wrong network and throw, leaving callers unable to reach the intended testnet. Use the 59141 (0xe705/0xe704) chainId when requesting the switch.

Useful? React with 👍 / 👎.

Comment thread lockb0x/interstitial.html
Comment on lines +25 to +27
<script type="module">
import { isMetaMaskConnected, getWalletConnected, hasLockb0xSigilNFT, ensureLineaSepolia, registerWalletEventHandlers } from './utils.js';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Import gating helpers from modules that export them

The interstitial page imports hasLockb0xSigilNFT and ensureLineaSepolia from utils.js, but that module only exports the MetaMask helpers and lacks those names. The ES module will fail to load with a missing export error before any gating logic runs. Import the functions from the files that define them (e.g., contract.js/web3.js) or re-export them from utils.js.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant