0

I have a marketplace. I wanted to make a sales receipt for each item sold. The sales receipt will indicate address_receipt,nameOfGood, amountOfGood,Price, sumPrice,address_transaction. What should I effectively implement through? Through an array? in solidity maybe arrays in an array? or through a struct? I need that when the buyer's address is given at the entrance, his sales receipts should be displayed. thanks in advance

0

You could generate a contract for each item sold and store the sale info on a struct in a more readable and accessible way.

pragma solidity ^0.4.18;

contract MarketplaceContract{    

  struct SalesReceipt{
        address  address_receipt
        string   nameOfGood 
        uint     amountOfGood 
        uint     Price  
        uint     sumPrice
        address  address_transaction
    }
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.