Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

Commit 2a12492

Browse files
authored
ctc: less calls (#205)
1 parent 791370b commit 2a12492

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,11 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
177177
Lib_OVMCodec.QueueElement memory _element
178178
)
179179
{
180+
iOVM_ChainStorageContainer queue = queue();
181+
180182
uint40 trueIndex = uint40(_index * 2);
181-
bytes32 queueRoot = queue().get(trueIndex);
182-
bytes32 timestampAndBlockNumber = queue().get(trueIndex + 1);
183+
bytes32 queueRoot = queue.get(trueIndex);
184+
bytes32 timestampAndBlockNumber = queue.get(trueIndex + 1);
183185

184186
uint40 elementTimestamp;
185187
uint40 elementBlockNumber;
@@ -293,12 +295,14 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
293295
timestampAndBlockNumber := or(timestampAndBlockNumber, shl(40, number()))
294296
}
295297

296-
queue().push2(
298+
iOVM_ChainStorageContainer queue = queue();
299+
300+
queue.push2(
297301
transactionHash,
298302
timestampAndBlockNumber
299303
);
300304

301-
uint256 queueIndex = queue().length() / 2;
305+
uint256 queueIndex = queue.length() / 2;
302306
emit TransactionEnqueued(
303307
msg.sender,
304308
_target,
@@ -886,7 +890,7 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
886890
_nextContext.blockNumber <= nextQueueElement.blockNumber,
887891
"Sequencer transaction blockNumber exceeds that of next queue element."
888892
);
889-
}
893+
}
890894
}
891895

892896
/**

0 commit comments

Comments
 (0)