hi, i need to transfer ether from smartcontract A to smartcontract B, but solidity requires reciever contract B to be payable. how can i transfer ether from A to B and pay gas fees obnly from A balance, because B has 0 balance ?

Feb 6, 2022, 7:59 AM
A receiver doesn’t pay gas. Also, the gas is paid by a caller and not the sc
Feb 6, 2022, 8:35 AM
but transaction fails, because reciever smartcontract has not gas…
could u show me a code example, where ether transfers between 2 smartcontracts?
Feb 6, 2022, 8:38 AM
yep, gas paid by caller not receiver
Feb 6, 2022, 8:44 AM
There must be something else. Is the called function payable?
Feb 6, 2022, 8:45 AM
If a contract doesnt have payable function, it cannot recieve any ether or other tokens
And reciever doesnt pay gas already
Feb 6, 2022, 8:46 AM

© 2024 Draquery.com All rights reserved.