Hello,
I'm using UUPS method to deploy a v2 of a contract.
Brief:
I declared a couple state variables in v1 and forgot to initialize value for one of them (commissionPercent) (PFA Snippet)
Now when trying to deploy a v2 of the contract with a couple enhancements and trying to initialize the value of the variable, I'm getting the: "New variables should be placed after all existing inherited variables" error message.
Although I'm inheriting the v1 of the contract. I tried using the same and different variable name but the error message is still the same.
P.S when deploying both versions of the contract using Remix, it works absolutely fine.
Please provide the entire error message that you are getting.
This is the error message:
New variables should be placed after all existing inherited variables.
The error message should also indicate the line in your contract that is causing the error, and the variable name of the new variable that is being inserted. Please provide that as well.
This error is reporting that there is a conflict in your contract's storage layout. If possible, please provide the source code of your v1 and v2 contracts, as well as the other information listed here: Required information when requesting support for Upgrades Plugins
It works now . I wasn't using the Initializable library when writing the contracts.