Skip to content

base class for the "till" pattern聽#4361

Description

@moodysalem

馃 Motivation
The till pattern that utilizes transient storage is useful for many DeFi protocols.

馃摑 Details

Create a base contract that implements the till pattern, that can be inherited by other contracts. In this pattern:

  • A caller calls the contract and then receives a callback with a new ID
  • Within the callback, the caller can make any number of changes (need a modifier and helper function to get current caller ID and prevent calling other methods without a lock)
  • At the end of the till, run some abstract validation to ensure the initial call can return successfully
  • Note in this pattern, re-entrance is allowed and the nested caller gets a new ID
  • Caller must be able to specify input to the callback and receive output from the callback

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions