[Ethereum] Passing constructor arguments while deploying contract from byte code

constructorcontract-deploymentmyetherwallet

I am trying to deploy a contract via MyEtherWallet from byte code generated by browser-solidity. I unlocked my wallet using private key,but I didn't find any way of passing parameters to contract's constructor. How can I do that?

This makes me doubt whether I will be able to call all functions of my contract from MyEtherWallet as I was able to do using Mist.
I am using MyEtherWallet as substitue to Mist because it saves me from downloading blockchain data.But not sure whether this will work as substitue of Mist for deploying and accessing contracts.

Edit 1: Even on deploying contract from Mist using byte code doesn't give any option to choose for a contact and pass parameters to contract. While deploying contract from source code works as good as expected.

Best Answer

If you look at Web3's documentation, you can get the full deployment bytecode with:

var bytecodeWithParam = MyContract.new.getData(
    param1,
    param2,
    { data: compiledByteCode });

It is this bytecodeWithParam that you paste into the "Byte Code" field. If you look at it in detail, you will see param1 and param2 32-byte packed at the end.

Related Topic