News for hackers. Stuff that matters.
Re:Missing line in a smart contract leads to $10M hack by hiq on Sunday May 16, 2021 @04:49PM (#27176900)
Many people are asking what happened, because the article does not go much into detail.

The code is there (linked in the article): https://bscscan.com/address/0x7a8ac384d3a9086afcc13eb58e9091...

After spending 2min on it and using this hint from the article:

> The affected pool contract had an initialize() function that should have been activated after deployment.

> The line: initialized = true; is missing from the function.

That's really the crux of the issue. Have a look at the `initialize()` function. It's meant to be called only once (that's why it uses the modifier `notInitialized`), right after the smart contract is deployed, and never again. But the `initialized` variable is never set to true, meaning that it can be called again, and it seems that's what the attacker did.

...so for those who expected something fancy and technically advanced, that's not for you.

Re:Missing line in a smart contract leads to $10M hack by andrewfromx on Sunday May 16, 2021 @05:34PM (#27177203)
so where does one draw the line between theft and just doing what the code allows? I wonder in the future crypto courts is the defense, "your honor, the code allowed me to call initialize again, they specifically didn't set it to true." going to fly? Or will you have to prove that the 10 mil you now have was intended to be given to you and your "victim" isn't a victim at all.
Re:Missing line in a smart contract leads to $10M hack by timoth3y on Sunday May 16, 2021 @05:56PM (#27177377)
> so where does one draw the line between theft and just doing what the code allows?

This is the heart of the problem with smart contracts. The theory is that the code is the law. There is no theft. There is no need to trust, authority, or arbitration.

Of course, this only works when the smart contracts perfectly meet a correctly defined spec and have no bugs.

Re:Missing line in a smart contract leads to $10M hack by missblit on Sunday May 16, 2021 @07:39PM (#27178338)
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.

Re:Missing line in a smart contract leads to $10M hack by judge2020 on Monday May 17, 2021 @01:22AM (#27180299)
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.
Re:Missing line in a smart contract leads to $10M hack by elcomet on Monday May 17, 2021 @02:24AM (#27180561)
They can order you to give back the money.

And like in real life, you can refuse to tell where the money is hidden.

Re:Missing line in a smart contract leads to $10M hack by thaumasiotes on Monday May 17, 2021 @03:26AM (#27180856)
Also like in real life, you might have spent the money.
Re:Missing line in a smart contract leads to $10M hack by lobocinza on Monday May 17, 2021 @04:40PM (#27188168)
Or lost it day trading.
Re:Missing line in a smart contract leads to $10M hack by thatjamesdude on Monday May 17, 2021 @04:16AM (#27181130)
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 if the need arises.

"But the code" yeah, no, that's a silly argument that only applies to cyberspace and not the physical world you occupy

Re:Missing line in a smart contract leads to $10M hack by judge2020 on Monday May 17, 2021 @10:09AM (#27183589)
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 get paid without the court even knowing that you are receiving crypto as payment.
Re:Missing line in a smart contract leads to $10M hack by dragonwriter on Tuesday May 18, 2021 @10:10PM (#27203772)
> and the anonymity part of crypto means you can create a new wallet whenever you want to get paid without the court even knowing that you are receiving crypto as payment.

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 by dools on Tuesday May 18, 2021 @10:04PM (#27203746)
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 :)

Re:Missing line in a smart contract leads to $10M hack by dragonwriter on Tuesday May 18, 2021 @10:07PM (#27203755)
> Also the verb is "garnisheed".

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 by dools on Thursday May 20, 2021 @03:15AM (#27218306)
No it's not, the word is garnishee
Re:Missing line in a smart contract leads to $10M hack by dragonwriter on Thursday May 20, 2021 @03:33AM (#27218422)
“garnishee” is the noun for the person subject to the garnishment (that is, the person owing/controlling money to/of the debtor whose held funds or payments are redirected from the debtor to the creditor); the verb for imposing the garnishment is “garnish”, and in the past tense “garnished” not “garnisheed”.

https://www.law.cornell.edu/wex/garnishee

Re:Missing line in a smart contract leads to $10M hack by bryanrasmussen on Monday May 17, 2021 @01:55AM (#27180443)
my reading of the code is law idea is that the code determines what is possible in the system, in this theory you can say that the law which code represents in more ironclad than most laws (at least common law) however this reading, which I thought was the default one, does not take into account bugs occurring in code or that people may not have thought rigorously enough to prevent people from doing not what the law intends but also what the code allows.
Re:Missing line in a smart contract leads to $10M hack by mondoveneziano on Sunday May 16, 2021 @06:13PM (#27177520)
That's not enough, all parties would have to have 100% awareness and understanding of the smart contract, detail by detail.

Real life contracts sometimes turn out to have non-enforceable clauses within our legal framework, or may be entirely invalid if, for example, signed under pressure or false pretense.

Re:Missing line in a smart contract leads to $10M hack by adflux on Sunday May 16, 2021 @06:33PM (#27177662)
And a judge will decide whether the contract was signed under duress. Who will judge smart contracts?
Re:Missing line in a smart contract leads to $10M hack by rtpg on Sunday May 16, 2021 @09:18PM (#27179051)
A judge! A judge can just claim jursidiction!

Imagine if Goldman Sachs did this. A judge can say "look, you can follow our rules or we start seizing assets etc".

And when you're sitting around trying to be anonymous, well... you're doing everything on a public ledger, so now you're extremely restricted.

Hell, courts/legislative bodies could even go down the "force all miners within their jurisdiction to rollback an unwanted transaction". You think miners care enough to make a stand on this kind of stuff?

Unless you're going to like.... download your consciousness onto the blockchain you are still just as liable to being told by a court what to do as anything else.

Re:Missing line in a smart contract leads to $10M hack by stjohnswarts on Sunday May 16, 2021 @09:53PM (#27179285)
Well if you don't know who the person who got the money is then there's not much a judge can do.
Re:Missing line in a smart contract leads to $10M hack by crooked-v on Sunday May 16, 2021 @10:21PM (#27179466)
Judges have tremendous amounts of discretionary power when carrying out the law, and a good judge certainly isn't going to just give up because the identity of one party isn't immediately known. The example already given of ordering that the transaction be reversed on the network (even if that involves compelling uninvolved people to cooperate with the process) is entirely plausible.
Re:Missing line in a smart contract leads to $10M hack by arilotter on Sunday May 16, 2021 @10:27PM (#27179509)
Are judges going to manage to identify and compel enough miners (or devs, i guess, assuming the miners adopt the compelled transaction revert version) to have enough hash power to win a fork?
Re:Missing line in a smart contract leads to $10M hack by rtpg on Sunday May 16, 2021 @11:15PM (#27179745)
this could easily be combined with legislation providing tools to make it harder and harder to participate in mining off-fork.

US financial laws have been very useful for the gov't to be able to de facto give it worldwide jurisdiction in some areas, I think there would be relatively few qualms about continuing down this path. Especially if (for example) Robinhood and Coinbase were forced to follow along. At one point the "blessed" thing will become the only place you can really operate.

Re:Missing line in a smart contract leads to $10M hack by stickfigure on Monday May 17, 2021 @06:21AM (#27181902)
This would require an incredible amount of international cooperation. It might be possible, but I doubt it likely.
Re:Missing line in a smart contract leads to $10M hack by pornel on Monday May 17, 2021 @06:22AM (#27181914)
For example, the court could declare that this transaction was illegal, and anything spent from it is also illegal forever. The ledger is open, so courts can compel exchanges to watch for such transactions and report anyone that can spend coins derived from them (exchanges have already been forced to comply with KYC).

This would destroy the real-world value of this block, basically making it a digital equivalent of dirty money.

Re:Missing line in a smart contract leads to $10M hack by ryanmentor on Sunday May 16, 2021 @07:09PM (#27178059)
Kleros Digital Courts, if their story holds through.
Re:Missing line in a smart contract leads to $10M hack by ArchD on Sunday May 16, 2021 @10:27PM (#27179503)
The power of the court to 'right' the 'wrong' (e.g. by reversing transactions) is limited on a decentralized public blockchain governed by pure code that crosses national borders. This strengthens the position "the code is the law".

On the other hand, this feature is a motivation for centralists to take issues with public decentralized blockchains.

Re:Missing line in a smart contract leads to $10M hack by crooked-v on Sunday May 16, 2021 @10:45PM (#27179600)
Except it's not, really, because a judge who's unhappy at it isn't going to care about "the code is the law" talk. They're just going to tell people to fix it or else, and all being in another country usually means is that the asset seizures will take longer.
Re:Missing line in a smart contract leads to $10M hack by bryanrasmussen on Monday May 17, 2021 @01:59AM (#27180467)
>because a judge who's unhappy at it isn't going to care about "the code is the law" talk.

in my experience if you ever tried to tell a judge the code is the law you will be in for a world of hurt. Hope they don't read about it elsewhere either.

on edit: obviously in agreement with parent, just noting that the very concept of the code is the law introduced to a judge is going to elicit some very negative reactions.

Re:Missing line in a smart contract leads to $10M hack by ArchD on Sunday May 16, 2021 @11:15PM (#27179751)
How are they practically going to find the defendant? On a public blockchain, you can't always put a name or face to an address. The tokens in question can change hands many times and make it hard to trace identity.
Re:Missing line in a smart contract leads to $10M hack by username90 on Monday May 17, 2021 @12:05AM (#27179954)
Most criminals aren't masterminds, they are easy to find.
Re:Missing line in a smart contract leads to $10M hack by arvinsim on Sunday May 16, 2021 @11:26PM (#27179802)
"Fix it or else" eerily sounds like an incompetent project manager.
Re:Missing line in a smart contract leads to $10M hack by fake-name on Sunday May 16, 2021 @10:59PM (#27179661)
> Of course, this only works when the smart contracts perfectly meet a correctly defined spec and have no bugs.

In other words, it doesn't work.

Re:Missing line in a smart contract leads to $10M hack by thatjamesdude on Monday May 17, 2021 @04:14AM (#27181113)
>The theory is that the code is the law. There is no theft.

What rubbish. You cannot claim "the computer let me do it" and expect to be let off for that. That's an extreme absurdity and is absolutely not how the law works.

Contrary to what a lot of people seem to think: Crypto is not "outside" the law in any way. It is a token of value (like FIAT currency) and there are plenty of laws that cover use cases from capital gains taxes to money laundering to, you guessed it, theft.

Re:Missing line in a smart contract leads to $10M hack by pnt12 on Monday May 17, 2021 @07:47AM (#27182396)
That's a big design flaw from the premise itself - it works if the code has no bugs, but all code has bugs, therefore it does not work
Re:Missing line in a smart contract leads to $10M hack by hypertele-Xii on Monday May 17, 2021 @04:50AM (#27181341)
A smart contract is only as smart as the programmers writing it.
Re:Missing line in a smart contract leads to $10M hack by rorykoehler on Monday May 17, 2021 @05:12AM (#27181455)
The code is the spec. Any other documentation is a compression of the spec.
Re:Missing line in a smart contract leads to $10M hack by derefr on Sunday May 16, 2021 @06:52PM (#27177875)
> Of course, this only works when the smart contracts perfectly meet a correctly defined spec and have no bugs.

In practice, if using a smart contract as a contract, the way you'd use a paper contract, then two parties would sit down and negotiate; draft the negotiated agreement into the form of a smart contract; and then agree (signatures, handshake, multi-sig deployment, whatever) that "what the smart contract does — as executed by the network-consensus abstract machine — is our explicit mutual intent, and damn any statement by either of us to the contrary."

This is the same thing you're doing with a paper contract: by both signing it, you're agreeing that "what the paper contract says — as interpreted by a judge — is our explicit mutual intent, and damn any statement by either of us to the contrary."

Of course, nobody's actually using smart contracts as contracts. They're just using them as trusts/agents. For now.

But a smart contract used as a contract wouldn't have "bugs." It's a negotiated agreement; negotiated agreements have loopholes. And loopholes are perfectly legal. If you left one in, and your counterparty exploits it? Too bad for you. You should have run your contract through a better (code) lawyer.

Re:Missing line in a smart contract leads to $10M hack by astrange on Sunday May 16, 2021 @07:49PM (#27178422)
Signing a paper contract doesn't mean you're bound to any bad thing that happens because of it for life. If a smart contract is so strict that eg it can be against public policy then it's not a real contract.
Re:Missing line in a smart contract leads to $10M hack by derefr on Sunday May 16, 2021 @08:01PM (#27178508)
Note that in my above statement, the "network-consensus abstract machine" is the same kind of thing as "a judge": namely, both an arbitrator, and an official that declares certain clauses objectively void even if both parties like them.

See also: the DAO hard-fork that created Ethereum Classic.

Re:Missing line in a smart contract leads to $10M hack by crooked-v on Sunday May 16, 2021 @09:45PM (#27179232)
Except it's not the same kind of thing, because an actual judge has legal power. Your abstract machine is going to be sidelined pretty quickly if a judge decides it's doing something illegal or unconscionable and issues injunctions to that effect.
Re:Missing line in a smart contract leads to $10M hack by derefr on Sunday May 16, 2021 @10:40PM (#27179573)
I meant that the abstract machine's behavior is dictated by the legislation of the "society" of node operators, in the same way that the judge's behavior is dictated by the legislation of the society you live in. They're both appointed arbiters. And they've both got the responsibility of enforcing, among other things, certain 'inalienable rights' — i.e. making certain contracts (or certain legal motions based on the wording of a contract) invalid, if they would be greatly damaging to one party in a way deemed unacceptable to "society."

> if a judge decides it's doing something illegal or unconscionable and issues injunctions to that effect

A judge can't tell a distributed network that has equal presence in countries with mutually-antagonistic economies what to do. They can at most ban the network's nodes from being operated in their country — but people in that country can still continue to use the network through a VPN.

Think of it like offshore gambling, except that it's 'offshore' respective to every country on Earth, and there's nowhere a sufficiently-motivated Navy can send a bunch of boats to shoot at it, either.

Much of the economic value of blockchains comes from the fact that they allow private citizens of countries that have no trade/treaty compatibility (e.g. countries actively at war with one-another), to have a basis for trust allowing them to enter into contracts with one-another. The basis for this trust is the virtual 'overlay' legal framework of "whatever the software the majority of node operators decide to install says, goes."

Of course, if you and I are both in America, and we enter into a smart-contract contract, then we're also entering into a civil legal contract evidenced by that smart contract (just like we're entering into a legal contract if we make a verbal "handshake agreement.")

But if we have a compatible legal framework to operate in, that grants our contract as valid†, then why would we even need a blockchain?

† (A common reason to not grant a civil contract as valid: because it's a contract for purchase of illegal goods. In such cases, you don't have a compatible legal framework to operate in, even if you're operating in the same country.)

Re:Missing line in a smart contract leads to $10M hack by crooked-v on Sunday May 16, 2021 @10:54PM (#27179637)
> A judge can't tell a distributed network that has equal presence in countries with mutually-antagonistic economies what to do. They can at most ban the network's nodes from being operated in their country — but people in that country can still continue to use the network through a VPN.

The distributed network is to some degree a red herring here: in most cases, an unhappy judge would be issuing orders compelling behaviors from specific people (e.g. "you're going to send that $10M back to the person who had it"), and if that contradicts the code, too bad - do it some other way.

> Think of it like offshore gambling, except that it's 'offshore' respective to every country on Earth

Except it's not: if you're in Iraq and I'm in Brazil and we enter into a contract (as would be legally understood in either or both countries), we are now in a contract under the jurisdictions of both countries.

Even being literally "offshore" doesn't really matter: almost every country will claim jurisdiction over its own citizens if they're not already under the jurisdiction of some other nation (by way of being on a ship registered under that nation's flag). You can't actually escape the law just by going out into the middle of the ocean.

Re:Missing line in a smart contract leads to $10M hack by derefr on Sunday May 16, 2021 @11:07PM (#27179699)
> in most cases, an unhappy judge would be issuing orders compelling behaviors from specific people

I'm presuming here that the unhappy judge is on the other end, is the thing. There's no judge local to the person “in the wrong” who actually has cause to go after them. Only the judge in the other country does.

If I'm in Iraq and you're in Brazil, and I rip you off, and you have no idea who I am because I'm just some pseudonym on a darknet market, then sure, a Brazilian judge can write an order for "me" to pay the money back... but how are they ever going to enforce that? They don't even know who "I" am.

Let's say they at least know where I am (Iraq.) In a compatible-legal-frameworks situation, your judge could get an arrest warrant out, and nudge my country's police to try to do some ISP PRISM-ing to figure out who I am. Then your judge could try to get me extradited to Brazil to be tried.

But if Iraq and Brazil aren't on "good buddies who treat one-another's warrants in good faith" terms... then what's your judge going to do?

(To put this another way: if Edward Snowden ripped a bunch of private US citizens off before heading to Russia/Switzerland/wherever, would he have been any more likely to have been extradited sooner?)

> if you're in Iraq and I'm in Brazil and we enter into a contract (as would be legally understood in either or both countries), we are now in a contract under the jurisdictions of both countries.

In the case of actual offshore casinos, if you lose money to another person, you don't owe them money, because you never interacted with them directly. You played a game together; but while doing so, what was technically, legally happening was that you were interacting with the casino, and they were interacting with the casino. So, if anyone owes anyone money, then it's the casino that you owe money; and, separately, it's the casino that owes them money. (This is a large part of why casinos get you to trade your cash in for tokens, and then play games using the tokens. Everything that happens with the tokens, is "you interacting with the casino.")

You see this dynamic domestically in the form of e.g. car insurance. If you rear-end someone, you don't owe that person money. You owe your insurance provider money; your insurance provider owes their insurance provider money; and their insurance provider owes them money. Usually all different amounts! Because those are three different contractual agreements, being settled separately.

While it’s not necessarily the case that this is the body of case-law that would pertain if you send Dogecoin to someone in another country through your mutual memberships in some DEx, it’s not not necessarily the case, either.

—————

I think we’re getting off-track here, though. My original point wasn’t that a judge would be replaced by a network-consensus abstract machine. It’s that a network-consensus abstract machine is a valid replacement good for a judge, when you don’t have any compatible legal framework through which to access a judge. This is the good people are paying for when they pay crypto transaction fees: this fake robot judge, that—while worse than a real judge in almost all respects—is at least better than the nothing (i.e. the “send Western Union and pray your counterparty isn’t a Nigerian prince”) you get by default in international civil/contract-law dispute scenarios.

Re:Missing line in a smart contract leads to $10M hack by withinboredom on Monday May 17, 2021 @08:55AM (#27182868)
> If you rear-end someone, you don't owe that person money.

You are in for a world of hurt... that's not how this works. At all. https://en.wikipedia.org/wiki/Tort

Re:Missing line in a smart contract leads to $10M hack by astrange on Monday May 17, 2021 @12:39AM (#27180088)
I mean, I agree with that, but I don't think having to restart the entire financial system or get 51% approval to edit any existing program is a good way to deal with problems like this.
Re:Missing line in a smart contract leads to $10M hack by samatman on Monday May 17, 2021 @02:28AM (#27180576)
There's a name for this, it's called a Ricardian contract.

https://en.wikipedia.org/wiki/Ricardian_contract

It's slightly different than what you describe, because the parallel contract is an actual contract: a written and binding agreement between multiple parties, which explicitly grants consent for some bit of software to govern a given business arrangement.

Most "smart contracts" aren't Ricardian contracts, though, they're just chunks of software running on a blockchain.

They probably should be though, because contract law applies to business whether a specific legal contract is drafted or not, and no, that implicit contract doesn't say "whatever the software does is fine".

Re:Missing line in a smart contract leads to $10M hack by sidlls on Sunday May 16, 2021 @05:47PM (#27177312)
The legal system isn't a computer that implements the law strictly to the letter based on only factual information. There are "reasonable person" standards, allowance/tolerance for mistakes, etc.

Relevant to this discussion is rules covering mistaken deposits to a bank account: recipients are obliged to return the assets, not shrug their shoulders and use the cash while they proclaim "Bank's fault; they're responsible!"

Re:Missing line in a smart contract leads to $10M hack by logicalmonster on Sunday May 16, 2021 @08:21PM (#27178659)
Nobody can predict the future of how business will get done years down the road, but I think Smart Contracts can potentially utilize both Oracles (systems like Chainlink) to provide objective data about the world for triggering Smart Contract logic, and Arbitration systems (something along the lines of Kleros) for humans to make subjective judgements about human concepts like "reasonableness" in contracts.

A very contrived example. Say a Smart Contract exists for a contractor to paint a boat cornflower blue and then get paid when the job is done, but the Oracle system says that the contractor messed up and painted it sky blue. It can be part of the Smart Contract in the event of some error that it can go to arbitration to some pre-agreed-to subject matter experts that both sides agreed to beforehand for a quick and reasonable resolution or fee.

This kind of thing can be planned for and made standard in smart contracts. It'll only happen if it saves businesses more time and money than it costs though, and many other question marks will be involved. I think it's very exciting conceptually though.

Re:Missing line in a smart contract leads to $10M hack by withinboredom on Monday May 17, 2021 @01:21PM (#27185831)
But if a bug allows you to delete the contract. It’s useless. In the real world, a contract exists unless all parties agrees it doesn’t. A “loophole” won’t cause money to be removed from escrow unilaterally.
Re:Missing line in a smart contract leads to $10M hack by drdrey on Sunday May 16, 2021 @09:40PM (#27179201)
Actually didn’t a judge just rule Citibank wasn’t entitled to get its money back after a mistake like that?

https://www.forbes.com/sites/jonathanponciano/2021/02/16/cit...

Re:Missing line in a smart contract leads to $10M hack by sio8ohPi on Sunday May 16, 2021 @09:43PM (#27179217)
Citi accidentally paid back lenders, rather than accidentally sending money to some unrelated party. This doesn't seem relevant.
Re:Missing line in a smart contract leads to $10M hack by sellyme on Monday May 17, 2021 @02:54AM (#27180702)
A very major part of that decision was because the payment was not reasonably assumed to be a mistake. Obviously that argument isn't going to work here.
Re:Missing line in a smart contract leads to $10M hack by philangist on Sunday May 16, 2021 @05:48PM (#27177320)
All exploits are technically some version of “just doing what the code allows”, I don’t see how that would change whether or not a hack/theft actually occurred.
Re:Missing line in a smart contract leads to $10M hack by 2OEH8eoCRo0 on Sunday May 16, 2021 @05:54PM (#27177361)
Reminds me of a Team Fortress 2 griefing video where they kept putting turrets underneath the map that couldn't be killed but could shoot players.

"If they didn't want you to do that then why did they put it in the game?"

Re:Missing line in a smart contract leads to $10M hack by dragonwriter on Sunday May 16, 2021 @05:54PM (#27177365)
One view of smart contracts is that the code defines the intent/agreement, so if the code allows it, the it is, ipso facto, not theft.

Of course,

Re:Missing line in a smart contract leads to $10M hack by nkrisc on Sunday May 16, 2021 @06:26PM (#27177610)
Seems like these smart contacts should include written contracts as well to outline what the code is intended to do, if you can’t rely on the code.
Re:Missing line in a smart contract leads to $10M hack by crooked-v on Sunday May 16, 2021 @10:31PM (#27179521)
At that point, why have the smart contract? If you want 'automation', just get a trustworthy third party to execute the financials for you , as is already done with (for example) most real estate contracts.
Re:Missing line in a smart contract leads to $10M hack by solveit on Sunday May 16, 2021 @10:37PM (#27179556)
> trustworthy third party

Merits aside, sidestepping the need for this is the whole point of blockchain.

Re:Missing line in a smart contract leads to $10M hack by withinboredom on Monday May 17, 2021 @01:23PM (#27185850)
Apparently you can’t even trust the um, paper, it’s written on
Re:Missing line in a smart contract leads to $10M hack by nkrisc on Monday May 17, 2021 @08:07AM (#27182529)
Why have smart contracts indeed, if executing the code in the contract is called a "hack." Perhaps in the case in the article a trusted third party would have been superior and there wouldn't be $10M missing.
Re:Missing line in a smart contract leads to $10M hack by davidwritesbugs on Monday May 17, 2021 @02:32AM (#27180593)
ex-lawyer here.

Where big money is at stake most sensible judges will, or will /try/ to, look behind absolutist language in a contract (be it smart or not). Courts are very good at looking at contracts and asking what the parties intent was. They will ask things like "was it intended not to initialize this function?" They may then answer the question with, "No of course not, it was a bug. The person exploiting that bug knew that and cannot reap the benefit". Maybe, or maybe not: trying to guess what a judge will say is a mugs game, but my point is that saying it's a smart contract not operated humans renders it "Absolute Code-as-law" one can't interfere with is unlikely to fly.

Re:Missing line in a smart contract leads to $10M hack by jlarocco on Sunday May 16, 2021 @05:47PM (#27177314)
I don't follow any of this too closely, but I thought the whole idea was to get rid of courts by using precisely codified contracts?

What's the advantage if the result is the same system as before (lawsuits, courts, etc.) with added complexity of "smart contracts"?

Re:Missing line in a smart contract leads to $10M hack by jypepin on Sunday May 16, 2021 @05:52PM (#27177354)
I think smart contracts are meant to automate the work behind contracts/agreements, but if someone hacks you, well, they did something illegal and you can sue?
Re:Missing line in a smart contract leads to $10M hack by mondoveneziano on Sunday May 16, 2021 @05:56PM (#27177375)
I think the question is: Why then deal with all those inefficiencies and cost of distributed computation, mining, and broadcast transactions, if you need courts to override decisions anyway, and insurance to cover yourself when something goes wrong? You can already "automate" without smart contracts.
Re:Missing line in a smart contract leads to $10M hack by aaronharnly on Sunday May 16, 2021 @07:08PM (#27178051)
I share the general skepticism, but I am open to the idea that (much like other electronic commerce), the smart contracts might make 99% of transactions much more efficient; so the expensive manual interventions are only used on a small proportion.

Of course, it is not necessarily obvious that blockchain-powered smart contracts are the only way — or the best way — to achieve that automation and efficiency!

Re:Missing line in a smart contract leads to $10M hack by mondoveneziano on Sunday May 16, 2021 @07:42PM (#27178355)
> the smart contracts might make 99% of transactions much more efficient

The entire point of proof-of-work is that it is inefficient, by design. Efficiency is counteracted: Advances in technology that lead to more efficient mining techniques directly mean the difficulty for the next block being adjusted up.

Operating on traditional databases (where automation is regularly implemented, too) is orders of magnitude more efficient. Because like most other things other than proof-of-work, those processes directly benefit from getting more efficient.

Re:Missing line in a smart contract leads to $10M hack by trompetenaccoun on Sunday May 16, 2021 @08:07PM (#27178550)
PoW wasn't designed to be more efficient, the Nakamoto consensus type implementation exists to improve honesty and security. There is no traditional database that's as secure as a blockchain, it's always a tradeoff between security/immutability and efficiency. But since efficiency does matter many 2nd generation chains have moved away from PoW.
Re:Missing line in a smart contract leads to $10M hack by rawtxapp on Sunday May 16, 2021 @07:33PM (#27178270)
I think the way to look at is that, smart contracts are not behind the contracts/agreements, smart contracts are the contracts/agreements. Once you realize that, if a smart contract executed successfully then the operation was legitimate.

Of course, ethereum forked when a big hack happened, but it won't be forking for every hack, otherwise it's not really a reliable blockchain.

Re:Missing line in a smart contract leads to $10M hack by crooked-v on Sunday May 16, 2021 @10:27PM (#27179508)
A smart contract can't actually be the contract (and may end up not even vaguely correspond to the resulting situation in the real world) because the legal system alters or voids contracts all the time. A judge who decides that your smart contract has an unconscionable clause isn't going to care about what you say about immutable code - he's going to tell you to fix it in the real world or else.
Re:Missing line in a smart contract leads to $10M hack by withinboredom on Monday May 17, 2021 @01:26PM (#27185879)
Judging from the amount of contract disputes in the court system, I would expect it to be forked pretty regularly
Re:Missing line in a smart contract leads to $10M hack by lmm on Sunday May 16, 2021 @09:21PM (#27179079)
So what's the difference between "hacking" and "following the contract"? The whole point of a smart contract is that the code is the contract.
Re:Missing line in a smart contract leads to $10M hack by crooked-v on Sunday May 16, 2021 @09:47PM (#27179245)
Except it can't be, because the legal system can and regularly does adjust or override the terms of contracts for a variety of reasons.
Re:Missing line in a smart contract leads to $10M hack by xyzzy_plugh on Sunday May 16, 2021 @05:52PM (#27177350)
How do you get rid of courts? Do you imagine an alternate reality where existing regulations do not and can not apply? Because I'd recommend continuing to imagine.
Re:Missing line in a smart contract leads to $10M hack by fpig on Sunday May 16, 2021 @08:00PM (#27178497)
I think that's the wrong question. If a court can decide (and enforce) what a smart contract "really means", then smart contracts don't really bring much to the table. It doesn't matter what the court would actually decide.

The main thing smart contracts bring to the table is a mechanism of enforcing contracts without government involvement or control. The contract gets enforced, period. The parties can be anonymous, it doesn't matter which country they're from, and so on.

Re:Missing line in a smart contract leads to $10M hack by klodolph on Sunday May 16, 2021 @08:05PM (#27178532)
If a court can decide/enforce what a smart contract "really means", then the smart contract still decides who has possession of the related assets before the courts get involved. That's for ill or for good. Anyone who wants to get the courts involved has to care enough about changing the status quo to pay for a lawsuit. Changing what the status quo is, before the lawsuit, changes the balance of power.
Re:Missing line in a smart contract leads to $10M hack by solveit on Sunday May 16, 2021 @10:40PM (#27179570)
Automation is valuable in itself. Imagine a system of thousands of smart contracts interacting with each other millions of times a second. No court system is (currently) equipped to deal with that except in the most superficial way.
Re:Missing line in a smart contract leads to $10M hack by cosmodisk on Sunday May 16, 2021 @05:45PM (#27177283)
It may depend on a legal system in a country but I think 'Or will you have to prove that the 10 mil you now have was intended to be given to you and your "victim" isn't a victim at all' is more likely. For instance there were cases,where ATMs dispensed stupid amounts of money because of some error. People would normally be found guilty if they take the money that technically isn't theirs.
Re:Missing line in a smart contract leads to $10M hack by bseidensticker on Sunday May 16, 2021 @05:50PM (#27177333)
Proponents of Ethereum will say that smart contracts obviate the need for courts. I don't think this sort of Ethereum bug/hack thing has ever shown up in the court system yet. I'm sure someone will bring a case if they know who did it. If gaining access to someone's system using default credentials or no credentials is a violation of the CFAA then I'm sure this is as well.
Re:Missing line in a smart contract leads to $10M hack by meowkit on Sunday May 16, 2021 @05:47PM (#27177310)
In the future I think smart contracts will be standardized - these kinds of things won’t happen unless you’re trying something new. If that’s the case there will probably be services/testnets to properly vet it before launching on a mainnet.
Re:Missing line in a smart contract leads to $10M hack by IncRnd on Sunday May 16, 2021 @07:06PM (#27178031)
> these kinds of things won’t happen unless you’re trying something new.

Unfortunately, that's probably not going to be what occurs. Even today, there are constantly bugs discovered and fixed, some critical, that have been latent in systems for decades - as in since the last century.

The recent FragAttacks against WiFi systems come to mind.

Re:Missing line in a smart contract leads to $10M hack by benplumley on Monday May 17, 2021 @04:08AM (#27181068)
A bug-free version of ProfitSharingRewardPool is much more plausible than a bug-free version of WiFi, or SSL, because the former is less than 1000 lines of code and apparently had an unintended $10M bug bounty.
Re:Missing line in a smart contract leads to $10M hack by IncRnd on Monday May 17, 2021 @07:58AM (#27182467)
We were dicussing errors in smart contracts not just errors specific to ProfitSharingRewardPool. Your comment is correct about ProfitSharingRewardPool but is incorrect about smart contracts. That goes to show that errors happen all the time.
Re:Missing line in a smart contract leads to $10M hack by Scarblac on Monday May 17, 2021 @02:27AM (#27180573)
Future crypto courts? This whole crypto circus exists to solve the problem of having no central authority.

If you can use courts, you have no reason to use "smart" contracts.

Re:Missing line in a smart contract leads to $10M hack by paulpauper on Sunday May 16, 2021 @05:44PM (#27177275)
if it went to court, i am guessing presuambly under a plea deal the hacker would be required give back all or most of the crpyto to rectify the 'mistake;' if not, it would prove intent to steal . For example, there is the 2005 Sammy MySpace XSS incident. Technically, his code was interpreted by Myspace as valid CSS/html, but was still guilty due to intent.
Re:Missing line in a smart contract leads to $10M hack by anoncake on Sunday May 16, 2021 @09:40PM (#27179203)
The "point" of smart contracts is that the code is the contract. The "victim" voluntarily gave that money away.
Re:Missing line in a smart contract leads to $10M hack by TeMPOraL on Monday May 17, 2021 @04:46AM (#27181312)
> The "victim" voluntarily gave that money away.

This explanation, much like its sibling "voluntary transaction" defense of market failures and economic coercion, sounds to me like a bully who hits their victim with their own arm, and then exclaims, "stop punching yourself!".

Re:Missing line in a smart contract leads to $10M hack by anoncake on Monday May 17, 2021 @05:05AM (#27181423)
If the person who lost the money had to use smart contracts, you've got a point. If they used them because they thought they were a good idea, I hope they learned their lesson.
Re:Missing line in a smart contract leads to $10M hack by TeMPOraL on Monday May 17, 2021 @05:56AM (#27181698)
Agreed, but the crypto crowd wants smart contracts to be ultimately used by everyone, which means (in their hypothetical world, which I hope never materializes) many if not most uses will be of the "had to use" kind.
Re:Missing line in a smart contract leads to $10M hack by crooked-v on Sunday May 16, 2021 @09:50PM (#27179267)
That only holds right up until a judge disagrees and orders the transfer reversed.
Re:Missing line in a smart contract leads to $10M hack by lordnacho on Monday May 17, 2021 @04:11AM (#27181085)
IIRC the DAO "hack" was also caused by an init that could be called twice. Kinda interesting how this could happen again. I haven't looked at the smart contract as I'm on a phone but it's imagine you'd at the very least put a comment explaining what the purpose of stopping the reinit was.
Re:Missing line in a smart contract leads to $10M hack by intricatedetail on Sunday May 16, 2021 @07:03PM (#27178001)
Why contracts don't have a test suite that verifies them?
Re:Missing line in a smart contract leads to $10M hack by o-__-o on Sunday May 16, 2021 @09:19PM (#27179060)
They do, if you don’t have 100% code coverage then you get what you get
Re:Missing line in a smart contract leads to $10M hack by NateEag on Sunday May 16, 2021 @10:00PM (#27179334)
100% code coverage isn't even close to a guarantee of correctness.
Re:Missing line in a smart contract leads to $10M hack by o-__-o on Sunday May 16, 2021 @11:03PM (#27179684)
But is the easiest metric to guage test quality. What I’m saying is this code is probably not well tested
Re:Missing line in a smart contract leads to $10M hack by dr_zoidberg on Monday May 17, 2021 @06:29AM (#27181956)
This code isn't tested at all. They messed up copying code from a previous implementation, that's how bad this is. If they had had a few basic tests in place they would've spotted this before it even had a chance to be a problem.
Re:Missing line in a smart contract leads to $10M hack by o-__-o on Thursday May 20, 2021 @04:15AM (#27218690)
Then the problem has zero to do with the type of testing, now does it :)
Re:Missing line in a smart contract leads to $10M hack by masklinn on Monday May 17, 2021 @06:05AM (#27181768)
Because the entire field is nonsense and pyramid schemes. Ethereum derives their smart contract langage from JavaScript for fuck’s sake. That alone should tell you that their interest was always to disregard everything in order to maximise adoption. And then they added pitfalls to JavaScript because it was not broken enough for their tastes.
Re:Missing line in a smart contract leads to $10M hack by stjohnswarts on Sunday May 16, 2021 @09:52PM (#27179276)
So I wonder if someone watches the block chains for these kinds of bugs then swoop in when it happens.
Re:Missing line in a smart contract leads to $10M hack by bouncycastle on Sunday May 16, 2021 @10:49PM (#27179620)
Reminds me of the 2nd "Parity wallet hack", where they forgotten to initialize the contract, despite extensive audits after a previews hack.

That one lost around $154 million USD at the time. The hacker didn't get anything though, the funds became permanently trapped.

Imagine having a bad day at work? https://hackernoon.com/parity-wallet-hack-2-electric-boogalo...

Re:Missing line in a smart contract leads to $10M hack by drdrey on Sunday May 16, 2021 @09:49PM (#27179257)
Can the deployment and the initialization happen in the same transaction? Or would it be in principle possible for a 3rd party to swoop in and initialize it ?