Skip to content
Merged
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
4 changes: 2 additions & 2 deletions Benchmark/Cases/UnlinkXyz/Pool/Contract.lean
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,6 @@ verity_contract UnlinkPool where
/- `_executeWithdrawal(WithdrawalTransaction calldata _txn, bool _emergency)`
(UnlinkPool.sol:614-666). -/
function executeWithdrawal (txn : WithdrawalTransaction, emergency : Bool) : Unit := do
let recipient := wordToAddress txn.withdrawal.npk
requireError (txn.withdrawal.amount != 0)
PoolInvalidNoteAmount()
requireError (txn.withdrawal.npk != 0)
Expand All @@ -915,6 +914,7 @@ verity_contract UnlinkPool where
PoolInvalidNoteToken()
requireError (txn.withdrawal.npk <= 0xffffffffffffffffffffffffffffffffffffffff)
PoolInvalidWithdrawalRecipient()
let recipient := wordToAddress txn.withdrawal.npk
let selfAddr ← Verity.contractAddress
requireError (recipient != selfAddr) PoolInvalidWithdrawalRecipient()
let verifierRouter ← getStorageAddr stateVerifierRouter
Expand All @@ -932,7 +932,7 @@ verity_contract UnlinkPool where
let wSlot := sub outputCount 1
let withdrawalCommitment := arrayElement txn.newCommitments wSlot
requireError (withdrawalCommitment != 0) PoolWithdrawalSlotZero()
let noteHash := add txn.withdrawal.npk txn.withdrawal.amount
let noteHash ← hashNote txn.withdrawal.npk txn.withdrawal.token txn.withdrawal.amount
requireError (withdrawalCommitment == noteHash) PoolInvalidWithdrawalCommitment()
let ciphertextCount ← countNonZero txn.newCommitments wSlot
requireError ((arrayLength txn.ciphertexts) == ciphertextCount)
Expand Down
Loading