Is there a way to check if an address is a smart contract address?
The smart contract addresses all have a sequence like q...q (E.g.: erd1qqqqqqqqqqqqqpgqhe8t5jewej70zupmh44jurgn29psua5l2jps3ntjj3), but is there something more formal to check this?
If you have the bech32 representation of an address you can convert it to hexadecimal representation and check if starts with 16 of
0.E.g.:
Using https://utils.multiversx.com/converters , this value:
can be converted to
Or programmatically:
https://github.com/multiversx/mx-sdk-js-core/blob/e059d13fe4e3789af7cc457cc448b86235faaca9/src/address.ts#L202
where the constant is