joshua | Flow (2024-01-24)
If I define an
access(contract)
function in a resource interface, does that mean that only code in the interface's contract can call it or only code in the implementation's contract can call it? or both?8 Replies
I've created a thread for your message. Please continue any relevant discussion in this thread.
You can rename this thread using
/title <new title>
If this is a technical question that others may benefit from, considering also asking it on Stackoverflow: https://stackoverflow.com/questions/ask?tags=onflow-cadenceExample:
I believe its access is scoped to anything in the implementing contract
Nvm I see what you're saying now
thats what I'm assuming. I tried this in the playground, but I got an unexpected error with no error message
so I'm gonna try it somewhere else
actually it looks like both worked
that is kind of strange behavior
feels like it should be either one or the other, not both
I tested it with the init() method that I added to the implementation above
I guess it makes sense if we think of
access(contract)
acts as internal
?
But I agree, it's kind of ambiguouswait a sec, I also added this to the init function:
and it worked. that definitely shouldn't work, right?
If
vault3.burnCallback()
is called from within Impl
, I believe that makes sense
since the method is defined in an inherited interface as access(contract)
oh yeah, you're right. I tried it in a transaction and it didn't work
@jan.6550