Pass ether(gas) value form Contract(has Ethers), transaction method.?

vipulvipul Member Posts: 5
Hi Team,

I have create one sample contract, and I have fund Ether to this contract, for performing transaction from this contract, we have to pass gas value, I use the contract address to pass ether for transaction.

There is found exception "unlock: account"

and when I pass my primary account address(EOA), It will perform successfull transaction

so any one can help me why this happening.??

Comments

  • jesus666jesus666 Member Posts: 62 ✭✭
    You don't perform transactions "from a contract". You always transact from your account, even if you have a network of contracts making inter-contract calls.

    Hence, you don't need to "fund" your contract, you only need to have ether in your personal account

    Now, "unlock: account" is a separate issue. In order to perform transactions from your account via web3 you first need to "unlock" it. You can do it very easily by running geth with the --unlock primary option and entering the password once prompted
  • oomooomo Member Posts: 31
    I can't find the reference on the forum, but I remember reading somewhere that a contract has an ether balance. Matter of fact, one can even send some ether to a contract instance (I know I have done so successfully). And if so, it should be able to use that ether as the gas for it's transactions. I mean, aren't Ethereum contracts, smart-contracts. What is the purpose of contract having a balance, if I can't use them?
  • mtbitcoinmtbitcoin Member Posts: 40
    oomo said:

    What is the purpose of contract having a balance, if I can't use them?

    These contracts can then send out ether to other accounts

Sign In or Register to comment.