Ethereum has a opportunity to create new contract from another. Does eosio has the same? I found a code with new account creation, but I didn't find nothing about setting code and abi from contract.
1 Answer
You can call eosio::setcode and eosio::setabi as inline-action to external contract or deferred-action and set code and abi of a contract you have the necessary permissions for, from within your contract.
-
The contract would have to have access to the compiled code it is deploying then, no? In other words, can you point to an already deployed contract and say "deploy that to my contract address"? Commented Apr 26, 2019 at 5:39
-
There is no way to retrieve source code of a contract deployed on chain unless the contract has an action in it to retrieve a copy of its own code.– cmadhCommented Apr 26, 2019 at 14:39