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

Feature request: Traverse callstack #501

Open
jonas089 opened this issue Jul 10, 2024 · 0 comments
Open

Feature request: Traverse callstack #501

jonas089 opened this issue Jul 10, 2024 · 0 comments

Comments

@jonas089
Copy link

I would like to request a feature to expand env::caller() by env::nth_caller() or eq.

There are use cases (such as the burn function of a Stablecoin) where I would like to be able to match the immediate caller and depending on the result traverse the callstack further to get the user's account.

Example call stack

User -> Burn Contract -> Stablecoin Contract

If the Burn Contract is the immediate caller of the Stablecoin Contract, then tokens are burned from the Stablecoin Contract's account.

If the immediate caller is anything but the Burn Contract, then I would like to burn from the User's account. Therefore I need to traverse the callstack by n-2, not n-1.

Thanks for considering this feature request.\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 Discuss
Development

No branches or pull requests

1 participant