When using fork cheatcodes and switching fork, state is not persisted by default. This means contracts already created prior to switching forks are reset and must be explicitly marked with vm.makePersistent.
For the above code it is recommended to instead define the variable in the class (UlnOptionsMock ulnOptions;), and then init the variable in a setup function (ulnOptions = new UlnOptionsMock(). Without doing so, and without using vm.makePersistent, leads to a very opaque error.
When using fork cheatcodes and switching fork, state is not persisted by default. This means contracts already created prior to switching forks are reset and must be explicitly marked with
vm.makePersistent
.https://github.com/LayerZero-Labs/LayerZero-v2/blob/3fd23fd21a3c7c42473d43bee44cedecbc93569e/oapp/test/OptionsHelper.sol#L18-L19
For the above code it is recommended to instead define the variable in the class (
UlnOptionsMock ulnOptions;
), and then init the variable in a setup function (ulnOptions = new UlnOptionsMock()
. Without doing so, and without usingvm.makePersistent
, leads to a very opaque error.