provable-things / ethereum-api

Provable API for Ethereum smart contracts
https://docs.provable.xyz/#ethereum
MIT License
801 stars 427 forks source link

How to reset and re-enter variables made by oraclize? #63

Closed ingyunson closed 6 years ago

ingyunson commented 6 years ago

Hello guys. I tried to make token network using oraclize to give token by youtube view count.

https://github.com/ingyunson/token-transfer-using-orzclize/blob/5197e34ecd2a41d8694202c01d3a4ac8c0a9c5f0/youtube_viewcount.sol#L49

In my code, it works when it deployed on the first time. After run the function YoutubeViews, I cannot reset and re-enter new information using same function.

When I remarked oraclize part(which are line 49 and 50), it works well so I think the problem from my oraclize lines.

If someone knows about this, please help me.

Sincery.

D-Nice commented 6 years ago

From my understanding you are able to call YoutubeViews only a single time when Oraclize is present? With default parameters (gasPrice + gasLimit), the first oraclize query is free, any second or subsequent query requires a sufficient ether balance in the contract to pay for it. Same goes for testnet or privatenet networks, you just need to place the test Ether in the contract and you can keep calling the function without it throwing an exception or reverting.

ingyunson commented 6 years ago

I got the point The problem solved, thanks!