Spaces:
Sleeping
Sleeping
Arshit-Verma
feat: Complete SolidityGuard v2.0 with exploit proofs, auto-fix suggestions, multi-agent verification, and advanced reporting
5de1250 Download data/samples/task2/poor_packing.sol from tanaymitra01/solidityguard-openenv: direct link, hf CLI and curl.
- Browser
- Download file 651 Bytes
-
https://huggingface.co/spaces/tanaymitra01/solidityguard-openenv/resolve/main/data/samples/task2/poor_packing.sol
- Command line
-
hf download hf://spaces/tanaymitra01/solidityguard-openenv/data/samples/task2/poor_packing.sol
-
curl -L -o poor_packing.sol https://huggingface.co/spaces/tanaymitra01/solidityguard-openenv/resolve/main/data/samples/task2/poor_packing.sol
651 Bytes
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.19; | |
| contract PackingIssues { | |
| // Poor struct packing - wastes storage slots | |
| struct User { | |
| bool isActive; // 1 byte | |
| uint256 balance; // 32 bytes | |
| bool isVerified; // 1 byte | |
| uint256 timestamp; // 32 bytes | |
| uint8 level; // 1 byte | |
| } | |
| User[] public users; | |
| function addUser(uint256 balance, uint8 level) external { | |
| users.push(User({ | |
| isActive: true, | |
| balance: balance, | |
| isVerified: false, | |
| timestamp: block.timestamp, | |
| level: level | |
| })); | |
| } | |
| } |