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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface IProposalValidator is ISemver {
error ProposalValidator_InsufficientVotingPower();
error ProposalValidator_InvalidAttestation();
error ProposalValidator_ProposalDoesNotExist();
error ProposalValidator_VotingCycleAlreadySet();
error ReinitializableBase_ZeroInitVersion();

struct ProposalData {
Expand Down Expand Up @@ -61,8 +62,15 @@ interface IProposalValidator is ISemver {

event DistributionThresholdSet(uint256 newDistributionThreshold);

event ProposalApprovalThresholdSet(ProposalType proposalType, uint256 newApprovalThreshold);

event ProposalTypeApprovalThresholdSet(ProposalType proposalType, uint256 newApprovalThreshold);

event VotingCycleDataSet(
uint256 cycleNumber,
uint256 startBlock,
uint256 duration,
uint256 votingCycleDistributionLimit
);

event Initialized(uint8 version);

function submitProposal(
Expand All @@ -87,8 +95,27 @@ interface IProposalValidator is ISemver {
function setMinimumVotingPower(uint256 _minimumVotingPower) external;

function setDistributionThreshold(uint256 _distributionThreshold) external;

function setProposalRequiredApprovals(ProposalType _proposalType, uint256 _requiredApprovals) external;

function setProposalTypeApprovalThreshold(ProposalType _proposalType, uint256 _requiredApprovals) external;

function setVotingCycleData(
uint256 _cycleNumber,
uint256 _startBlock,
uint256 _duration,
uint256 _votingCycleDistributionLimit
) external;

function initialize(
address _owner,
uint256 _minimumVotingPower,
uint256 _cycleNumber,
uint256 _startBlock,
uint256 _duration,
uint256 _votingCycleDistributionLimit,
uint256 _distributionThreshold,
ProposalType[] memory _proposalTypes,
uint256[] memory _requiredApprovals
) external;

function renounceOwnership() external;

Expand All @@ -109,14 +136,14 @@ interface IProposalValidator is ISemver {
function initVersion() external view returns (uint8);

function ATTESTATION_SCHEMA_UID() external view returns (bytes32);

function initialize(
address _owner,
uint256 _minimumVotingPower,
uint256 _distributionThreshold,
IProposalValidator.ProposalType[] memory _proposalTypes,
uint256[] memory _requiredApprovals
) external;
function proposalRequiredApprovals(ProposalType) external view returns (uint256);

function votingCycles(uint256) external view returns (
uint256 startingBlock,
uint256 duration,
uint256 votingCycleDistributionLimit
);

function __constructor__(
bytes32 _attestationSchemaUid,
Expand Down
172 changes: 152 additions & 20 deletions packages/contracts-bedrock/snapshots/abi/ProposalValidator.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,26 @@
"name": "_minimumVotingPower",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_cycleNumber",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_startBlock",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_duration",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_votingCycleDistributionLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_distributionThreshold",
Expand Down Expand Up @@ -210,6 +230,25 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "enum ProposalValidator.ProposalType",
"name": "",
"type": "uint8"
}
],
"name": "proposalRequiredApprovals",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
Expand Down Expand Up @@ -256,7 +295,35 @@
"type": "uint256"
}
],
"name": "setProposalRequiredApprovals",
"name": "setProposalTypeApprovalThreshold",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_cycleNumber",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_startBlock",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_duration",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_votingCycleDistributionLimit",
"type": "uint256"
}
],
"name": "setVotingCycleData",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
Expand Down Expand Up @@ -336,6 +403,35 @@
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "votingCycles",
"outputs": [
{
"internalType": "uint256",
"name": "startingBlock",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "duration",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "votingCycleDistributionLimit",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -394,25 +490,6 @@
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "enum ProposalValidator.ProposalType",
"name": "proposalType",
"type": "uint8"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newApprovalThreshold",
"type": "uint256"
}
],
"name": "ProposalApprovalThresholdSet",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -506,6 +583,56 @@
"name": "ProposalSubmitted",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "enum ProposalValidator.ProposalType",
"name": "proposalType",
"type": "uint8"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newApprovalThreshold",
"type": "uint256"
}
],
"name": "ProposalTypeApprovalThresholdSet",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "cycleNumber",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "startBlock",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "duration",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "votingCycleDistributionLimit",
"type": "uint256"
}
],
"name": "VotingCycleDataSet",
"type": "event"
},
{
"inputs": [],
"name": "ProposalValidator_InsufficientApprovals",
Expand Down Expand Up @@ -536,6 +663,11 @@
"name": "ProposalValidator_ProposalDoesNotExist",
"type": "error"
},
{
"inputs": [],
"name": "ProposalValidator_VotingCycleAlreadySet",
"type": "error"
},
{
"inputs": [],
"name": "ReinitializableBase_ZeroInitVersion",
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/snapshots/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@
"sourceCodeHash": "0x18f43b227decd0f2a895b8b55e23fa6a47706697c272bbf2482b3f912be446e1"
},
"src/governance/ProposalValidator.sol:ProposalValidator": {
"initCodeHash": "0x295082116c7ed6b02211af266697b6e0839987eba410c4654051ad62b76e308e",
"sourceCodeHash": "0xd47d9c8bfbb130a8f1290dab1b25c4f92da9f7d0e9a5b7923dd646178713593f"
"initCodeHash": "0x218b5001f56c04cefe63991cdfa08d79595e94ba203dd615818f3e5c570d9f26",
"sourceCodeHash": "0xd9cbe54c1f1c0152ee3da444f39f4cf6b0f6087d6b8c3da18ed8beb830835029"
},
"src/legacy/DeployerWhitelist.sol:DeployerWhitelist": {
"initCodeHash": "0x53099379ed48b87f027d55712dbdd1da7d7099925426eb0531da9c0012e02c29",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,23 @@
},
{
"bytes": "32",
"label": "_proposalRequiredApprovals",
"label": "votingCycles",
"offset": 0,
"slot": "103",
"type": "mapping(uint256 => struct ProposalValidator.VotingCycleData)"
},
{
"bytes": "32",
"label": "proposalRequiredApprovals",
"offset": 0,
"slot": "104",
"type": "mapping(enum ProposalValidator.ProposalType => uint256)"
},
{
"bytes": "32",
"label": "_proposals",
"offset": 0,
"slot": "104",
"slot": "105",
"type": "mapping(bytes32 => struct ProposalValidator.ProposalData)"
}
]
Loading