contract_storage_clear.sol 326 B

12345678910111213
  1. contract s {
  2. struct user {
  3. address f1;
  4. int256[] list;
  5. }
  6. user[1000] users;
  7. function clear() public {
  8. // delete has to iterate over 1000 users, and for each of those clear the
  9. // f1 field, read the length of the list, and iterate over each of those
  10. delete users;
  11. }
  12. }