Skip to content

[TM-274] Update ManagedLedger

Ivan Gromakovskii requested to merge gromak/tm274-update-managed-ledger into master

Description

Problem: there are some changes¹ in FA1.2 and our implementation of ManagedLedger does not account for them. Specifically:

  1. FA1.2 now has less strict requirements on parameter type, so Managed Ledger can be somewhat simplified (no SaneParameter stuff).
  2. At the same time FA1.2 has a stricter variation to be usable in Athens. We do not have an implementation of it.

Solution:

  1. Now there are three contracts:
  • ManagedLedger implementation for Babylon.
  • ManagedLedger implementation for Athens using the approach described in FA1.2.
  • Proxy for the Athens implementation as described in FA1.2.
  1. There are two new modules with code shared by these contracts.
  2. Tests are updated: their logic is generalized and we instantiate them with each contract (only some tests are suitable for Proxy).
  3. Some tags (which use named) are updated to be consistent with FA1.2.
  4. Previously we allowed admin to make arbitrary transfers without checking approval. This logic was removed to make implementation simpler.

¹ https://gitlab.com/serokell/morley/tzip/merge_requests/1

Related issue(s)

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

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • 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 Ivan Gromakovskii

Merge request reports