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?

Distinction between apt-cache and dpkg -l

Is it possible to avoid unpacking when merging Association?

What's the "normal" opposite of flautando?

Makefile strange variable substitution

meaning and function of 幸 in "则幸分我一杯羹"

How can The Temple of Elementary Evil reliably protect itself against kinetic bombardment?

What wound would be of little consequence to a biped but terrible for a quadruped?

Word for a person who has no opinion about whether god exists

If I receive an SOS signal, what is the proper response?

Can I pump my MTB tire to max (55 psi / 380 kPa) without the tube inside bursting?

Accepted offer letter, position changed

List elements digit difference sort

Counting all the hearts

Contract Factories

Examples of a statistic that is not independent of sample's distribution?

How can I ensure my trip to the UK will not have to be cancelled because of Brexit?

PTIJ: Should I kill my computer after installing software?

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

Why does the negative sign arise in this thermodynamic relation?

UART pins to unpowered MCU?

How do I express some one as a black person?

Motivation for Zeta Function of an Algebraic Variety

How did Alan Turing break the enigma code using the hint given by the lady in the bar?

What are actual Tesla M60 models used by AWS?



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
    3 hours ago











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

    – Rob
    3 hours ago












  • ok cool, probably a ways out then.

    – Rob
    3 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
    3 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
    3 hours ago











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

    – Rob
    3 hours ago












  • ok cool, probably a ways out then.

    – Rob
    3 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
    3 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

2885




2885












  • 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
    3 hours ago











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

    – Rob
    3 hours ago












  • ok cool, probably a ways out then.

    – Rob
    3 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
    3 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
    3 hours ago











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

    – Rob
    3 hours ago












  • ok cool, probably a ways out then.

    – Rob
    3 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
    3 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
3 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
3 hours ago













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

– Rob
3 hours ago






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

– Rob
3 hours ago














ok cool, probably a ways out then.

– Rob
3 hours ago





ok cool, probably a ways out then.

– Rob
3 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
3 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
3 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 3 hours ago

























        answered 3 hours ago









        FFFFFF

        636212




        636212



























            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

            Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

            Lioubotyn Sommaire Géographie | Histoire | Population | Notes et références | Liens externes | Menu de navigationlubotin.kharkov.uamodifier« Recensements et estimations de la population depuis 1897 »« Office des statistiques d'Ukraine : population au 1er janvier 2010, 2011 et 2012 »« Office des statistiques d'Ukraine : population au 1er janvier 2011, 2012 et 2013 »Informations officiellesCartes topographiquesCarte routièrem

            Mpande kaSenzangakhona Biographie | Références | Menu de navigationmodifierMpande kaSenzangakhonavoir la liste des auteursm