T09 · Insecure Skill Coding Practices
- Location
scripts/bridge_optimizer.py:98- Finding
Simulated bridge estimates are misrepresented as live, executable recommendations
- Content
View full analysis
dict | None: """Stargate public quote — LayerZero Scan API.""" try: # Stargate has no fully free quote API; we estimate via known fee structure. # The official path requires their router contract; this returns a structural estimate. # For real production use, integrate @stargatefinance/stargate or call the router. return { "bridge": "Stargate", "fee_usd": round((amount_raw / 1e18) * 0.0005, 4) if token_addr != TOKEN_ADDRESSES_ETH["USDC"] else round((amount_raw / 1e6) * 0.0005, 4), "eta_sec": 120, "hops": 1, "raw": {"note": "structural estimate, not a live quote"}, } except Exception as e: return {"bridge": "Stargate", "error": str(e)} def quote_hop(src: int, dst: int, token_addr: str, amount_raw: int) -> dict | None: try: return { "bridge": "Hop", "fee_usd": round((amount_raw / 1e18) * 0.0010, 4) if token_addr not in (TOKEN_ADDRESSES_ETH["USDC"], TOKEN_ADDRESSES_ETH["USDT"]) else round((amount_raw / 1e6) * 0.0010, 4), "eta_sec": 300, "hops": 2, "raw": {"note": "structural estimate, Hop's live quote requires their SDK"}, } except Exception as e: return {"bridge": "Hop", "error": str(e)} def quote_connext(src: int, dst: int, token_addr: str, amount_raw: int) -> dict | None: try: return { "bridge": "Connext", "fee_usd": round((amount_raw / 1e18) * 0.0003, 4) if token_addr ...[truncated 3459 chars]- Remediation
View remediation
