Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changelog/t7-rewards-deprecation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
pytempo: patch
---

Document T7 changes: mark the TIP-20 reward builders `distribute_reward` and
`set_reward_recipient` as deprecated (TIP-1075 — post-T7 no-ops). `claim_rewards`
stays valid: it still checkpoints and settles pre-T7 lazy accruals through T7,
and pays only already-settled balances from the T8 cleanup fork. Also note the
dynamic base fee (TIP-1067) so `max_fee_per_gas` should come from a live estimate
rather than a constant.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,13 @@ Immutable, strongly-typed transaction (frozen attrs model).
- `calls` (tuple[Call, ...]) - Tuple of Call objects
- `access_list` (tuple[AccessListItem, ...]) - EIP-2930 access list

> **Note (T7 / TIP-1067):** the base fee is now dynamic — it floats within a
> protocol-bounded range instead of being fixed, rising under load and decaying
> when idle. The range is capped below the old fixed base fee, so fees never
> exceed pre-T7 pricing. Still set `max_fee_per_gas` from a live fee estimate
> rather than a hardcoded constant; the `2_000_000_000` values in the examples
> above are illustrative only.

**Methods:**

- `sign(private_key, for_fee_payer=False)` - Sign transaction (returns new instance)
Expand Down
23 changes: 20 additions & 3 deletions pytempo/contracts/tip20.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ def change_transfer_policy_id(self, *, new_policy_id: int) -> Call:
return Call.create(to=self.token, data=data)

def claim_rewards(self) -> Call:
"""Build a ``claimRewards()`` call."""
"""Build a ``claimRewards()`` call.

Note:
TIP-20 rewards are deprecated by the T7 upgrade (TIP-1075): no new
rewards accrue post-T7. ``claimRewards`` stays valid — through T7 it
still checkpoints and settles pre-T7 lazy accruals, and from the T8
cleanup fork it pays out only already-settled reward balances.
"""
data = encode_calldata(_ABI, "claimRewards", [])
return Call.create(to=self.token, data=data)

Expand All @@ -121,7 +128,12 @@ def complete_quote_token_update(self) -> Call:
return Call.create(to=self.token, data=data)

def distribute_reward(self, *, amount: int) -> Call:
"""Build a ``distributeReward(uint256)`` call."""
"""Build a ``distributeReward(uint256)`` call.

.. deprecated:: T7
TIP-20 rewards are deprecated (TIP-1075). Post-T7 this call is a
non-reverting no-op: no new rewards are distributed.
"""
data = encode_calldata(_ABI, "distributeReward", [amount])
return Call.create(to=self.token, data=data)

Expand All @@ -141,7 +153,12 @@ def set_next_quote_token(self, *, new_quote_token: str) -> Call:
return Call.create(to=self.token, data=data)

def set_reward_recipient(self, *, new_reward_recipient: str) -> Call:
"""Build a ``setRewardRecipient(address)`` call."""
"""Build a ``setRewardRecipient(address)`` call.

.. deprecated:: T7
TIP-20 rewards are deprecated (TIP-1075). Post-T7 this call is a
non-reverting no-op: reward opt-ins/recipients no longer change.
"""
data = encode_calldata(_ABI, "setRewardRecipient", [new_reward_recipient])
return Call.create(to=self.token, data=data)

Expand Down