[Ethereum] I created a wallet contract, sent ether to it and now cannot send to another account

contract-invocationethereum-wallet-dappmisttransactionswallets

While experimenting. I creating a wallet contract. Here is the address: https://etherscan.io/address/0xC23501aB1E8E5C5EDB0fFA83C5A4DcFb9c31a355 I sent some ether to it. Now I want to send the ether from the wallet contract to a different account. I go to send, I input amount, check the gas, when I press send. The amount shows 0. I think I did something wrong with the creation of the wallet contract in Mist.

Best Answer

I prefer to use geth rather than mist to interact with contracts. The command line lets you do exactly what you intend vs working through a GUI.

The first thing you need is the contract ABI. This is a piece of javascript (or JSON) which defines how you can interact with the contract. Every contract on the blockchain has one -- a simple greeter contract, Etheria, the DAO... all of them.

To get the abi, paste your contract code into a compiler e.g. https://ethereum.github.io/browser-solidity/.

This "endowment retriever" contract may be similar to what you're trying to do. When compiled, its abi is revealed to be:

[{"constant":false,"inputs":[],"name":"kill","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"getContractCreationValue","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"sendOneEtherHome","outputs":[],"type":"function"},{"inputs":[],"type":"constructor"}]

Compile your contract and you'll get something that looks similar. (The above code will not work for your contract.)

Now that you have the ABI and the contract address, you’re ready to gain interactive access to the contract with geth.

var abi = <cut and paste the contract abi here>;
var contract = web3.eth.contract(abi).at(<contract address>);
contract.functionname();
contract.functionname.sendTransaction(...);

Hopefully the contract from which you're trying to retrieve funds contains a method for retrieving the ether and you have permission to do so. In my "endowment retriever" example, you'd do:

var tx = endowmentretriever.sendOneEtherHome.sendTransaction({from:eth.coinbase});

If you post the entire contract (use a gist, probably), I might be able to help further and/or determine if retrieval is even possible.

Good luck!