If contract a was to call one or more contracts when running it, would the gas cost be the sum of both contract's gas cost?


Yes, plus the cost for calling the other contract(s). Basically it's the sum of whatever gas was used in the execution until the call finally exits your original contract's original function.

You always need to be careful when calling contracts not written by you as they may contain all sorts of vulnerabilities which may drain your gas and cause whole transaction to be reverted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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