enigma-core
enigma-core copied to clipboard
Deployment of a valid contract with invalid constructor succeeds
As the title says, when deploying a valid secret contract bytecode with an invalid constructor, such as Fn='not a valid construct()';, the deployment succeeds, seemingly ignoring the constructor function passed as an argument.
Is this the intended behavior, or should it fail?
@lacabra To reproduce the behavior I need some clarifications:
- Does the valid contract have a constructor. It is better if you point me to the real contract.
- What is this: Fn='not a valid construct()' ? Is this a decrypted callable?
- Please give me the relevant inputs, at least
callableandarguments
I think he meant the opposite, that he passed an invalid constructor and it didn't fail.
Correct, I passed an invalid constructor, and it didn't fail. Take any contract, and pass the following:
Callable='whatever-you-want-here-that-is-not-a-valid-construct-function'
Args=[]
In the integration tests, run the following tests in this order:
01_init.spec.js03_deploy_fail_constructor.spec.js
And the deployment does not fail as expected, but instead it succeeds.
This defect is planned to be fixed as part of general improvement of treating wrong inputs for deployment and computation of secret contracts.