# Project export: Eigensurance: AI x Web3

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: TreeHacks 2025
- Tagline: Decentralized AI-Managed Disaster Insurance Built on EigenLayer AVS. Disrupting the $9.8 trillion insurance industry.
- Devpost: https://devpost.com/software/lalala-vqp6xg
- GitHub: https://github.com/andrewgcodes/eigen
- Demo: https://eigensurance.vercel.app/
- Video: https://www.youtube.com/embed/59hxRp7uhn0?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 1 GitHub contributor(s) — Andrew (6 commits)

## Devpost submission (written by the team)

### Inspiration

💡🏠 Coming from Southern California, I'm very aware of the immense risks posed by wildfires, like the ones in LA last month. In fact, there was a brush fire just a few miles from my house. Unfortunately, increasing wildfire risks means that most home insurers are leaving the state, leaving millions without insurance. And, the remaining insurers have increased prices significantly. I've never done any crypto/web3 stuff before but wanted to explore for the hackathon. After reading about decentralized projects like Filecoin and Helium, I wondered: could we do the same for insurance? Instead of one profit-oriented corporation, services could be rendered transparently, quickly, and fairly on the blockchain, assisted by AI agents. I realized that insurance companies basically have three jobs: Risk assessment: determining how much insurance costs based on risk models Claims processing: reviewing claims and disbursing/denying funds Treasury investing: insurance companies make profit by investing collected money Having humans do this is very expensive. ~27% of annual premiums collected ($560B) is spent on operating expenses like salaries, sales commissions, management fees, etc. I realized that all three of these components could be replaced by AI and web3 technology, driving down costs exponentially—meaning that insurance can become cheaper, faster, and more fair. All this is enabled by the** Eigenlayer AVS system**, which enables us to get zkTLS verified off-chain LLM responses through Opacity and Cloudflare. Eigenlayer provides a way for independent operators to provide services like LLM inference, and they are incentivized to be truthful because they get slashed (lose their stake) if they are caught lying. Also, by being on the blockchain, we can ensure transparent pricing and payout conditions via smart contracts. What I made 🔗 While I wasn't able to finish the entire thing due to the complexity of the project and working solo, I was able to develop various working + open sourced key components including an AI agent and various smart contracts. a landing page + detailed technical whitepaper on a local testnet based on Eigenlayer Hello World AVS, a smart contract setup where users can purchase insurance policies, process claims, and simulate disaster events for testing. Operators would provide verified LLM inference, which powers the agents. Github repo local demo that uses Opacity and Perplexity API to review claims and verify the disaster events via Perplexity API, and returns a zkTLS-verified verdict. I hard-coded in satellite, weather, and other data for the time being but the Opacity GPT4o zkTLS stuff is real and so is the Perplexity API! Github repo more complex insurance policy smart contract with features like voting, various levels of insurance, expiry, etc. smart contract for wildfire prediction market **To invest collected premiums to make profit to reward restakers/operators and pay policyholders: Financial AI agent (uses five tools) that invests premiums using real data + calculator + submits simulated trade orders. Live demo Advanced version with simulated trades, and Github How I built it 🛠️ First of all, it was only possible thanks to a lot of explanations and help from the Eigenlayer and Opacity teams since this is my first time building a web3 project. To build things, I relied on the sample repos, Eigenlayer Hello World AVS and the Eigenlayer AI quickstart. The main languages were Solidity, TypeScript, and some HTML/CSS for the frontends. I also used Remix which is kind of like Replit for web3, which helped me test my smart contracts. I also used Google Colab to code and test the stock trading agent and then Replit to deploy the live demo. Challenges I ran into Learning the intricacies of smart contracts, on‑chain/off‑chain interactions, and integrating AVS Getting set up with a MetaMask wallet Remembering how much gwei, wei, and eth are Accomplishments that I'm proud of Building working smart contracts Learning about web3 and Eigenlayer What I learned How restaking, zkTLS, smart contracts, and AVS work

### What's next

for Eigensurance I would like to work on deploying this live!

## README (from the GitHub repository)

# Eigensurance AVS

Eigensurance is a decentralized disaster insurance protocol built on EigenLayer that leverages multiple operator validation for disaster event verification and claims processing.

## Architecture

The protocol consists of several key components:
- `DisasterInsuranceServiceManager`: Main contract handling policy creation, disaster validation, and claims
- `MockDisasterOracle`: Simulates disaster data feeds
- `MockStakeRegistry`: Handles operator registration and validation
- `MockAVSDirectory`: Manages AVS operator registration

## Setup Instructions

### Prerequisites
- [Node.js](https://nodejs.org/)
- [Foundry](https://getfoundry.sh/)
- [Git](https://git-scm.com/)

### Installation

1. Clone the repository:
```bash
git clone https://github.com/andrewgcodes/eigen.git
cd eigen
```

2. Install dependencies:
```bash
npm install
```

3. Copy environment files:
```bash
cp .env.example .env
cp contracts/.env.example contracts/.env
```

### Local Development

1. Start local Anvil chain:
```bash
npm run start:anvil
```

2. In a new terminal, deploy the contracts:
```bash
# Deploy EigenLayer core contracts
npm run deploy:core

# Deploy Disaster Insurance contracts
npm run deploy:insurance
```

## Usage

### Create a Policy
Create a new insurance policy:
```bash
npm run insurance:create-policy
```
This creates a policy with:
- Coverage amount: 1 ETH
- Location: San Francisco
- Disaster Type: EARTHQUAKE
- Premium: 5% of coverage amount

### Simulate a Disaster
Simulate a disaster event:
```bash
npm run insurance:simulate-disaster
```
This simulates an earthquake in San Francisco with:
- Severity: 7.0 on Richter scale
- Multiple operator validations
- Event verification

### Process Claims
Process an insurance claim:
```bash
npm run insurance:process-claim
```
This processes the claim for:
- The most recently created policy
- The most recent disaster event
- Transfers coverage amount to policyholder if valid

## Testing

Run the test suite:
```bash
cd contracts
forge test -vv
```

The tests cover:
- Policy creation
- Disaster event simulation
- Multi-operator validation
- Claim processing
- Edge cases and error conditions

## Contract Addresses (Local Testnet)

After deployment, contract addresses can be found in:
- EigenLayer Core: `deployments/core/31337.json`
- Disaster Insurance: `deployments/disaster-insurance/31337.json`

## Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

This project is licensed under the MIT License.

## Security

This is a prototype and has not been audited. Do not use in production.


## Detected evidence (automated analysis)

Indexed codebase: 3432 recognized source files, 21752 KB.
- CSS (language) — detected in the code
- Go (language) — detected in the code
- HTML (language) — detected in the code
- JavaScript (language) — detected in the code
- Python (language) — detected in the code
- React (technology) — detected in the code
- Rust (language) — detected in the code
- Solidity (language) — detected in the code
- TypeScript (language) — detected in the code
- OpenAI (technology) — claimed on Devpost, not found in the code
- Vercel (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (120 of 3888)

```
.dockerignore
.DS_Store
.env.example
.github/workflows/daily-dev-build.yml
.github/workflows/test.yml
.gitignore
.gitmodules
abis/ECDSAStakeRegistry.json
abis/HelloWorldServiceManager.json
abis/IAVSDirectory.json
abis/IDelegationManager.json
Cargo.lock
Cargo.toml
contracts/.env.example
contracts/.gitignore
contracts/anvil/deploy-el.sh
contracts/anvil/deploy-helloworld.sh
contracts/config/core/31337.json
contracts/config/hello-world/31337.json
contracts/foundry.toml
contracts/lib/eigenlayer-middleware/.github/ISSUE_TEMPLATE/bug_report.md
contracts/lib/eigenlayer-middleware/.github/ISSUE_TEMPLATE/design.md
contracts/lib/eigenlayer-middleware/.github/ISSUE_TEMPLATE/feature_request.md
contracts/lib/eigenlayer-middleware/.github/ISSUE_TEMPLATE/test.md
contracts/lib/eigenlayer-middleware/.github/workflows/commitlint.yml
contracts/lib/eigenlayer-middleware/.github/workflows/tests.yml
contracts/lib/eigenlayer-middleware/.gitignore
contracts/lib/eigenlayer-middleware/.gitmodules
contracts/lib/eigenlayer-middleware/.husky/commit-msg
contracts/lib/eigenlayer-middleware/commitlint.config.js
contracts/lib/eigenlayer-middleware/CONTRIBUTING.md
contracts/lib/eigenlayer-middleware/foundry.toml
contracts/lib/eigenlayer-middleware/go.mod
contracts/lib/eigenlayer-middleware/go.sum
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.devcontainer/devcontainer.json
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.devcontainer/Dockerfile
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.devcontainer/install.sh
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.dockerignore
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.env.example
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.gitattributes
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/ISSUE_TEMPLATE/bug_report.md
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/ISSUE_TEMPLATE/design.md
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/ISSUE_TEMPLATE/feature_request.md
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/ISSUE_TEMPLATE/implement.md
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/ISSUE_TEMPLATE/research.md
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/ISSUE_TEMPLATE/task.md
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/ISSUE_TEMPLATE/test_implementation.md
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/workflows/certora-prover.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/workflows/check-compilation.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/workflows/commitlint.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/workflows/coverage.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/workflows/deploy-local.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/workflows/format.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/workflows/storage-report.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.github/workflows/testinparallel.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.gitignore
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.gitmodules
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.husky/commit-msg
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.prettierrc
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.solhint.json
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/.solhintignore
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/bin/compile-bindings.sh
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/bin/install-deps.sh
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/bin/pre-commit.sh
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/bin/storage-report.sh
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/harnesses/DelegationManagerHarness.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/harnesses/EigenPodHarness.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/harnesses/EigenPodManagerHarness.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/harnesses/PausableHarness.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/harnesses/SlasherHarness.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/harnesses/StrategyManagerHarness.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/harnesses/StructuredLinkedListHarness.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/scripts/core/verifyDelegationManager.sh
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/scripts/core/verifyStrategyManager.sh
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/scripts/permissions/verifyPausable.sh
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/scripts/pods/verifyEigenPod.sh
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/scripts/pods/verifyEigenPodManager.sh
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/scripts/strategies/verifyStrategyBase.sh
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/specs/core/DelegationManager.spec
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/specs/core/Slasher.spec
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/specs/core/StrategyManager.spec
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/specs/libraries/StructuredLinkedList.spec
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/specs/permissions/Pausable.spec
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/specs/pods/EigenPod.spec
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/specs/pods/EigenPodManager.spec
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/certora/specs/strategies/StrategyBase.spec
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/commitlint.config.js
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/config.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/CONTRIBUTING.md
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/Dockerfile
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/foundry.toml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/go.mod
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/go.sum
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/hardhat.config.ts
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/ds-test/.github/workflows/build.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/ds-test/.gitignore
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/ds-test/default.nix
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/ds-test/demo/demo.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/ds-test/LICENSE
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/ds-test/Makefile
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/ds-test/package.json
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/ds-test/src/test.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/ds-test/src/test.t.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/.github/workflows/ci.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/.gitignore
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/.gitmodules
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/foundry.toml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/lib/ds-test/.github/workflows/build.yml
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/lib/ds-test/.gitignore
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/lib/ds-test/default.nix
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/lib/ds-test/demo/demo.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/lib/ds-test/LICENSE
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/lib/ds-test/Makefile
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/lib/ds-test/package.json
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/lib/ds-test/src/test.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/lib/ds-test/src/test.t.sol
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/LICENSE-APACHE
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/LICENSE-MIT
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/package.json
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/forge-std/README.md
[3768 more files omitted for size]
```

### Dependencies

- contracts/lib/eigenlayer-middleware/go.mod: github.com/bits-and-blooms/bitset@v1.5.0, github.com/consensys/bavard@v0.1.13, github.com/consensys/gnark-crypto@v0.11.1, github.com/mmcloughlin/addchain@v0.4.0, golang.org/x/sys@v0.2.0, rsc.io/tmplfunc@v0.0.3
- contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/go.mod: github.com/bits-and-blooms/bitset@v1.10.0, github.com/btcsuite/btcd/btcec/v2@v2.2.0, github.com/consensys/bavard@v0.1.13, github.com/consensys/gnark-crypto@v0.12.1, github.com/crate-crypto/go-kzg-4844@v1.0.0, github.com/deckarep/golang-set/v2@v2.1.0, github.com/decred/dcrd/dcrec/secp256k1/v4@v4.0.1, github.com/ethereum/c-kzg-4844@v1.0.0, github.com/ethereum/go-ethereum@v1.14.0, github.com/fsnotify/fsnotify@v1.6.0, github.com/go-ole/go-ole@v1.3.0, github.com/google/uuid@v1.3.0, github.com/gorilla/websocket@v1.4.2, github.com/holiman/uint256@v1.2.4, github.com/Microsoft/go-winio@v0.6.1, github.com/mmcloughlin/addchain@v0.4.0, github.com/shirou/gopsutil@v3.21.4-0.20210419000835-c7a38de76ee5+incompatible, github.com/StackExchange/wmi@v1.2.1, github.com/supranational/blst@v0.3.11, github.com/tklauser/go-sysconf@v0.3.12, github.com/tklauser/numcpus@v0.6.1, golang.org/x/crypto@v0.22.0, golang.org/x/mod@v0.17.0, golang.org/x/sync@v0.7.0, golang.org/x/sys@v0.19.0, golang.org/x/tools@v0.20.0, rsc.io/tmplfunc@v0.0.3
- contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/package.json: @changesets/changelog-github@^0.4.8, @changesets/cli@^2.26.0, @changesets/pre@^1.0.14, @changesets/read@^0.5.9, @nomicfoundation/hardhat-network-helpers@^1.0.3, @nomiclabs/hardhat-truffle5@^2.0.5, @nomiclabs/hardhat-web3@^2.0.0, @openzeppelin/docs-utils@^0.1.3, @openzeppelin/test-helpers@^0.5.13, @openzeppelin/upgrades-core@^1.20.6, chai@^4.2.0, eslint@^8.30.0, eslint-config-prettier@^8.5.0, eth-sig-util@^3.0.0, ethereumjs-util@^7.0.7, ethereumjs-wallet@^1.0.1, glob@^8.0.3, graphlib@^2.1.8, hardhat@^2.9.1, hardhat-exposed@^0.3.3, hardhat-gas-reporter@^1.0.4, hardhat-ignore-warnings@^0.2.0, keccak256@^1.0.2, lodash.startcase@^4.4.0, lodash.zip@^4.2.0, merkletreejs@^0.2.13, micromatch@^4.0.2, p-limit@^3.1.0, prettier@^2.8.1, prettier-plugin-solidity@^1.1.0, rimraf@^3.0.2, semver@^7.3.5, solhint@^3.3.6, solidity-ast@^0.4.25, solidity-coverage@^0.8.0, solidity-docgen@^0.6.0-beta.29, undici@^5.22.1, web3@^1.3.0, yargs@^17.0.0
- contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/requirements.txt: certora-cli@==3.6.4
- contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable/package.json: @nomiclabs/hardhat-truffle5@^2.0.5, @nomiclabs/hardhat-web3@^2.0.0, @openzeppelin/docs-utils@^0.1.0, @openzeppelin/test-helpers@^0.5.13, chai@^4.2.0, eslint@^7.32.0, eslint-config-standard@^16.0.3, eslint-plugin-import@^2.25.4, eslint-plugin-mocha@^10.0.3, eslint-plugin-node@^11.1.0, eslint-plugin-promise@^5.2.0, eth-sig-util@^3.0.0, ethereumjs-util@^7.0.7, ethereumjs-wallet@^1.0.1, graphlib@^2.1.8, hardhat@^2.9.1, hardhat-gas-reporter@^1.0.4, keccak256@^1.0.2, lodash.startcase@^4.4.0, lodash.zip@^4.2.0, merkletreejs@^0.2.13, micromatch@^4.0.2, prettier@^2.3.0, prettier-plugin-solidity@^1.0.0-beta.16, rimraf@^3.0.2, semver@^7.3.5, solhint@^3.3.6, solidity-ast@^0.4.25, solidity-coverage@^0.7.18, solidity-docgen@^0.5.3, web3@^1.3.0, yargs@^17.0.0
- contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-v4.9.0/package.json: @changesets/changelog-github@^0.4.8, @changesets/cli@^2.26.0, @changesets/pre@^1.0.14, @changesets/read@^0.5.9, @nomicfoundation/hardhat-network-helpers@^1.0.3, @nomiclabs/hardhat-truffle5@^2.0.5, @nomiclabs/hardhat-web3@^2.0.0, @openzeppelin/docs-utils@^0.1.3, @openzeppelin/test-helpers@^0.5.13, @openzeppelin/upgrades-core@^1.20.6, chai@^4.2.0, eslint@^8.30.0, eslint-config-prettier@^8.5.0, eth-sig-util@^3.0.0, ethereumjs-util@^7.0.7, ethereumjs-wallet@^1.0.1, glob@^8.0.3, graphlib@^2.1.8, hardhat@^2.9.1, hardhat-exposed@^0.3.3, hardhat-gas-reporter@^1.0.4, hardhat-ignore-warnings@^0.2.0, keccak256@^1.0.2, lodash.startcase@^4.4.0, lodash.zip@^4.2.0, merkletreejs@^0.2.13, micromatch@^4.0.2, p-limit@^3.1.0, prettier@^2.8.1, prettier-plugin-solidity@^1.1.0, rimraf@^3.0.2, semver@^7.3.5, solhint@^3.3.6, solidity-ast@^0.4.25, solidity-coverage@^0.8.0, solidity-docgen@^0.6.0-beta.29, undici@^5.22.1, web3@^1.3.0, yargs@^17.0.0
- contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-v4.9.0/requirements.txt: certora-cli@==3.6.4
- contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts/package.json: @nomiclabs/hardhat-truffle5@^2.0.5, @nomiclabs/hardhat-web3@^2.0.0, @openzeppelin/docs-utils@^0.1.0, @openzeppelin/test-helpers@^0.5.13, chai@^4.2.0, eslint@^7.32.0, eslint-config-standard@^16.0.3, eslint-plugin-import@^2.25.4, eslint-plugin-mocha@^10.0.3, eslint-plugin-node@^11.1.0, eslint-plugin-promise@^5.2.0, eth-sig-util@^3.0.0, ethereumjs-util@^7.0.7, ethereumjs-wallet@^1.0.1, graphlib@^2.1.8, hardhat@^2.9.1, hardhat-gas-reporter@^1.0.4, keccak256@^1.0.2, lodash.startcase@^4.4.0, lodash.zip@^4.2.0, merkletreejs@^0.2.13, micromatch@^4.0.2, prettier@^2.3.0, prettier-plugin-solidity@^1.0.0-beta.16, rimraf@^3.0.2, semver@^7.3.5, solhint@^3.3.6, solidity-ast@^0.4.25, solidity-coverage@^0.7.18, solidity-docgen@^0.5.3, web3@^1.3.0, yargs@^17.0.0
- contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/package.json: @commitlint/cli@^18.2.0, @commitlint/config-conventional@^18.1.0, @types/yargs@^17.0.28, chalk@^4.1.0, dotenv@^16.3.1, fs@^0.0.1-security, hardhat@^2.22.4, hardhat-preprocessor@^0.1.5, husky@^8.0.3, solhint@5.0.1, solidity-docgen@^0.6.0-beta.32, ts-node@^10.9.1, typescript@^4.9.4, yargs@^17.7.2
- contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/requirements.txt: certora-cli@==3.6.4
- contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/testHelpers/package.json: keccak256@^1.0.6, merkletreejs@^0.2.31, web3@^1.7.1
- contracts/lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/package.json: @nomiclabs/hardhat-truffle5@^2.0.5, @nomiclabs/hardhat-web3@^2.0.0, @openzeppelin/docs-utils@^0.1.0, @openzeppelin/test-helpers@^0.5.13, chai@^4.2.0, eslint@^7.32.0, eslint-config-standard@^16.0.3, eslint-plugin-import@^2.25.4, eslint-plugin-mocha@^10.0.3, eslint-plugin-node@^11.1.0, eslint-plugin-promise@^5.2.0, eth-sig-util@^3.0.0, ethereumjs-util@^7.0.7, ethereumjs-wallet@^1.0.1, graphlib@^2.1.8, hardhat@^2.9.1, hardhat-gas-reporter@^1.0.4, keccak256@^1.0.2, lodash.startcase@^4.4.0, lodash.zip@^4.2.0, merkletreejs@^0.2.13, micromatch@^4.0.2, prettier@^2.3.0, prettier-plugin-solidity@^1.0.0-beta.16, rimraf@^3.0.2, semver@^7.3.5, solhint@^3.3.6, solidity-ast@^0.4.25, solidity-coverage@^0.7.18, solidity-docgen@^0.5.3, web3@^1.3.0, yargs@^17.0.0
- contracts/lib/eigenlayer-middleware/lib/openzeppelin-contracts/package.json: @nomiclabs/hardhat-truffle5@^2.0.5, @nomiclabs/hardhat-web3@^2.0.0, @openzeppelin/docs-utils@^0.1.0, @openzeppelin/test-helpers@^0.5.13, chai@^4.2.0, eslint@^7.32.0, eslint-config-standard@^16.0.3, eslint-plugin-import@^2.25.4, eslint-plugin-mocha@^10.0.3, eslint-plugin-node@^11.1.0, eslint-plugin-promise@^5.2.0, eth-sig-util@^3.0.0, ethereumjs-util@^7.0.7, ethereumjs-wallet@^1.0.1, graphlib@^2.1.8, hardhat@^2.9.1, hardhat-gas-reporter@^1.0.4, keccak256@^1.0.2, lodash.startcase@^4.4.0, lodash.zip@^4.2.0, merkletreejs@^0.2.13, micromatch@^4.0.2, prettier@^2.3.0, prettier-plugin-solidity@^1.0.0-beta.16, rimraf@^3.0.2, semver@^7.3.5, solhint@^3.3.6, solidity-ast@^0.4.25, solidity-coverage@^0.7.18, solidity-docgen@^0.5.3, web3@^1.3.0, yargs@^17.0.0
- contracts/lib/eigenlayer-middleware/package.json: @commitlint/cli@^18.2.0, @commitlint/config-conventional@^18.1.0, husky@^8.0.3
- frontend/package.json: @chakra-ui/react@^3.8.0, @emotion/react@^11.14.0, @emotion/styled@^11.14.0, @eslint/js@^9.19.0, @types/react@^19.0.8, @types/react-dom@^19.0.3, @vitejs/plugin-react@^4.3.4, eslint@^9.19.0, eslint-plugin-react@^7.37.4, eslint-plugin-react-hooks@^5.0.0, eslint-plugin-react-refresh@^0.4.18, ethers@^6.13.2, framer-motion@^12.4.3, globals@^15.14.0, react@^19.0.0, react-dom@^19.0.0, vite@^6.1.0
- operator/rust/crates/operator/Cargo.toml: alloy@0.4.2, chrono@0.4.38, dotenv@0.15.0, eigen-client-elcontracts, eigen-logging, eigen-testing-utils, eigen-types, eigen-utils, eyre@0.6.12, futures@0.3.30, futures-util@0.3, hello-world-utils, hex@0.4.3, num-bigint@0.4.4, once_cell@1.19.0, rand@0.8.5, reqwest@0.12.9, serde@1.0.214, serde_json@1.0.121, serial_test@3.1.1, tokio, tracing@0.1.40
- operator/rust/crates/utils/Cargo.toml: alloy@0.4.2, eyre@0.6.12, serde, serde_json@1.0.121
- package.json: @types/jest@^29.5.13, @types/node@^20.12.12, @viem/anvil@^0.0.10, dotenv@^10.0.0, ethers@^6.13.2, jest@^29.7.0, ts-jest@^29.2.5, ts-node@^10.9.2, typescript@^5.4.5

### Recent commits (newest first)

- Merge pull request #1 from andrewgcodes/feature/openweather-oracle
- Add OpenWeatherMap oracle integration with disaster risk assessment features
- feat: add ML/LLM-powered mock oracles for risk assessment, claims review, and fraud detection
- docs: add comprehensive README with setup and usage instructions
- chore: add gitignore file
- initial commit: eigenlayer based disaster insurance AVS implementation

## Key source files (fetched from GitHub, selected and truncated for size)

### docs/FAQ.md

```markdown
FAQ About The Repo

The goal is to be a list of random bespoke things that might not be immediately clear and if using an AI tool to ask questions about the repo can be a source for the AI to surface information to the user

Typescript Notes:

- We used ts-node in the repo as a dev dependency and dev commands use ts-node to run the typescript files so that there isn't an intermediate build step that the developer must call in the process to compile the typescript files to javascript and then separately use the output javascript.  This allows us to directly run the typescript files which get compiled on the fly.  We will still use tsc when creating production builds of our code but during development using ts-node has better UX and is more clear for developing

Solidity Notes:

- If you're running into low level errors with transactions being executed by ethers.js ie, code: BAD_DATA or returned with No Data related errors, then one solution to get more verbose errors is to compile and deploy your smart contracts with --revert-strings debug.  This will insert verbose revert strings to catch before a low level revert would happen in an anvil instance.

```

### docs/nix-setup-guide.md

```markdown
# Nix Setup Guide 

Here you will find instructions on how to install and configure [nix package manager](https://nixos.wiki/wiki/Nix_package_manager) to work with 
projects.

## Installing / Upgrading 

If you don't have nix installed, follow the instructions on the 
[official website](https://nixos.org/download), or simply use one of following
commands in a terminal:

- For multi-user installation (i.e., system-wide setup, **recommended**)
```bash
sh <(curl -L https://nixos.org/nix/install) --daemon
```
- For single-user installation (i.e., local setup)
```bash 
sh <(curl -L https://nixos.org/nix/install) --no-daemon
```

We use nix `flakes` which require nix version `>= 2.4`, therefore if you already 
have nix installed, make sure to 
[upgrade](https://nixos.org/manual/nix/stable/installation/upgrading) to a 
recent version.

## Becoming a Truster User

If you are on NixOS or have installed nix in multi-user mode, you **must** be 
a [trusted user](https://nixos.org/nix/manual/#ssec-multi-user), which is 
necessary to enable access to our binary cache.

On non-NixOS systems, append the following line to the system-wide configuration 
`/etc/nix/nix.conf`:
```txt
trusted-users = USER root
```
**Where `USER` is the result of running `whoami` in a terminal.**

You can also use a group name by prefixing it with `@`. For instance, to add all 
members of the `wheel` group:
```txt
trusted-users = @wheel root
```

On NixOS, add the user/group name to the list under 
[`nix.settings.trusted-users`](https://search.nixos.org/options?show=nix.settings.trusted-users).

## Setting Up for Flakes

We use [Nix flakes](https://nixos.wiki/wiki/Flakes). To configure for flakes, follow the instruction  on the [Nixos Wiki](https://nixos.wiki/wiki/Flakes) or simply do one of the following depending on your system:

- On non-NixOS systems, edit one of the following two files (create them if they don't exist):
   - `/etc/nix/nix.conf` for system-wide settings on a multi-user installation 
   - `~/.config/nix/nix.conf` for user-wide settings on a single-user installation

By appending the following lines:
```txt
experimental-features = nix-command flakes
```

On NixOS systems, set the following NixOS options:
```nix
 nix.settings.experimental-features = [ "nix-command" "flakes" ];
```

## Notes for Apple Users

Apple Silicon users can run any Intel binary out-of-the-box thanks to Rosetta
emulation, but when working with nix flakes, the `aarch64-darwin` system will be
selected by default.

However, some projects at cannot be built natively on `aarch64-darwin`.

Therefore you must specify the `--system` explicitly to target `x86_64-darwin`.
```bash
nix (develop|build|run|check) --system x86_64-darwin # Will use the x86_64-darwin derivation
nix (develop|build|run|check) # Will use the aarch64-darwin derivation, if available
```

To enable this, you must append the following lines to your `/etc/nix/nix.conf` 
or `~/.config/nix/nix.conf`:
```txt
extra-platforms = x86_64-darwin
[truncated — 2348 more characters]
```

### Dockerfile

```
FROM node:22

WORKDIR /app

COPY package.json ./
COPY tsconfig.json ./
RUN npm install

COPY . .

CMD ["npm", "start"]

```

### Cargo.toml

```
[workspace]
members = ["operator/rust/crates/operator/",
"operator/rust/crates/utils/"
]

resolver = "2"

[workspace.package]
version = "0.0.1-alpha"
edition = "2021"
authors = ["Eigen Layer contributors"]
rust-version = "1.79"
repository = "https://github.com/Layr-Labs/hello-world-avs"
homepage = ""
license-file = "LICENSE"


[workspace.lints]
rust.missing_debug_implementations = "warn"
rust.missing_docs = "warn"
rust.unreachable_pub = "warn"
rust.unused_must_use = "deny"
rust.rust_2018_idioms = "deny"
rustdoc.all = "warn"


[workspace.dependencies]

#tokio
tokio = {version = "1.37.0" , features = ["test-util", "full","sync","rt-multi-thread", "macros"] }

serde = "1.0.214"

hello-world-avs-operator = {path = "operator/rust/crates/operator"}
hello-world-utils = {path = "operator/rust/crates/utils"}
#eigensdk-rs
eigen-client-elcontracts = {git = "https://github.com/Layr-labs/eigensdk-rs", rev = "f3a9f32"}
eigen-types = {git = "https://github.com/Layr-labs/eigensdk-rs", rev = "f3a9f32"}
eigen-utils = {git = "https://github.com/Layr-labs/eigensdk-rs", rev = "f3a9f32"}
eigen-logging = {git = "https://github.com/Layr-labs/eigensdk-rs", rev = "f3a9f32"}
eigen-testing-utils = {git = "https://github.com/Layr-labs/eigensdk-rs", rev = "f3a9f32"}





```

### package.json

```
{
  "name": "hello-world-avs",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start:operator": "ts-node operator/index.ts",
    "start:traffic": "ts-node operator/createNewTasks.ts",
    "start:anvil": "anvil",
    "start:anvil-quick": "anvil --block-time 0.01",
    "deploy:core": "cd contracts && forge script script/DeployEigenLayerCore.s.sol --rpc-url http://localhost:8545 --broadcast --optimize --optimizer-runs 200 --via-ir",
    "deploy:hello-world": "cd contracts && forge script script/HelloWorldDeployer.s.sol --rpc-url http://localhost:8545 --broadcast --optimize --optimizer-runs 200 --via-ir",
    "deploy:core-debug": "cd contracts && forge script script/DeployEigenLayerCore.s.sol --rpc-url http://localhost:8545 --broadcast --revert-strings debug --optimize --optimizer-runs 200 --via-ir",
    "deploy:hello-world-debug": "cd contracts && forge script script/HelloWorldDeployer.s.sol --rpc-url http://localhost:8545 --broadcast --revert-strings debug",
    "deploy:insurance": "cd contracts && forge script script/DisasterInsuranceDeployer.s.sol --rpc-url http://localhost:8545 --broadcast --optimize --optimizer-runs 200 --via-ir",
    "insurance:create-policy": "cd contracts && forge script script/DisasterInsuranceTest.s.sol --rpc-url http://localhost:8545 --broadcast --sig \"createPolicy()\" -v",
    "insurance:simulate-disaster": "cd contracts && forge script script/DisasterInsuranceTest.s.sol --rpc-url http://localhost:8545 --broadcast --sig \"simulateDisaster()\" -v",
    "insurance:process-claim": "cd contracts && forge script script/DisasterInsuranceTest.s.sol --rpc-url http://localhost:8545 --broadcast --sig \"processClaim(uint256,uint256)\" -v",
    "create-payments-root": "cd contracts && forge script script/SetupPayments.s.sol --rpc-url http://localhost:8545 --broadcast -v --sender 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
    "claim-payments": "cd contracts && forge script script/SetupPayments.s.sol --rpc-url http://localhost:8545 --broadcast --sig \"executeProcessClaim()\" -v --sender 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
    "create-operator-directed-payments-root": "cd contracts && forge script script/SetupPayments.s.sol --rpc-url http://localhost:8545 --broadcast --sig \"runOperatorDirected()\" -v --sender 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
    "build": "cd contracts && forge build",
    "extract:abis": "node utils/abis.js",
    "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest"
  },
  "dependencies": {
    "dotenv": "^10.0.0",
    "ethers": "^6.13.2"
  },
  "devDependencies": {
    "@types/jest": "^29.5.13",
    "@types/node": "^20.12.12",
    "@viem/anvil": "^0.0.10",
    "jest": "^29.7.0",
    "ts-jest": "^29.2.5",
    "ts-node": "^10.9.2",
    "typescript": "^5.4.5"
  }
}

```

### frontend/package.json

```
{
  "name": "frontend",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  },
  "dependencies": {
    "@chakra-ui/react": "^3.8.0",
    "@emotion/react": "^11.14.0",
    "@emotion/styled": "^11.14.0",
    "ethers": "^6.13.2",
    "framer-motion": "^12.4.3",
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  },
  "devDependencies": {
    "@eslint/js": "^9.19.0",
    "@types/react": "^19.0.8",
    "@types/react-dom": "^19.0.3",
    "@vitejs/plugin-react": "^4.3.4",
    "eslint": "^9.19.0",
    "eslint-plugin-react": "^7.37.4",
    "eslint-plugin-react-hooks": "^5.0.0",
    "eslint-plugin-react-refresh": "^0.4.18",
    "globals": "^15.14.0",
    "vite": "^6.1.0"
  }
}

```

### contracts/lib/eigenlayer-middleware/package.json

```
{
  "name": "eigenlayer-middleware",
  "devDependencies": {
    "husky": "^8.0.3",
    "@commitlint/cli": "^18.2.0",
    "@commitlint/config-conventional": "^18.1.0"
  }
}

```

### contracts/lib/eigenlayer-middleware/go.mod

```
module github.com/Layr-Labs/ffi

go 1.20

require (
	github.com/bits-and-blooms/bitset v1.5.0 // indirect
	github.com/consensys/bavard v0.1.13 // indirect
	github.com/consensys/gnark-crypto v0.11.1 // indirect
	github.com/mmcloughlin/addchain v0.4.0 // indirect
	golang.org/x/sys v0.2.0 // indirect
	rsc.io/tmplfunc v0.0.3 // indirect
)

```

### contracts/lib/forge-std/package.json

```
{
  "name": "forge-std",
  "version": "1.9.5",
  "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.",
  "homepage": "https://book.getfoundry.sh/forge/forge-std",
  "bugs": "https://github.com/foundry-rs/forge-std/issues",
  "license": "(Apache-2.0 OR MIT)",
  "author": "Contributors to Forge Standard Library",
  "files": [
    "src/**/*"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/foundry-rs/forge-std.git"
  }
}

```

### operator/rust/crates/utils/Cargo.toml

```
[package]
name = "hello-world-utils"
description = "Hello world avs operator start and spam utilities"

version.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license-file.workspace = true

[dependencies]
alloy = { version = "0.4.2", features = ["full"] }
serde.workspace = true
serde_json = "1.0.121"
eyre = "0.6.12"

```

[3352 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]