3 ms·
What if there's a comment like: // User should only receive positive deposit from this code But someone finds a vulnerability to withdraw instead of deposit.
by legohead 8y ago
What if there's a comment like:
// User should only receive positive deposit from this code
But someone finds a vulnerability to withdraw instead of deposit. The code allows it, but the comment says that shouldn't be allowed. Did they act in bad faith, with fraud in mind?
And to add on to that, could you consider function names as part of documentation/proof? ie. deposit()
And to add on to that, what about the actual code: if reasonably prudent person were to read the code and assume it was made to deposit only, is that sufficient?
I would assume a judge would say yes.
- gus_massa 8y agoWhat if the comment has a bug? Which part is the legal binding, the code or the comments? Also, the Ethereum blockchain has only the compiled version of the smart contracts that use a bytecode for a simple virtual machine. So the source code (and the comments) disappear before entering the blockchain. [I guess you can add some comments in some dead code that is not optimized away during compilation, making the smart contract burn a small amount of additional gas each time it runs. My guess is that the current compilation just strips the comments.]