I would like to automatically after an event occurs to withdraw an amount of money from a certain ethereum address and keep the money with the contract. How can I do this? Any hint is appreciated.
I tried calling an internal payable function from my contract POD_PhysicalItems:
Here is how I call it, sender is an ethereum address defined in the constructor, but there is an error at the line below Type error Member "value" not found or not visible after argument dependent look up in the function address:
POD_PhysicalItems.withdrawAgreedUponCollateral.value(2*itemPrice)(sender);
This is the function:
function withdrawAgreedUponCollateral(address entityAddress) payable internal {
require(state == contractState.DoneVerificationofTerms);
collateralWithdrawnSuccessfully("Double deposit is withdrawn successfully from: ", entityAddress);
}
entityAddress
? Do i understand correctly?entityAddress
is the same address as the sender, you don't need the argument because you can just referencemsg.sender
. I answered a similar question here, lemme know if this helps: ethereum.stackexchange.com/questions/43022/…