Hi I got this code from 0xProject Exchange.sol


Quote: "TokenContract(contract_address).balanceOf.gas(gas_limit)(target_account_address); // Limit gas to prevent reentrancy"

Could you explain what syntax this is: ".gas(gas_limit)(target_account_address)" ?

Thank you


That means


But the address that is calling this line will get gas limit by inserting .gas(gas_limit) after balanceOf

because The called token contract may attempt to change state, but will not be able to due to an added gas limit.

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.