Skip to content

[TM-17] Make contract's address computation more correct

Ivan Gromakovskii requested to merge gromak/tm17-contract-address into master

Description

Problem: we have 'contractAddress' function to compute address of a contract. However, it returns a constant value, which is also invalid. Solution: implement address computation in a similar way to what Tezos reference implementation does based on this stackexchange answer¹. Since we don't know precise binary format yet, it uses JSON serialization as the easiest solution. We don't need to be precisely compatible with Tezos at this point.

¹ https://tezos.stackexchange.com/a/361/342

Related issue(s)

https://issues.serokell.io/issue/TM-17

Checklist for your Merge Request

Related changes (conditional)

  • Tests

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:

Stylistic guide (mandatory)

Merge request reports