Contract IDs are represented as BytesN<32> throughout the SDK.
As part of Auth Next we have this Address type, and idea is to support future account abstraction that everything is one of these addresses and most code shouldn't need to think about the type of address something is.
If we end up succeeding at true account abstraction, in the end an Address that is a contract ID should be usable anywhere any Address is usable and the importance of contract vs account addresses should fade away even more.
In the SDK we use BytesN<32> for contract IDs and pass them around as their raw bytes. This is visible to the developer in a few places:
● Contract clients must be instantiated with a BytesN<32>.
● Registering contracts in tests returns a BytesN<32>.
● Passing around contract IDs between contracts in our examples use BytesN<32>.
● Env call stacks use BytesN<32> as the contract ID parameter.
However, by proliferating this BytesN<32> about in so many ways, the developer has to learn about and deal with both Address and BytesN<32> and their conversion. When coding myself I find myself doing conversions between them as a matter of necessity and their distinction isn't adding much value to the code I write – it feels like busy work.
this again because somehow twice in one day I got tripped up by this again 😅.