You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Giver/Locker sends funds to script address. Both giver and taker need to have some ADA in their addresses to pay for the transaction fees and collateral.
198
197
We will attach the public key hash of a receiver address as datum to the utxo.
199
198
Note that we will just use the datatype defined in the contract, as it also uses ``PlutusData``.
200
199
@@ -211,8 +210,8 @@ Note that we will just use the datatype defined in the contract, as it also uses
211
210
>>> builder = TransactionBuilder(context)
212
211
>>> builder.add_input_address(giver_address)
213
212
214
-
>>> from gift import CancelDatum
215
-
>>> datum = CancelDatum(payment_vkey_2.hash().to_primitive())
213
+
>>> from gift import WithdrawDatum
214
+
>>> datum = WithdrawDatum(payment_vkey_2.hash().to_primitive())
Taker/Unlocker sends transaction to consume funds. Here we specify the redeemer tag as spend and pass in no special redeemer, as it is being ignored by the contract.::
228
227
229
-
>>> redeemer = Redeemer(PlutusData()) # The plutus equivalent of None
228
+
>>> redeemer = Redeemer(Unit()) # The plutus equivalent of None
Taker/Unlocker provides collateral. Collateral has been introduced in Alonzo transactions to cover the cost of the validating node executing a failing script. In this scenario, the provided UTXO is consumed instead of the fees. A UTXO provided for collateral must only have ada, no other native assets::
242
-
243
-
>>> non_nft_utxo = None
244
-
>>> for utxo in context.utxos(str(taker_address)):
245
-
>>> # multi_asset should be empty for collateral utxo
0 commit comments