diff --git a/oraclizeAPI_0.4.25.sol b/oraclizeAPI_0.4.25.sol index 1c8fc0e..f1dd4e1 100755 --- a/oraclizeAPI_0.4.25.sol +++ b/oraclizeAPI_0.4.25.sol @@ -4667,6 +4667,27 @@ contract usingOraclize { return oraclize.queryCached.value(_queryPrice)(); } + function oraclize_token_queryCached(uint256 _queryPrice) + oraclizeAPI + internal + returns (bytes32 _queryId) + { + settleERC20Payment(_queryPrice); + return oraclize.queryCached(); + } + + function settleERC20Payment(uint256 _queryPriceInEth) + private + { + address tokenAddress = oraclize + .addressCustomPaymentToken(address(this)); + ERC20Interface(tokenAddress) + .transfer( + address(oraclize), + oraclize.convertToERC20Price(_queryPriceInEth, tokenAddress) + ); + } + function oraclize_getDatasourceByte( string memory _datasourceString )