Bitcoin Forum
May 08, 2024, 10:36:39 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Can 1 smart contract perform multiple functions or is new contract needed for...  (Read 67 times)
MeSoCorny (OP)
Jr. Member
*
Offline Offline

Activity: 48
Merit: 2


View Profile
March 25, 2018, 07:57:18 PM
 #1

Can 1 smart contract perform multiple functions or is new contract needed for multiple tasks? For instance, let's say I built en eCommerce store that sold pre-made Wordpress Themes, a digital product. Can I setup just one smart contract that dispenses different themes at different prices or do I need a new contract for every different item, or at the very least, every different priced item? Can the contracts be set to be recurring or do they auto void after one use? I'm kind of researching a lot of this as I go so I may be ignorant in my understanding in how it all works at all and my questions may not even make sense.

“What separates the winners from the losers is how a person reacts to each new twist of fate.”
The forum was founded in 2009 by Satoshi and Sirius. It replaced a SourceForge forum.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
XinXan
Hero Member
*****
Offline Offline

Activity: 1064
Merit: 505


View Profile
March 25, 2018, 11:23:01 PM
 #2

You wouldn't need to display the different themes in the contract itself. You would make your website communicate with the smart contract and then payments come in. Better explained here: https://gist.github.com/Zuchos/082b37c687c38f13a5d15e8f88579d00

It's basically a small ''tutorial'' on how to do what you are basically asking for.
MeSoCorny (OP)
Jr. Member
*
Offline Offline

Activity: 48
Merit: 2


View Profile
March 25, 2018, 11:56:54 PM
 #3

You wouldn't need to display the different themes in the contract itself. You would make your website communicate with the smart contract and then payments come in. Better explained here: https://gist.github.com/Zuchos/082b37c687c38f13a5d15e8f88579d00

It's basically a small ''tutorial'' on how to do what you are basically asking for.

Oh sweet thank you!

“What separates the winners from the losers is how a person reacts to each new twist of fate.”
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!