Skip to content

Commit

Permalink
env, scripts and forge-test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
preston4896 committed Nov 18, 2024
1 parent 383d853 commit 8f63a44
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Environment Configuration
PRIVATE_KEY=0x
RPC_URL=""
DCAP_IMAGE_ID=0x4052beb38db7869b15596d53c2d5c02c9307faffca9215e69b0f0d0e1812a6c2
DCAP_RISCZERO_IMAGE_ID=0x4052beb38db7869b15596d53c2d5c02c9307faffca9215e69b0f0d0e1812a6c2

# On-Chain PCCS Configurations
ENCLAVE_IDENTITY_HELPER=0xfd4a34b578B352FE1896CDafaEb0f45f993352Bf
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:

env:
DCAP_IMAGE_ID: "0x4052beb38db7869b15596d53c2d5c02c9307faffca9215e69b0f0d0e1812a6c2"
DCAP_RISCZERO_IMAGE_ID: "0x4052beb38db7869b15596d53c2d5c02c9307faffca9215e69b0f0d0e1812a6c2"

jobs:
check:
Expand Down
2 changes: 0 additions & 2 deletions forge-script/AttestationScript.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import "../contracts/AutomataDcapAttestation.sol";

contract AttestationScript is Script {
uint256 deployerKey = uint256(vm.envBytes32("PRIVATE_KEY"));
address riscZeroVerifier = vm.envAddress("RISC0_VERIFIER");
bytes32 riscZeroImageId = vm.envBytes32("DCAP_IMAGE_ID");

function deployEntrypoint() public {
vm.startBroadcast(deployerKey);
Expand Down
13 changes: 13 additions & 0 deletions forge-script/DeployRouter.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,21 @@ contract DeployRouter is Script {
vm.stopBroadcast();
}

function updateConfig() public {
vm.startBroadcast(deployerKey);

PCCSRouter router = PCCSRouter(vm.envAddress("PCCS_ROUTER"));
router.setConfig(enclaveIdDaoAddr, tcbDaoAddr, pcsDaoAddr, pckDaoAddr, pckHelperAddr, crlHelperAddr);

vm.stopBroadcast();
}

function setAuthorizedCaller(address caller, bool authorized) public {
vm.startBroadcast(deployerKey);

PCCSRouter router = PCCSRouter(vm.envAddress("PCCS_ROUTER"));
router.setAuthorized(caller, authorized);

vm.stopBroadcast();
}
}
2 changes: 1 addition & 1 deletion forge-test/AutomataDcapAttestationFeeTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ contract AutomataDcapAttestationFeeTest is PCCSSetupBase, RiscZeroSetup {
AutomataDcapAttestationFee attestation;
PCCSRouter pccsRouter;

bytes32 imageId = vm.envBytes32("DCAP_IMAGE_ID");
bytes32 imageId = vm.envBytes32("DCAP_RISCZERO_IMAGE_ID");
address user = address(69);

function setUp() public override {
Expand Down
105 changes: 58 additions & 47 deletions forge-test/AutomataDcapAttestationTest.t.sol

Large diffs are not rendered by default.

25 changes: 0 additions & 25 deletions forge-test/utils/SuccinctSetup.sol

This file was deleted.

11 changes: 11 additions & 0 deletions forge-test/utils/succinct/Groth16Setup.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {SP1Verifier} from "@sp1-contracts/v3.0.0/SP1VerifierGroth16.sol";

contract Groth16Setup {
function setup() public returns (address verifier) {
SP1Verifier groth16Verifier = new SP1Verifier();
verifier = address(groth16Verifier);
}
}
11 changes: 11 additions & 0 deletions forge-test/utils/succinct/PlonkSetup.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {SP1Verifier} from "@sp1-contracts/v3.0.0/SP1VerifierPlonk.sol";

contract PlonkSetup {
function setup() public returns (address verifier) {
SP1Verifier plonkVerifier = new SP1Verifier();
verifier = address(plonkVerifier);
}
}

0 comments on commit 8f63a44

Please sign in to comment.