Allow Users to Allocate Space for DynamicScratchVar's
- 主要言語
- Python
- スター
- 288
- フォーク
- 138
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
## Problem
When a user creates a `DynamicScratchVar`, the compiler -by design- does not block-off slot space for this variable. Typically, the compiler allocates scratch slots at runtime with slot numbers which are as small as possible. However, without knowing at compile time what slots the compiler will create, there is always the possibility that the compiler will _step on_ a user's dynamic slots. In the worst case, this could lead to unpredictable run-time behavior.
## Solution
We should allow users to allocate a range of dynamic scratch var's at compile time. For example, the following API might work:
```python
def approval_program():
DynamicScratchVar.allocate(range(128, 256)) # allocates slot id's [128, 255] for use only by DynamicScratchVar's
return Seq( ... the actual pyteal ... )
```
## Dependencies
#195
## Urgency
Medium
コントリビューションガイド
評価
この issue はまだ評価されていません。