@@ -51,6 +51,7 @@ abstract contract GovernorStorage is Governor {
51
51
* @dev Version of {IGovernorTimelock-queue} with only `proposalId` as an argument.
52
52
*/
53
53
function queue (uint256 proposalId ) public virtual {
54
+ // here, using storage is more efficient than memory
54
55
ProposalDetails storage details = _proposalDetails[proposalId];
55
56
queue (details.targets, details.values, details.calldatas, details.descriptionHash);
56
57
}
@@ -59,6 +60,7 @@ abstract contract GovernorStorage is Governor {
59
60
* @dev Version of {IGovernor-execute} with only `proposalId` as an argument.
60
61
*/
61
62
function execute (uint256 proposalId ) public payable virtual {
63
+ // here, using storage is more efficient than memory
62
64
ProposalDetails storage details = _proposalDetails[proposalId];
63
65
execute (details.targets, details.values, details.calldatas, details.descriptionHash);
64
66
}
@@ -67,6 +69,7 @@ abstract contract GovernorStorage is Governor {
67
69
* @dev ProposalId version of {IGovernor-cancel}.
68
70
*/
69
71
function cancel (uint256 proposalId ) public virtual {
72
+ // here, using storage is more efficient than memory
70
73
ProposalDetails storage details = _proposalDetails[proposalId];
71
74
cancel (details.targets, details.values, details.calldatas, details.descriptionHash);
72
75
}
@@ -84,6 +87,7 @@ abstract contract GovernorStorage is Governor {
84
87
function proposalDetails (
85
88
uint256 proposalId
86
89
) public view virtual returns (address [] memory , uint256 [] memory , bytes [] memory , bytes32 ) {
90
+ // here, using memory is more efficient than storage
87
91
ProposalDetails memory details = _proposalDetails[proposalId];
88
92
if (details.descriptionHash == 0 ) {
89
93
revert GovernorNonexistentProposal (proposalId);
0 commit comments