Except if code is law then whatever the code permits is by definition allowed
Contract law is only one part of the law.
There are myriad reasons legal reasons actual contracts are voided and thrown out in court as unenforceable, no consideration, illegal actions or unilateral negotation or even unfair terms etc.
You cannot have a legal contract which for murder for example.
It is quite catchy, "code is law". But law where? In some virtual crypto land?
Enforcement in this case is not LEOs but rather the smart contract that lives in the blockchain. Except there are no grey areas