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. Jun 1, 2018 at 11:19

1 Answer 1

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 and acknowledge you have read our privacy policy.

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