remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/libs/remix-analyzer/test/analysis/test-contracts/solidity-v0.5/deleteDynamicArray.sol

37 lines
795 B

pragma solidity >=0.4.9 <0.7.0;
contract arr {
uint[] users;
bytes access_rights_per_user;
uint user_index;
address owner;
string grr = "message";
uint[100] last_100_users;
constructor(address owner1) public {
owner = owner1;
user_index = 0;
}
function addUser(uint id, byte rights) public{
users[user_index] = id;
last_100_users[user_index % 100] = id;
access_rights_per_user[user_index] = rights;
user_index++;
}
function resetState() public{
require(msg.sender == owner, grr);
delete users;
delete access_rights_per_user;
delete last_100_users;
}
function bla(string memory bal) public {
grr = bal;
}
}