1

Hi I got this code from 0xProject Exchange.sol

https://0xproject.com/wiki#Deployed-Addresses:

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

1

That means

TokenContract(contract_address).balanceOf(target_account_address);

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.