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
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ MINIMUM_PROPOSER_VOTING_POWER="1"

# Micro committee
COMMITTEE_SIZE="0"
# Insecure params (testing only)
PARAM_SET="0"

CRISP_PROGRAM_PARAMS="0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000ffffee0010000000000000000000000000000000000000000000000000000000ffffc400100000000000000000000000000000000000000000000000000000000000000013300000000000000000000000000000000000000000000000000000000000000"
COMPUTE_PROVIDER_PARAMS="0x7b226e616d65223a225249534330222c22706172616c6c656c223a66616c73652c2262617463685f73697a65223a347d"
2 changes: 1 addition & 1 deletion script/DeploySimple.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ contract CrispVotingScript is Script {
token: address(0),
enclave: crispEnvVariables.enclave,
committeeSize: crispEnvVariables.committeeSize,
paramSet: crispEnvVariables.paramSet,
crispProgramAddress: crispEnvVariables.crispProgramAddress,
crispProgramParams: crispEnvVariables.crispProgramParams,
computeProviderParams: crispEnvVariables.computeProviderParams
});
}
Expand Down
4 changes: 2 additions & 2 deletions script/Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ library Utils {
ICrispVoting.VotingSettings votingSettings;
IPlugin.TargetConfig targetConfig;
IEnclave.CommitteeSize committeeSize;
bytes crispProgramParams;
uint8 paramSet;
bytes computeProviderParams;
}

Expand All @@ -38,8 +38,8 @@ library Utils {
});
crispEnvVariables.targetConfig = defaultTargetConfig;
crispEnvVariables.committeeSize = IEnclave.CommitteeSize(uint8(VM.envUint("COMMITTEE_SIZE")));
crispEnvVariables.crispProgramParams = VM.envBytes("CRISP_PROGRAM_PARAMS");
crispEnvVariables.computeProviderParams = VM.envBytes("COMPUTE_PROVIDER_PARAMS");
crispEnvVariables.paramSet = uint8(VM.envUint("PARAM_SET"));
}

function getGovernanceTokenAndMintSettings()
Expand Down
8 changes: 4 additions & 4 deletions src/CrispVoting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ contract CrispVoting is PluginUUPSUpgradeable, ProposalUpgradeable, ICrispVoting

/// @notice The ciphernode threshold
IEnclave.CommitteeSize private committeeSize;
/// @notice The parameter set to use
uint8 private paramSet;
/// @notice The address of the E3 Program
address private crispProgramAddress;
/// @notice The ABI encoded program parameters
bytes private crispProgramParams;
/// @notice The ABI encoded compute provider parameters
bytes private computeProviderParams;

Expand All @@ -85,8 +85,8 @@ contract CrispVoting is PluginUUPSUpgradeable, ProposalUpgradeable, ICrispVoting
votingToken = IVotesUpgradeable(_params.token);
enclaveFeeToken = IERC20(enclave.feeToken());
committeeSize = _params.committeeSize;
paramSet = _params.paramSet;
crispProgramAddress = _params.crispProgramAddress;
crispProgramParams = _params.crispProgramParams;
computeProviderParams = _params.computeProviderParams;
}

Expand Down Expand Up @@ -152,7 +152,7 @@ contract CrispVoting is PluginUUPSUpgradeable, ProposalUpgradeable, ICrispVoting
computeProviderParams: computeProviderParams,
customParams: customParams,
proofAggregationEnabled: false,
paramSet: 0
paramSet: paramSet
});

// calculate the E3 fee
Expand Down
3 changes: 2 additions & 1 deletion src/ICrispVoting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,16 @@ interface ICrispVoting {
/// @param token The token contract address
/// @param enclave The enclave contract address
/// @param committeeSize The size of the committee.
/// @param paramSet The parameter set to use.
/// @param e3Program The address of the E3 Program.
/// @param e3ProgramParams The ABI encoded computation parameters.
struct PluginInitParams {
IDAO dao;
address token;
address enclave;
IEnclave.CommitteeSize committeeSize;
uint8 paramSet;
address crispProgramAddress;
bytes crispProgramParams;
bytes computeProviderParams;
}

Expand Down
5 changes: 1 addition & 4 deletions src/IPkVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@ interface IPkVerifier {
/// @param foldProof ABI-encoded fold proof (bytes, bytes32[]) or empty to skip.
/// @return pkCommitment The aggregate public key commitment (last public input).
/// @dev Reverts if the proof is invalid.
function verify(
bytes memory proof,
bytes memory foldProof
) external view returns (bytes32 pkCommitment);
function verify(bytes memory proof, bytes memory foldProof) external view returns (bytes32 pkCommitment);
}
4 changes: 1 addition & 3 deletions test/builders/SimpleBuilder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ contract SimpleBuilder is TestBase {
address crispProgramAddress = 0x0b75A4d93c686103a903091a91C869aD9ad9CB7B;
address enclaveAddress = 0x95bC90fcb37684bfbAA3ffA2CbF4067fA404c4AA;

bytes memory crispProgramParams =
"0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000ffffee0010000000000000000000000000000000000000000000000000000000ffffc400100000000000000000000000000000000000000000000000000000000000000013300000000000000000000000000000000000000000000000000000000000000";
bytes memory computeProviderParams =
"0x7b226e616d65223a225249534330222c22706172616c6c656c223a66616c73652c2262617463685f73697a65223a347d";

Expand All @@ -72,7 +70,7 @@ contract SimpleBuilder is TestBase {
enclave: enclaveAddress,
committeeSize: committeeSize,
crispProgramAddress: crispProgramAddress,
crispProgramParams: crispProgramParams,
paramSet: 0,
computeProviderParams: computeProviderParams
});

Expand Down
4 changes: 1 addition & 3 deletions test/crispVoting.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ contract MyPluginTest is TestBase {
address crispProgramAddress = 0x67d269191c92Caf3cD7723F116c85e6E9bf55933;
address enclaveAddress = 0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0;

bytes crispProgramParams =
"0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000ffffee0010000000000000000000000000000000000000000000000000000000ffffc400100000000000000000000000000000000000000000000000000000000000000013300000000000000000000000000000000000000000000000000000000000000";
bytes computeProviderParams =
"0x7b226e616d65223a225249534330222c22706172616c6c656c223a66616c73652c2262617463685f73697a65223a347d";

Expand All @@ -31,7 +29,7 @@ contract MyPluginTest is TestBase {
enclave: enclaveAddress,
committeeSize: IEnclave.CommitteeSize(0),
crispProgramAddress: crispProgramAddress,
crispProgramParams: crispProgramParams,
paramSet: 0,
computeProviderParams: computeProviderParams
});

Expand Down
4 changes: 1 addition & 3 deletions test/fork-tests/crisp.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ contract MyPluginTestFork is TestBase {
address enclaveAddress = 0x95bC90fcb37684bfbAA3ffA2CbF4067fA404c4AA;
address enclaveFeeToken = 0x80C5504A6704359C40B88777b1639096d3453804;

bytes crispProgramParams =
"0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000ffffee0010000000000000000000000000000000000000000000000000000000ffffc400100000000000000000000000000000000000000000000000000000000000000013300000000000000000000000000000000000000000000000000000000000000";
bytes computeProviderParams =
"0x7b226e616d65223a225249534330222c22706172616c6c656c223a66616c73652c2262617463685f73697a65223a347d";

Expand All @@ -32,7 +30,7 @@ contract MyPluginTestFork is TestBase {
enclave: enclaveAddress,
committeeSize: IEnclave.CommitteeSize(0),
crispProgramAddress: crispProgramAddress,
crispProgramParams: crispProgramParams,
paramSet: 0,
computeProviderParams: computeProviderParams
});

Expand Down
Loading