Spaces:
Sleeping
Sleeping
File size: 311 Bytes
b214779 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
contract LoopGas {
uint256[] public values;
function sum() public view returns (uint256) {
uint256 total = 0;
for (uint256 i = 0; i < values.length; i++) {
total += values[i];
}
return total;
}
}
|