5 ms·
The article makes it sound like a smart contract was hacked. Which is not possible under a "code is law" perspective. Will be interesting to see what really ha
by ArtTimeInvestor 6y ago
The article makes it sound like a smart contract was hacked. Which is not possible under a "code is law" perspective.
Will be interesting to see what really happened.
- bombcar 6y agoGiven that all forms of communication with the team are dead, it sounds like a standard exit scam to me.
- ArtTimeInvestor 6y agoYou mean they put a backdoor into their smart contract? Or did they hold the money off chain?
- deweller 6y agoIt wasn't a back door. They modified the smart contract and drained the crypto. > The hackers implemented a change in the ownership of the smart contract address.
- ArtTimeInvestor 6y agoSmart contracts are immutable. How do you mean they "changed" it? What is "ownership" of a smart contract?
- jcfrei 6y agoYou can write smart contracts which are upgradable (by moving the assets/tokens to a new address with new code). The upgrade to a different contract can either be triggered by votes or by the author depending on the setup.
- qqii 6y agoThis is incorrect, unless you can argue that they were so incompitent they wrote '0' instead of 'O' on line 304: bytes32 slot = ADMIN_SL0T; https://bscscan.com/address/0x7e0c621ea9f7afd5b86a50b0942eaee68b04a61c#code https://bscscan.com/address/0x7e0c621ea9f7afd5b86a50b0942eae... These kind of rug pulls are more uncommon but not rare, they give the developers some level of plausible deniability. Even so their actions after speak volumes.
- qqii 6y agoYou are correct, here is their smart contact code which has been verified: https://bscscan.com/address/0x7e0c621ea9f7afd5b86a50b0942eaee68b04a61c#code https://bscscan.com/address/0x7e0c621ea9f7afd5b86a50b0942eae... Note line 304 the O is a 0: bytes32 slot = ADMIN_SL0T;
- minitoar 6y agoWhat does this obfuscation accomplish? Is ADMIN_SLOT some sort of standard constant?
- Semaphor 6y agoNo, but it’s one they set in the code: comment: @dev Storage slot with the admin of the contract. This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is validated in the constructor. bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
- minitoar 6y agoSo by using ADMIN_SL0T instead was it just set to null or something?
- Semaphor 6y agoI have no idea how the language or VM works, I guess the important part was that it wasn’t the right constant ;)
- qqii 6y agoThat's right, they've tried to obfuscate that their setter doesn't actually set. https://news.ycombinator.com/item?id=26358876 https://news.ycombinator.com/item?id=26358876
- qqii 6y agoPerhaps it will be clear if I move all of the code together and add comments: bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; // this is the getter function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { // return the memory at slot adm := sload(slot) } } // this is the setter, notice the 0 and the different hash bytes32 internal constant ADMIN_SL0T = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6102; // this doesn't set the same value as the getter, in effect the admin cannot be changed function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SL0T; assembly { // set the memory at slot to the value of newAdmin sstore(slot, newAdmin) } } https://bscscan.com/address/0x7e0c621ea9f7afd5b86a50b0942eaee68b04a61c#code https://bscscan.com/address/0x7e0c621ea9f7afd5b86a50b0942eae...
- Nextgrid 6y agoIt's possible in the sense that the code might not reflect the intentions of its creators due to an oversight. What's interesting is to see how it will be dealt with. Most "DeFi" and cryptocurrency aficionados are quick to claim that "code is law", so we'll see whether they change their minds when their own money is at stake.
- ArtTimeInvestor 6y agocode might not reflect the intentions So now we need human judges to judge what the intention of a smart contract is?
- z3rgl1ng 6y agoWe should train these people to understand them. Then each party can have their reviewer carefully review them. We can call them... hm, nope, can’t think of an analogous job for this.
- TacticalCoder 6y ago> So now we need human judges to judge what the intention of a smart contract is? Well, wouldn't it already be quite a win if for 99.9% of the smart contract out there no human judge was needed? It's an honest question: ain't it unthinkable that most could be fully automated and yet real courts could be used in rare cases and that that'd be already be quite an improvement? Or is the system only working if 100% of the time no human ruling is needed? I have no idea...
- WanderPanda 6y agoCode is law + Extreme Ownership is all you need
- kubanczyk 6y agoAssuming you mean something from that bestseller, could you sum up what's "Extreme Ownership" in this context?
- 6y ago
- qqii 6y agoIt was an intentional backdoor in the contract. https://bscscan.com/address/0x7e0c621ea9f7afd5b86a50b0942eaee68b04a61c#code https://bscscan.com/address/0x7e0c621ea9f7afd5b86a50b0942eae... Note line 304 the O is a 0: bytes32 slot = ADMIN_SL0T;
- KirillPanov 6y agoHoly crap you're right. This is like in Java, where you mean to override a method in a superclass but mis-spell the name of the method and therefore instead end up simply adding a new method with the mis-spelled name. I guess either Solidity doesn't have something like Java 1.5+'s @Override, or else it just wasn't used. In any case it's hard to believe this was accidental. Of all the places you could make this mistake, most of the others wouldn't result in a massive exploit like this.
- hulahoof 6y agoI don't think anyone would consider an accident possible after they stole the funds.
- KirillPanov 6y agoWell there have been other accidental bugs (reentrancy, for one) that got exploited by thieves who turned out not to be the devs. But I agree, that's not what happened here.
- ashkankiani 6y agoThis is definitely the funniest thing I've read this week.
- gruez 6y agoCan you elaborate on this? How does swapping out O for a 0 introduce a backdoor?
- qqii 6y ago
- PretzelPirate 6y agoI’m not sure this applies to Binance Smart Chain. It is a centralized service providing cheaper, centralized DeFi. Centralized services don’t need to follow “code is law” since they have actual laws they have to follow.