Earlier quoted context omitted.
They can order you to give back the money. And like in real life, you can refuse to tell where the money is hidden.
Also like in real life, you might have spent the money.
Missing line in a smart contract leads to $10M hack
321–330 of 333 posts
Re: Missing line in a smart contract leads to $10M hack
#322Earlier quoted context omitted.
In what way is Solidity terribly designed?
It's modelled after JS with the explicitly expressed intent to get web devs from JS to Solidity. And it worked.
Re: Missing line in a smart contract leads to $10M hack
#323Looks like there are plenty of more DeFi hacks/internal fraud/incompetence https://www.rekt.news/leaderboard/ Setting aside the hacks, what good is DeFi anyhow for those outside crypto space? Seems DeFi currently serve two main functions. 1. Crypto backed loans - main purpose being crypto speculation / possibly some dubious tax benefits 2. Decentralized exchanges - nice for those into crypto but not for Joe Sixpack.
If you specifically want to avoid speculation, you could also provide liquidity with stablecoins and collect fees from people trading against your liquidity. For people outside the US, they could also get price exposure to US stocks with things like sAAPL, sGOOG, etc (synthetic assets that represent an underlying equity)
Re: Missing line in a smart contract leads to $10M hack
#324Earlier quoted context omitted.
But aren't proofs exact in what they state? So it wouldn't be the proof that would be faulty. It'd be the interpretation of what somebody thinks the proof means to them, and that'd be something you could entirely objectively reason/work on.
Proofs are programs and programs are proofs of themselves. The ways proofs might help you show that a program is "correct" (what you meant to say) are 1. the effect of writing it twice in different languages 2. that proofs may be more abstract and you can refine the program from them. But a proof/formal methods can't actually prevent you from being wrong because you can be wrong at any meta level.
Oh, this is a definition of "correct", it's not me correcting the OP.
Re: Missing line in a smart contract leads to $10M hack
#325Earlier quoted context omitted.
There are better tools for this, they just aren't in common use unfortunately. Had this been written in Glow, both this bug and the bug that followed where another 7M was stolen would have been compile errors. This is just the consequence of people developing code in languages that provide little to no protection against their various footguns. At the very least we should expect to see some additional tool on top of…
How would those bugs have been compile errors in Glow? I'm unfamiliar with it, but that sounds interesting.
In this case the transition would have moved the SM out of the initialised state which would have precluded the ability to re-initialise the contract/state machine. Attempting to invoke said re-initialisation would cause a compile error. You could write the contract in such a way that would still allow this however it would be evident that something is amiss as it would be incredibly un-idiomatic and awkward.
In the other case, the function had an implicit constraint that the value was within a certain bounds. The contract made no effort to check these bounds. With Glow you would have specified the constraints on the inputs and the interaction with the contract would be denied if the input for the function was outside those constrained bounds. This would be a compile error and possibly also a runtime check in the case of malicious actors ignoring bounds. I'm not sure how necessary the runtime check would be (as I'd have to check how the smart contract generation is set up) but at the very least the exploit would not have been able to occur.
Re: Missing line in a smart contract leads to $10M hack
#326Earlier quoted context omitted.
I think the big issue is using tools without verification infrastructure. Of course there are specification level bugs to deal with but hacks seem to be oh so often the simple "I forgot to initialise a variable" kind of attacks. I think we really need to be splitting up code for smart contracts into 3 classes: - Low Complexity, Automated Assurance: Non-turing complete DSLs that allow you to fully reason about their b…
There are some interesting projects on Tezos in this regard: https://archetype-lang.org/ is a non-turing complete dsl that you can run http://why3.lri.fr/ proofs on. Another way is to run proofs on the michelson that was generated by a higher level language ( https://ligolang.org/ , https://hackage.haskell.org/package/morley ...) with: https://gitlab.com/nomadic-labs/mi-cho-coq The most interesting project (still alp…
By the way what's your thought on Plutus (https://developers.cardano.org/en/programming-languages/plut...)?
It's technically its own language however it is basically a Haskell DSL/library that lifts code into a smart contract domain. It seems to retain the full expressivity and safety of Haskell (and the Haskell tooling). Additionally it allows you to share the same code base for on and off network code (as the smart contract code is largely just code lifted into a smart contract domain. This provides pretty much seamless interaction between the two domains. The documentation is a bit sparse at the moment which is its biggest weakness however that's rapidly being improved with the approach of Alonzo at the end of July/start of August.
I'm honestly so glad we as a space are finally starting to move away from Solidity and all of its footguns.
Re: Missing line in a smart contract leads to $10M hack
#327Earlier quoted context omitted.
It also only works if the smart contract is a legal contract, which is something that gets hashed out in court, not in code review. Some cryptocurrency enthusiasts seem to think declaring "code is law" actually makes it so while this is pretty far from the truth.
Code is law applies at least to the flow of money - unlike USD, the court can’t do something like garnish your wages to pay back a 10M settlement by taking some crypto out of your incoming transactions, both due to the anonymity and cryptographic parts of the concept. Of course, they could simply throw you in jail (civil contempt of court), but you still keep your money in that scenario.
Also the verb is "garnisheed". They're not putting parsely on it :)
Re: Missing line in a smart contract leads to $10M hack
#328Earlier quoted context omitted.
Code is law applies at least to the flow of money - unlike USD, the court can’t do something like garnish your wages to pay back a 10M settlement by taking some crypto out of your incoming transactions, both due to the anonymity and cryptographic parts of the concept. Of course, they could simply throw you in jail (civil contempt of court), but you still keep your money in that scenario.
Didn't the US government just drain the crypto accounts of some online hacker collective that ransomwared that petrol pipeline? Also the verb is "garnisheed". They're not putting parsely on it :)
No, its “garnish”, past-tense “garnished”.
> They're not putting parsely on it :)
No, but its the exact same verb, just a different sense.
Re: Missing line in a smart contract leads to $10M hack
#329Earlier quoted context omitted.
Comments like this make me think we software engineers live in a different world. >unlike USD, the court can’t do something like garnish your wages to pay back a 10M settlement by taking some crypto out of your incoming transactions You think so, do you? "The law is the because that's what the law says it is". It might not be possible now (and I'm not sure I believe that, you can garnish foreign wages) but it will be…
It's 'legally' possible in that the court can say that you have to pay back some amount of crypto or some amount of USD, but with crypto it's not something that they can enforce in reality if the debtor doesn't cooperate. I'm saying the court can't force incoming transactions to be 60/40 split with 40% going to a different party, and the anonymity part of crypto means you can create a new wallet whenever you want to…
Yeah, and if you get paid in cash you can keep it secret to.
OTOH, if your lifestyle reveals you have access go and are spending funds and not making required payments, courts can impose other consequences, up to and including imprisonment. But usually, seizing and selling off physical or reachable intangible property would be the first way to handle monetary debts. And, sure, crypto itself may be easy to conceal, but if you can’t use it to acquire anything tangible without sacrificing the safety, is it really usefully safe?
Re: Missing line in a smart contract leads to $10M hack
#330Earlier quoted context omitted.
If you specifically want to avoid speculation, you could also provide liquidity with stablecoins and collect fees from people trading against your liquidity. For people outside the US, they could also get price exposure to US stocks with things like sAAPL, sGOOG, etc (synthetic assets that represent an underlying equity)
How do these synthetic assets implement tracking the original asset price? Are the assets still subject to the swings of the general crypto industry (e.g. BTC crashing pulls sGOOG down as well even though Google's real stock appreciates)?
https://docs.synthetix.io/litepaper/#synth-pegging-mechanism