r/Bitcoincash • • 14h ago

Breaking News General Protocols is sunsetting BCH Bull for XO. Think we'll see BCH Bull 2.0 on XO?

Thumbnail
ad-hoc-news.de
11 Upvotes

r/Bitcoincash • • 3h ago

How Bitcoin Cash Brings Tokens to Life (GP Shorts)

Thumbnail
youtube.com
4 Upvotes

r/Bitcoincash • • 1h ago

A great example of infrastructure that's improved massively over the years, even if end users don't see the direct results: debugging UTXO smart contracts

Thumbnail
generalprotocols.com
3 Upvotes

Part one:

In early CashScript debugging, if there's something that went wrong in your smart contract transaction, you'll see, like, okay, mandatory script verify flag failed. You kind of understand that, okay, well, so something somewhere went wrong, but most CashScript smart contracts have a dozen different verify operations. So try figuring out which one of them failed. In the early days, that meant that you would be, like, commenting out different lines to see if that would make the contract succeed. And when something like that failed, you could use a tool like Meep, where you can jump in and go to the actual opcodes, but that's not really the easiest way to figure out what's going on. And there's no mapping between this low-level code and the high-level CashScript. So, it doesn't really help you understand what you need to change about your CashScript code.

Part two:

https://generalprotocols.com/media/shorts/early-cashscript-debugging-vs-modern-cashscript-debugging-part-2/

Now, if something fails in your smart contract, it shows you exactly which require statement failed. So, you know exactly where to look. Here you actually see the opcodes on the left with a source mapping on the right. So, you see exactly how the compiled code maps to the original source code, and on the right you see the execution there. So, you see where it fails. You can see the stack at every point in time. This essentially means that rather than having to dig through all of this to figure out where things are going wrong, what the stack is at the time, and then, I guess, having to figure out what that means for your contract code, you can just have it side by side. So you see, okay, well, on the right you see exactly where it failed. So it says "program failed and op_verify operation. You can see the exact line and the corresponding bytecode for that.