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

How to execute the 'new" function to create the strategy object? #8

Open
Jarekkkkk opened this issue May 22, 2024 · 1 comment
Open

Comments

@Jarekkkkk
Copy link

Hello,

i noticed a new function in some contracts, like scallop_whusdte.move, that requires creating the shared strategy object . The function has been assigned the entry modifier and friend visibility but doesn't introduced with any friend package declaration, may i ask what the purpose of this pattern is?

example code: https://github.com/kunalabs-io/sui-smart-contracts/blob/8151c3690a2f60276b4d38b02dfc53650ae898ee/kai-finance/sources/scallop_whusdte.move#L84C30-L84C33

@kklas
Copy link
Contributor

kklas commented May 23, 2024

Indeed, friend visibility doesn't achieve anything in this case and can be removed. I had it like this originally because I was planning to create strategies from other modules within the package but changed the approach since. The funciton is private for better upgradeability.

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

No branches or pull requests

2 participants