Skip to content

Commit

Permalink
Holesky Deployment and Github Actions (#6)
Browse files Browse the repository at this point in the history
* holesky helper broadcasts, remapping, solc updates and untrack standard-json-inputs

* updated README.md

* network segregation

* github actions and added slither

* typo

* update bot commenting script
  • Loading branch information
preston4896 authored Sep 26, 2024
1 parent a6abae3 commit 3a4063d
Show file tree
Hide file tree
Showing 22 changed files with 692 additions and 34 deletions.
31 changes: 31 additions & 0 deletions .github/scripts/slither-comment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Ref: https://github.com/marketplace/actions/slither-action#example-workflow-markdown-report

module.exports = async ({ github, context, header, body }) => {
const collapse_details = '<details> <summary> Click me to view the full report </summary>';
const close_details = '</details>';

const comment = [header, collapse_details, body, close_details].join("\n");

const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
});

const botComment = comments.find(
(comment) =>
// github-actions bot user
comment.user.id === 41898282 && comment.body.startsWith(header)
);

const commentFn = botComment ? "updateComment" : "createComment";

await github.rest.issues[commentFn]({
owner: context.repo.owner,
repo: context.repo.repo,
body: comment,
...(botComment
? { comment_id: botComment.id }
: { issue_number: context.payload.number }),
});
};
15 changes: 10 additions & 5 deletions .github/workflows/test.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: test
name: Foundry Build CI/CD

on: workflow_dispatch

env:
FOUNDRY_PROFILE: ci
# Controls when the workflow will run
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
check:
Expand Down Expand Up @@ -32,3 +34,6 @@ jobs:
run: |
forge test -vvv
id: test

- name: Run snapshot and Generate Summary
run: NO_COLOR=1 forge snapshot --gas-report >> $GITHUB_STEP_SUMMARY
41 changes: 41 additions & 0 deletions .github/workflows/slither.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Slither Static Analysis

# Runs only on PR merging to main
on:
pull_request:
branches: [ main ]
types: [ opened, reopened, synchronize, ready_for_review ]

workflow_dispatch:

jobs:
analyze:
runs-on: ubuntu-latest

# Do not run when PR is still a draft
if: ${{ !github.event.pull_request.draft }}

env:
commit_url: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.event.pull_request.head.sha }}/

steps:
- uses: actions/checkout@v3

- name: Run Slither
uses: crytic/[email protected]
id: slither
with:
fail-on: none
slither-args: --checklist --show-ignored-findings --markdown-root ${{ env.commit_url }}


- name: Create/update checklist as PR comment
uses: actions/github-script@v7
env:
REPORT: ${{ steps.slither.outputs.stdout }}
with:
script: |
const script = require('.github/scripts/slither-comment')
const header = '# Slither report'
const body = process.env.REPORT
await script({ github, context, header, body })
57 changes: 39 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,58 @@ The Helper contracts provide APIs for parsing collaterals and converting into So

The Helper contracts have been deployed to testnet, and can be used by both on-chain and off-chain programs.

#### Testnet

| | Network | Address |
| --- | --- | --- |
| `EnclaveIdentityHelper.sol` | Automata Testnet | [0xfd4a34b578B352FE1896CDafaEb0f45f993352Bf](https://explorer-testnet.ata.network/address/0xfd4a34b578B352FE1896CDafaEb0f45f993352Bf) |
| | Ethereum Holesky Testnet | [0xEea41Ae0cB09A478b80425Ae61c85e445E83c415](https://holesky.etherscan.io/address/0xEea41Ae0cB09A478b80425Ae61c85e445E83c415) |
| `FmspcTcbHelper.sol` | Automata Testnet | [0xC2A662e08A35513596E22D0aC236Ce72e59125EE](https://explorer-testnet.ata.network/address/0xC2A662e08A35513596E22D0aC236Ce72e59125EE) |
| | Ethereum Holesky Testnet | [0xc728DD0FcD76CD9166F66e1CD8002dE86d6525B8](https://holesky.etherscan.io/address/0xc728DD0FcD76CD9166F66e1CD8002dE86d6525B8) |
| `PCKHelper.sol` | Automata Testnet | [0x5213c0e3Ab478dbc83E8afFF8909717332E4f8E1](https://explorer-testnet.ata.network/address/0x5213c0e3Ab478dbc83E8afFF8909717332E4f8E1) |
| | Ethereum Holesky Testnet | [0xDe20629a87C371668bB371ef1d77D9D167E52021](https://holesky.etherscan.io/address/0xDe20629a87C371668bB371ef1d77D9D167E52021) |
| `X509CRLHelper.sol` | Automata Testnet | [0x12C1E13Aa2a238EAb15c2e2b6AC670266bc3C814](https://explorer-testnet.ata.network/address/0x12C1E13Aa2a238EAb15c2e2b6AC670266bc3C814) |
| | Ethereum Holesky Testnet | [0x3ACBfad7460e2fae32A31f863e1A38F7a002cEA8](https://holesky.etherscan.io/address/0x3ACBfad7460e2fae32A31f863e1A38F7a002cEA8) |

#### Mainnet
| | Network | Address |
| --- | --- | --- |
| `EnclaveIdentityHelper.sol` | testnet | [0xfd4a34b578B352FE1896CDafaEb0f45f993352Bf](https://explorer-testnet.ata.network/address/0xfd4a34b578B352FE1896CDafaEb0f45f993352Bf) |
| | mainnet (preview) | [0x13BECaa512713Ac7C2d7a04ba221aD5E02D43DFE](https://explorer.ata.network/address/0x13BECaa512713Ac7C2d7a04ba221aD5E02D43DFE) |
| `FmspcTcbHelper.sol` | testnet | [0xC2A662e08A35513596E22D0aC236Ce72e59125EE](https://explorer-testnet.ata.network/address/0xC2A662e08A35513596E22D0aC236Ce72e59125EE) |
| | mainnet (preview) | [0xc99bf04c31bf3d026b5b47b2574fc19c1459b732](https://explorer.ata.network/address/0xc99bf04c31bf3d026b5b47b2574fc19c1459b732) |
| `PCKHelper.sol` | testnet | [0x5213c0e3Ab478dbc83E8afFF8909717332E4f8E1](https://explorer-testnet.ata.network/address/0x5213c0e3Ab478dbc83E8afFF8909717332E4f8E1) |
| | mainnet (preview) | [0x3e2fe733E444313A93Fa3f9AEd3bB203048dDE70](https://explorer.ata.network/address/0x3e2fe733E444313A93Fa3f9AEd3bB203048dDE70) |
| `X509CRLHelper.sol` | testnet | [0x12C1E13Aa2a238EAb15c2e2b6AC670266bc3C814](https://explorer-testnet.ata.network/address/0x12C1E13Aa2a238EAb15c2e2b6AC670266bc3C814) |
| | mainnet (preview) | [0x2567245dE6E349C8B7AA82fD6FF854b844A0aEF9](https://explorer.ata.network/address/0x2567245dE6E349C8B7AA82fD6FF854b844A0aEF9) |
| `EnclaveIdentityHelper.sol` | Automata Mainnet (preview) | [0x13BECaa512713Ac7C2d7a04ba221aD5E02D43DFE](https://explorer.ata.network/address/0x13BECaa512713Ac7C2d7a04ba221aD5E02D43DFE) |
| `FmspcTcbHelper.sol` | Automata Mainnet (preview) | [0xc99bf04c31bf3d026b5b47b2574fc19c1459b732](https://explorer.ata.network/address/0xc99bf04c31bf3d026b5b47b2574fc19c1459b732) |
| `PCKHelper.sol` | Automata Mainnet (preview) | [0x3e2fe733E444313A93Fa3f9AEd3bB203048dDE70](https://explorer.ata.network/address/0x3e2fe733E444313A93Fa3f9AEd3bB203048dDE70) |
| `X509CRLHelper.sol` | Automata Mainnet (preview) | [0x2567245dE6E349C8B7AA82fD6FF854b844A0aEF9](https://explorer.ata.network/address/0x2567245dE6E349C8B7AA82fD6FF854b844A0aEF9) |

### Base Contracts
### Base libraries and Automata DAO contracts

The Base contracts are libraries that provide the Data Access Object (DAO) APIs with similar designs inspired from the [Design Guide for Intel SGX PCCS](https://download.01.org/intel-sgx/sgx-dcap/1.21/linux/docs/SGX_DCAP_Caching_Service_Design_Guide.pdf).
The base contracts are libraries that provide the Data Access Object (DAO) APIs with similar designs inspired from the [Design Guide for Intel SGX PCCS](https://download.01.org/intel-sgx/sgx-dcap/1.21/linux/docs/SGX_DCAP_Caching_Service_Design_Guide.pdf).

Base contracts are dependent on Helper contracts to parse collaterals, and contains implementation of basic collateral authenticity check functions for upserts. Smart contract developers are encouraged to extend the base contracts to build their own custom implementation of on-chain PCCS.

<!-- Click [here](./src/bases/) to learn more about each DAOs. -->

Our DAO implementation can be found in the [`automata_pccs`](./src/automata_pccs/) directory, and are deployed to testnet.

#### Testnet

| | Network | Address |
| --- | --- | --- |
| `AutomataEnclaveIdentityDao.sol` | Automata Testnet | [0x413272890ab9F155a47A5F90a404Fb51aa259087](https://explorer-testnet.ata.network/address/0x413272890ab9F155a47A5F90a404Fb51aa259087) |
| | Ethereum Holesky Testnet | [0x9f4b0fB3A95072bD133082e9683A3536669EFE07](https://holesky.etherscan.io/address/0x9f4b0fB3A95072bD133082e9683A3536669EFE07) |
| `AutomataFmspcTcbDao.sol` | Automata Testnet | [0x7c04B466DebA13D48116b1339C62b35B9805E5A0](https://explorer-testnet.ata.network/address/0x7c04B466DebA13D48116b1339C62b35B9805E5A0) |
| | Ethereum Holesky Testnet | [0xaB5074445E5ae3C650553d5a7560B3A7121635B9](https://holesky.etherscan.io/address/0xaB5074445E5ae3C650553d5a7560B3A7121635B9) |
| `AutomataPckDao.sol` | Automata Testnet | [0x6D4cA6AE5315EBBcb4331c82531db0ad8853Eb31](https://explorer-testnet.ata.network/address/0x6D4cA6AE5315EBBcb4331c82531db0ad8853Eb31) |
| | Ethereum Holesky Testnet | [0x5B2d7781E3c44966769484daBCdc435EFD281c34](https://holesky.etherscan.io/address/0x5B2d7781E3c44966769484daBCdc435EFD281c34) |
| `AutomataPcsDao.sol` | Automata Testnet | [0xD0335cbC73CA2f8EDd98a2BE3909f55642F414D7](https://explorer-testnet.ata.network/address/0xD0335cbC73CA2f8EDd98a2BE3909f55642F414D7) |
| | Ethereum Holesky Testnet | [0x66FdB4E72d2F4a7e2081bf83F1FfACC9bbCb384b](https://holesky.etherscan.io/address/0x66FdB4E72d2F4a7e2081bf83F1FfACC9bbCb384b) |

### Mainnet

| | Network | Address |
| --- | --- | --- |
| `AutomataEnclaveIdentityDao.sol` | testnet | [0x413272890ab9F155a47A5F90a404Fb51aa259087](https://explorer-testnet.ata.network/address/0x413272890ab9F155a47A5F90a404Fb51aa259087) |
| | mainnet (preview) | [0x28111536292b34f37120861A46B39BF39187d73a](https://explorer.ata.network/address/0x28111536292b34f37120861A46B39BF39187d73a) |
| `AutomataFmspcTcbDao.sol` | testnet | [0x7c04B466DebA13D48116b1339C62b35B9805E5A0](https://explorer-testnet.ata.network/address/0x7c04B466DebA13D48116b1339C62b35B9805E5A0) |
| | mainnet (preview) | [0x868c18869f68E0E0b0b7B2B4439f7fDDd0421e6b](https://explorer.ata.network/address/0x868c18869f68E0E0b0b7B2B4439f7fDDd0421e6b) |
| `AutomataPckDao.sol` | testnet | [0x6D4cA6AE5315EBBcb4331c82531db0ad8853Eb31](https://explorer-testnet.ata.network/address/0x6D4cA6AE5315EBBcb4331c82531db0ad8853Eb31) |
| | mainnet (preview) | [0xeCc198936FcA3Ca1fDc97B8612B32185908917B0](https://explorer.ata.network/address/0xeCc198936FcA3Ca1fDc97B8612B32185908917B0) |
| `AutomataPcsDao.sol` | testnet | [0xD0335cbC73CA2f8EDd98a2BE3909f55642F414D7](https://explorer-testnet.ata.network/address/0xD0335cbC73CA2f8EDd98a2BE3909f55642F414D7) |
| | mainnet (preview) | [0x86f8865bce8be62cb8096b5b94fa3fb3a6ed330c](https://explorer.ata.network/address/0x86f8865bce8be62cb8096b5b94fa3fb3a6ed330c) |
| `AutomataEnclaveIdentityDao.sol` | Automata Mainnet (preview) | [0x28111536292b34f37120861A46B39BF39187d73a](https://explorer.ata.network/address/0x28111536292b34f37120861A46B39BF39187d73a) |
| `AutomataFmspcTcbDao.sol` | Automata Mainnet (preview) | [0x868c18869f68E0E0b0b7B2B4439f7fDDd0421e6b](https://explorer.ata.network/address/0x868c18869f68E0E0b0b7B2B4439f7fDDd0421e6b) |
| `AutomataPckDao.sol` | Automata Mainnet (preview) | [0xeCc198936FcA3Ca1fDc97B8612B32185908917B0](https://explorer.ata.network/address/0xeCc198936FcA3Ca1fDc97B8612B32185908917B0) |
| `AutomataPcsDao.sol` | Automata Mainnet (preview) | [0x86f8865bce8be62cb8096b5b94fa3fb3a6ed330c](https://explorer.ata.network/address/0x86f8865bce8be62cb8096b5b94fa3fb3a6ed330c) |

---

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"transactions": [
{
"hash": "0xf8dad7ed1df383b23241f479f1a2a09b0a99cbf242a984ca1345b65be38a5037",
"transactionType": "CALL",
"contractName": null,
"contractAddress": "0x528538ab97aa4f7d3397b3ca0a4a6f5d9cf52f97",
"function": "updateDao(address,address,address,address)",
"arguments": [
"0x66FdB4E72d2F4a7e2081bf83F1FfACC9bbCb384b",
"0x5B2d7781E3c44966769484daBCdc435EFD281c34",
"0xaB5074445E5ae3C650553d5a7560B3A7121635B9",
"0x9f4b0fB3A95072bD133082e9683A3536669EFE07"
],
"transaction": {
"from": "0xdc3bda6d40f0e33e0dfa4aef9604b66195e6c5dc",
"to": "0x528538ab97aa4f7d3397b3ca0a4a6f5d9cf52f97",
"gas": "0xb87b",
"value": "0x0",
"input": "0x40070f2d00000000000000000000000066fdb4e72d2f4a7e2081bf83f1ffacc9bbcb384b0000000000000000000000005b2d7781e3c44966769484dabcdc435efd281c34000000000000000000000000ab5074445e5ae3c650553d5a7560b3a7121635b90000000000000000000000009f4b0fb3a95072bd133082e9683a3536669efe07",
"nonce": "0x10",
"chainId": "0x4268"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0x286c78",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0xf8dad7ed1df383b23241f479f1a2a09b0a99cbf242a984ca1345b65be38a5037",
"transactionIndex": "0x13",
"blockHash": "0xc3e11d60b12c88caa2a5070f3644768927443479537cf580bc3e6c6c77efb38b",
"blockNumber": "0x24b699",
"gasUsed": "0x8590",
"effectiveGasPrice": "0x5f5e109",
"from": "0xdc3bda6d40f0e33e0dfa4aef9604b66195e6c5dc",
"to": "0x528538ab97aa4f7d3397b3ca0a4a6f5d9cf52f97",
"contractAddress": null
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1727269520,
"chain": 17000,
"commit": "fbc73d7"
}
Loading

0 comments on commit 3a4063d

Please sign in to comment.