File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ NEXT_PUBLIC_NFT_STORAGE_KEY=your-nft-storage-api-key
2323# SBT Contract Address Overrides (optional; prefer env over code edits)
2424# NEXT_PUBLIC_SBT_CONTRACT_ADDRESS_POLYGON_AMOY=0xYourDeployedAmoyContractAddress
2525
26+ # Cert threshold for publishing Web3 certificates
27+ # Lower this for testing, then raise it back before public use.
28+ # NEXT_PUBLIC_CERT_THRESHOLD=40
29+
2630# RPC URLs (optional - defaults are provided in code)
2731# POLYGON_AMOY_RPC=https://rpc-amoy.polygon.technology
2832# POLYGON_RPC=https://polygon-rpc.com
Original file line number Diff line number Diff line change @@ -98,7 +98,8 @@ export interface RatingReport {
9898 budgetPenaltyApplied : boolean ;
9999}
100100
101- const CERT_THRESHOLD = 40 ;
101+ const DEFAULT_CERT_THRESHOLD = 40 ;
102+ const CERT_THRESHOLD = readCertThreshold ( ) ;
102103
103104/** Public scoring entry point. */
104105export function score ( state : BuildState ) : RatingReport {
@@ -178,6 +179,13 @@ export function score(state: BuildState): RatingReport {
178179
179180const RULE_PACK_VERSION = '0.1.0' ;
180181
182+ function readCertThreshold ( ) : number {
183+ const raw = process . env . NEXT_PUBLIC_CERT_THRESHOLD ?? process . env . CERT_THRESHOLD ;
184+ if ( ! raw ) return DEFAULT_CERT_THRESHOLD ;
185+ const parsed = Number ( raw ) ;
186+ return Number . isFinite ( parsed ) ? parsed : DEFAULT_CERT_THRESHOLD ;
187+ }
188+
181189function clamp ( v : number , min : number , max : number ) {
182190 return Math . max ( min , Math . min ( max , v ) ) ;
183191}
You can’t perform that action at this time.
0 commit comments