2

confused on input after call is made

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

1
  • Please, the next time include the code as text. Also you could paste the whole input.
    – Ismael
    Commented Aug 10, 2022 at 4:40

3 Answers 3

0

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

0

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.

0

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.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.