You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The <clinit> of every class submitted as part of the contract (including all the code within static {} blocks) will be run when the contract is first deployed, and never again. This makes static {} the ideal place to run any contract initialization logic.
The order of the static {} blocks should be specified.
The text was updated successfully, but these errors were encountered:
Data supplied in the data field must be supplied in the exact same order as the @Initializable field are defined. If not, an ABIException will be thrown.
...
The static{} function will do the following in order:
Instantiate an ABIDecoder with Blockchain.getData() and try to decode an Integer and a string;
Set owner as the address that deployed the contract.
Execute increaseMyIntByOne() and increase the value of myInt by one.
It looks to me that this addresses this issue. I'll leave this issue open for now for further comments however.
Is that the order the the contracts are processed (and for each in the order defined in the files)? What happens if I don't have test code, is there different code that runs for deployment?
From https://docs.aion.network/docs/deployment-initialization
It is stated:
The order of the
static {}
blocks should be specified.The text was updated successfully, but these errors were encountered: