2

I have this function on my MultiSigWallet

function submitTransaction(address destination, uint value, bytes data)
    public
    returns (uint transactionId)
{
    transactionId = addTransaction(destination, value, data);
    confirmTransaction(transactionId);
}

I want to use this to send a transaction to another contract and interface with a function. How do I prepare the data field ahead of time to make sure it works?

The idea behind this, is I want to have children contracts owned by this MultiSigWallet where I submit transactions to interact with the child contract which need approval by signers of the multisig.

1
  • can you add, your contracts and web3 code for this. – Anand Kumar Jun 1 '18 at 11:19
2

Figured out how to do it!

Using web3 and having the contract ABI.

var MyContract = web3.eth.contract(abi);

var myCallData = myContractInstance.myMethod.getData(param1 [, param2, ...]);

You can then use the myCallData as a parameter passed to the submitTransaction function on the multisig contract.

Your Answer

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

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