Skip to content

Commit

Permalink
Fix CIP68 minting + chaining missing UTxOs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfarrelly committed Aug 23, 2024
1 parent 7be2c75 commit 02f877f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion addons/@mlabs-haskell/godot-cardano/src/provider/provider.gd
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ func _chain_utxos(utxos: Array[Utxo]) -> Array[Utxo]:
return utxos

var chained: Array[Utxo] = utxos.duplicate()
for utxo in utxos:
for utxo: Utxo in utxos:
if utxo == null:
continue

var out_ref := utxo.to_out_ref_string()
for key in _chaining_map:
var inner: Dictionary = _chaining_map[key]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ func mint_cip68_pair(redeemer: PlutusData, conf: Cip68Config) -> TxBuilder:
mint_assets(
conf.minting_policy_source,
[
TxBuilder.MintToken.new(conf.get_user_token_name(), conf.get_quantity().negate()),
TxBuilder.MintToken.new(conf.get_ref_token_name(), BigInt.one().negate())
TxBuilder.MintToken.new(conf.get_user_token_name(), conf.get_quantity()),
TxBuilder.MintToken.new(conf.get_ref_token_name(), BigInt.one())
],
redeemer
)
Expand Down
1 change: 1 addition & 0 deletions libcsl_godot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ impl GTxBuilder {
&BigNum::from(params.ref_script_coins_per_byte),
&BigNum::from(1u64),
))
.deduplicate_explicit_ref_inputs_with_regular_inputs(true)
.build()
.map_err(|e| TxBuilderError::BadProtocolParameters(e))?;
let tx_builder = TransactionBuilder::new(&tx_builder_config);
Expand Down
1 change: 0 additions & 1 deletion shop-demo/shop.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ var update_timer: Timer = null
var cip68_data: Array[Cip68Config] = []

var owner_pub_key_hash: PubKeyHash = null
var tag: BigInt = BigInt.from_int(239058)
var ref_lock_source: PlutusScriptSource
var shop_script_source: PlutusScriptSource

Expand Down

0 comments on commit 02f877f

Please sign in to comment.