after deploying this contract on rinkeby it uses a bit of gas to get onto the network, when i use the call function the gas denomination leaves and there is another input that is not clear to me it is the 0x8e1...5f473
3 Answers
There is no input needed besides the aggregator contract address. Which in your screenshot is pointed at ETHUSD. The answer is even displayed in your screenshot "170008744161" = 1700.087usd
The first 4 bytes of the input are the function id 0x8e15f473.
Searching in the Ethereum Signature Database it correspond to
getLatestPrice()
Which makes sense because that's the function you are calling.
I assume you're referring to the value of the input
field in the output showing in your remix console here.
The input is the hash of the function - this is how the bytecode of your function looks (after encoding to hexadecimal).
In addition to Ismael's answer, you should keep in mind that when you compile your contract the whole things gets converted to bytecode to deploy on chain.
The function signature getLatestPrice()
, when hashed, looks like 8e15f473
.
You can check this yourself in Remix.
Go to the "compiler" button on the left panel. Then make sure you choose the right contract from the CONTRACT
dropdown. Hit the Compile button.
Then down the bottom of that panel click the button Compilation Details
.
You'll see a window pop up that has your contract name on top (make sure its the right contract!).
scroll down and you'll see something called Function Hashes
. Expand that
and you'll see an object with that same hash in it, and it tells you which function it maps to.