From c1168f2998f6922f47fbe1e46a9fc56ae71db8fd Mon Sep 17 00:00:00 2001 From: Parsa Date: Thu, 2 Nov 2023 11:37:00 +0330 Subject: [PATCH] Update GovernorContract.sol Since these arrays don't need to be modified in the functions, calldata is preferable and more gas efficient. --- .../governance_standard/GovernorContract.sol | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/contracts/governance_standard/GovernorContract.sol b/contracts/governance_standard/GovernorContract.sol index 82dbd55..38621b7 100644 --- a/contracts/governance_standard/GovernorContract.sol +++ b/contracts/governance_standard/GovernorContract.sol @@ -71,9 +71,9 @@ contract GovernorContract is } function propose( - address[] memory targets, - uint256[] memory values, - bytes[] memory calldatas, + address[] calldata targets, + uint256[] calldata values, + bytes[] calldata calldatas, string memory description ) public override(Governor, IGovernor) returns (uint256) { return super.propose(targets, values, calldatas, description); @@ -81,18 +81,18 @@ contract GovernorContract is function _execute( uint256 proposalId, - address[] memory targets, - uint256[] memory values, - bytes[] memory calldatas, + address[] calldata targets, + uint256[] calldata values, + bytes[] calldata calldatas, bytes32 descriptionHash ) internal override(Governor, GovernorTimelockControl) { super._execute(proposalId, targets, values, calldatas, descriptionHash); } function _cancel( - address[] memory targets, - uint256[] memory values, - bytes[] memory calldatas, + address[] calldata targets, + uint256[] calldata values, + bytes[] calldata calldatas, bytes32 descriptionHash ) internal override(Governor, GovernorTimelockControl) returns (uint256) { return super._cancel(targets, values, calldatas, descriptionHash);