2

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 1

4

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.

2
  • 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.
    – cmadh
    Commented Apr 26, 2019 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.