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

getAddress('0x1') get 0x0000000000000000000000000000000000000000 #123

Closed
dengxp opened this issue May 16, 2021 · 4 comments
Closed

getAddress('0x1') get 0x0000000000000000000000000000000000000000 #123

dengxp opened this issue May 16, 2021 · 4 comments

Comments

@dengxp
Copy link

dengxp commented May 16, 2021

  const providerContract = new web3.eth.Contract(
    addressProviderABI,
    providerAddress
  );

  providerContract.methods.getAddress("0x1").call()
  .then(address => {
    console.log("protocolDataProviderAddress: ", address);
  })
  .catch(err=> {
    console.error("getAddress Error: ", err);
  });

protocolDataProviderAddress: 0x0000000000000000000000000000000000000000

@nkolchakov
Copy link

Got the same issue using Brownie

@shivgupt
Copy link

shivgupt commented Mar 1, 2022

Try providerContract.methods.getAddress("0x0100000000000000000000000000000000000000000000000000000000000000").call() instead

@shivgupt shivgupt closed this as completed Mar 1, 2022
@ScienceBlocker
Copy link

Got the same issue using Brownie.Me too~~~
Does some one to help us out please.
Always return 0x0000000000000000000000000000000000000000

@risinek
Copy link

risinek commented Aug 23, 2022

I see this kind of unintuitive because it expects different value than what documentation says.
In documentation

Each market has a separate Protocol Data Provider. To get the address for a particular market, call getAddress() using the value 0x1.

0x1 would rather equal to 0x0000000000000000000000000000000000000000000000000000000000000001 padded 32 bytes right? Or am I missing something?

Most significant byte is usually on the left. Unless it is understood as a stream of bytes, then 01 00 00 00 makes sense. Is there some convention how bytes32 type should look like?

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

No branches or pull requests

5 participants