Hi! I study solidity. Stuck on a task.
1. contract A { uint256 private one;
constructor() { one = 1;}
func setOne(uint256 first) external virtual {} }
2. contract B is A { }
Could someone please help how to change private value of one without changing contract A ?
I know that it is necessary to use assembly.
Thanks.
Sep 13, 2023, 2:21 PM
Figure out the slot value of "one" and sstore to it
Sep 13, 2023, 5:49 PM
could you please tell how to get slot value of "one" slot(one) because i got:
TypeError: Expected expression to evaluate to one value, but got 0 values instead.
TypeError: Expected expression to evaluate to one value, but got 0 values instead.
Sep 14, 2023, 1:39 PM
Hmm since one is a private variable, you'll have to manually inspect and figure it out
Hint : slot indexes for simple data types are indexed just like arrays
Sep 14, 2023, 1:59 PM