How to construct deployable bytecode from runtime bytecode?

by hellopeach   Last Updated August 13, 2019 06:28 AM - source

For example I want to redeploy/clone a contract to another address but don't have the original source code, so I only have the runtime bytecode stored on the blockchain. If I try to deploy the runtime bytecode directly, it will result in a failure. So is there any way to construct valid deployable bytecode from runtime bytecode, so that the exact same contract code can be deployed/cloned to another address?

I'm not looking to deploy a forwarder proxy, I know how to do that in both solidity assembly and vyper, what I need is to deploy the exact same runtime bytecode to a new address without the original source code. Thanks.

Related Questions

Can the CALL opcode be used to create a contract?

Updated November 17, 2017 04:28 AM

Deploying a smart contract with just bytecode

Updated November 08, 2017 11:28 AM

"queue limit" error

Updated April 16, 2018 15:28 PM

Deploying contract using byteCode

Updated May 16, 2019 14:28 PM

How to call ecrecover() in pure assembly?

Updated September 30, 2019 03:28 AM