Skip to content

Commit

Permalink
fix(protocol): typos; deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
failfmi committed Oct 31, 2024
1 parent ece6835 commit 9d65fc5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ import "./interfaces/IAttestationVerifier.sol";

/// @title AttestationVerifier
contract AttestationVerifier is IAttestationVerifier, EssentialContract {
IAttestation public attestationVerifier; // slot 1
IAttestationV2 public automataDcapAttestation; // slot 1
mapping(bytes32 pcr10 => bool trusted) public trustedPcr10; // slot 2
bool checkPcr10; // slot3

uint256[47] private __gap;

function init(
address _owner,
address _attestationVerifier,
address _automataDcapAttestation,
bool _checkPcr10
)
external
initializer
{
__Essential_init(_owner);
attestationVerifier = IAttestation(_attestationVerifier);
automataDcapAttestation = IAttestationV2(_automataDcapAttestation);
checkPcr10 = _checkPcr10;
}

Expand All @@ -41,9 +41,9 @@ contract AttestationVerifier is IAttestationVerifier, EssentialContract {
)
external
{
if (address(attestationVerifier) == address(0)) return;
if (address(automataDcapAttestation) == address(0)) return;

(bool succ, bytes memory output) = attestationVerifier
(bool succ, bytes memory output) = automataDcapAttestation
.verifyAndAttestOnChain(_report);
if (!succ) revert INVALID_REPORT();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pragma solidity ^0.8.24;
* @dev should also implement Risc0 Guest Program to use this interface.
* See https://dev.risczero.com/api/blockchain-integration/bonsai-on-eth to learn more
*/
interface IAttestation {
interface IAttestationV2 {
/**
* @notice full on-chain verification for an attestation
* @dev must further specify the structure of inputs/outputs, to be serialized and passed to this method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import "../../contracts/layer1/automata-attestation/AttestationVerifier.sol";
import "../../contracts/layer1/automata-attestation/interfaces/IAttestationVerifier.sol";

contract DeployAttestationVerifier is DeployCapability {
address public automataDcapAttesattion = vm.envAddress("AUTOMATA_DCAP_ATTESTATION");
address public automataDcapAttestation = vm.envAddress("AUTOMATA_DCAP_ATTESTATION");
bool public checkPCR10 = vm.envOr("CHECK_PRC10", true);
bool public simulateVerify = vm.envOr("SIMULATE_VERIFY", false);

function run() external {
require(automataDcapAttesattion != address(0), "invalid automata DCAP attestation address");
require(automataDcapAttestation != address(0), "invalid automata DCAP attestation address");

vm.startBroadcast();

Expand All @@ -21,7 +21,7 @@ contract DeployAttestationVerifier is DeployCapability {
address proxy = deployProxy({
name: "attestation_verifier",
impl: address(attesatationVerifier),
data: abi.encodeCall(AttestationVerifier.init, (msg.sender, automataDcapAttesattion, true))
data: abi.encodeCall(AttestationVerifier.init, (msg.sender, automataDcapAttestation, true))
});

vm.stopBroadcast();
Expand Down
3 changes: 2 additions & 1 deletion packages/protocol/script/layer1/DeployProtocolOnL1.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ contract DeployProtocolOnL1 is DeployCapability {
addressNotNull(vm.envAddress("TAIKO_L2_ADDRESS"), "TAIKO_L2_ADDRESS");
addressNotNull(vm.envAddress("L2_SIGNAL_SERVICE"), "L2_SIGNAL_SERVICE");
addressNotNull(vm.envAddress("CONTRACT_OWNER"), "CONTRACT_OWNER");
addressNotNull(vm.envAddress("AUTOMATA_DCAP_ATTESTATION"), "AUTOMATA_DCAP_ATTESTATION");

require(vm.envBytes32("L2_GENESIS_HASH") != 0, "L2_GENESIS_HASH");
address contractOwner = vm.envAddress("CONTRACT_OWNER");
Expand Down Expand Up @@ -335,7 +336,7 @@ contract DeployProtocolOnL1 is DeployCapability {
address attestationVerifier = deployProxy({
name: "attestation_verifier",
impl: address(new AttestationVerifier()),
data: abi.encodeCall(AttestationVerifier.init, (owner, address(0)))
data: abi.encodeCall(AttestationVerifier.init, (owner, vm.envAddress("AUTOMATA_DCAP_ATTESTATION"), true))
});

deployProxy({
Expand Down
1 change: 1 addition & 0 deletions packages/protocol/script/layer1/deploy_protocol_on_l1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ TAIKO_TOKEN_NAME="Taiko Token Test" \
TAIKO_TOKEN_SYMBOL=TTKOk \
SHARED_ADDRESS_MANAGER=0x0000000000000000000000000000000000000000 \
L2_GENESIS_HASH=0xee1950562d42f0da28bd4550d88886bc90894c77c9c9eaefef775d4c8223f259 \
AUTOMATA_DCAP_ATTESTATION=0x0000000000000000000000000000000000000000 \
PAUSE_TAIKO_L1=true \
PAUSE_BRIDGE=true \
NUM_MIN_MAJORITY_GUARDIANS=7 \
Expand Down

0 comments on commit 9d65fc5

Please sign in to comment.