GlassEaters / hydra

Collective account pooling, fan out wallet, dao treasury
hydra-dox.vercel.app
GNU General Public License v3.0
67 stars 28 forks source link

No Support for wSOL for Distribution #29

Open TheCurryMan opened 2 years ago

TheCurryMan commented 2 years ago

Hydra currently does not support adding wSOL as an SPL token when calling initializeForFanoutMint. The function violates a raw constraint on the method.

Upon further research, the constraint in question can be found here: constraint = mint_holding_account.is_native() == false,

The issue is that wSOL is an SPL token, but also considered a native token. The associated token account created violated this constraint. Is there a way we can modify or remove this constraint to support wSOL?

staccDOTsol commented 2 years ago

We accept any and all PRs and then the team can review and merge what they will.

Bias: I am regular contributor && also not team.

jpbogle commented 2 years ago

@staccDOTsol do you see any reason removing the constraint for is_native() would be unsafe or why that constraint was ever desired? also who manages deployment of the program / how is upgrade authority managed

staccDOTsol commented 2 years ago

No not really, it may be worth it? I'm unsure the reasoning whether or not there's a security concern or if it may have been an oversight.

You're aware you can send actual sol to the hodlingAccount? Is there a requirement for WSOL?

Afaik @austbot deploys it

jpbogle commented 2 years ago

You're aware you can send actual sol to the hodlingAccount? Is there a requirement for WSOL?

ya ofc but the use case is sending wSOL from another program which handles SPL tokens

staccDOTsol commented 2 years ago

well if you doing it anyways why not unwrap?

is it at scale and therein costly for negligible fees?

... which other program lol

jpbogle commented 2 years ago

well if you doing it anyways why not unwrap?

There is no real reason to overcomplicate most programs to handle both native and wSOL, it should be handled by adding other instructions to the transaction to wrap/unwrap client side. Fees dont matter since its just more instructions in the same transaction

other programs include -> https://github.com/cardinal-labs/cardinal-token-manager and others

staccDOTsol commented 2 years ago

Sorry if the solution is js sdk then that's a much easier potential merge for @austbot whenever he's awake and not swamped with the work of a dozen devs :)

can't speak for him tho