Add constant public function to read feed value that throws if there is a payment token
- Dominant language
- Makefile
- Stars
- 33
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
**shayan 8:43 PM**
I'm trying to get my head around how feedbase works. one main thing now is so when we publish a value, how can we read it. as it says on the documentation `inspect` does not show the value. I tried using the ABI in the `js_module.js` but apparently with that geth doesnt let me call the variables/functions. so how would this work?
I have this feedbase on morden
```
{
"id": 15,
"token": "0x0000000000000000000000000000000000000000",
"owner": "0x9172aa9636dc7941a23e72c5d9a43d2e06f5fd01",
"label": "BTCUSD",
"price": "0x0",
"timestamp": 1470249594,
"expiration": 1471249558,
"unpaid": false
}
```
**dbrock 8:43 PM**
it's a little bit annoying to read directly from storage from javascript
and we can't expose the value as a regular public constant function as that would defeat the purpose of the fee...
I've been asking around various solidity and ethereum developer forums but nobody seems to have a great solution for this yet
I actually got the impression that most people never even considered it yet
I guess we could add a public function to read the value that would just throw if there is a payment token though
that's probably a good idea
**shayan 8:46 PM**
hmm... let's say no fee for now, then I guess I should modify feedbase.sol and remove most of the erc20 requirements, and maybe make the variables public. but not sure that would actually solve anything here.
yeah that would be a better idea
**dbrock 8:48 PM**
yeah, cool, I agree. I'll create an issue and add this in the next day or so if you don't beat me to it
**shayan 8:49 PM**
great, I'd try to get it to work as is and if I get the time today I'll do a pull request with the public function
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading feedbase.sol and the existing documentation around inspect, then trace how payment tokens and feed values are stored and exposed through the ABI. The change is complete when callers can read a feed value through a public function while calls for feeds with a payment token throw, with the behavior verified on the relevant deployment or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100