Can a public function be called from another contract? When add an interface for Contract A within Contract B, it says function calls from made within B from the Contract A Interface must be declared external

Mar 17, 2021, 8:14 PM
public is both external and internal
Mar 17, 2021, 8:16 PM
Yeah! I thought so, that's why I'm confused to why Remix wont let me interface a public function from contract A to contract B
Mar 17, 2021, 8:17 PM
modifiers are always internal, and modifers can't be in interfaces anyway
I'm having difficulties finding proper documentation on where modifiers can be declared, but I don't think you can declare them (well, their signature) in interfaces.
how is that related to modifiers? or are we mixing up the two uses of the term: visibility modifier (external, internal, ...) and the modifier keyword? I guess we are :)
great, settled ;)
Mar 17, 2021, 8:26 PM
anyway to answer you question, just put the visibility modifier as external when declaring interface for contract A inside contract B
Mar 17, 2021, 8:28 PM
This is what I mean
So even if the function inside contract A is public I declare it as external when I cull it in the interface
Mar 17, 2021, 8:28 PM
yep
Mar 17, 2021, 8:29 PM
Thank you! I thought they had to match. Learned something today
Mar 17, 2021, 8:29 PM
well don't listen to events. listen to new transactions. and it would be better suited for you if you're tracking one ( or a couple) pairs, that you listen to those pairs only
Filter out the noise
Mar 17, 2021, 8:34 PM

© 2024 Draquery.com All rights reserved.