diff --git a/contracts/AutomataDcapAttestation.sol b/contracts/AutomataDcapAttestation.sol deleted file mode 100644 index c1b6839..0000000 --- a/contracts/AutomataDcapAttestation.sol +++ /dev/null @@ -1,29 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "./AttestationEntrypointBase.sol"; - -/** - * @title Automata DCAP Attestation - */ -contract AutomataDcapAttestation is AttestationEntrypointBase { - function verifyAndAttestOnChain(bytes calldata rawQuote) - external - view - returns (bool success, bytes memory output) - { - (success, output) = _verifyAndAttestOnChain(rawQuote); - } - - function verifyAndAttestWithZKProof( - bytes calldata output, - ZkCoProcessorType zkCoprocessor, - bytes calldata proofBytes - ) - external - view - returns (bool success, bytes memory verifiedOutput) - { - (success, verifiedOutput) = _verifyAndAttestWithZKProof(output, zkCoprocessor, proofBytes); - } -} diff --git a/contracts/AutomataDcapAttestationFee.sol b/contracts/AutomataDcapAttestationFee.sol index baba4e3..eeca3ce 100644 --- a/contracts/AutomataDcapAttestationFee.sol +++ b/contracts/AutomataDcapAttestationFee.sol @@ -10,14 +10,6 @@ import "./bases/FeeManagerBase.sol"; * needed to perform DCAP attestation. */ contract AutomataDcapAttestationFee is FeeManagerBase, AttestationEntrypointBase { - function enableFee() public override onlyOwner { - super.enableFee(); - } - - function disableFee() public override onlyOwner { - super.disableFee(); - } - function setBp(uint16 _newBp) public override onlyOwner { super.setBp(_newBp); } diff --git a/contracts/bases/FeeManagerBase.sol b/contracts/bases/FeeManagerBase.sol index 57b9dea..1733b7d 100644 --- a/contracts/bases/FeeManagerBase.sol +++ b/contracts/bases/FeeManagerBase.sol @@ -5,7 +5,6 @@ abstract contract FeeManagerBase { uint16 constant MAX_BP = 10_000; uint16 _feeBP; // the percentage of gas fee in basis point; - bool _isFeeEnabled; // 1356a63b error BP_Not_Valid(); @@ -22,14 +21,6 @@ abstract contract FeeManagerBase { _feeBP = _newBp; } - function enableFee() public virtual { - _isFeeEnabled = true; - } - - function disableFee() public virtual { - _isFeeEnabled = false; - } - function getBp() public view returns (uint16) { return _feeBP; } @@ -44,7 +35,7 @@ abstract contract FeeManagerBase { modifier collectFee() { uint256 txFee; - if (_isFeeEnabled && _feeBP > 0) { + if (_feeBP > 0) { uint256 gasBefore = gasleft(); _; uint256 gasAfter = gasleft(); diff --git a/forge-script/AttestationScript.s.sol b/forge-script/AttestationScript.s.sol index cf9b7e0..3ff14c0 100644 --- a/forge-script/AttestationScript.s.sol +++ b/forge-script/AttestationScript.s.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import "forge-std/Script.sol"; import {console2} from "forge-std/console2.sol"; -import "../contracts/AutomataDcapAttestation.sol"; +import "../contracts/AutomataDcapAttestationFee.sol"; contract AttestationScript is Script { uint256 deployerKey = uint256(vm.envBytes32("PRIVATE_KEY")); @@ -12,7 +12,7 @@ contract AttestationScript is Script { function deployEntrypoint() public { vm.startBroadcast(deployerKey); - AutomataDcapAttestation attestation = new AutomataDcapAttestation(); + AutomataDcapAttestationFee attestation = new AutomataDcapAttestationFee(); console.log("Automata Dcap Attestation deployed at: ", address(attestation)); @@ -22,7 +22,7 @@ contract AttestationScript is Script { function configVerifier(address verifier) public { address attestationAddr = vm.envAddress("DCAP_ATTESTATION"); vm.broadcast(deployerKey); - AutomataDcapAttestation(attestationAddr).setQuoteVerifier(verifier); + AutomataDcapAttestationFee(attestationAddr).setQuoteVerifier(verifier); } function configureZk(uint8 zk, address verifierGateway, bytes32 programId) public { @@ -32,6 +32,6 @@ contract AttestationScript is Script { ZkCoProcessorConfig({dcapProgramIdentifier: programId, zkVerifier: verifierGateway}); vm.broadcast(deployerKey); - AutomataDcapAttestation(attestationAddr).setZkConfiguration(ZkCoProcessorType(zk), config); + AutomataDcapAttestationFee(attestationAddr).setZkConfiguration(ZkCoProcessorType(zk), config); } } diff --git a/forge-test/AutomataDcapAttestationTest.t.sol b/forge-test/AutomataDcapAttestationTest.t.sol index 2799c6a..88ed2ec 100644 --- a/forge-test/AutomataDcapAttestationTest.t.sol +++ b/forge-test/AutomataDcapAttestationTest.t.sol @@ -7,15 +7,15 @@ import {PlonkSetup} from "./utils/succinct/PlonkSetup.sol"; import {Groth16Setup} from "./utils/succinct/Groth16Setup.sol"; import { - AutomataDcapAttestation, ZkCoProcessorConfig, ZkCoProcessorType -} from "../contracts/AutomataDcapAttestation.sol"; + AutomataDcapAttestationFee, ZkCoProcessorConfig, ZkCoProcessorType +} from "../contracts/AutomataDcapAttestationFee.sol"; import {V3QuoteVerifier} from "../contracts/verifiers/V3QuoteVerifier.sol"; import {V4QuoteVerifier} from "../contracts/verifiers/V4QuoteVerifier.sol"; import {ISP1Verifier} from "@sp1-contracts/ISP1Verifier.sol"; -contract AutomataDcapAttestationTest is PCCSSetupBase, RiscZeroSetup { - AutomataDcapAttestation attestation; +contract AutomataDcapAttestationFeeTest is PCCSSetupBase, RiscZeroSetup { + AutomataDcapAttestationFee attestation; PCCSRouter pccsRouter; // Contracts used for testing only @@ -31,7 +31,7 @@ contract AutomataDcapAttestationTest is PCCSSetupBase, RiscZeroSetup { pcsDaoUpserts(); // DCAP Contract Deployment - attestation = new AutomataDcapAttestation(); + attestation = new AutomataDcapAttestationFee(); vm.stopPrank(); }