RGB-WG / rgb-core

RGB Core Library: consensus validation for private & scalable client-validated smart contracts on Bitcoin & Lightning
https://spec.rgb.tech
Apache License 2.0
207 stars 52 forks source link

Contract::CnC Question #253

Closed cymqqqq closed 3 months ago

cymqqqq commented 3 months ago

Description of the CnC operation: Counts number of global state items of the provided type in the contract state and puts the number to the destination a16 register. and the parameters: CnC(AssignmentType, Reg32), I don't understand if we aim to count the global state items in the contract state, why there is the AssignmentType but not the GlobalStateType. I know the AssignmentType works for the data, fungible, structure, and attachment state.

cymqqqq commented 3 months ago

https://github.com/RGB-WG/rgb-core/pull/208 I read this pull request, so the reason for the AssignmentType added here is we can add the contract state in the VM, and then we can compute the global state based on the whole contract state?

dr-orlovsky commented 3 months ago

This is error, you are right, it should be GlobalStateType. Will work on the fix

dr-orlovsky commented 3 months ago

Closed in #255