JPYC.transfer_above_cap_allowlisted
名称・種別
- 名称:
JPYC.transfer_above_cap_allowlisted - 種別: theorem
- モジュール:
JpycFormalVerification.AccessControlTheorems - ソース:
JpycFormalVerification/AccessControlTheorems.lean:743-747 - 概要: 上限超の transfer 成功は送り手が許可登録済みであることを含意する。
- 仕様: 対象
型シグネチャ
lean
∀ {s s' : JPYC.State} {ctx : JPYC.CallContext} {dst : JPYC.Address} {value : JPYC.U256}, Eq (JPYC.transfer s ctx dst value) (Except.ok s') → GT.gt value JPYC.allowlistLimitAmount → Eq (s.allowlisted ctx.sender) 1transfer で allowlistLimitAmount(上限額)を超える額が成功したなら、送り手は許可リスト登録済み(allowlisted sender = 1)だった、という許可リスト・キャップの定理です。
和訳 docstring
allowlistLimitAmount を超える transfer の成功は、送り手が許可リスト登録済みだったことを含意する。
解説
何を述べているか。 transfer が成功し、かつ金額が上限 allowlistLimitAmount を超えるなら、allowlisted sender = 1、すなわち送り手が許可リストに載っていたことが導けます。*_guards の条件付き含意に「上限超」という仮定を当てて得ます(おおもとは checkAllowlist_bind_cap)。
直感。 checkAllowlist ガードの対偶です。「大口(10 万トークン超)が通った ⇒ その人は登録済みだった」。逆に言えば、未登録なら上限超の取引は必ず失敗します。
なぜ安全性に効くか。 JPYC 固有の 送金上限つき許可リスト の中心的保証です。大口の資金移動を「事前に審査・登録されたアカウントだけ」に限定し、未知のアドレスによる大量送金を防ぎます。
図解
Lean ソースコード
lean
/-- A successful `transfer` of more than `allowlistLimitAmount` implies the sender
was allowlisted. -/
theorem transfer_above_cap_allowlisted {s s' : State} {ctx : CallContext} {dst : Address}
{value : U256} (h : transfer s ctx dst value = .ok s') (hcap : value > allowlistLimitAmount) :
s.allowlisted ctx.sender = 1 := (transfer_guards h).2.2.2 hcap