Closed frangio closed 6 years ago
As we discussed offline, this approach alone doesn't work for upgrades, because the PC is likely to change, allowing an initializer to be re-run.
However, it can probably be used alongside one of the other approaches to prevent this situation.
Here's a crazy idea... (This is
labs
after all. :man_scientist:)Since modifiers are inlined, we can use the program counter to identify each separate initializer, and thus check that each of them is run exactly once. This solves the problem with multiple inheritance tackled by #111 and #112, and solves the problem with accidentally running an initializer twice in the contract hierarchy (although not statically as with normal constructors).