1

If smart contract A has a balance of 1 ETH, can I call a payable function on Contract B, from a function in Contract A, with a msg.value that would be effectively withdrawn from the balance of smart contract A? As opposed to calling from EOA.

marked as duplicate by Lauri Peltonen, Achala Dissanayake, Richard Horrocks, Aquila, flygoing Oct 16 '18 at 12:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

The general syntax for calling a function in another contract with arguments and sending funds is: address.func.value(amount)(arg1, arg2, arg3)

From How can you call a payable function in another contract with arguments and send funds?, which is a duplicate of this question.

Please research your topic a bit more (for example I searched up 'solidity call function payable') before posting; many times you can find your question already on stack overflow.

Welcome to Ethereum Stack Overflow!

  • thank you for your response and maybe I should have phrased better/more specifically. I was asking if you could simply "fund" contract B with some sufficient balance of ether that would satisfy the needs of the payable function in Contract B. In this case, the payable function in B needs a value to satisfy oraclize query fee. So maybe the better questions is, will the oraclize auto-deduct its fee from the calling contract balance (contract B)? – Chadd Bennett Oct 17 '18 at 18:14

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