Skip to content

WIP: [TM-47] Prohibit creation a contract wrong literal

Ilya Peresadin requested to merge pva/tm47-prohibit-contracts into master

Description

Problem: one can try to PUSH a contract's address which doesn't exist and then try to call this contract. As result, code isn't so typesafe, how it could be. As well, it diverses with reference implementation.

Solution: pass to typechecker's environment a map from contract's address to its type parameter and verify that every PUSH of a contract is valid, namely, a contract's type in PUSH converges with a type parameter of a corresponding contract from the map. Functions which depends on typechecking also takes this map now.

Related issue(s)

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

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)

Edited by Ilya Peresadin

Merge request reports