Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Paris] Implement pseudo operations - Stake, Unstake, Finalize_unstake and Set_delegate_parameters in Contract API #2886

Closed
3 of 4 tasks
hui-an-yang opened this issue Mar 20, 2024 · 0 comments
Assignees
Labels
ai Adaptive Issuance Paris
Milestone

Comments

@hui-an-yang
Copy link
Collaborator

hui-an-yang commented Mar 20, 2024

ContractAPI support

  • staker related:
    • stake
    • unstake
    • finalize_unstake
  • baker related:
    • set_delegate_parameters

Note:

  • The endpoint GET - /chains/main/blocks/head/context/adaptive_issuance_launch_cycle can be used as a heuristic to check whether Adaptive Issuance is enabled in the protocol - [Paris] new adaptive issuance rpc endpoints (generic) #2678
    it returns the cycle it started (i.e.6) need to compare it with the head block .metadata.level_info.cycle to confirm it started

Protocol Oxford will bring forth a feature flag, that when enabled, will allow users to perform stake, unstake, and finalize_unstake pseudo operations on implicit accounts.

Support the 3 pseudo operations in Taquito Contract API.

Implementation Details

Stake, unstake, and finalize_unstake are all considered 'pseudo operations' because they are essentially an extension of the existing transaction operation.

Refer to this document for further details on what that means: https://hackmd.io/@dsawali/H1_vK4t33

Implement a method wrapper in contract API similar to contractCall or setDelegate and registerDelegate. The work will encompass these domains:

  • Prepare provider
  • RPC contract provider
  • Estimate provider
  • Local forger

The method wrappers should be callable via the contract API as such:

await Tezos.contract.stake(...);

await Tezos.contract.unstake(...);

await Tezos.contract.finalizeUnstake(...);

note: same application for estimate, and prepare provider

The same goes for wallet API (but need verification on this).

Testing

Write appropriate unit and integration tests. This will be part of the ticket's acceptance criteria.

@hui-an-yang hui-an-yang added Paris ai Adaptive Issuance labels Mar 20, 2024
@hui-an-yang hui-an-yang added this to the v20 milestone Mar 20, 2024
@hui-an-yang hui-an-yang changed the title [paris] new pseudo operations - stake, unstake, finalize_unstake and set_delegate_parameters support in contractAPI [Paris] new pseudo operations - stake, unstake, finalize_unstake and set_delegate_parameters support in contractAPI Mar 20, 2024
@dsawali dsawali changed the title [Paris] new pseudo operations - stake, unstake, finalize_unstake and set_delegate_parameters support in contractAPI [Paris] Implement pseudo operations - Stake, Unstake, Finalize_unstake and Set_delegate_parameters in Contract API Mar 21, 2024
@dsawali dsawali self-assigned this Apr 16, 2024
@ac10n ac10n moved this to Done in Taquito Dev Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai Adaptive Issuance Paris
Projects
Status: Done
Development

No branches or pull requests

2 participants