Smart Contract Tutorial | Create a Safe Remote Purchase Ethereum Smart Contract with Solidity

Поделиться
HTML-код
  • Опубликовано: 19 дек 2024

Комментарии • 52

  • @skynetwork6612
    @skynetwork6612 2 года назад +4

    Great, after a few years in cybersecurity i fell like i want to learn more about blockchain and how this technology works.

  • @MitjaFelicijan
    @MitjaFelicijan 2 года назад +1

    Value not being set up in the constructor was tripping me out throughout half of the video :) I was thinking to myself what kind of magic is this :) amazing video btw!

  • @AmiasYaska
    @AmiasYaska 2 года назад +1

    U are the best teacher man. We really appreciate all your work and we hope to see more videos from you.

  • @jerrywang3225
    @jerrywang3225 Год назад +1

    Great tutorial, i am looking forward to a more advanced version of this application, like adding duration for certain state in case seller or buyer never call the function, we can also add shipping state to the enum and let buyer revoke the transaction before shipping state is initiated, we can even add refund function. Thanks again.

  • @algotrader6912
    @algotrader6912 2 года назад +4

    Keep it up with the videos man you are a great teacher!

  • @felipediniz2048
    @felipediniz2048 2 года назад +7

    I think is still missing some checks so the game theory works.
    - The seller should have a maximum time to send the package, so the buyer can abort and get the 2*value back if the seller never sends it.
    - Also the buyer should have a maximum time to abort or to confirm received, so the seller can get his 2*value back.

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад

      hey Felipe - those are great ideas to improve this contract, thanks for sharing

    • @osamarizk
      @osamarizk 2 года назад

      i think that in any abort case , either from seller or buyer , the return value(2x) should back to the two(buyer an seller)

  • @yoshikagarner6655
    @yoshikagarner6655 2 года назад +3

    I do have another question for you. What would stop someone from using your basic smart contract in this video as his/her own or adding to it and using it as his/her own? I always wonder if people are using these smart contracts, that are created in these RUclips videos, as their own and getting paid using the work of others...

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад +3

      hi Yoshika, great question. there's nothing stopping anyone from using the code. in fact any smart contract code deployed to the blockchain is completely transparent and visible to anyone. so I think people reuse other's code all the time. however one would still probably want to have a good understanding of smart contract development because they would likely need to tweak the existing code in some way to meet their specific requirements and also to make sure the code works and make sure there are no security vulnerabilities. thanks for asking this!

    • @yoshikagarner6655
      @yoshikagarner6655 2 года назад +1

      @@BlockExplorerMedia, great explanation! I understand better, now. Thank you!

  • @Juwon04
    @Juwon04 2 года назад +1

    Do you have a full course tutorial I can enroll on...maybe something like udemy or so.

  • @Adventure-Story
    @Adventure-Story 2 года назад +1

    hello it is possible to write a contract to return your tokens back if was accidentally send to a scam address?

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад +1

      Unfortunately it's not possible. There's no way to control the funds in the scam wallet (or any wallet) without knowledge of the wallet's private key.

    • @Adventure-Story
      @Adventure-Story 2 года назад

      @@BlockExplorerMedia thanks!

  • @FuturusDao
    @FuturusDao 2 года назад +1

    Curious could you add another fucntion that pays a commission fee to the contract?

  • @kristiangolemi9935
    @kristiangolemi9935 2 года назад +1

    I am trying to implement this safe remote purchase in another scenario. What if the buyer lies that he did not receive the item (but in fact he did receive it), so that he eventually gets the item for free. In my scenario we can not ensure whether he received the item or not. We suppose that there is a function which will return the buyer all of his money back if he does not receive the item. Is there a way we can ensure the truthfulness of the buyer regarding this issue? Thanks in advance.

  • @genabeton
    @genabeton 2 года назад +1

    u `re the best, man. keep going

  • @sreeparnapaul5974
    @sreeparnapaul5974 2 года назад +1

    Can we choose any other function or keyword instead of payable?because when i am converting the abi and bytecode in java ,the converted java code has no option to send or transfer ether,putting value in remix environment and transacting it is easy,but is there any other way if I am using Java for backend?

  • @osamarizk
    @osamarizk 2 года назад +1

    I think that payseller() function should be called automatically after confirmReceived() and no need to have onlySeller modifier , could please confirm? - thank you

    • @yashsolanki069
      @yashsolanki069 2 года назад +2

      This is good but then buyer would be the one who is gonna pay gas fees for seller's amount withdraw, which may not be good practice so just to separate them to pay their own gas fees.

  • @datascience4768
    @datascience4768 2 года назад +1

    thank you for this tutorial
    in this case how seller should know buyers address to send?
    how we can handle that and keep their address hidden from users without access?

  • @felipediniz2048
    @felipediniz2048 2 года назад +1

    Could do a video in automated testing? Could be using this example!

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад +1

      hey Felipe, I'm afraid automated testing isn't my forte, but I'll add this of my list of things to learn.

  • @lordmelbury7174
    @lordmelbury7174 2 года назад +1

    Great tutorial, is this a common method of transaction?
    If it was a very expensive purchase, eg a car, then adding 2x the value as a deposit might make it too expensive to do, or is there some sort of short term loan thing that people use which still ends up cheaper than the traditional legacy trad-fi type of transactions?

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад +1

      Thanks Lord Melbury! yeah your points are valid and putting up 2x the item price is probably not feasible in a lot of cases. maybe at some point oracles will be able to track shipment data...not sure what other solutions might be out there.

    • @amberzhang7097
      @amberzhang7097 2 года назад

      @@BlockExplorerMedia Thanks for your tutorial! What if we set a receiptWindow in the contract? Let's say the receipt window is 14 days. If buyer doesn't confirm receipt of items/request to return items within 14 days, then the contract will automatically send the fund to seller.

    • @avnishbadoni1393
      @avnishbadoni1393 7 месяцев назад

      I think multi step shipment acts as verifiers of the contract delivery in multiple steps. None of the shipment stage has any direct communication with any other parties and just have the next step to proceed with. At every step, a signed validation is added to the contract delivery, allowing for efficient tracking of all the handshakes that occured at each stage. Now if everything happened properly till the end, and the issue occurs at the final stage, every other step of the chain/delivery loop could be exempted from the issue/fraud and can be settled. Localised issue at that individual bit puts the concern at a limited scope of risk.
      Also, limited visibility could also help the concern.
      Timeframes could also be adjusted as per time taken at every stage.

  • @bikechainapp2964
    @bikechainapp2964 2 года назад +1

    Awesome tutorial! It would be cool to do one for a car rental concept based on time parameters.

    • @bikechainapp2964
      @bikechainapp2964 2 года назад +1

      We will pay you to make one like that happen actually :)

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад +1

      That's a really interesting use case - thanks for sharing BikeChainApp!

  • @TheTestimonialAltar
    @TheTestimonialAltar 2 года назад +1

    Hey can u do a mint NFT solidity contacts been stuck 🥺

  • @yoshikagarner6655
    @yoshikagarner6655 2 года назад +5

    Hi! I attempted to reach out to you via LinkedIn a few days ago. I do want to ask if you have any training courses available aside from RUclips...like through your own website or via Udemy or something of that nature? I really enjoy your teaching style. It's very easy to follow and you take time to explain as you go through your smart contracts. That's exactly what I need and how I learn. Please let me know. Thank you and this video was very helpful. I'm learning a lot from your channel. :)

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад +6

      Hey Yoshika, thanks for the invite - we're connected on Linkedin now. I don't have any courses outside of RUclips yet but it's something I'm planning to do hopefully soon. Thanks for the kind words and I'm so glad you're enjoying the tutorials!

    • @mrBayuga
      @mrBayuga 2 года назад +1

      I will also love to be on the list of learners if you start a course.

    • @matteopolleschi7567
      @matteopolleschi7567 2 года назад

      Interesting. Do you have plans for translations?

  • @felipediniz2048
    @felipediniz2048 2 года назад

    Why the confirmedReceived function also doesn't pay the Seller? Why we need another function?

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад +1

      hey Felipe, i think the main reason for keeping them separated is so that the buyer and seller each pay their own gas fees for the transfer of their respective funds.

  • @kr15taffa
    @kr15taffa 2 года назад +1

    Thanks for making this video. Would you mind sharing the source code?

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад

      github.com/jspruance/block-explorer-tutorials/blob/main/smart-contracts/solidity/SafeRemotePurchase.sol

  • @joiker2pen
    @joiker2pen 2 года назад +1

    Very good video (Y)

  • @fawazshak
    @fawazshak Год назад

    Thank u very useful

  • @markndugga4213
    @markndugga4213 2 года назад +1

    github?

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад

      You can find this one here:
      github.com/jspruance/block-explorer-tutorials/blob/main/smart-contracts/solidity/SafeRemotePurchase.sol

  • @tonmoyroy2157
    @tonmoyroy2157 2 года назад

    could I get the source code? please I need the source code.

  • @xTano007x
    @xTano007x 2 года назад

    awesome vid, thank you!

  • @algotrader6912
    @algotrader6912 2 года назад +1

    Yes sir.