Spaces:
Sleeping
Sleeping
Download data/samples/task2/inefficient_loop.sol from tanaymitra01/solidityguard-openenv: direct link, hf CLI and curl.
- Browser
- Download file 311 Bytes
-
https://huggingface.co/spaces/tanaymitra01/solidityguard-openenv/resolve/main/data/samples/task2/inefficient_loop.sol
- Command line
-
hf download hf://spaces/tanaymitra01/solidityguard-openenv/data/samples/task2/inefficient_loop.sol
-
curl -L -o inefficient_loop.sol https://huggingface.co/spaces/tanaymitra01/solidityguard-openenv/resolve/main/data/samples/task2/inefficient_loop.sol
311 Bytes
| // 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; | |
| } | |
| } | |