0

I want to sign my contract offline (I have ABI and Bytecode) and then broadcast it to the network. I found this code that is quite good : https://gist.github.com/cicorias/ae88a6012fa6153ed58c5d9c53d7edf0

But I have a this raw transaction :

const rawTx = {
    nonce: nonceHex,
    gasPrice: gasPriceHex,
    gasLimit: gasLimitHex,
    data: contractData,  // <==== this is Bytecode only, no need ABI ?
    from: web3.eth.coinbase
};

I did a contract deploy on Ropsten : https://ropsten.etherscan.io/tx/0x4faf12cd1c7f1a63a23e31dfb1efcdb380a377dbd88e27984f00d56b29059141

In this transaction, you have only "0x + BYTECODE" on data. But the "to" transaction is computed by EVM network.

Can I construct the transaction like that ? Directly with :

const rawTx = {
    nonce: nonce,
    gasPrice: gasPriceHex,
    gasLimit: gasLimitHex,
    data: ByteCode,
    from: myaddress
};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.