-
Notifications
You must be signed in to change notification settings - Fork 215
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
Unable to do the CPI to Orca whirlpool program after obtaining its interface via solang #1610
Comments
Notes:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
We are unable to correctly finalize the call to the Orca whirlpool program fork after we have obtained the whirlpool interface via the
solang idl whirlpool.json
command.When doing the CPI, we have tried to analyze how the whirlpool SDK calls the needed function, and the assembled data seem to match with what we have passed into the function.
In brief, the CPI we are calling is this one:
https://github.com/valory-xyz/autonolas-tokenomics-solana/blob/a1676ba93a7da2f0da44d32647752b76ac8ae1ae/solidity/nft_token.sol#L207-L224
The
solana idl
-obtained whirlpool interface is located here:https://github.com/valory-xyz/autonolas-tokenomics-solana/blob/integration/solidity/interfaces/whirlpool.sol
The originating script code is located here:
https://github.com/valory-xyz/autonolas-tokenomics-solana/blob/a1676ba93a7da2f0da44d32647752b76ac8ae1ae/tests/nft_token.ts#L328-L362
To Reproduce
Steps to reproduce the behavior:
'Program GUGGHzwC8wEKY3g7QS38YmoS8t5Q2faWAGAfxDK2bXbb failed: Access violation in unknown section at address 0xa of size 32'
errorPlease read the main README in order to reproduce the exact behavior:
https://github.com/valory-xyz/autonolas-tokenomics-solana/tree/integration
In order to see the expected behavior, the following lines can be uncommented:
https://github.com/valory-xyz/autonolas-tokenomics-solana/blob/a1676ba93a7da2f0da44d32647752b76ac8ae1ae/tests/nft_token.ts#L227-L260
When calling the decreaseLiquidity() function via the whirlpool SDK, we are seeing the following data formed:
We can then state that the decreaseLiquidity() selector is correctly created by the
solang idl whirlpool.json
execution as it matches here:https://github.com/valory-xyz/autonolas-tokenomics-solana/blob/a1676ba93a7da2f0da44d32647752b76ac8ae1ae/solidity/interfaces/whirlpool.sol#L192-L193
We have also tried to just encode the data into the set of bytes to follow the SDK output, and those lines are listed here:
https://github.com/valory-xyz/autonolas-tokenomics-solana/blob/a1676ba93a7da2f0da44d32647752b76ac8ae1ae/solidity/nft_token.sol#L221-L223
However, we've got the same error result.
Expected behavior
We expected the decreaseLiquidity() function to complete and essentially decrease the liquidity of our LP token.
Screenshots
Seeing behavior
Expected behavior:
Hyperledger Solang version
Version of Solang (v0.3.3)
Version of Solana (solana-cli 1.17.7 (src:fca44b78; feat:3073089885, client:SolanaLabs))
Version of Anchor (anchor-cli 0.29.0)
Include the complete solidity source code
The code is located here: https://github.com/valory-xyz/autonolas-tokenomics-solana/tree/integration
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: