0

I have setup a multisig contract using the standard Wallet Contract and have been interacting with it on my geth console successfully as per the Mist Wallet Contract wiki entry.

So far I've been able to successfully call "execute" and "confirm" on the contract via the console. However, I now want to do this completely offline.

My code currently does the following:

var myAddress = "0xContractAddress";
var myContract = eth.contract("contractABI_here");
var myInstance = myContract.at(myAddress);
toAddress = "0xDestinationAccount";
amtGas = 100000;
requestAddress = "0xSigner1Address";
requestAddressNonce = someNonce; // Get the correct nonce
valueWithdrawn = web3.toWei(someValue, "ether");
personal.unlockAccount(requestAddress)
myInstance.execute(toAddress, valueWithdrawn, "", { from: requestAddress, gas: amtGas, nonce: requestAddressNonce } );

However, that last instruction returns in an off-line, unsynced node:

Error: exceeds block gas limit

If I set amtGas to less than 5001 then it returns in the offline node:

Error: insufficient funds for gas * price + value

I saw people had a similar problem when signing regular transactions and this stackexchange post suggests to use signTransaction but I can't figure out how to sign the transaction generated by myInstance.execute(....)

Your help would be much appreciated!

1

OK, I believe I have found the answer.

You can call getData and then use that as an input to sign the transaction:

data = myInstance.execute.getData(toAddress, valueWithdrawn, "" );
eth.signTransaction({ from: requestAddress, gas: amtGas, nonce: requestAddressNonce, data: data })

You can then grab the "raw" output, copy it to an online machine, and call sendRawTransaction on it.

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.