Skip to content

alvarengao/sentinel-bounty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Sentinel: Decentralized Incident Resolution System

Sentinel is a high-integrity Smart Contract built on the Solana blockchain (via Anchor Framework). It is designed to manage the registration, dispute, and resolution of incidents in a transparent, immutable, and verifiable manner.

🚀 Project Status The contract has been successfully optimized, compiled, and deployed to the Solana Devnet.

  • Program ID: 9DhDJEzfQN83y8EgjeKnrvRV1vf74gyrRL3qCBHLyuet
  • Explorer: View on Solana Explorer
  • Status: Fully Functional (Full lifecycle: File -> Dispute -> Resolve verified).
  • Anchor Version: 0.29.0

🏗️ Architecture & Logic Flow Sentinel utilizes a governance model based on PDAs (Program Derived Addresses) to ensure each incident is unique, secure, and cryptographically linked to its metadata.

  1. Incident Filing (file_incident): A victim registers an incident by providing the amount claimed and a 32-byte evidence hash (referencing off-chain data like IPFS/Arweave).
  2. Dispute Mechanism (dispute_incident): The designated respondent can contest the incident, transitioning the state to Disputed.
  3. Final Resolution (resolve_incident): Only the designated arbitrator can issue a final verdict, locking the status to prevent further tampering.

🛠️ Technical Challenges & Engineering Solutions The development process involved advanced system engineering to overcome environment-specific constraints:

  • Heap Allocation via Box: To overcome the strict 4KB stack limit of the Solana eBPF and prevent Access Violation errors, large account structures were wrapped in Box, moving data from the stack to the heap.
  • Internal Funding Mechanism: To bypass Devnet's 429 Too Many Requests (Airdrop rate limits), the test suite was engineered to use internal SystemProgram::transfer from the provider wallet to ephemeral signers.
  • Manual Space Allocation: Abandoned dynamic InitSpace macros in favor of deterministic manual byte calculation to ensure predictable Rent costs and eliminate compiler ambiguity during upgrades.
  • Stack Offset Optimization: Performed manual variable optimization to respect the 4096-byte stack limit, successfully mitigating stack offset overflows.

📂 File Structure

  • /programs/sentinel/src/lib.rs: Core contract logic.
  • /target/deploy/sentinel.so: Compiled SBF binary.
  • /target/idl/sentinel.json: Interface Definition Language (IDL) for front-end/test integration.
  • tests/sentinel.ts: Full integration test suite.

🧪 Testing & Interaction To execute the full lifecycle integration test:

yarn ts-mocha -p ./tsconfig.json -t 1000000 tests/sentinel.ts

#Developed by Alvarengao (Verdelli Technology)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors