Skip to content
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

Sync develop branch with recent commits #30

Merged
merged 13 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 19 additions & 1 deletion .env.sample.goerli
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,22 @@ INFURA_KEY=""

## optional - address of already deployed ERC20 token which shall be used as rollup's fee token
FEE_TOKEN_ADDRESS=""
ESPRESSO_LIGHT_CLIENT_ADDRESS=""

### Example TEE ATTESTATION CONTRACTS ###
DCAP_IMAGE_ID=0x4052beb38db7869b15596d53c2d5c02c9307faffca9215e69b0f0d0e1812a6c2

# On-Chain PCCS Configurations
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=0x4967e2fB48E2037eC466a8b60722A94bBce48Eb7
DCAP_ATTESTATION=0xefE368b17D137E86298eec8EbC5502fb56d27832

PCCS_ROUTER=0xbFDeE7A1f1bFA2267cD0DA50BE76D8c4a3864543
V3_VERIFIER=0x67042d171b8b7da1a4a98df787bdce79190dac3c
96 changes: 83 additions & 13 deletions .github/workflows/contract-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ jobs:
with:
version: nightly

- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done

- name: Setup node/yarn
uses: actions/setup-node@v3
with:
Expand All @@ -34,7 +42,7 @@ jobs:
run: yarn

- name: Build
run: forge test
run: forge test --no-match-path test/foundry/ExpressLaneBalance.t.sol
tests:
if: false # broken
name: Contract tests
Expand All @@ -53,6 +61,20 @@ jobs:
with:
version: nightly

- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done

- name: Run unused Solidity errors checker
uses: OffchainLabs/actions/check-unused-errors@main
with:
directory: './src'
exceptions_file: './test/unused-errors/exceptions.txt'

- name: Setup nodejs
uses: actions/setup-node@v2
with:
Expand Down Expand Up @@ -95,12 +117,6 @@ jobs:
- name: Test function signatures
run: yarn run test:signatures

- name: Run unused Solidity errors checker
uses: OffchainLabs/actions/check-unused-errors@main
with:
directory: './src'
exceptions_file: './test/unused-errors/exceptions.txt'

- name: Run coverage
run: yarn hardhat coverage --testfiles "test/contract/*.spec.ts"

Expand Down Expand Up @@ -128,7 +144,15 @@ jobs:
with:
version: nightly

- uses: OffchainLabs/actions/run-nitro-test-node@main
- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done

- uses: OffchainLabs/actions/run-nitro-test-node@test-node-args
with:
args: --pos
no-token-bridge: true
Expand Down Expand Up @@ -157,12 +181,20 @@ jobs:
with:
submodules: recursive

- uses: OffchainLabs/actions/run-nitro-test-node@main
- uses: EspressoSystems/offchainlabs-actions/run-nitro-test-node@specify-checkout-repo
with:
l3-node: true
args: --espresso --latest-espresso-image
no-token-bridge: true
no-l3-token-bridge: true
nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
nitro-testnode-ref: celestia-integration
nitro-testnode-repo: EspressoSystems/nitro-testnode

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Setup node/yarn
uses: actions/setup-node@v3
Expand All @@ -171,6 +203,14 @@ jobs:
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done

- name: Install packages
run: yarn

Expand All @@ -188,13 +228,20 @@ jobs:
with:
submodules: recursive

- uses: OffchainLabs/actions/run-nitro-test-node@main
- uses: EspressoSystems/offchainlabs-actions/run-nitro-test-node@specify-checkout-repo
with:
l3-node: true
args: --l3-fee-token
args: --l3-fee-token --espresso --latest-espresso-image
no-token-bridge: true
no-l3-token-bridge: true
nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
nitro-testnode-ref: celestia-integration
nitro-testnode-repo: EspressoSystems/nitro-testnode

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Setup node/yarn
uses: actions/setup-node@v3
Expand All @@ -203,6 +250,14 @@ jobs:
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done

- name: Install packages
run: yarn

Expand All @@ -220,13 +275,20 @@ jobs:
with:
submodules: recursive

- uses: OffchainLabs/actions/run-nitro-test-node@main
- uses: EspressoSystems/offchainlabs-actions/run-nitro-test-node@specify-checkout-repo
with:
l3-node: true
args: --l3-fee-token --l3-fee-token-decimals 6
args: --espresso --latest-espresso-image --l3-fee-token --l3-fee-token-decimals 6
no-token-bridge: true
no-l3-token-bridge: true
nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
nitro-testnode-ref: 'celestia-integration'
nitro-testnode-repo: EspressoSystems/nitro-testnode

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Setup node/yarn
uses: actions/setup-node@v3
Expand All @@ -235,6 +297,14 @@ jobs:
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done

- name: Install packages
run: yarn

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/automata-dcap-attestation"]
path = lib/automata-dcap-attestation
url = https://github.com/EspressoSystems/automata-dcap-attestation
8 changes: 8 additions & 0 deletions deploy/SequencerInboxStubCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ module.exports = async hre => {
const { deployer } = await getNamedAccounts()

const bridge = await ethers.getContract('BridgeStub')

const espressoTEEVerifierInboxFac = await ethers.getContractFactory(
'EspressoTEEVerifierMock'
)
const espressoTEEVerifier = await espressoTEEVerifierInboxFac.deploy()
await espressoTEEVerifier.deployed()

const reader4844 = await Toolkit4844.deployReader4844(
await ethers.getSigner(deployer)
)
Expand All @@ -24,6 +31,7 @@ module.exports = async hre => {
117964,
reader4844.address,
false,
espressoTEEVerifier.address,
],
})
}
Expand Down
8 changes: 5 additions & 3 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ libs = ['node_modules', 'lib']
test = 'test/foundry'
cache_path = 'forge-cache/sol'
optimizer = true
optimizer_runs = 100
via_ir = false
optimizer_runs = 1
via_ir = true
solc_version = '0.8.25'
evm_version = 'cancun'
fs_permissions = [{ access = "read", path = "./"}]
remappings = ['ds-test/=lib/forge-std/lib/ds-test/src/',
'forge-std/=lib/forge-std/src/',
'@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/',
Expand All @@ -24,4 +26,4 @@ auto_detect_remappings = false
[fmt]
number_underscore = 'thousands'
line_length = 100
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
14 changes: 12 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'solidity-coverage'
import 'hardhat-gas-reporter'
import 'hardhat-contract-sizer'
import 'hardhat-ignore-warnings'
import '@nomicfoundation/hardhat-foundry'
// import '@tovarishfin/hardhat-yul';
import dotenv from 'dotenv'

Expand All @@ -15,18 +16,19 @@ dotenv.config()
const solidity = {
compilers: [
{
version: '0.8.9',
version: '0.8.25',
settings: {
optimizer: {
enabled: true,
runs: 100,
},
viaIR: true,
},
},
],
overrides: {
'src/rollup/RollupUserLogic.sol': {
version: '0.8.26',
version: '0.8.20',
settings: {
optimizer: {
enabled: true,
Expand Down Expand Up @@ -221,6 +223,14 @@ module.exports = {
browserURL: 'https://sepolia.arbiscan.io/',
},
},
{
network: 'baseSepolia',
chainId: 84532,
urls: {
apiURL: 'https://api-sepolia.basescan.org/api',
browserURL: 'https://sepolia.basescan.org/',
},
},
],
},
mocha: {
Expand Down
1 change: 1 addition & 0 deletions lib/automata-dcap-attestation
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"prepublishOnly": "hardhat clean && forge clean && hardhat compile && yarn build:forge:yul",
"build:all": "yarn build && yarn build:forge",
"build": "hardhat compile",
"build:forge:sol": "forge build --skip *.yul",
"build:forge:sol": "forge build --skip *.yul test/foundry/ExpressLaneBalance.t.sol",
"build:forge:yul": "FOUNDRY_PROFILE=yul forge build --skip *.sol",
"build:forge": "yarn build:forge:sol && yarn build:forge:yul",
"contract:size": "hardhat size-contracts",
Expand All @@ -50,17 +50,18 @@
"deploy-cachemanager-testnode": "hardhat run scripts/local-deployment/deployCacheManager.ts"
},
"dependencies": {
"@nomicfoundation/hardhat-verify": "^2.0.12",
"@offchainlabs/upgrade-executor": "1.1.0-beta.0",
"@openzeppelin/contracts": "4.5.0",
"@openzeppelin/contracts-upgradeable": "4.5.2",
"@openzeppelin/contracts": "4.8.0",
"@openzeppelin/contracts-upgradeable": "4.8.0",
"patch-package": "^6.4.7",
"solady": "0.0.182"
},
"private": false,
"devDependencies": {
"@arbitrum/sdk": "^3.4.1",
"@ethersproject/providers": "^5.7.2",
"@nomicfoundation/hardhat-verify": "^2.0.9",
"@nomicfoundation/hardhat-foundry": "^1.1.2",
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.13",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@tovarishfin/hardhat-yul": "^3.0.5",
Expand Down
8 changes: 8 additions & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
openzeppelin-contracts/=node_modules/@openzeppelin/contracts/
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/
@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/
@automata-network/dcap-attestation/contracts=lib/automata-dcap-attestation/contracts/
@automata-network/dcap-attestation/test=lib/automata-dcap-attestation/forge-test/
solady/=node_modules/solady/src/
1 change: 1 addition & 0 deletions scripts/config.ts.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const config = {
delaySeconds: ethers.BigNumber.from('86400'),
futureSeconds: ethers.BigNumber.from('3600'),
},
espressoTEEVerifier: '0xb562622f2D76F355D673560CB88c1dF6088702f1',
},
validators: [
'0x1234123412341234123412341234123412341234',
Expand Down
6 changes: 6 additions & 0 deletions scripts/createERC20Rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@ async function main() {
throw new Error('ROLLUP_CREATOR_ADDRESS not set')
}

const espressoTEEVerifierAddress = process.env.ESPRESSO_TEE_VERIFIER_ADDRESS
if (!espressoTEEVerifierAddress) {
throw new Error('ESPRESSO_TEE_VERIFIER_ADDRESS not set')
}

console.log('Creating new rollup with', customFeeTokenAddress, 'as fee token')
await createRollup(
deployer,
false,
rollupCreatorAddress,
espressoTEEVerifierAddress,
customFeeTokenAddress
)
}
Expand Down
Loading
Loading