FuelLabs / fuel-specs

📝 Specifications for the Fuel protocol and the FuelVM, a blazingly fast blockchain VM.
https://fuellabs.github.io/fuel-specs/master
Apache License 2.0
1.78k stars 710 forks source link

Add GM getter for the base asset id #559

Closed xgreenx closed 5 months ago

Dentosal commented 6 months ago

@xgreenx GM is a bit weird opcode for this, as it currently returns either Word-sized value or a pointer to memory. In this case there seems to be no requirement for the base asset id to exist in memory, so there's nowhere to point to. Or maybe it's always part of runtime balances and we could point to the value in that array?

Dentosal commented 6 months ago

As discussed, the way to do this is adding the base asset id to memory on VM startup.