timewave-computer / valence-services

Other
3 stars 0 forks source link

Add verification of contract addresses based on code id #13

Closed Art3miX closed 1 year ago

Art3miX commented 1 year ago

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:

  1. Only allow Valence account contracts to register to services
  2. When oracle contract address is updated on the auctions manager, we can verify the contract is an oracle using the code id.
Art3miX commented 1 year ago

Fixed in #12