Repository navigation
swap_order: relax cancel policy from AllOf to AtLeast(2, owners) - #18
Merged
Merged
Conversation
As discussed in the Discord channel. Rationale: any 2 of the 4 treasury scope owners can already disburse funds out of the treasury at will. Requiring all 4 signatures merely to cancel a pending swap order — and return the locked ADA back to that same treasury — is therefore strictly more restrictive than the disburse permission and creates a denial-of-cancellation risk if any one owner is unavailable. Aligning the swap-cancel policy with the disburse threshold makes cancellation no easier than spending the returned funds, so the change does not weaken control. Concretely the SundaeSwap V3 order owner-policy datum flips from `AllOf [Signature(o1), Signature(o2), Signature(o3), Signature(o4)]` to `AtLeast 2 [Signature(o1), Signature(o2), Signature(o3), Signature(o4)]`: - constructor 1 (AllOf) → constructor 3 (AtLeast) - adds a leading `Int 2` quorum field before the signer list (SundaeSwap aicone multisig schema: 0=Signature, 1=AllOf, 2=AnyOf, 3=AtLeast, 4=Before, 5=After.) Past orders already on chain keep whatever policy they were created with; only future orders built by this script are affected. Signed-off-by: paolino <paolo.veronelli@gmail.com>
paolino
force-pushed
the
swap-cancel-atleast-2
branch
from
May 16, 2026 06:18
0556b3c to
6c08ba5
Compare
KtorZ
reviewed
May 16, 2026
| { "constructor": 0, "fields": [ { "bytes": "$(echo "$metadata" | jq -cr ".treasuries.middleware.owner")" } ] } | ||
| ] | ||
| } | ||
| ] |
Contributor
There was a problem hiding this comment.
pub type MultisigScript {
Signature { key_hash: ByteArray } // variant 0
AllOf { scripts: List<MultisigScript> } // variant 1
AnyOf { scripts: List<MultisigScript> } // variant 2
AtLeast { required: Int, scripts: List<MultisigScript> } // variant 3
Before { time: Int }
After { time: Int }
Script { script_hash: ByteArray }
}Looks about right.
KtorZ
approved these changes
May 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in the Discord channel.
Summary
Flip the SundaeSwap V3 order owner-policy embedded into the swap order datum from
AllOf(4-of-4 owners) toAtLeast 2(2-of-4 owners). One-file change injournal/2026/lib/swap_order.sh.Rationale
Any 2 of the 4 treasury scope owners can already disburse funds out of the treasury at will. Requiring all 4 signatures merely to cancel a pending swap order — and return the locked ADA back to that same treasury — is therefore strictly more restrictive than the disburse permission and creates a denial-of-cancellation risk if any one owner is unavailable. Aligning the swap-cancel policy with the disburse threshold makes cancellation no easier than spending the returned funds, so the change does not weaken control.
Plutus-data shape change
Per the SundaeSwap aicone multisig schema (0=Signature, 1=AllOf, 2=AnyOf, 3=AtLeast, 4=Before, 5=After):
In the bash recipe's JSON:
Scope