enigma-core icon indicating copy to clipboard operation
enigma-core copied to clipboard

Deployment of a valid contract with invalid constructor succeeds

Open lacabra opened this issue 6 years ago • 5 comments

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 avatar Apr 05 '19 05:04 lacabra

@lacabra To reproduce the behavior I need some clarifications:

  1. Does the valid contract have a constructor. It is better if you point me to the real contract.
  2. What is this: Fn='not a valid construct()' ? Is this a decrypted callable?
  3. Please give me the relevant inputs, at least callable and arguments

moriaab avatar Apr 10 '19 08:04 moriaab

I think he meant the opposite, that he passed an invalid constructor and it didn't fail.

elichai avatar Apr 10 '19 09:04 elichai

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=[]

lacabra avatar Apr 10 '19 12:04 lacabra

In the integration tests, run the following tests in this order:

  1. 01_init.spec.js
  2. 03_deploy_fail_constructor.spec.js

And the deployment does not fail as expected, but instead it succeeds.

lacabra avatar Apr 10 '19 23:04 lacabra

This defect is planned to be fixed as part of general improvement of treating wrong inputs for deployment and computation of secret contracts.

moriaab avatar Apr 28 '19 06:04 moriaab