Skip to content

Commit

Permalink
bump forwarder version, small optimization (#11032)
Browse files Browse the repository at this point in the history
* bump forwarder version, use ++i

* go gen
  • Loading branch information
essamhassan authored Oct 20, 2023
1 parent 7194613 commit 8040dfa
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contract AuthorizedForwarder is ConfirmedOwnerWithProposal, AuthorizedReceiver {
}

// solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables
string public constant typeAndVersion = "AuthorizedForwarder 1.0.0";
string public constant typeAndVersion = "AuthorizedForwarder 1.1.0";

// @notice Forward a call to another contract
// @dev Only callable by an authorized sender
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ abstract contract AuthorizedReceiver is AuthorizedReceiverInterface {
require(senders.length > 0, "Must have at least 1 sender");
// Set previous authorized senders to false
uint256 authorizedSendersLength = s_authorizedSenderList.length;
for (uint256 i = 0; i < authorizedSendersLength; i++) {
for (uint256 i = 0; i < authorizedSendersLength; ++i) {
s_authorizedSenders[s_authorizedSenderList[i]] = false;
}
// Set new to true
for (uint256 i = 0; i < senders.length; i++) {
for (uint256 i = 0; i < senders.length; ++i) {
require(s_authorizedSenders[senders[i]] == false, "Must not have duplicate senders");
s_authorizedSenders[senders[i]] = true;
}
Expand Down
8 changes: 4 additions & 4 deletions contracts/src/v0.8/operatorforwarder/dev/Operator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ contract Operator is AuthorizedReceiver, ConfirmedOwner, LinkTokenReceiver, Oper
// @param ownable list of addresses to transfer
// @param newOwner address to transfer ownership to
function transferOwnableContracts(address[] calldata ownable, address newOwner) external onlyOwner {
for (uint256 i = 0; i < ownable.length; i++) {
for (uint256 i = 0; i < ownable.length; ++i) {
s_owned[ownable[i]] = false;
IOwnable(ownable[i]).transferOwnership(newOwner);
}
Expand All @@ -228,7 +228,7 @@ contract Operator is AuthorizedReceiver, ConfirmedOwner, LinkTokenReceiver, Oper
// @dev Must be the pending owner on the contract
// @param ownable list of addresses of Ownable contracts to accept
function acceptOwnableContracts(address[] calldata ownable) public validateAuthorizedSenderSetter {
for (uint256 i = 0; i < ownable.length; i++) {
for (uint256 i = 0; i < ownable.length; ++i) {
s_owned[ownable[i]] = true;
emit OwnableContractAccepted(ownable[i]);
IOwnable(ownable[i]).acceptOwnership();
Expand All @@ -244,7 +244,7 @@ contract Operator is AuthorizedReceiver, ConfirmedOwner, LinkTokenReceiver, Oper
) public validateAuthorizedSenderSetter {
emit TargetsUpdatedAuthorizedSenders(targets, senders, msg.sender);

for (uint256 i = 0; i < targets.length; i++) {
for (uint256 i = 0; i < targets.length; ++i) {
AuthorizedReceiverInterface(targets[i]).setAuthorizedSenders(senders);
}
}
Expand Down Expand Up @@ -315,7 +315,7 @@ contract Operator is AuthorizedReceiver, ConfirmedOwner, LinkTokenReceiver, Oper
function distributeFunds(address payable[] calldata receivers, uint256[] calldata amounts) external payable {
require(receivers.length > 0 && receivers.length == amounts.length, "Invalid array length(s)");
uint256 valueRemaining = msg.value;
for (uint256 i = 0; i < receivers.length; i++) {
for (uint256 i = 0; i < receivers.length; ++i) {
uint256 sendAmount = amounts[i];
valueRemaining = valueRemaining - sendAmount;
receivers[i].transfer(sendAmount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('AuthorizedForwarder', () => {
it('describes the authorized forwarder', async () => {
assert.equal(
await forwarder.typeAndVersion(),
'AuthorizedForwarder 1.0.0',
'AuthorizedForwarder 1.1.0',
)
})
})
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GETH_VERSION: 1.12.0
aggregator_v2v3_interface: ../../contracts/solc/v0.8.6/AggregatorV2V3Interface.abi ../../contracts/solc/v0.8.6/AggregatorV2V3Interface.bin 95e8814b408bb05bf21742ef580d98698b7db6a9bac6a35c3de12b23aec4ee28
aggregator_v3_interface: ../../contracts/solc/v0.8.6/AggregatorV3Interface.abi ../../contracts/solc/v0.8.6/AggregatorV3Interface.bin 351b55d3b0f04af67db6dfb5c92f1c64479400ca1fec77afc20bc0ce65cb49ab
authorized_forwarder: ../../contracts/solc/v0.8.19/AuthorizedForwarder.abi ../../contracts/solc/v0.8.19/AuthorizedForwarder.bin 30407c9237e9444b58b11e30bce50edfee340da9757681f90c5f2dc72b4d54d9
authorized_forwarder: ../../contracts/solc/v0.8.19/AuthorizedForwarder.abi ../../contracts/solc/v0.8.19/AuthorizedForwarder.bin 8ea76c883d460f8353a45a493f2aebeb5a2d9a7b4619d1bc4fff5fb590bb3e10
authorized_receiver: ../../contracts/solc/v0.8.19/AuthorizedReceiver.abi ../../contracts/solc/v0.8.19/AuthorizedReceiver.bin 18e8969ba3234b027e1b16c11a783aca58d0ea5c2361010ec597f134b7bf1c4f
automation_consumer_benchmark: ../../contracts/solc/v0.8.16/AutomationConsumerBenchmark.abi ../../contracts/solc/v0.8.16/AutomationConsumerBenchmark.bin f52c76f1aaed4be541d82d97189d70f5aa027fc9838037dd7a7d21910c8c488e
automation_forwarder_logic: ../../contracts/solc/v0.8.16/AutomationForwarderLogic.abi ../../contracts/solc/v0.8.16/AutomationForwarderLogic.bin 15ae0c367297955fdab4b552dbb10e1f2be80a8fde0efec4a4d398693e9d72b5
Expand Down Expand Up @@ -46,8 +46,8 @@ mock_ethlink_aggregator_wrapper: ../../contracts/solc/v0.6/MockETHLINKAggregator
mock_gas_aggregator_wrapper: ../../contracts/solc/v0.6/MockGASAggregator.abi ../../contracts/solc/v0.6/MockGASAggregator.bin bacbb1ea4dc6beac0db8a13ca5c75e2fd61b903d70feea9b3b1c8b10fe8df4f3
multiwordconsumer_wrapper: ../../contracts/solc/v0.7/MultiWordConsumer.abi ../../contracts/solc/v0.7/MultiWordConsumer.bin 6e68abdf614e3ed0f5066c1b5f9d7c1199f1e7c5c5251fe8a471344a59afc6ba
offchain_aggregator_wrapper: OffchainAggregator/OffchainAggregator.abi - 5c8d6562e94166d4790f1ee6e4321d359d9f7262e6c5452a712b1f1c896f45cf
operator_factory: ../../contracts/solc/v0.8.19/OperatorFactory.abi ../../contracts/solc/v0.8.19/OperatorFactory.bin 6ced94aba2fa1313be996b65fc96484092a484fa9eb90c2b841d1dd907fb3167
operator_wrapper: ../../contracts/solc/v0.8.19/Operator.abi ../../contracts/solc/v0.8.19/Operator.bin 3513eeb7de568a1690ec4dfdb5e67a7be392189f4bc94b65670f12512f421715
operator_factory: ../../contracts/solc/v0.8.19/OperatorFactory.abi ../../contracts/solc/v0.8.19/OperatorFactory.bin 0fdfacf8879537b854875608dfca41c6221c342174417112acaa67dfcadafddc
operator_wrapper: ../../contracts/solc/v0.8.19/Operator.abi ../../contracts/solc/v0.8.19/Operator.bin d7abd0e67f30a3a4c9c04c896124391306fa364fcf579fa6df04dbf912b48568
oracle_wrapper: ../../contracts/solc/v0.6/Oracle.abi ../../contracts/solc/v0.6/Oracle.bin 7af2fbac22a6e8c2847e8e685a5400cac5101d72ddf5365213beb79e4dede43a
solidity_vrf_consumer_interface: ../../contracts/solc/v0.6/VRFConsumer.abi ../../contracts/solc/v0.6/VRFConsumer.bin ecc99378aa798014de9db42b2eb81320778b0663dbe208008dad75ccdc1d4366
solidity_vrf_consumer_interface_v08: ../../contracts/solc/v0.8.6/VRFConsumer.abi ../../contracts/solc/v0.8.6/VRFConsumer.bin b14f9136b15e3dc9d6154d5700f3ed4cf88ddc4f70f20c3bb57fc46050904c8f
Expand Down

0 comments on commit 8040dfa

Please sign in to comment.