input-output-hk / plutus-pioneer-program

This repository hosts the lectures of the Plutus Pioneers Program. This program is a training course that the IOG Education Team provides to recruit and train software developers in Plutus, the native smart contract language for the Cardano ecosystem.
1.39k stars 986 forks source link

Week01/EnglishAuction.hs : an issue when two bids by two independent wallets are made in same slot #46

Closed ghost closed 1 year ago

ghost commented 3 years ago

There seems a bug in Week-1's EnglishAuction script.

  1. To start with the simulator, I used three wallets in total and allocated 1000 ADA each. Wallet-1 was additionally allocated one Native Token T.
  2. I added "start" event by Wallet-1. input values (POSITime-1596059101, minBid-100 ADA, currencySymbol-66, Token-T ) are provided exactly as Plutus-Pioneer-Program Week01 youtube Lecture.
  3. Afterwards a wait time of 1 block was added.
  4. I added a "bid" event by Wallet-2. bid value was 120 ADA. (as per youtube video)
  5. I added a "bid" event by Wallet-3. bid value was 150 ADA. (as per youtube video)
  6. Afterwards a wait time of 1 block was added.
  7. "Evaluate" button was clicked.

Below mentioned are relevant points as shown by Simulator for Slot-2.

  1. Slot-2, Txn-0 shows two inputs i.e. Wallet-3 (1,000,000,000 Lovelace) & Script (1 T). It shows three outputs i.e. Fee (14,129 Lovelace), Wallet-3 (849,985,871 Lovelace), Script (1 T, 150,000,000 Lovelace).
  2. Slot-2, Txn-1 shows only one input i.e. Wallet-2 (1,000,000,000 Lovelace). It shows three outputs i.e. Fee (14,129 Lovelace), Wallet-2 (879,985,871 Lovelace), Script (1 T, 120,000,000 Lovelace).

Point-2 above seems to have caused some issues w.r.t Wallet-2. having Script in output seems wrong as Script was never a part of Input. Moreover bid event by Wallet-2 must never been accepted considering its a lower bid amount than Wallet-3 bid.

Finally to top it all, Final Balances is showing Wallet-2 with 0 ADA which is absolutely in-correct.

Below pasted is the Logs:

Validating transaction: e7474b9a08609a9ebb87542d364c6e58b6ea83b2c977e98d9a32d7d5247a45c1
Add slot 1
Contract instance for wallet 1: (ReceiveEndpointCall (EndpointDescription { getEndpointDescription: "start" }) (RawJson "{\"contents\":[{\"getEndpointDescription\":\"start\"},{\"unEndpointValue\":{\"spToken\":{\"unTokenName\":\"T\"},\"spCurrency\":{\"unCurrencySymbol\":\"66\"},\"spDeadline\":{\"getPOSIXTime\":1596059101},\"spMinBid\":100000000}}],\"tag\":\"ExposeEndpointResp\"}"))
Validating transaction: 1ae51f0514155523289cd4ba1bd391011143dce3933543fc69bcd3748119e435
Add slot 2
Contract instance for wallet 1: (ContractLog (RawJson "started auction Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"} for token Value (Map [(66,Map [(\"T\",1)])])"))
Contract instance for wallet 2: (ReceiveEndpointCall (EndpointDescription { getEndpointDescription: "bid" }) (RawJson "{\"contents\":[{\"getEndpointDescription\":\"bid\"},{\"unEndpointValue\":{\"bpToken\":{\"unTokenName\":\"T\"},\"bpBid\":120000000,\"bpCurrency\":{\"unCurrencySymbol\":\"66\"}}}],\"tag\":\"ExposeEndpointResp\"}"))
Contract instance for wallet 2: (ContractLog (RawJson "found auction utxo with datum AuctionDatum {adAuction = Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"}, adHighestBid = Nothing}"))
Contract instance for wallet 3: (ReceiveEndpointCall (EndpointDescription { getEndpointDescription: "bid" }) (RawJson "{\"contents\":[{\"getEndpointDescription\":\"bid\"},{\"unEndpointValue\":{\"bpToken\":{\"unTokenName\":\"T\"},\"bpBid\":150000000,\"bpCurrency\":{\"unCurrencySymbol\":\"66\"}}}],\"tag\":\"ExposeEndpointResp\"}"))
Contract instance for wallet 3: (ContractLog (RawJson "found auction utxo with datum AuctionDatum {adAuction = Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"}, adHighestBid = Nothing}"))
Validating transaction: a5e0fd04880058a02333174fc0a0bea2b956d36cac539608c92959bc7028a191
Validation failed: f86b2d4e20f089bb7311f3ad5caed1907a2375ff849b776797b447eadd5b269c
 (TxOutRefNotFound (TxOutRef { txOutRefId: (TxId { getTxId: "1ae51f0514155523289cd4ba1bd391011143dce3933543fc69bcd3748119e435" }), txOutRefIdx: 1 }))
Add slot 3
Contract instance for wallet 2: (ContractLog (RawJson "made bid of 120000000 lovelace in auction Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"} for token (66, \"T\")"))

Below pasted is the Trace:

[ Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Contract instance started
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Current requests (3):   Iteration 1 request ID 3
                                    Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 2
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 1
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            No requests handled
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Receive endpoint call on 'start' for Object (fromList [("contents",Array [Object (fromList [("getEndpointDescription",String "start")]),Object (fromList [("unEndpointValue",Object (fromList [("spCurrency",Object (fromList [("unCurrencySymbol",String "66")])),("spDeadline",Object (fromList [("getPOSIXTime",Number 1.596059101e9)])),("spMinBid",Number 1.0e8),("spToken",Object (fromList [("unTokenName",String "T")]))]))])]),("tag",String "ExposeEndpointResp")])
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Handled request:   Iteration 1 request ID 1
                               Response: "{\"contents\":[{\"getEndpointDescription\":\"star
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Current requests (1):   Iteration 2 request ID 1
                                    Request: "{\"tag\":\"OwnPublicKeyReq\"}"
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Handled request:   Iteration 2 request ID 1
                               Response: "{\"contents\":{\"getPubKey\":\"d75a980182b10ab7d5
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Current requests (1):   Iteration 3 request ID 1
                                    Request: "{\"contents\":{\"unBalancedTxTx\":{\"txData\":[[\
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Handled request:   Iteration 3 request ID 1
                               Response: "{\"contents\":{\"contents\":{\"txData\":[[\"061fc
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Current requests (1):   Iteration 4 request ID 1
                                    Request: "{\"contents\":{\"getTxId\":\"1ae51f0514155523289c
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Contract log: String "started auction Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"} for token Value (Map [(66,Map [(\"T\",1)])])"
, Slot 2: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Handled request:   Iteration 4 request ID 1
                               Response: "{\"contents\":{\"getTxId\":\"1ae51f0514155523289c
, Slot 2: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Current requests (3):   Iteration 5 request ID 3
                                    Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 5 request ID 2
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 5 request ID 1
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
, Slot 2: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            No requests handled
, Slot 3: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            No requests handled ]
[ Slot 1: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Contract instance started
, Slot 1: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (3):   Iteration 1 request ID 3
                                    Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 2
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 1
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
, Slot 1: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            No requests handled
, Slot 1: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Receive endpoint call on 'bid' for Object (fromList [("contents",Array [Object (fromList [("getEndpointDescription",String "bid")]),Object (fromList [("unEndpointValue",Object (fromList [("bpBid",Number 1.2e8),("bpCurrency",Object (fromList [("unCurrencySymbol",String "66")])),("bpToken",Object (fromList [("unTokenName",String "T")]))]))])]),("tag",String "ExposeEndpointResp")])
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Handled request:   Iteration 1 request ID 2
                               Response: "{\"contents\":[{\"getEndpointDescription\":\"bid\
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (1):   Iteration 2 request ID 1
                                    Request: "{\"contents\":{\"addressStakingCredential\":null,
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Contract log: String "found auction utxo with datum AuctionDatum {adAuction = Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"}, adHighestBid = Nothing}"
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Handled request:   Iteration 2 request ID 1
                               Response: "{\"contents\":{\"address\":{\"addressStakingCrede
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (1):   Iteration 3 request ID 1
                                    Request: "{\"tag\":\"OwnPublicKeyReq\"}"
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Handled request:   Iteration 3 request ID 1
                               Response: "{\"contents\":{\"getPubKey\":\"3d4017c3e843895a92
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (1):   Iteration 4 request ID 1
                                    Request: "{\"contents\":{\"unBalancedTxTx\":{\"txData\":[[\
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Handled request:   Iteration 4 request ID 1
                               Response: "{\"contents\":{\"contents\":{\"txData\":[[\"061fc
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (1):   Iteration 5 request ID 1
                                    Request: "{\"contents\":{\"getTxId\":\"f86b2d4e20f089bb7311
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            No requests handled
, Slot 3: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Contract log: String "made bid of 120000000 lovelace in auction Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"} for token (66, \"T\")"
, Slot 3: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Handled request:   Iteration 5 request ID 1
                               Response: "{\"contents\":{\"getTxId\":\"f86b2d4e20f089bb7311
, Slot 3: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (3):   Iteration 6 request ID 3
                                    Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 6 request ID 2
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 6 request ID 1
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
, Slot 3: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            No requests handled ]
[ Slot 1: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Contract instance started
, Slot 1: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Current requests (3):   Iteration 1 request ID 3
                                    Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 2
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 1
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
, Slot 1: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            No requests handled
, Slot 1: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Receive endpoint call on 'bid' for Object (fromList [("contents",Array [Object (fromList [("getEndpointDescription",String "bid")]),Object (fromList [("unEndpointValue",Object (fromList [("bpBid",Number 1.5e8),("bpCurrency",Object (fromList [("unCurrencySymbol",String "66")])),("bpToken",Object (fromList [("unTokenName",String "T")]))]))])]),("tag",String "ExposeEndpointResp")])
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Handled request:   Iteration 1 request ID 2
                               Response: "{\"contents\":[{\"getEndpointDescription\":\"bid\
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Current requests (1):   Iteration 2 request ID 1
                                    Request: "{\"contents\":{\"addressStakingCredential\":null,
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Contract log: String "found auction utxo with datum AuctionDatum {adAuction = Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"}, adHighestBid = Nothing}"
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Handled request:   Iteration 2 request ID 1
                               Response: "{\"contents\":{\"address\":{\"addressStakingCrede
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Current requests (1):   Iteration 3 request ID 1
                                    Request: "{\"tag\":\"OwnPublicKeyReq\"}"
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Handled request:   Iteration 3 request ID 1
                               Response: "{\"contents\":{\"getPubKey\":\"fc51cd8e6218a1a38d
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Current requests (1):   Iteration 4 request ID 1
                                    Request: "{\"contents\":{\"unBalancedTxTx\":{\"txData\":[[\
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Handled request:   Iteration 4 request ID 1
                               Response: "{\"contents\":{\"contents\":{\"txData\":[[\"061fc
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Current requests (1):   Iteration 5 request ID 1
                                    Request: "{\"contents\":{\"getTxId\":\"a5e0fd04880058a02333
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            No requests handled ]
Kaleb47 commented 3 years ago

I'm having the same issues as you, the only difference is I can't even compile the EunglishAuction.hs contract. May I ask what dependencies you're using?

ghost commented 3 years ago

I am not sure I understand your question ? I have followed basic, standard steps as available on the readme of this repo (pasted below for easy reference)

Week #1

Clone the The Plutus repository, check out the correct commit as specified in cabal.project. Install NixOS cross-referencing the following resources. https://nixos.org/download.html https://docs.plutus-community.com A few resources to understand the what and why regarding NixOS https://nixos.org/manual/nix/stable https://serokell.io/blog/what-is-nix Set-up IOHK binary caches How to set up the IOHK binary caches. "If you do not do this, you will end up building GHC, which takes several hours. If you find yourself building GHC, STOP and fix the cache." Enter a nix-shell. Build the English Auction contract with cabal build (you may need to run cabal update first). Go to the plutus-playground-client folder. Start the Playground server with plutus-playground-server. Start the Playground client (in another nix-shell) with npm run start. Copy-paste the auction contract into the Playground editor. Compile. Simulate various auction scenarios.

ullamonster commented 3 years ago

I'm having the same issues as you, the only difference is I can't even compile the EunglishAuction.hs contract. May I ask what dependencies you're using?

I'm also experiencing a compile issue when using the web interface alone and the script from this repo. I appended Language. to the import entries for Plutus.Contract and all PlutusTX.* and it then passes initial errors but kicks back on POSIXTime. I'm going to go through the normal steps as outlined above as I believe it will resolve this.

ullamonster commented 3 years ago

There seems a bug in Week-1's EnglishAuction script.

  1. To start with the simulator, I used three wallets in total and allocated 1000 ADA each. Wallet-1 was additionally allocated one Native Token T.
  2. I added "start" event by Wallet-1. input values (POSITime-1596059101, minBid-100 ADA, currencySymbol-66, Token-T ) are provided exactly as Plutus-Pioneer-Program Week01 youtube Lecture.
  3. Afterwards a wait time of 1 block was added.
  4. I added a "bid" event by Wallet-2. bid value was 120 ADA. (as per youtube video)
  5. I added a "bid" event by Wallet-3. bid value was 150 ADA. (as per youtube video)
  6. Afterwards a wait time of 1 block was added.
  7. "Evaluate" button was clicked.

Below mentioned are relevant points as shown by Simulator for Slot-2.

  1. Slot-2, Txn-0 shows two inputs i.e. Wallet-3 (1,000,000,000 Lovelace) & Script (1 T). It shows three outputs i.e. Fee (14,129 Lovelace), Wallet-3 (849,985,871 Lovelace), Script (1 T, 150,000,000 Lovelace).
  2. Slot-2, Txn-1 shows only one input i.e. Wallet-2 (1,000,000,000 Lovelace). It shows three outputs i.e. Fee (14,129 Lovelace), Wallet-2 (879,985,871 Lovelace), Script (1 T, 120,000,000 Lovelace).

Point-2 above seems to have caused some issues w.r.t Wallet-2. having Script in output seems wrong as Script was never a part of Input. Moreover bid event by Wallet-2 must never been accepted considering its a lower bid amount than Wallet-3 bid.

Finally to top it all, Final Balances is showing Wallet-2 with 0 ADA which is absolutely in-correct.

Below pasted is the Logs:

Validating transaction: e7474b9a08609a9ebb87542d364c6e58b6ea83b2c977e98d9a32d7d5247a45c1
Add slot 1
Contract instance for wallet 1: (ReceiveEndpointCall (EndpointDescription { getEndpointDescription: "start" }) (RawJson "{\"contents\":[{\"getEndpointDescription\":\"start\"},{\"unEndpointValue\":{\"spToken\":{\"unTokenName\":\"T\"},\"spCurrency\":{\"unCurrencySymbol\":\"66\"},\"spDeadline\":{\"getPOSIXTime\":1596059101},\"spMinBid\":100000000}}],\"tag\":\"ExposeEndpointResp\"}"))
Validating transaction: 1ae51f0514155523289cd4ba1bd391011143dce3933543fc69bcd3748119e435
Add slot 2
Contract instance for wallet 1: (ContractLog (RawJson "started auction Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"} for token Value (Map [(66,Map [(\"T\",1)])])"))
Contract instance for wallet 2: (ReceiveEndpointCall (EndpointDescription { getEndpointDescription: "bid" }) (RawJson "{\"contents\":[{\"getEndpointDescription\":\"bid\"},{\"unEndpointValue\":{\"bpToken\":{\"unTokenName\":\"T\"},\"bpBid\":120000000,\"bpCurrency\":{\"unCurrencySymbol\":\"66\"}}}],\"tag\":\"ExposeEndpointResp\"}"))
Contract instance for wallet 2: (ContractLog (RawJson "found auction utxo with datum AuctionDatum {adAuction = Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"}, adHighestBid = Nothing}"))
Contract instance for wallet 3: (ReceiveEndpointCall (EndpointDescription { getEndpointDescription: "bid" }) (RawJson "{\"contents\":[{\"getEndpointDescription\":\"bid\"},{\"unEndpointValue\":{\"bpToken\":{\"unTokenName\":\"T\"},\"bpBid\":150000000,\"bpCurrency\":{\"unCurrencySymbol\":\"66\"}}}],\"tag\":\"ExposeEndpointResp\"}"))
Contract instance for wallet 3: (ContractLog (RawJson "found auction utxo with datum AuctionDatum {adAuction = Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"}, adHighestBid = Nothing}"))
Validating transaction: a5e0fd04880058a02333174fc0a0bea2b956d36cac539608c92959bc7028a191
Validation failed: f86b2d4e20f089bb7311f3ad5caed1907a2375ff849b776797b447eadd5b269c
 (TxOutRefNotFound (TxOutRef { txOutRefId: (TxId { getTxId: "1ae51f0514155523289cd4ba1bd391011143dce3933543fc69bcd3748119e435" }), txOutRefIdx: 1 }))
Add slot 3
Contract instance for wallet 2: (ContractLog (RawJson "made bid of 120000000 lovelace in auction Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"} for token (66, \"T\")"))

Below pasted is the Trace:

[ Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Contract instance started
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Current requests (3):   Iteration 1 request ID 3
                                    Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 2
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 1
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            No requests handled
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Receive endpoint call on 'start' for Object (fromList [("contents",Array [Object (fromList [("getEndpointDescription",String "start")]),Object (fromList [("unEndpointValue",Object (fromList [("spCurrency",Object (fromList [("unCurrencySymbol",String "66")])),("spDeadline",Object (fromList [("getPOSIXTime",Number 1.596059101e9)])),("spMinBid",Number 1.0e8),("spToken",Object (fromList [("unTokenName",String "T")]))]))])]),("tag",String "ExposeEndpointResp")])
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Handled request:   Iteration 1 request ID 1
                               Response: "{\"contents\":[{\"getEndpointDescription\":\"star
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Current requests (1):   Iteration 2 request ID 1
                                    Request: "{\"tag\":\"OwnPublicKeyReq\"}"
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Handled request:   Iteration 2 request ID 1
                               Response: "{\"contents\":{\"getPubKey\":\"d75a980182b10ab7d5
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Current requests (1):   Iteration 3 request ID 1
                                    Request: "{\"contents\":{\"unBalancedTxTx\":{\"txData\":[[\
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Handled request:   Iteration 3 request ID 1
                               Response: "{\"contents\":{\"contents\":{\"txData\":[[\"061fc
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Current requests (1):   Iteration 4 request ID 1
                                    Request: "{\"contents\":{\"getTxId\":\"1ae51f0514155523289c
, Slot 1: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Contract log: String "started auction Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"} for token Value (Map [(66,Map [(\"T\",1)])])"
, Slot 2: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Handled request:   Iteration 4 request ID 1
                               Response: "{\"contents\":{\"getTxId\":\"1ae51f0514155523289c
, Slot 2: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            Current requests (3):   Iteration 5 request ID 3
                                    Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 5 request ID 2
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 5 request ID 1
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
, Slot 2: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            No requests handled
, Slot 3: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
            No requests handled ]
[ Slot 1: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Contract instance started
, Slot 1: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (3):   Iteration 1 request ID 3
                                    Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 2
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 1
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
, Slot 1: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            No requests handled
, Slot 1: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Receive endpoint call on 'bid' for Object (fromList [("contents",Array [Object (fromList [("getEndpointDescription",String "bid")]),Object (fromList [("unEndpointValue",Object (fromList [("bpBid",Number 1.2e8),("bpCurrency",Object (fromList [("unCurrencySymbol",String "66")])),("bpToken",Object (fromList [("unTokenName",String "T")]))]))])]),("tag",String "ExposeEndpointResp")])
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Handled request:   Iteration 1 request ID 2
                               Response: "{\"contents\":[{\"getEndpointDescription\":\"bid\
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (1):   Iteration 2 request ID 1
                                    Request: "{\"contents\":{\"addressStakingCredential\":null,
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Contract log: String "found auction utxo with datum AuctionDatum {adAuction = Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"}, adHighestBid = Nothing}"
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Handled request:   Iteration 2 request ID 1
                               Response: "{\"contents\":{\"address\":{\"addressStakingCrede
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (1):   Iteration 3 request ID 1
                                    Request: "{\"tag\":\"OwnPublicKeyReq\"}"
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Handled request:   Iteration 3 request ID 1
                               Response: "{\"contents\":{\"getPubKey\":\"3d4017c3e843895a92
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (1):   Iteration 4 request ID 1
                                    Request: "{\"contents\":{\"unBalancedTxTx\":{\"txData\":[[\
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Handled request:   Iteration 4 request ID 1
                               Response: "{\"contents\":{\"contents\":{\"txData\":[[\"061fc
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (1):   Iteration 5 request ID 1
                                    Request: "{\"contents\":{\"getTxId\":\"f86b2d4e20f089bb7311
, Slot 2: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            No requests handled
, Slot 3: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Contract log: String "made bid of 120000000 lovelace in auction Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"} for token (66, \"T\")"
, Slot 3: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Handled request:   Iteration 5 request ID 1
                               Response: "{\"contents\":{\"getTxId\":\"f86b2d4e20f089bb7311
, Slot 3: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            Current requests (3):   Iteration 6 request ID 3
                                    Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 6 request ID 2
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 6 request ID 1
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
, Slot 3: 00000000-0000-4000-8000-000000000001 {Contract instance for wallet 2}:
            No requests handled ]
[ Slot 1: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Contract instance started
, Slot 1: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Current requests (3):   Iteration 1 request ID 3
                                    Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 2
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 1
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
, Slot 1: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            No requests handled
, Slot 1: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            No requests handled
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Receive endpoint call on 'bid' for Object (fromList [("contents",Array [Object (fromList [("getEndpointDescription",String "bid")]),Object (fromList [("unEndpointValue",Object (fromList [("bpBid",Number 1.5e8),("bpCurrency",Object (fromList [("unCurrencySymbol",String "66")])),("bpToken",Object (fromList [("unTokenName",String "T")]))]))])]),("tag",String "ExposeEndpointResp")])
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Handled request:   Iteration 1 request ID 2
                               Response: "{\"contents\":[{\"getEndpointDescription\":\"bid\
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Current requests (1):   Iteration 2 request ID 1
                                    Request: "{\"contents\":{\"addressStakingCredential\":null,
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Contract log: String "found auction utxo with datum AuctionDatum {adAuction = Auction {aSeller = 21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9, aDeadline = POSIXTime {getPOSIXTime = 1596059101}, aMinBid = 100000000, aCurrency = 66, aToken = \"T\"}, adHighestBid = Nothing}"
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Handled request:   Iteration 2 request ID 1
                               Response: "{\"contents\":{\"address\":{\"addressStakingCrede
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Current requests (1):   Iteration 3 request ID 1
                                    Request: "{\"tag\":\"OwnPublicKeyReq\"}"
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Handled request:   Iteration 3 request ID 1
                               Response: "{\"contents\":{\"getPubKey\":\"fc51cd8e6218a1a38d
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Current requests (1):   Iteration 4 request ID 1
                                    Request: "{\"contents\":{\"unBalancedTxTx\":{\"txData\":[[\
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Handled request:   Iteration 4 request ID 1
                               Response: "{\"contents\":{\"contents\":{\"txData\":[[\"061fc
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            Current requests (1):   Iteration 5 request ID 1
                                    Request: "{\"contents\":{\"getTxId\":\"a5e0fd04880058a02333
, Slot 2: 00000000-0000-4000-8000-000000000002 {Contract instance for wallet 3}:
            No requests handled ]

In your simulation did you indicate a value of 0 for the NFT for wallets 2 and 3?

luisantonioig commented 1 year ago

Hi @ghost,

I hope this message finds you well.

I wanted to inform you that we have decided to close this issue as it pertains to an old branch of the course. Please note that these branches are not actively maintained and are kept for historical purposes.

We encourage you to utilize the branch that best suits your needs, whether it's the current version or any other relevant branch.

Please don't hesitate to reach out if you have any questions or require further assistance. We're here to help!

Thank you for your understanding and your valuable contributions.