Contract Factories2019 Community Moderator ElectionWhat is the BigMap container and why does it matter?Parameter passed when calling CONTRACT in michelsonA contract calling another contractGet a returned value when calling a Michelson contractHow can I deploy a Michelson smart contract?Is there a way to call a function inside a contract from a function in another contract?

Contract Factories

Is "conspicuously missing" or "conspicuously" the subject of this sentence?

Should I tell my boss the work he did was worthless

Was Luke Skywalker the leader of the Rebel forces on Hoth?

Why does liquid water form when we exhale on a mirror?

Reversed Sudoku

Why does the negative sign arise in this thermodynamic relation?

Does the nature of the Apocalypse in The Umbrella Academy change from the first to the last episode?

How can I get players to stop ignoring or overlooking the plot hooks I'm giving them?

Can one live in the U.S. and not use a credit card?

Makefile strange variable substitution

Why would one plane in this picture not have gear down yet?

Are tamper resistant receptacles really safer?

PTIJ: Should I kill my computer after installing software?

Counting all the hearts

NASA's RS-25 Engines shut down time

Declaring and defining template, and specialising them

Definition of Statistic

How to detect if C code (which needs 'extern C') is compiled in C++

Bash script should only kill those instances of another script's that it has launched

What's the "normal" opposite of flautando?

What are actual Tesla M60 models used by AWS?

Are there historical instances of the capital of a colonising country being temporarily or permanently shifted to one of its colonies?

Conservation of Mass and Energy



Contract Factories



2019 Community Moderator ElectionWhat is the BigMap container and why does it matter?Parameter passed when calling CONTRACT in michelsonA contract calling another contractGet a returned value when calling a Michelson contractHow can I deploy a Michelson smart contract?Is there a way to call a function inside a contract from a function in another contract?










4















Has there been any research into how a contract factory might be made in Michelson/Liquidity?



To elaborate, in Solidity a contract factory might look like:



pragma solidity ^0.4.8;

contract Bakery

// index of created contracts

address[] public contracts;

// useful to know the row count in contracts index

function getContractCount()
public
constant
returns(uint contractCount)

return contracts.length;


// deploy a new contract

function newCookie()
public
returns(address newContract)

Cookie c = new Cookie();
contracts.push(c);
return c;




contract Cookie

// suppose the deployed contract has a purpose

function getFlavor()
public
constant
returns (string flavor)

return "mmm ... chocolate chip";




(referenced from https://ethereum.stackexchange.com/questions/13415/deploy-contract-from-contract-in-solidity)



This is a powerful feature in DAPP development, as it allows you to build an object oriented structure for your DAPP where requests can create new contracts. It is a well established design pattern, so what would the equivalent be in the Tezos ecosystem?










share|improve this question






















  • It appears like CREATE_CONTRACT storage 'g ; parameter 'p ; code ... would work, but this will bloat the size of a contract a bit, and it feels like there should be a way to handle this gracefully like in Solidity's Java style class instantiation.

    – Rob
    4 hours ago











  • If not, a clean example in Michelson would be nice.

    – Rob
    4 hours ago












  • ok cool, probably a ways out then.

    – Rob
    4 hours ago






  • 1





    I put a comment that I deleted to convert it into an answer. I missed your comment that was added afterwards. My apologies for this.

    – FFF
    4 hours ago















4















Has there been any research into how a contract factory might be made in Michelson/Liquidity?



To elaborate, in Solidity a contract factory might look like:



pragma solidity ^0.4.8;

contract Bakery

// index of created contracts

address[] public contracts;

// useful to know the row count in contracts index

function getContractCount()
public
constant
returns(uint contractCount)

return contracts.length;


// deploy a new contract

function newCookie()
public
returns(address newContract)

Cookie c = new Cookie();
contracts.push(c);
return c;




contract Cookie

// suppose the deployed contract has a purpose

function getFlavor()
public
constant
returns (string flavor)

return "mmm ... chocolate chip";




(referenced from https://ethereum.stackexchange.com/questions/13415/deploy-contract-from-contract-in-solidity)



This is a powerful feature in DAPP development, as it allows you to build an object oriented structure for your DAPP where requests can create new contracts. It is a well established design pattern, so what would the equivalent be in the Tezos ecosystem?










share|improve this question






















  • It appears like CREATE_CONTRACT storage 'g ; parameter 'p ; code ... would work, but this will bloat the size of a contract a bit, and it feels like there should be a way to handle this gracefully like in Solidity's Java style class instantiation.

    – Rob
    4 hours ago











  • If not, a clean example in Michelson would be nice.

    – Rob
    4 hours ago












  • ok cool, probably a ways out then.

    – Rob
    4 hours ago






  • 1





    I put a comment that I deleted to convert it into an answer. I missed your comment that was added afterwards. My apologies for this.

    – FFF
    4 hours ago













4












4








4


1






Has there been any research into how a contract factory might be made in Michelson/Liquidity?



To elaborate, in Solidity a contract factory might look like:



pragma solidity ^0.4.8;

contract Bakery

// index of created contracts

address[] public contracts;

// useful to know the row count in contracts index

function getContractCount()
public
constant
returns(uint contractCount)

return contracts.length;


// deploy a new contract

function newCookie()
public
returns(address newContract)

Cookie c = new Cookie();
contracts.push(c);
return c;




contract Cookie

// suppose the deployed contract has a purpose

function getFlavor()
public
constant
returns (string flavor)

return "mmm ... chocolate chip";




(referenced from https://ethereum.stackexchange.com/questions/13415/deploy-contract-from-contract-in-solidity)



This is a powerful feature in DAPP development, as it allows you to build an object oriented structure for your DAPP where requests can create new contracts. It is a well established design pattern, so what would the equivalent be in the Tezos ecosystem?










share|improve this question














Has there been any research into how a contract factory might be made in Michelson/Liquidity?



To elaborate, in Solidity a contract factory might look like:



pragma solidity ^0.4.8;

contract Bakery

// index of created contracts

address[] public contracts;

// useful to know the row count in contracts index

function getContractCount()
public
constant
returns(uint contractCount)

return contracts.length;


// deploy a new contract

function newCookie()
public
returns(address newContract)

Cookie c = new Cookie();
contracts.push(c);
return c;




contract Cookie

// suppose the deployed contract has a purpose

function getFlavor()
public
constant
returns (string flavor)

return "mmm ... chocolate chip";




(referenced from https://ethereum.stackexchange.com/questions/13415/deploy-contract-from-contract-in-solidity)



This is a powerful feature in DAPP development, as it allows you to build an object oriented structure for your DAPP where requests can create new contracts. It is a well established design pattern, so what would the equivalent be in the Tezos ecosystem?







michelson






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 4 hours ago









RobRob

2886




2886












  • It appears like CREATE_CONTRACT storage 'g ; parameter 'p ; code ... would work, but this will bloat the size of a contract a bit, and it feels like there should be a way to handle this gracefully like in Solidity's Java style class instantiation.

    – Rob
    4 hours ago











  • If not, a clean example in Michelson would be nice.

    – Rob
    4 hours ago












  • ok cool, probably a ways out then.

    – Rob
    4 hours ago






  • 1





    I put a comment that I deleted to convert it into an answer. I missed your comment that was added afterwards. My apologies for this.

    – FFF
    4 hours ago

















  • It appears like CREATE_CONTRACT storage 'g ; parameter 'p ; code ... would work, but this will bloat the size of a contract a bit, and it feels like there should be a way to handle this gracefully like in Solidity's Java style class instantiation.

    – Rob
    4 hours ago











  • If not, a clean example in Michelson would be nice.

    – Rob
    4 hours ago












  • ok cool, probably a ways out then.

    – Rob
    4 hours ago






  • 1





    I put a comment that I deleted to convert it into an answer. I missed your comment that was added afterwards. My apologies for this.

    – FFF
    4 hours ago
















It appears like CREATE_CONTRACT storage 'g ; parameter 'p ; code ... would work, but this will bloat the size of a contract a bit, and it feels like there should be a way to handle this gracefully like in Solidity's Java style class instantiation.

– Rob
4 hours ago





It appears like CREATE_CONTRACT storage 'g ; parameter 'p ; code ... would work, but this will bloat the size of a contract a bit, and it feels like there should be a way to handle this gracefully like in Solidity's Java style class instantiation.

– Rob
4 hours ago













If not, a clean example in Michelson would be nice.

– Rob
4 hours ago






If not, a clean example in Michelson would be nice.

– Rob
4 hours ago














ok cool, probably a ways out then.

– Rob
4 hours ago





ok cool, probably a ways out then.

– Rob
4 hours ago




1




1





I put a comment that I deleted to convert it into an answer. I missed your comment that was added afterwards. My apologies for this.

– FFF
4 hours ago





I put a comment that I deleted to convert it into an answer. I missed your comment that was added afterwards. My apologies for this.

– FFF
4 hours ago










1 Answer
1






active

oldest

votes


















2














There is a very succinct discussion in the announcement for SmartPy https://medium.com/@SmartPy_io/introducing-smartpy-and-smartpy-io-d4013bee7d4e#15ee.



The idea is to have a contract that holds a big_map and each element of the big_map represents a contract.



This is absolutely not restricted to SmartPy and it is directly doable in Michelson, Liquidity or Fi.



This subject also appeared here:
What is the BigMap container and why does it matter?






share|improve this answer
























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "698"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftezos.stackexchange.com%2fquestions%2f745%2fcontract-factories%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    There is a very succinct discussion in the announcement for SmartPy https://medium.com/@SmartPy_io/introducing-smartpy-and-smartpy-io-d4013bee7d4e#15ee.



    The idea is to have a contract that holds a big_map and each element of the big_map represents a contract.



    This is absolutely not restricted to SmartPy and it is directly doable in Michelson, Liquidity or Fi.



    This subject also appeared here:
    What is the BigMap container and why does it matter?






    share|improve this answer





























      2














      There is a very succinct discussion in the announcement for SmartPy https://medium.com/@SmartPy_io/introducing-smartpy-and-smartpy-io-d4013bee7d4e#15ee.



      The idea is to have a contract that holds a big_map and each element of the big_map represents a contract.



      This is absolutely not restricted to SmartPy and it is directly doable in Michelson, Liquidity or Fi.



      This subject also appeared here:
      What is the BigMap container and why does it matter?






      share|improve this answer



























        2












        2








        2







        There is a very succinct discussion in the announcement for SmartPy https://medium.com/@SmartPy_io/introducing-smartpy-and-smartpy-io-d4013bee7d4e#15ee.



        The idea is to have a contract that holds a big_map and each element of the big_map represents a contract.



        This is absolutely not restricted to SmartPy and it is directly doable in Michelson, Liquidity or Fi.



        This subject also appeared here:
        What is the BigMap container and why does it matter?






        share|improve this answer















        There is a very succinct discussion in the announcement for SmartPy https://medium.com/@SmartPy_io/introducing-smartpy-and-smartpy-io-d4013bee7d4e#15ee.



        The idea is to have a contract that holds a big_map and each element of the big_map represents a contract.



        This is absolutely not restricted to SmartPy and it is directly doable in Michelson, Liquidity or Fi.



        This subject also appeared here:
        What is the BigMap container and why does it matter?







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 4 hours ago

























        answered 4 hours ago









        FFFFFF

        641212




        641212



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Tezos Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftezos.stackexchange.com%2fquestions%2f745%2fcontract-factories%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

            Are there any comparative studies done between Ashtavakra Gita and Buddhim?How is it wrong to believe that a self exists, or that it doesn't?Can you criticise or improve Ven. Bodhi's description of MahayanaWas the doctrine of 'Anatta', accepted as doctrine by modern Buddhism, actually taught by the Buddha?Relationship between Buddhism, Hinduism and Yoga?Comparison of Nirvana, Tao and Brahman/AtmaIs there a distinction between “ego identity” and “craving/hating”?Are there many differences between Taoism and Buddhism?Loss of “faith” in buddhismSimilarity between creation in Abrahamic religions and beginning of life in Earth mentioned Agganna Sutta?Are there studies about the difference between meditating in the morning versus in the evening?Can one follow Hinduism and Buddhism at the same time?Are there any prohibitions on participating in other religion's practices?Psychology of 'flow'

            Eliminatorias de Conmebol para la Copa Mundial de Fútbol de 2006 Índice Tabla de posiciones final Partidos Goleadores Repesca Intercontinental Clasificados Véase también Referencias Enlaces externos Menú de navegación2:0 (1:0)2:2 (2:0)4:1 (2:1)5:0 (2:0)1:2 (1:1)0:3 (0:3)2:1 (1:0)4:0 (2:0)4:1 (1:1)1:0 (1:0)2:1 (1:1)0:1 (0:1)2:1 (1:0)3:0 (0:0)1:1 (0:1)2:1 (0:0)0:1 (0:1)0:01:1 (0:1)3:3 (2:0)0:2 (0:1)1:0 (0:0)0:3 (0:1)0:00:2 (0:2)2:1 (1:1)0:1 (0:0)1:3 (0:2)2:1 (1:0)3:1 (1:0)3:2 (3:0)0:00:05:0 (3:0)1:1 (0:1)1:3 (0:1)1:0 (0:0)3:1 (3:0)1:0 (0:0)0:04:2 (3:0)1:0 (0:0)1:1 (1:0)2:5 (0:2)2:0 (0:0)0:01:1 (1:0)0:00:03:1 (1:1)3:2 (2:1)1:0 (1:0)2:1 (0:0)1:0 (0:0)1:0 (0:0)0:01:1 (0:1)1:2 (0:0)5:2 (2:2)1:0 (0:0)3:1 (2:0)2:1 (1:0)1:0 (0:0)2:2 (1:2)1:1 (0:0)3:1 (2:0)2:0 (0:0)1:1 (0:1)5:0 (1:0)4:1 (2:0)0:03:0 (2:0)2:1 (1:0)3:1 (3:0)4:1 (2:1)1:0 (1:0)4:1 (1:0)1:2 (1:1)5:0 (4:0)3:2 (1:0)0:00:1 (0:0)1:1 (1:0)1:1 (0:1)2:0 (0:0)1:0 (0:0)0:1 (0:1)0:03:0 (1:0)4:1 (3:0)ReporteReporteGoleadores de las Eliminatorias Sudamericanas 2006.Eliminatorias Sudamericanas 2006 - FIFAEliminatorias Sudamericanas 2006 - RSSSF