Skip to content

Commit

Permalink
README.md and .env.example updates
Browse files Browse the repository at this point in the history
  • Loading branch information
preston4896 committed Sep 5, 2024
1 parent ebd81a6 commit 0a3ac49
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 56 deletions.
26 changes: 13 additions & 13 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Environment Configuration
PRIVATE_KEY=0x
RPC_URL=""
DCAP_IMAGE_ID=
DCAP_IMAGE_ID=0x4052beb38db7869b15596d53c2d5c02c9307faffca9215e69b0f0d0e1812a6c2

# On-Chain PCCS Configurations
ENCLAVE_IDENTITY_HELPER=
FMSPC_TCB_HELPER=
X509_CRL_HELPER=
X509_HELPER=
ENCLAVE_ID_DAO=
FMSPC_TCB_DAO=
PCK_DAO=
PCS_DAO=
ENCLAVE_IDENTITY_HELPER=0xfd4a34b578B352FE1896CDafaEb0f45f993352Bf
FMSPC_TCB_HELPER=0xC2A662e08A35513596E22D0aC236Ce72e59125EE
X509_CRL_HELPER=0x12C1E13Aa2a238EAb15c2e2b6AC670266bc3C814
X509_HELPER=0x5213c0e3Ab478dbc83E8afFF8909717332E4f8E1
ENCLAVE_ID_DAO=0x413272890ab9F155a47A5F90a404Fb51aa259087
FMSPC_TCB_DAO=0x7c04B466DebA13D48116b1339C62b35B9805E5A0
PCK_DAO=0x6D4cA6AE5315EBBcb4331c82531db0ad8853Eb31
PCS_DAO=0xD0335cbC73CA2f8EDd98a2BE3909f55642F414D7

RISC0_VERIFIER=
DCAP_ATTESTATION=
RISC0_VERIFIER=0x4967e2fB48E2037eC466a8b60722A94bBce48Eb7
DCAP_ATTESTATION=0xefE368b17D137E86298eec8EbC5502fb56d27832

V3_VERIFIER=
V4_VERIFIER=
V3_VERIFIER=0x67042d171b8b7da1a4a98df787bdce79190dac3c
V4_VERIFIER=0x921b8f6ec83e405b715111ec1ae8b54a3ea063eb
58 changes: 27 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,75 @@
# AutomataDcapV3Attestation
# Automata DCAP Attestation

## Getting Started
## Summary

Clone this repo, by running the following command:
Automata DCAP Attestation consists of three parts:

```bash
git clone [email protected]:automata-network/automata-dcap-v3-attestation.git --recurse-submodules
```
- PCCS Router: A central contract to read collaterals from [`automata-on-chain-pccs`](https://github.com/automata-network/automata-on-chain-pccs)

This repo includes both Hardhat and Foundry frameworks. Therefore, you can absolutely provide additional scripts and test cases written in both Solidity and TypeScript.
- Automata DCAP Attestation: This is the entrypoint contract for users to submit a quote to be verified. This contract parses the Quote header to identify the version, which then forwards the quote to the respective QuoteVerifier contract.

If you are building with Hardhat, make sure to run the command below to install the necessary NPM packages.
- Quote Verifier(s): This contract provides the full implementation on verifying a given quote specific to its version. This contract is intended to be called only from the Automata DCAP Attestation contract.

## Getting Started

Clone this repo, by running the following command:

```bash
npm install
git clone [email protected]:automata-network/automata-dcap-attestation.git --recurse-submodules
```

Before you begin, make sure to create a copy of the `.env` file with the example provided. Then, please provide any remaining variables that are missing.

```bash
cp .env.example .env
```

---

## Building With Foundry

Compile the contract:
Compile the contracts:

```bash
forge build
```

Testing the contract:
Testing the contracts:

```bash
forge test
```

To view gas report, pass the `--gas-report` flag.

To provide additional test cases, please include those in the `/forge-test` directory.

To provide additional scripts, please include those in the `/forge-script` directory.

### Deployment Scripts

- `AutomataDcapV3Attestation` deployment
Deploy the PCCS Router:

```bash
forge script DeployDCAPScript --broadcast --rpc-url $RPC_URL
forge script DeployRouter --rpc-url $RPC_URL --broadcast -vvvv
```

---

<!-- ## Building With Hardhat
Compile the contract:
Deploy Automata DCAP Attestation Entrypoint:

```bash
npx hardhat compile
forge script AttestationScript --rpc-url $RPC_URL --broadcast -vvvv --sig "deployEntrypoint()"
```

Local deployment and testing:
Deploy Quote Verifier(s):

```bash
npx hardhat run scripts/deploy.ts
forge script DeployV3 --rpc-url $RPC_URL --broadcast -vvvv
```

To deploy the contract on a live network, please configure `hardhat.config.ts`, then pass the `--network` flag to the command.
The naming format for the script is simply `DeployV{x}`, where `x` is the quote version supported by the verifier. Currently, we only support V3 and V4 quotes.

To provide additional test cases, please include those in the `/test` directory.
Whitelist QuoteVerifier(s) in the Entrypoint contract:

To provide additional scripts, please include those in the `/scripts` directory. -->


## Projects using AutomataDcapV3Attestation

* [Flashbots](https://writings.flashbots.net/suave-tee-coprocessor)
* [Taiko](
https://github.com/taikoxyz/taiko-mono/tree/main/packages/protocol/contracts/automata-attestation)
```bash
forge script AttestationScript --rpc-url $RPC_URL --broadcast -vvvv --sig "configVerifier(address)" <verifier-address>
```
12 changes: 0 additions & 12 deletions forge-script/setup.sh

This file was deleted.

0 comments on commit 0a3ac49

Please sign in to comment.