second-state/smart-contract-search-engine

Update frontend when new versioning of contracts is done

tpmccallum opened this issue · 1 comments

We are now

  • hashing the ABI
  • hashing the bytecode
  • hashing both the hash of the ABI and the hash of the bytecode strings into its own single hash

We are doing this so that any combination of versioning is deterministic. For example if a user has the bytecode and or ABI to a contract they can hash it and then search the API.

Also, this is the most robust way to handle versioning of contracts where some contract instances will have shared ABI but unique bytecode etc.

The frontend DApps which are currently using the search engine and API will have to update their Javascript to perform a quick conversion. For example instead of getting the version from the data like this

var version = value._source.dappVersion

They will need to have code like this (which converts the unique hashes to the appropriate version)

if (value._source.abiBytecodeSha3 == "0x12345") {
    var version = "v1";
}

This is updated in the secondStateJS.js code and also documented here