Skip to content

Recently audited contracts have been deployed to all supported network #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 92 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
44c8b4f
added explicit error for unauthorized reads
preston4896 Jan 20, 2025
68b3ea9
implemented check duplicate method in the base contract
preston4896 Jan 22, 2025
781141f
check enclave identity duplicates
preston4896 Jan 22, 2025
4466610
fmspc tcb duplicate check
preston4896 Jan 22, 2025
02427de
duplicate check pckdao
preston4896 Jan 22, 2025
abbd942
duplicate check for pcs dao
preston4896 Jan 22, 2025
0209653
new collateral issuance date must be strictly higher than the issuanc…
preston4896 Jan 22, 2025
6fbf38a
fixed incorrect enclave identity data fetcher
preston4896 Jan 22, 2025
c4732ca
consistent behavior for granting and revoking dao write permission to…
preston4896 Jan 22, 2025
6023781
modified fmspc tcb timestamp attestation
preston4896 Feb 7, 2025
458ec52
defined external getter interface to fetch the collateral validity ti…
preston4896 Feb 7, 2025
4195d64
implemented getter in fmspc dao
preston4896 Feb 7, 2025
f56d748
timestamp attestation for all collaterals
preston4896 Feb 7, 2025
d135be8
moved _storeTcbInfoIssueEvaluation in FMSPC TCB DAO
preston4896 Feb 7, 2025
e4b3c3d
added authority key identifier and subject key identifier getters for…
preston4896 Feb 10, 2025
313d35d
negative test case
preston4896 Feb 10, 2025
8ebb3dd
included key identifiers in parsed struct
preston4896 Feb 10, 2025
16c0c37
platform tcb event logs
preston4896 Feb 11, 2025
b811738
emit logs via state-changes in the storage
preston4896 Feb 11, 2025
576d059
Update FmspcTcbDao.sol
maximevtush Feb 11, 2025
3ea8965
Update PckDao.sol
maximevtush Feb 11, 2025
b5b47f4
declare keyIdentifiers as dynamic bytes
preston4896 Feb 12, 2025
83e3408
fixed internal method to find extension values
preston4896 Feb 12, 2025
9dd648e
removed keyIdentifier length check
preston4896 Feb 12, 2025
8de0cc6
length is still required to get the correct slice for subject key ide…
preston4896 Feb 12, 2025
aec11ed
fixed _findExtensionValuePtr to break infinite loop
preston4896 Feb 12, 2025
e5b48e4
changes to CN parsing
preston4896 Feb 12, 2025
d537e30
fmspc tcb content hash
preston4896 Feb 12, 2025
3882e45
parsedIdentityString returns tcb string
preston4896 Feb 12, 2025
2e270aa
enclave identity content hash
preston4896 Feb 12, 2025
ae65558
use internal methods to read attestation entry
preston4896 Feb 12, 2025
838a536
updated ci build action
preston4896 Feb 14, 2025
33baea4
Merge branch 'DEV-3731' into development
preston4896 Feb 14, 2025
3b32209
Merge branch 'DEV-3732' into development
preston4896 Feb 14, 2025
43dc12e
Merge branch 'DEV-3733' into development
preston4896 Feb 14, 2025
af1c261
Merge branch 'DEV-3784' into development
preston4896 Feb 14, 2025
436b116
Merge branch 'DEV-3794' into development
preston4896 Feb 14, 2025
8bd2904
Merge branch 'DEV-3790' into development
preston4896 Feb 14, 2025
154f40c
Merge branch 'DEV-3793' into development
preston4896 Feb 14, 2025
bdf2310
create2
preston4896 Feb 17, 2025
72f08ff
Merge branch 'create2' into test-development
preston4896 Feb 17, 2025
cbd2b7a
updated code commenting
preston4896 Feb 17, 2025
db3750f
appendix d: encode json obj as a whole, instead of individually by me…
preston4896 Feb 17, 2025
9517679
use _onFetchDataFromResolver() for collateral reads
preston4896 Feb 17, 2025
886bf37
Merge branch 'misc' into test-development
preston4896 Feb 17, 2025
14a3e90
fixes
preston4896 Feb 17, 2025
9889baa
asn1 decoder length check
preston4896 Feb 17, 2025
d356bb8
asn1 length bytes should not be zero
preston4896 Feb 17, 2025
4fa00f5
asn1 decoder index out of bound check
preston4896 Feb 18, 2025
7ff4760
Merge branch 'DEV-3791' into test-development
preston4896 Feb 18, 2025
d8716c7
do not use external calls to fetch data
preston4896 Feb 18, 2025
d2f29a9
Merge branch 'DEV-3794' into test-development
preston4896 Feb 18, 2025
c08b2c3
stricter issuer ca check
preston4896 Feb 18, 2025
f4dd1a5
do not store tcb evaluation twice
preston4896 Feb 24, 2025
c7c7bb2
docs
preston4896 Feb 25, 2025
7a1fc84
Merge branch 'development' into DEV-3732
preston4896 Feb 27, 2025
686412d
Merge branch 'development' into DEV-3794
preston4896 Feb 27, 2025
b4002d0
Merge pull request #19 from automata-network/DEV-3733
preston4896 Feb 28, 2025
940b626
Merge pull request #17 from automata-network/DEV-3732
preston4896 Feb 28, 2025
7a65941
Merge pull request #22 from automata-network/DEV-3784
preston4896 Feb 28, 2025
3c2b6bc
Merge pull request #23 from automata-network/DEV-3794
preston4896 Feb 28, 2025
5632048
Merge pull request #24 from automata-network/DEV-3790
preston4896 Feb 28, 2025
dc06a06
conflict resolution isnt my strongest suit, both in code and irl
preston4896 Feb 28, 2025
09c590f
Merge branch 'DEV-3791' into development
preston4896 Mar 3, 2025
db69757
Merge branch 'DEV-3793' into development
preston4896 Mar 3, 2025
884feb0
fmspc tcb merge conflict resolution
preston4896 Mar 3, 2025
4d6acd9
Merge branch 'create2' into development
preston4896 Mar 3, 2025
58b1513
Merge branch 'misc' into development
preston4896 Mar 3, 2025
299d17e
fixed enclaveiddao merge conflict resolution error
preston4896 Mar 3, 2025
64af71c
misc changes
preston4896 Mar 3, 2025
ac343b9
Merge branch 'development' into main
preston4896 Mar 3, 2025
bcb94b9
Merge pull request #25 from maximevtush/main
preston4896 Mar 3, 2025
315d8ac
deployment scripts
preston4896 Mar 11, 2025
ddcac9a
updated Makefile to include contract verification
preston4896 Mar 11, 2025
7f77d10
updated Makefile and README
preston4896 Mar 11, 2025
755f4c8
chore: clean up and fmt
preston4896 Mar 11, 2025
915e6d4
cleanup
preston4896 Mar 11, 2025
1015deb
chore: update
preston4896 Mar 11, 2025
6fb27f8
minor update on P256 util scripts
preston4896 Mar 11, 2025
dbd0490
testnet deployment
preston4896 Mar 19, 2025
4bde5e9
readme formatting
preston4896 Mar 19, 2025
1bfd3c5
world sepolia deployment
preston4896 Mar 19, 2025
1667b62
l2 mainnet deployment
preston4896 Mar 20, 2025
48b1b9d
fix: README World mainnet address typo
preston4896 Mar 20, 2025
dbfe9fd
fuji deployment
preston4896 Mar 20, 2025
7ac0691
polgon mainnet and bnb testnet deployment
preston4896 Mar 20, 2025
feaadc5
eth mainnet and bsc mainnet deployment
preston4896 Mar 20, 2025
3388036
updated readme
preston4896 Mar 20, 2025
0a11c03
polygon amoy deployment
preston4896 Mar 21, 2025
1a671c5
avax c mainnet deployment
preston4896 Mar 21, 2025
67c069b
hoodi deployment
preston4896 Mar 21, 2025
b7f9f3b
updated readme
preston4896 Mar 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# cast wallet address --keystore keystore/dcap_prod
OWNER=

ETHERSCAN_API_KEY_OG=
ETHERSCAN_API_KEY_BASE=
ETHERSCAN_API_KEY_OPTIMISM=
ETHERSCAN_API_KEY_ARBITRUM=
ETHERSCAN_API_KEY_WORLDCHAIN=
ETHERSCAN_API_KEY_BSC=
ETHERSCAN_API_KEY_POLYGON=
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Foundry Build CI/CD
# Controls when the workflow will run
on:
push:
branches: [main]
branches: [main, development]
pull_request:
branches: [main]

Expand Down
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ broadcast/**/run-*.json
broadcast/**/dry-run/
!broadcast/**/*-latest.json

# Docs
docs/

# Dotenv file
.env

**/.DS_Store
# Ignore development deployment files
deployment/31337.json

**/node_modules/
# Misc
**/.DS_Store
**/node_modules/
**/keystore/
**/.vscode
148 changes: 148 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Configuration
VERIFIER ?= etherscan
VERIFIER_URL ?=
WITH_STORAGE ?= true
SIMULATED ?=
KEYSTORE_PATH ?= keystore/dcap_prod
PRIVATE_KEY ?=

# Required environment variables check
check_env:
ifdef RPC_URL
$(eval CHAIN_ID := $(shell cast chain-id --rpc-url $(RPC_URL)))
@echo "Chain ID: $(CHAIN_ID)"
else
$(error RPC_URL is not set)
endif

# Get the Owner's Wallet Address
get_owner:
ifdef PRIVATE_KEY
$(eval OWNER := $(shell cast wallet address --private-key $(PRIVATE_KEY)))
else
$(eval KEYSTORE_PASSWORD := $(shell read -s -p "Enter keystore password: " pwd; echo $$pwd))
$(eval OWNER := $(shell cast wallet address --keystore $(KEYSTORE_PATH) --password $(KEYSTORE_PASSWORD) \
|| (echo "Improper wallet configuration"; exit 1)))
endif
@echo "\nWallet Owner: $(OWNER)"

# Deployment targets
deploy-helpers: check_env get_owner
@echo "Deploying helper contracts..."
@OWNER=$(OWNER) \
forge script script/helper/DeployHelpers.s.sol:DeployHelpers \
--rpc-url $(RPC_URL) \
$(if $(PRIVATE_KEY), --private-key $(PRIVATE_KEY), \
--keystore $(KEYSTORE_PATH) --password $(KEYSTORE_PASSWORD)) \
$(if $(SIMULATED),, --broadcast) \
$(if $(LEGACY), --legacy) \
-vv
@echo "Helper contracts deployed"

deploy-dao: check_env get_owner
@echo "Deploying DAO contracts..."
@if [ ! -f deployment/$(CHAIN_ID).json ]; then \
echo "Helper addresses not found. Run deploy-helpers first"; \
exit 1; \
fi
@OWNER=$(OWNER) \
forge script script/automata/DeployAutomataDao.s.sol:DeployAutomataDao \
--rpc-url $(RPC_URL) \
$(if $(PRIVATE_KEY), --private-key $(PRIVATE_KEY), \
--keystore $(KEYSTORE_PATH) --password $(KEYSTORE_PASSWORD)) \
$(if $(SIMULATED),, --broadcast) \
$(if $(LEGACY), --legacy) \
-vv \
--sig "deployAll(bool)" $(WITH_STORAGE)
@echo "DAO contracts deployed"

deploy-all: deploy-helpers deploy-dao
@echo "Deployment completed"

# Contract verification
verify-helpers: check_env
@echo "Verifying helper contracts..."
@if [ ! -f deployment/$(CHAIN_ID).json ]; then \
echo "Helper addresses not found. Deploy helpers first."; \
exit 1; \
fi
@for contract in EnclaveIdentityHelper FmspcTcbHelper PCKHelper X509CRLHelper; do \
addr=$$(jq -r ".$$contract" deployment/$(CHAIN_ID).json); \
if [ "$$addr" != "null" ]; then \
forge verify-contract \
--rpc-url $(RPC_URL) \
--verifier $(VERIFIER) \
--watch \
$(if $(VERIFIER_URL),--verifier-url $(VERIFIER_URL)) \
$$addr \
src/helpers/$$contract.sol:$$contract || true; \
fi \
done

verify-dao: check_env
@echo "Verifying DAO contracts..."
@if [ ! -f deployment/$(CHAIN_ID).json ]; then \
echo "DAO addresses not found. Deploy DAOs first."; \
exit 1; \
fi
@for contract in AutomataDaoStorage AutomataPcsDao AutomataPckDao AutomataEnclaveIdentityDao AutomataFmspcTcbDao; do \
addr=$$(jq -r ".$$contract" deployment/$(CHAIN_ID).json); \
if [ "$$addr" != "null" ]; then \
if [ "$$contract" != "AutomataDaoStorage" ]; then \
forge verify-contract \
--rpc-url $(RPC_URL) \
--verifier $(VERIFIER) \
--watch \
$(if $(VERIFIER_URL),--verifier-url $(VERIFIER_URL)) \
$$addr \
src/automata_pccs/$$contract.sol:$$contract || true; \
else \
forge verify-contract \
--rpc-url $(RPC_URL) \
--verifier $(VERIFIER) \
--watch \
$(if $(VERIFIER_URL),--verifier-url $(VERIFIER_URL)) \
$$addr \
src/automata_pccs/shared/AutomataDaoStorage.sol:AutomataDaoStorage || true; \
fi \
fi \
done

verify-all: verify-helpers verify-dao
@echo "Verification completed"

# Utility targets
clean:
forge clean

# Help target
help:
@echo "Available targets:"
@echo " deploy-helpers Deploy helper contracts"
@echo " deploy-dao Deploy DAO contracts"
@echo " deploy-all Deploy all contracts"
@echo " verify-helpers Verify helper contracts"
@echo " verify-dao Verify DAO contracts"
@echo " verify-all Verify all contracts"
@echo " clean Remove build artifacts"
@echo ""
@echo "Wallet environment variables: (you only need to set one)"
@echo " PRIVATE_KEY Private key for wallet"
@echo " KEYSTORE_PATH Path to keystore directory"
@echo ""
@echo "Required environment variables:"
@echo " RPC_URL RPC URL for the target network"
@echo ""
@echo "Optional environment variables:"
@echo " VERIFIER Contract verifier (default: etherscan)"
@echo " VERIFIER_URL Custom verifier API URL"
@echo " ETHERSCAN_API_KEY API key for contract verification"
@echo " WITH_STORAGE Deploy with storage (default: true)"
@echo " SIMULATED Simulate deployment (default: false)"
@echo ""
@echo "Example usage:"
@echo " make deploy-all RPC_URL=xxx"
@echo " make verify-all RPC_URL=xxx ETHERSCAN_API_KEY=xxx"
@echo " make deploy-dao PRIVATE_KEY=xxx RPC_URL=xxx SIMULATED=true"

.PHONY: check_env clean help deploy-% verify-%
Loading
Loading