You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose I have Contract A, and inside its constructor I initialize certain objects/resources and transfer them to the deployer (signer) during deployment. Later on, in one of Contract A’s functions (not the constructor), I want to borrow those objects immutably. However, this time the caller is not the deployer but some other address.
My concern is: since those objects were moved to the deployer at deployment, do I need to explicitly know the deployer’s address in order to access/borrow them later? If so, is there a way to retrieve the deployer’s address inside the contract when the deployer is not the current caller? Or alternatively, is there a better design pattern to handle this scenario so I can reliably borrow those objects regardless of who calls the function?
What error, if any, are you getting?
No response
What have you tried or looked at? Or how can we reproduce the error?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Discord user ID
No response
Describe your question in detail.
Suppose I have Contract A, and inside its constructor I initialize certain objects/resources and transfer them to the deployer (signer) during deployment. Later on, in one of Contract A’s functions (not the constructor), I want to borrow those objects immutably. However, this time the caller is not the deployer but some other address.
My concern is: since those objects were moved to the deployer at deployment, do I need to explicitly know the deployer’s address in order to access/borrow them later? If so, is there a way to retrieve the deployer’s address inside the contract when the deployer is not the current caller? Or alternatively, is there a better design pattern to handle this scenario so I can reliably borrow those objects regardless of who calls the function?
What error, if any, are you getting?
No response
What have you tried or looked at? Or how can we reproduce the error?
No response
Which operating system are you using?
Linux (Ubuntu, Fedora, Windows WSL, etc.)
Which SDK or tool are you using? (if any)
N/A
Describe your environment or tooling in detail
No response
Beta Was this translation helpful? Give feedback.
All reactions