Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tax-free value is now available with feedbase inspect #23

Merged
merged 3 commits into from
Aug 6, 2016

Conversation

shayanb
Copy link
Contributor

@shayanb shayanb commented Aug 3, 2016

No description provided.

@nmushegian
Copy link
Member

.sol changes look fine

I see you changed the address and redeployed, but manually edited js_module.js? That is a generated file from dapple build, but you also do have other dapple build updates?

@shayanb
Copy link
Contributor Author

shayanb commented Aug 3, 2016

Oh I see, I changed that for my tests.
does it read the address from build/environments/morden.json?

@shayanb
Copy link
Contributor Author

shayanb commented Aug 3, 2016

@nmushegian So I added the correct testnet address to build/environments/morden.json and everything else seems to be fine for dapple, but I couldn't get dapple to work to test the changes. npm install just stops progressing and sits there.

🍺  npm install -g dapple
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@2.0.1: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue


UPDATE: never mind this issue with dapple installation, it was little snitch blocking one of the requests.

@nmushegian
Copy link
Member

@mhhf @ryepdx ?

@nmushegian
Copy link
Member

I have never worked with build/environments/*. Let's sync on rocket chat

@dbrock
Copy link
Contributor

dbrock commented Aug 6, 2016

So what you do is you first run dapple run deploy/morden.ds -e morden, which deploys the contract and updates the dappfile with the new contract address.

When this is done, you then run dapple build -e morden. This reads the contract address from the dappfile and updates build/environments/morden.json and build/js_module.js.

You never really edit either of these files manually, except maybe to change the version number in the dappfile (although that is actually not used for anything right now).

@dbrock
Copy link
Contributor

dbrock commented Aug 6, 2016

I'll merge this and redeploy

@dbrock dbrock merged commit a849637 into dapphub:master Aug 6, 2016
@dbrock
Copy link
Contributor

dbrock commented Aug 6, 2016

Hmm, I thought of another reason why it may be a good idea after all to make value() just be a wrapper around get() with the constant modifier added: this way even paid feeds can be read for free using feedbase inspect as long as the user would hypothetically be able to make the payment (the payment will be performed and then simply reverted by virtue of the semantics of eth_call).

Of course this means that feedbase.value(123456) will charge on-chain consumers (just like feedbase.get(123456)) if the feed is unpaid, but then again if you don't want that you can always just do the equivalent of feedbase.unpaid(123456) ? 0 : feedbase.value(123456).

Hmm... let me just push the change to show what I mean.

dbrock added a commit that referenced this pull request Aug 6, 2016
(This makes sense to me, I hope you don't think it's bonkers...)
@nmushegian
Copy link
Member

The constant keyword is just a hint, you can eth_call a non-constant function. This just squelches the extra argument in the non-throwing case - the whole point of the pattern is to not hide the implicit failure

@nmushegian
Copy link
Member

see ethereum/EIPs#116 for clarity about how it is not real yet

@dbrock
Copy link
Contributor

dbrock commented Aug 7, 2016

oh... so we could just call get() then to get the value. LOL what are we doing

I didn't realize you could do web3.eth.contract(...).at(...).foo.call(...) to switch to eth_call

ok I'll just remove the value() function then

dbrock added a commit that referenced this pull request Aug 7, 2016
dbrock added a commit that referenced this pull request Aug 7, 2016
dbrock added a commit that referenced this pull request Aug 7, 2016
@shayanb
Copy link
Contributor Author

shayanb commented Aug 8, 2016

@dbrock nice job! everything works like a charm :)

I'm trying to get this value from another smart contract, but I end up with some other values, not sure how to debug this. we can talk on rocket chat about this if you have some ideas.

@dbrock
Copy link
Contributor

dbrock commented Aug 8, 2016

sure, hit me up on rocket chat 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants