CashScript / cashscript

⚖️ Easily write and interact with Bitcoin Cash smart contracts
https://cashscript.org
MIT License
112 stars 79 forks source link

Add support for [CHIP-2021-02: Native Introspection Opcodes] #108

Closed rkalis closed 2 years ago

rkalis commented 2 years ago

Examples and documentation still needs to be updated. The new covenant contracts also need to be updated to remove some theoretical vulnerabilities.

emergent-reasons commented 2 years ago

Overall it looks like a satisfying removal of special handling due to the better underlying vm design. I mentioned a few questions that are mostly where I couldn't understand a change, not because I thought there is an error.

One general thing was that tx version seems to have various checks including 2 and >=2 (maybe also 1? That might have been only in removed lines). Not sure if that was all intentional.

rkalis commented 2 years ago

@emergent-reasons What do you mean with this:

One general thing was that tx version seems to have various checks including 2 and >=2 (maybe also 1? That might have been only in removed lines). Not sure if that was all intentional.

emergent-reasons commented 2 years ago

What do you mean with this:

One general thing was that tx version seems to have various checks including 2 and >=2 (maybe also 1? That might have been only in removed lines). Not sure if that was all intentional.

I looked back through all the files and couldn't find the version 1 that I remember. I found these below. I guess it just didn't seem like there was a specific reason for some to be ==2 and some >=2 , but I don't think it's really relevant here. So no worries on this point.

tx.version >= 2

tx.version == 2

rkalis commented 2 years ago

Oh yeah. There wasn't a real reason to check for those values tbh. Just that I wanted to check something.

kiok46 commented 2 years ago

🚀