We can verify if a contract address is the contract we expect it to be based on its code id, we can do a query for the code id, and compare it to the allowed code id.
This gives us a strong verification that the address we expect is the contract we need, avoiding cases where an outdated contract address is added, or only allowing a specific type of contracts to be execute messages.
Some cases where we can use it:
Only allow Valence account contracts to register to services
When oracle contract address is updated on the auctions manager, we can verify the contract is an oracle using the code id.
We can verify if a contract address is the contract we expect it to be based on its code id, we can do a query for the code id, and compare it to the allowed code id.
This gives us a strong verification that the address we expect is the contract we need, avoiding cases where an outdated contract address is added, or only allowing a specific type of contracts to be execute messages.
Some cases where we can use it: