Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,8 @@ jobs:
- name: Test Template
run: |
cd templates/default
chmod 755 contracts tests
chmod 644 contracts/ImageID.sol
chmod 755 .enclave/generated/contracts tests
chmod 644 .enclave/generated/contracts/ImageID.sol
pnpm test:integration

test_enclave_init:
Expand Down
4 changes: 3 additions & 1 deletion crates/support-scripts/ctl/container
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ cleanup() {
trap cleanup EXIT INT TERM

mkdir -p "$(pwd)/.enclave/caches"/{target,registry,git,risc0-cache,risc0-circuits}
mkdir -p "$(pwd)/.enclave/generated"/{contracts,tests}
chmod -R 777 "$(pwd)/.enclave/caches"
chmod -R 777 "$(pwd)/.enclave/generated"
Comment thread
hmzakhalid marked this conversation as resolved.

if [ -t 0 ]; then
TTY_FLAGS="-it"
Expand All @@ -54,7 +56,7 @@ else
--platform linux/amd64 \
--add-host=host.local:host-gateway \
-p 13151:13151 \
-v "$(pwd)/contracts:/app/contracts" \
-v "$(pwd)/.enclave/generated/contracts:/app/contracts:rw" \
-v "$(pwd)/tests:/app/tests" \
-v "$(pwd)/.enclave/caches/target:/app/target" \
-v "$(pwd)/.enclave/caches/registry:/home/devuser/.cargo/registry" \
Expand Down
2 changes: 1 addition & 1 deletion crates/support/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
PKG=ghcr.io/gnosisguild/e3-support
GIT_SHA=$(git rev-parse --short HEAD)
GIT_SHA=$(git rev-parse --short=9 HEAD)

# Separate --push from other arguments
PUSH=false
Expand Down
4 changes: 2 additions & 2 deletions crates/support/scripts/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ docker run -it \
-v $(pwd)/types:/app/types \
-v $(pwd)/program:/app/program \
-v $(pwd)/scripts:/app/scripts \
-v $(pwd)/contracts:/app/contracts \
-v $(pwd)/tests:/app/tests \
-v $(pwd)/.enclave/generated/contracts:/app/contracts \
-v $(pwd)/.enclave/generated/tests:/app/tests \
-v $(pwd)/Cargo.toml:/app/Cargo.toml \
-v $(pwd)/Cargo.lock:/app/Cargo.lock \
$PKG
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
pragma solidity ^0.8.20;

library ImageID {
bytes32 public constant PROGRAM_ID = bytes32(0x23734b77b0f76e85623a88d7a82f24c34c94834f2501964ea123b7a2027013a2);
bytes32 public constant PROGRAM_ID = bytes32(0x23734b77b0f76e85623a88d7a82f24c34c94834f2501964ea123b7a2027013a2);
}
9 changes: 8 additions & 1 deletion examples/CRISP/packages/crisp-contracts/deploy/crisp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@

import { readDeploymentArgs, storeDeploymentArgs } from '@enclave-e3/contracts/scripts'
import { Enclave__factory as EnclaveFactory } from '@enclave-e3/contracts/types'
import { readFileSync } from 'fs'

import { ContractFactory } from 'ethers'
import hre from 'hardhat'

const IMAGE_ID = '0x23734b77b0f76e85623a88d7a82f24c34c94834f2501964ea123b7a2027013a2'
const imageIdContent = readFileSync('../../.enclave/generated/contracts/ImageID.sol', 'utf-8')
const match = imageIdContent.match(/bytes32 public constant PROGRAM_ID = bytes32\((0x[a-fA-F0-9]+)\)/)
const IMAGE_ID = match ? match[1] : null

if (!IMAGE_ID) {
throw new Error('IMAGE_ID not found')
}
Comment thread
hmzakhalid marked this conversation as resolved.

export const deployCRISPContracts = async () => {
const { ethers } = await hre.network.connect()
Expand Down
3 changes: 3 additions & 0 deletions templates/default/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ const config: HardhatUserConfig = {
outDir: './types',
tsNocheck: false,
},
paths: {
sources: ['./contracts', './.enclave/generated/contracts'],
},
networks: {
hardhat: {
type: 'edr-simulated',
Expand Down
Loading