Skip to main content
1 of 2
Foxxxey
  • 4.5k
  • 1
  • 7
  • 22

Don't use msg.sender for view functions,

await nftContract.getTokenUnlockableContent(0)

Sets msg.sender to 0 by default. You can specify a from parameter if you want when calling a view functions (which remix does, thats why it works there) but the best option is always to have an address parameter in your function and not rely on msg.sender

Foxxxey
  • 4.5k
  • 1
  • 7
  • 22