Skip to content

Commit

Permalink
Reducing the uint size needed for periods and durations
Browse files Browse the repository at this point in the history
  • Loading branch information
brickpop committed Nov 28, 2024
1 parent 6b0cdaf commit 2065c03
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/EmergencyMultisig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ contract EmergencyMultisig is IEmergencyMultisig, PluginUUPSUpgradeable, Proposa
bool onlyListed;
uint16 minApprovals;
SignerList signerList;
uint64 proposalExpirationPeriod;
uint32 proposalExpirationPeriod; // uint32 is enough, not a timestamp
}

/// @notice The ID of the permission required to call the `addAddresses` and `removeAddresses` functions.
Expand Down Expand Up @@ -128,7 +128,7 @@ contract EmergencyMultisig is IEmergencyMultisig, PluginUUPSUpgradeable, Proposa
/// @param signerList The contract defining who is a member and/or who is appointed as a decryption wallet
/// @param proposalExpirationPeriod The amount of seconds after which a non executed proposal expires.
event MultisigSettingsUpdated(
bool onlyListed, uint16 indexed minApprovals, SignerList signerList, uint64 proposalExpirationPeriod
bool onlyListed, uint16 indexed minApprovals, SignerList signerList, uint32 proposalExpirationPeriod
);

/// @notice Initializes Release 1, Build 1.
Expand Down
8 changes: 4 additions & 4 deletions src/Multisig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ contract Multisig is IMultisig, PluginUUPSUpgradeable, ProposalUpgradeable {
struct MultisigSettings {
bool onlyListed;
uint16 minApprovals;
uint64 destinationProposalDuration;
uint32 destinationProposalDuration; // uint32 is enough, not a timestamp
SignerList signerList;
uint64 proposalExpirationPeriod;
uint32 proposalExpirationPeriod; // uint32 is enough, not a timestamp
}

/// @notice The ID of the permission required to call the `addAddresses` and `removeAddresses` functions.
Expand Down Expand Up @@ -124,9 +124,9 @@ contract Multisig is IMultisig, PluginUUPSUpgradeable, ProposalUpgradeable {
event MultisigSettingsUpdated(
bool onlyListed,
uint16 indexed minApprovals,
uint64 destinationProposalDuration,
uint32 destinationProposalDuration,
SignerList signerList,
uint64 proposalExpirationPeriod
uint32 proposalExpirationPeriod
);

/// @notice Initializes Release 1, Build 1.
Expand Down
4 changes: 2 additions & 2 deletions test/EmergencyMultisig.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {IProposal} from "@aragon/osx/core/plugin/proposal/IProposal.sol";
import {IPlugin} from "@aragon/osx/core/plugin/IPlugin.sol";
import {IEmergencyMultisig} from "../src/interfaces/IEmergencyMultisig.sol";

uint64 constant EMERGENCY_MULTISIG_PROPOSAL_EXPIRATION_PERIOD = 10 days;
uint32 constant EMERGENCY_MULTISIG_PROPOSAL_EXPIRATION_PERIOD = 10 days;

contract EmergencyMultisigTest is AragonTest {
DaoBuilder builder;
Expand All @@ -38,7 +38,7 @@ contract EmergencyMultisigTest is AragonTest {
error InvalidActions(uint256 proposalId);

event MultisigSettingsUpdated(
bool onlyListed, uint16 indexed minApprovals, SignerList signerList, uint64 proposalExpirationPeriod
bool onlyListed, uint16 indexed minApprovals, SignerList signerList, uint32 proposalExpirationPeriod
);

event EmergencyProposalCreated(uint256 indexed proposalId, address indexed creator, bytes encryptedPayloadURI);
Expand Down
6 changes: 3 additions & 3 deletions test/Multisig.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {IProposal} from "@aragon/osx/core/plugin/proposal/IProposal.sol";
import {IPlugin} from "@aragon/osx/core/plugin/IPlugin.sol";
import {IMultisig} from "../src/interfaces/IMultisig.sol";

uint64 constant MULTISIG_PROPOSAL_EXPIRATION_PERIOD = 10 days;
uint32 constant MULTISIG_PROPOSAL_EXPIRATION_PERIOD = 10 days;
uint32 constant DESTINATION_PROPOSAL_DURATION = 9 days;

contract MultisigTest is AragonTest {
Expand All @@ -41,9 +41,9 @@ contract MultisigTest is AragonTest {
event MultisigSettingsUpdated(
bool onlyListed,
uint16 indexed minApprovals,
uint64 destinationProposalDuration,
uint32 destinationProposalDuration,
SignerList signerList,
uint64 proposalExpirationPeriod
uint32 proposalExpirationPeriod
);
// Multisig and OptimisticTokenVotingPlugin's event
event ProposalCreated(
Expand Down
6 changes: 3 additions & 3 deletions test/helpers/DaoBuilder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ contract DaoBuilder is Test {

bool public onlyListed = true;
uint16 public minApprovals = 1;
uint64 public stdProposalDuration = 10 days;
uint64 multisigProposalExpirationPeriod = 10 days;
uint32 public stdProposalDuration = 10 days;
uint32 public multisigProposalExpirationPeriod = 10 days;

function withDaoOwner(address newOwner) public returns (DaoBuilder) {
owner = newOwner;
Expand Down Expand Up @@ -105,7 +105,7 @@ contract DaoBuilder is Test {
return this;
}

function withExpiration(uint64 newExpirationPeriod) public returns (DaoBuilder) {
function withExpiration(uint32 newExpirationPeriod) public returns (DaoBuilder) {
multisigProposalExpirationPeriod = newExpirationPeriod;
return this;
}
Expand Down

0 comments on commit 2065c03

Please sign in to comment.