Fix deploy output min ADA: apply Babbage/Conway UTxO entry overhead formula#32
Merged
Merged
Conversation
Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix insufficiently funded transaction outputs
Fix insufficient ADA on script deploy output
Mar 1, 2026
…y tx Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com>
Copilot
AI
changed the title
Fix insufficient ADA on script deploy output
Replace hardcoded deploy ADA with dynamic min UTxO calculation; drop unnecessary datum
Mar 1, 2026
Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com>
Copilot
AI
changed the title
Replace hardcoded deploy ADA with dynamic min UTxO calculation; drop unnecessary datum
Fix deploy output min ADA: apply Babbage/Conway UTxO entry overhead formula
Mar 1, 2026
SynthLuvr
approved these changes
Mar 1, 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.
The deploy transaction output was underfunded because the SDK's
calculateMinimumUtxoLovelaceomits the 160-byte UTxO entry overhead mandated by the Babbage/Conway ledger formula, and seeding it withAssets.zeroproduces a CBOR size 4 bytes smaller than the actual output (0 lovelace = 1-byte CBOR vs. any typical min value ≥ 65536 = 5-byte CBOR). Result: 1,913,640 lovelace submitted vs. 2,620,480 required.Changes
src/mint.ts— Replace directcalculateMinimumUtxoLovelacecall with a two-step calculation:coinsPerUtxoByte: 1nto obtain the raw CBOR byte count rather than a lovelace amountAssets.fromLovelace(1_000_000n)as a placeholder so the lovelace field serializes with the same 5-byte CBOR encoding as the final value(cborSize + 160n) * coinsPerUtxoByte🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.