From 83ca9d119a56009401544a9eafa1732895c82409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enol=20=C3=81lvarez?= Date: Mon, 9 Dec 2024 12:22:41 +0100 Subject: [PATCH] Add more test cases to Sol Anchor --- tests/integration_test.go | 28 ++++++++++++++++++++++++ tests/sol-anchor/bonkswap.json | 9 ++++++++ tests/sol-anchor/jupiter-governance.json | 9 ++++++++ tests/sol-anchor/jupiter-staking.json | 9 ++++++++ tests/sol-anchor/lifinity.json | 9 ++++++++ tests/sol-anchor/oasis.json | 9 ++++++++ tests/sol-anchor/raydium-cp-swap.json | 9 ++++++++ tests/sol-anchor/sanctum.json | 9 ++++++++ 8 files changed, 91 insertions(+) create mode 100644 tests/sol-anchor/bonkswap.json create mode 100644 tests/sol-anchor/jupiter-governance.json create mode 100644 tests/sol-anchor/jupiter-staking.json create mode 100644 tests/sol-anchor/lifinity.json create mode 100644 tests/sol-anchor/oasis.json create mode 100644 tests/sol-anchor/raydium-cp-swap.json create mode 100644 tests/sol-anchor/sanctum.json diff --git a/tests/integration_test.go b/tests/integration_test.go index d7e248b..e3ab027 100644 --- a/tests/integration_test.go +++ b/tests/integration_test.go @@ -81,6 +81,34 @@ func TestIntegration(t *testing.T) { name: "sol-anchor-pump-fun", stateFile: "./sol-anchor/pump-fun.json", }, + { + name: "sol-anchor-jupiter-governance", + stateFile: "./sol-anchor/jupiter-governance.json", + }, + { + name: "sol-anchor-jupiter-staking", + stateFile: "./sol-anchor/jupiter-staking.json", + }, + { + name: "sol-anchor-raydium-cp-swap.json", + stateFile: "./sol-anchor/raydium-cp-swap.json", + }, + { + name: "sol-anchor-oasis.json", + stateFile: "./sol-anchor/oasis.json", + }, + { + name: "sol-anchor-lifinity.json", + stateFile: "./sol-anchor/lifinity.json", + }, + { + name: "sol-anchor-bonkswap.json", + stateFile: "./sol-anchor/bonkswap.json", + }, + { + name: "sol-anchor-sanctum.json", + stateFile: "./sol-anchor/sanctum.json", + }, } var zlog, _ = logging.RootLogger("test", "test") diff --git a/tests/sol-anchor/bonkswap.json b/tests/sol-anchor/bonkswap.json new file mode 100644 index 0000000..d3373b1 --- /dev/null +++ b/tests/sol-anchor/bonkswap.json @@ -0,0 +1,9 @@ +{ + "generator": "sol-anchor-beta", + "state": { + "name": "my_project", + "chainName": "solana-mainnet", + "initialBlockSet": true, + "idlString": "{ \"version\": \"0.1.1\", \"name\": \"bonkswap\", \"metadata\": { \"address\": \"BSwp6bEBihVLdqJRKGgzjcGLHkcTuzmSo1TQkHepzH8p\" }, \"instructions\": [ { \"name\": \"createPool\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"adminXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"projectOwner\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"lpFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"buybackFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"projectFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"mercantiFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"initialTokenX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"initialTokenY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"bump\", \"type\": \"u8\" } ] }, { \"name\": \"createProvider\", \"accounts\": [ { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapfarmv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" } ] } }, { \"name\": \"provider\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapproviderv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"path\": \"owner\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"owner\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"tokenXAmount\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"tokenYAmount\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"bump\", \"type\": \"u8\" } ] }, { \"name\": \"createState\", \"accounts\": [ { \"name\": \"state\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"nonce\", \"type\": \"u8\" } ] }, { \"name\": \"addTokens\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapfarmv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" } ] } }, { \"name\": \"provider\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapproviderv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"path\": \"owner\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirst\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecond\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"owner\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"deltaX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"deltaY\", \"type\": { \"defined\": \"Token\" } } ] }, { \"name\": \"withdrawBuyback\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"buybackXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"buybackYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"swap\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"swapperXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"swapperYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"swapper\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"referrerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"referrerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"referrer\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"deltaIn\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"priceLimit\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"xToY\", \"type\": \"bool\" } ] }, { \"name\": \"withdrawShares\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapfarmv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" } ] } }, { \"name\": \"provider\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapproviderv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"path\": \"owner\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirst\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecond\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"owner\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"shares\", \"type\": { \"defined\": \"Token\" } } ] }, { \"name\": \"withdrawLpFee\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"provider\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapproviderv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"path\": \"owner\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"ownerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"owner\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"withdrawProjectFee\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"projectOwnerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"projectOwnerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"projectOwner\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"createFarm\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapfarmv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"adminMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"supply\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"duration\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" } ] }, { \"name\": \"createDualFarm\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapfarmv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProjectFirst\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"adminMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"supplyMarco\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"supplyProjectFirst\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"duration\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" } ] }, { \"name\": \"createTripleFarm\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapfarmv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProjectFirst\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProjectSecond\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"adminMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"supplyMarco\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"supplyProjectFirst\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"supplyProjectSecond\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"duration\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" } ] }, { \"name\": \"withdrawRewards\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapfarmv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" } ] } }, { \"name\": \"provider\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapproviderv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"path\": \"owner\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirst\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecond\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"owner\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"closePool\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapfarmv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"buybackXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"buybackYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"withdrawMercantiFee\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"mercantiXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"mercantiYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"addSupply\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapfarmv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": false, \"isSigner\": true }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"supplyMarco\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"supplyProjectFirst\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"supplyProjectSecond\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"duration\", \"type\": \"u64\" } ] }, { \"name\": \"updateFees\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"newBuybackFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"newProjectFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"newProviderFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"newMercantiFee\", \"type\": { \"defined\": \"FixedPoint\" } } ] }, { \"name\": \"resetFarm\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Mint\", \"path\": \"token_y\" } ] } }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapfarmv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" } ] } }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"updateRewardTokens\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapstatev1\" } ] } }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswappoolv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool.token_x\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool.token_y\" } ] } }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false, \"pda\": { \"seeds\": [ { \"kind\": \"const\", \"type\": \"string\", \"value\": \"bonkswapfarmv1\" }, { \"kind\": \"account\", \"type\": \"publicKey\", \"account\": \"Pool\", \"path\": \"pool\" } ] } }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"newTokenMarcoAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] } ], \"accounts\": [ { \"name\": \"Farm\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"pool\", \"type\": \"publicKey\" }, { \"name\": \"tokens\", \"type\": { \"array\": [ \"publicKey\", 3 ] } }, { \"name\": \"tokenAccounts\", \"type\": { \"array\": [ \"publicKey\", 3 ] } }, { \"name\": \"supply\", \"type\": { \"array\": [ { \"defined\": \"Token\" }, 3 ] } }, { \"name\": \"supplyLeft\", \"type\": { \"array\": [ { \"defined\": \"Token\" }, 3 ] } }, { \"name\": \"accumulatedSecondsPerShare\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"offsetSecondsPerShare\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"startTime\", \"type\": \"u64\" }, { \"name\": \"endTime\", \"type\": \"u64\" }, { \"name\": \"lastUpdate\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" }, { \"name\": \"farmType\", \"type\": { \"defined\": \"FarmType\" } } ] } }, { \"name\": \"PoolV2\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"tokenX\", \"type\": \"publicKey\" }, { \"name\": \"tokenY\", \"type\": \"publicKey\" }, { \"name\": \"poolXAccount\", \"type\": \"publicKey\" }, { \"name\": \"poolYAccount\", \"type\": \"publicKey\" }, { \"name\": \"admin\", \"type\": \"publicKey\" }, { \"name\": \"projectOwner\", \"type\": \"publicKey\" }, { \"name\": \"tokenXReserve\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"tokenYReserve\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"selfShares\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"allShares\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"buybackAmountX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"buybackAmountY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"projectAmountX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"projectAmountY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"mercantiAmountX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"mercantiAmountY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"lpAccumulatorX\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lpAccumulatorY\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"constK\", \"type\": { \"defined\": \"Product\" } }, { \"name\": \"price\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lpFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"buybackFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"projectFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"mercantiFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"farmCount\", \"type\": \"u64\" }, { \"name\": \"poolBump\", \"type\": \"u8\" }, { \"name\": \"lpToken\", \"type\": \"publicKey\" }, { \"name\": \"lpTokenMintBump\", \"type\": \"u8\" }, { \"name\": \"padding\", \"type\": { \"array\": [ \"u64\", 8 ] } } ] } }, { \"name\": \"Pool\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"tokenX\", \"type\": \"publicKey\" }, { \"name\": \"tokenY\", \"type\": \"publicKey\" }, { \"name\": \"poolXAccount\", \"type\": \"publicKey\" }, { \"name\": \"poolYAccount\", \"type\": \"publicKey\" }, { \"name\": \"admin\", \"type\": \"publicKey\" }, { \"name\": \"projectOwner\", \"type\": \"publicKey\" }, { \"name\": \"tokenXReserve\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"tokenYReserve\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"selfShares\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"allShares\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"buybackAmountX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"buybackAmountY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"projectAmountX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"projectAmountY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"mercantiAmountX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"mercantiAmountY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"lpAccumulatorX\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lpAccumulatorY\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"constK\", \"type\": { \"defined\": \"Product\" } }, { \"name\": \"price\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lpFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"buybackFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"projectFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"mercantiFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"farmCount\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" } ] } }, { \"name\": \"Provider\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"tokenX\", \"type\": \"publicKey\" }, { \"name\": \"tokenY\", \"type\": \"publicKey\" }, { \"name\": \"owner\", \"type\": \"publicKey\" }, { \"name\": \"shares\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"lastFeeAccumulatorX\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lastFeeAccumulatorY\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lastSecondsPerShare\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lastWithdrawTime\", \"type\": \"u64\" }, { \"name\": \"tokensOwedX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"tokensOwedY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"currentFarmCount\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" } ] } }, { \"name\": \"State\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"admin\", \"type\": \"publicKey\" }, { \"name\": \"programAuthority\", \"type\": \"publicKey\" }, { \"name\": \"bump\", \"type\": \"u8\" }, { \"name\": \"nonce\", \"type\": \"u8\" } ] } } ], \"types\": [ { \"name\": \"FixedPoint\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"v\", \"type\": \"u128\" } ] } }, { \"name\": \"Token\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"v\", \"type\": \"u64\" } ] } }, { \"name\": \"Product\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"v\", \"type\": \"u128\" } ] } }, { \"name\": \"FarmType\", \"type\": { \"kind\": \"enum\", \"variants\": [ { \"name\": \"Single\" }, { \"name\": \"Dual\" }, { \"name\": \"Triple\" } ] } } ], \"errors\": [ { \"code\": 6000, \"name\": \"DeltaTooBig\", \"msg\": \"Delta greater than provider's tokens\" }, { \"code\": 6001, \"name\": \"TokenUnderflow\", \"msg\": \"Token amount underflow\" }, { \"code\": 6002, \"name\": \"WrongRatio\", \"msg\": \"Wrong tokens ratio\" }, { \"code\": 6003, \"name\": \"TooMuchShares\", \"msg\": \"Too much shares provided\" }, { \"code\": 6004, \"name\": \"SwapToBig\", \"msg\": \"Swap too big\" }, { \"code\": 6005, \"name\": \"FeeExceeded\", \"msg\": \"Fee exceeded 100%\" }, { \"code\": 6007, \"name\": \"ScalesNotEqual\", \"msg\": \"Scales have to be equal\" }, { \"code\": 6008, \"name\": \"FeeExceededDeltaOut\", \"msg\": \"Fees exceeded delta_out\" }, { \"code\": 6009, \"name\": \"PriceLimitExceeded\", \"msg\": \"Price limit exceeded\" }, { \"code\": 6010, \"name\": \"MintMismatch\", \"msg\": \"Mint mismatch\" }, { \"code\": 6011, \"name\": \"TokensAreTheSame\", \"msg\": \"Tokens are the same\" }, { \"code\": 6012, \"name\": \"WrongFarm\", \"msg\": \"Cannot add supply to wrong farm\" }, { \"code\": 6013, \"name\": \"RewardsExceedingSupply\", \"msg\": \"Cannot withdraw rewards exceeding supply left\" }, { \"code\": 6014, \"name\": \"FarmNotEnded\", \"msg\": \"Farm has not ended, cannot add additional rewards\" }, { \"code\": 6015, \"name\": \"ZeroAmount\", \"msg\": \"Must provide a nonzero amount\" }, { \"code\": 6016, \"name\": \"InvariantDecreased\", \"msg\": \"Invariant has changed\" } ] }" + } +} \ No newline at end of file diff --git a/tests/sol-anchor/jupiter-governance.json b/tests/sol-anchor/jupiter-governance.json new file mode 100644 index 0000000..8db6ae1 --- /dev/null +++ b/tests/sol-anchor/jupiter-governance.json @@ -0,0 +1,9 @@ +{ + "generator": "sol-anchor-beta", + "state": { + "name": "my_project", + "chainName": "solana-mainnet", + "initialBlockSet": true, + "idlString": "{ \"version\": \"0.1.0\", \"name\": \"govern\", \"docs\": [ \"The [govern] program.\" ], \"metadata\": { \"address\": \"GovaE4iu227srtG2s3tZzB4RmWBzw8sTwrCLZz7kN7rY\" }, \"constants\": [ { \"name\": \"MAX_OPTION\", \"type\": \"u8\", \"value\": \"10\" }, { \"name\": \"ABSTAIN_VOTE_INDEX\", \"type\": { \"defined\": \"usize\" }, \"value\": \"0\" }, { \"name\": \"AGAINST_VOTE_INDEX\", \"type\": { \"defined\": \"usize\" }, \"value\": \"1\" }, { \"name\": \"FOR_VOTE_INDEX\", \"type\": { \"defined\": \"usize\" }, \"value\": \"2\" } ], \"instructions\": [ { \"name\": \"createGovernor\", \"docs\": [ \"Creates a [Governor].\" ], \"accounts\": [ { \"name\": \"base\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Base of the [Governor] key.\" ] }, { \"name\": \"governor\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Governor.\" ] }, { \"name\": \"smartWallet\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The Smart Wallet.\" ] }, { \"name\": \"payer\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"Payer.\" ] }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"System program.\" ] } ], \"args\": [ { \"name\": \"locker\", \"type\": \"publicKey\" }, { \"name\": \"params\", \"type\": { \"defined\": \"GovernanceParameters\" } } ] }, { \"name\": \"createProposal\", \"docs\": [ \"Creates a [Proposal].\", \"This may be called by anyone, since the [Proposal] does not do anything until\", \"it is activated in [activate_proposal].\" ], \"accounts\": [ { \"name\": \"governor\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Governor].\" ] }, { \"name\": \"proposal\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Proposal].\" ] }, { \"name\": \"smartWallet\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"smart wallet of governor\" ] }, { \"name\": \"proposer\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Proposer of the proposal.\", \"One of the owners. Checked in the handler via [SmartWallet::owner_index].\" ] }, { \"name\": \"payer\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"Payer of the proposal.\" ] }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"System program.\" ] }, { \"name\": \"eventAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"program\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"proposalType\", \"type\": \"u8\" }, { \"name\": \"maxOption\", \"type\": \"u8\" }, { \"name\": \"instructions\", \"type\": { \"vec\": { \"defined\": \"ProposalInstruction\" } } } ] }, { \"name\": \"activateProposal\", \"docs\": [ \"Activates a proposal.\", \"Only the [Governor::voter] may call this; that program\", \"may ensure that only certain types of users can activate proposals.\" ], \"accounts\": [ { \"name\": \"governor\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [Governor].\" ] }, { \"name\": \"proposal\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Proposal] to activate.\" ] }, { \"name\": \"locker\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The locker of the [Governor] that may activate the proposal.\" ] } ], \"args\": [] }, { \"name\": \"cancelProposal\", \"docs\": [ \"Cancels a proposal.\", \"This is only callable by the creator of the proposal.\" ], \"accounts\": [ { \"name\": \"governor\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [Governor].\" ] }, { \"name\": \"proposal\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Proposal] to activate.\" ] }, { \"name\": \"proposer\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The [Proposal::proposer].\" ] }, { \"name\": \"eventAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"program\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"queueProposal\", \"docs\": [ \"Queues a proposal for execution by the [SmartWallet].\" ], \"accounts\": [ { \"name\": \"governor\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The Governor.\" ] }, { \"name\": \"proposal\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The Proposal to queue.\" ] }, { \"name\": \"transaction\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The transaction key of the proposal.\", \"This account is passed to and validated by the Smart Wallet program to be initialized.\" ] }, { \"name\": \"smartWallet\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The Smart Wallet.\" ] }, { \"name\": \"payer\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"Payer of the queued transaction.\" ] }, { \"name\": \"smartWalletProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The Smart Wallet program.\" ] }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The System program.\" ] }, { \"name\": \"eventAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"program\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"newVote\", \"docs\": [ \"Creates a new [Vote]. Anyone can call this.\" ], \"accounts\": [ { \"name\": \"proposal\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Proposal being voted on.\" ] }, { \"name\": \"vote\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The vote.\" ] }, { \"name\": \"payer\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"Payer of the [Vote].\" ] }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"System program.\" ] } ], \"args\": [ { \"name\": \"voter\", \"type\": \"publicKey\" } ] }, { \"name\": \"setVote\", \"docs\": [ \"Sets a [Vote] weight and side.\", \"This may only be called by the [Governor::voter].\" ], \"accounts\": [ { \"name\": \"governor\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [Governor].\" ] }, { \"name\": \"proposal\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Proposal].\" ] }, { \"name\": \"vote\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Vote].\" ] }, { \"name\": \"locker\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The [Governor::locker].\" ] } ], \"args\": [ { \"name\": \"side\", \"type\": \"u8\" }, { \"name\": \"weight\", \"type\": \"u64\" } ] }, { \"name\": \"setGovernanceParams\", \"docs\": [ \"Sets the [GovernanceParameters].\", \"This may only be called by the [Governor::smart_wallet].\" ], \"accounts\": [ { \"name\": \"governor\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Governor]\" ] }, { \"name\": \"smartWallet\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The Smart Wallet.\" ] } ], \"args\": [ { \"name\": \"params\", \"type\": { \"defined\": \"GovernanceParameters\" } } ] }, { \"name\": \"setVotingReward\", \"docs\": [ \"Sets Voting Reward.\", \"This may only be called by the [Governor::smart_wallet].\" ], \"accounts\": [ { \"name\": \"governor\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Governor]\" ] }, { \"name\": \"rewardMint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"reward mint\" ] }, { \"name\": \"smartWallet\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The Smart Wallet.\" ] } ], \"args\": [ { \"name\": \"rewardPerProposal\", \"type\": \"u64\" } ] }, { \"name\": \"claimReward\", \"docs\": [ \"Claim rewards, for voter\" ], \"accounts\": [ { \"name\": \"governor\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Governor]\" ] }, { \"name\": \"rewardVault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"reward mint\" ] }, { \"name\": \"proposal\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"proposal\" ] }, { \"name\": \"vote\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Vote].\" ] }, { \"name\": \"voter\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Owner of the vault\", \"TODO: check whether vote delegrate can claim on behalf of owner?\" ] }, { \"name\": \"voterTokenAccount\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Voter token account\" ] }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Token program.\" ] }, { \"name\": \"eventAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"program\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"setLocker\", \"docs\": [ \"Sets the locker of the [Governor].\" ], \"accounts\": [ { \"name\": \"governor\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Governor]\" ] }, { \"name\": \"smartWallet\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The Smart Wallet.\" ] } ], \"args\": [ { \"name\": \"newLocker\", \"type\": \"publicKey\" } ] }, { \"name\": \"createProposalMeta\", \"docs\": [ \"Creates a [ProposalMeta].\" ], \"accounts\": [ { \"name\": \"proposal\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [Proposal].\" ] }, { \"name\": \"proposer\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Proposer of the proposal.\" ] }, { \"name\": \"proposalMeta\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [ProposalMeta].\" ] }, { \"name\": \"payer\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"Payer of the [ProposalMeta].\" ] }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"System program.\" ] }, { \"name\": \"eventAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"program\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"bump\", \"type\": \"u8\" }, { \"name\": \"title\", \"type\": \"string\" }, { \"name\": \"descriptionLink\", \"type\": \"string\" } ] }, { \"name\": \"createOptionProposalMeta\", \"docs\": [ \"Creates an [OptionProposalMeta].\" ], \"accounts\": [ { \"name\": \"proposal\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [Proposal].\" ] }, { \"name\": \"proposer\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Proposer of the proposal.\" ] }, { \"name\": \"optionProposalMeta\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [ProposalMeta].\" ] }, { \"name\": \"payer\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"Payer of the [ProposalMeta].\" ] }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"System program.\" ] }, { \"name\": \"eventAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"program\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"bump\", \"type\": \"u8\" }, { \"name\": \"optionDescriptions\", \"type\": { \"vec\": \"string\" } } ] } ], \"accounts\": [ { \"name\": \"Governor\", \"docs\": [ \"A Governor is the \\\"DAO\\\": it is the account that holds control over important protocol functions,\", \"including treasury, protocol parameters, and more.\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"base\", \"docs\": [ \"Base.\" ], \"type\": \"publicKey\" }, { \"name\": \"bump\", \"docs\": [ \"Bump seed\" ], \"type\": \"u8\" }, { \"name\": \"proposalCount\", \"docs\": [ \"The total number of [Proposal]s\" ], \"type\": \"u64\" }, { \"name\": \"locker\", \"docs\": [ \"The voting body associated with the Governor.\", \"This account is responsible for handling vote proceedings, such as:\", \"- activating proposals\", \"- setting the number of votes per voter\" ], \"type\": \"publicKey\" }, { \"name\": \"smartWallet\", \"docs\": [ \"The public key of the [smart_wallet::SmartWallet] account.\", \"This smart wallet executes proposals.\" ], \"type\": \"publicKey\" }, { \"name\": \"params\", \"docs\": [ \"Governance parameters.\" ], \"type\": { \"defined\": \"GovernanceParameters\" } }, { \"name\": \"votingReward\", \"docs\": [ \"optional reward, can set by smartwallet\" ], \"type\": { \"defined\": \"VotingReward\" } }, { \"name\": \"buffers\", \"docs\": [ \"buffer for further use\" ], \"type\": { \"array\": [ \"u128\", 32 ] } } ] } }, { \"name\": \"Proposal\", \"docs\": [ \"A Yes/No Proposal is a pending transaction that may or may not be executed by the DAO.\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"governor\", \"docs\": [ \"The public key of the governor.\" ], \"type\": \"publicKey\" }, { \"name\": \"index\", \"docs\": [ \"The unique ID of the proposal, auto-incremented.\" ], \"type\": \"u64\" }, { \"name\": \"bump\", \"docs\": [ \"Bump seed\" ], \"type\": \"u8\" }, { \"name\": \"proposer\", \"docs\": [ \"The public key of the proposer.\" ], \"type\": \"publicKey\" }, { \"name\": \"quorumVotes\", \"docs\": [ \"The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed\" ], \"type\": \"u64\" }, { \"name\": \"maxOption\", \"docs\": [ \"maximum options of the proposal\" ], \"type\": \"u8\" }, { \"name\": \"optionVotes\", \"docs\": [ \"Vote for each option\" ], \"type\": { \"vec\": \"u64\" } }, { \"name\": \"canceledAt\", \"docs\": [ \"The timestamp when the proposal was canceled.\" ], \"type\": \"i64\" }, { \"name\": \"createdAt\", \"docs\": [ \"The timestamp when the proposal was created.\" ], \"type\": \"i64\" }, { \"name\": \"activatedAt\", \"docs\": [ \"The timestamp in which the proposal was activated.\", \"This is when voting begins.\" ], \"type\": \"i64\" }, { \"name\": \"votingEndsAt\", \"docs\": [ \"The timestamp when voting ends.\", \"This only applies to active proposals.\" ], \"type\": \"i64\" }, { \"name\": \"queuedAt\", \"docs\": [ \"The timestamp in which the proposal was queued, i.e.\", \"approved for execution on the Smart Wallet.\" ], \"type\": \"i64\" }, { \"name\": \"queuedTransaction\", \"docs\": [ \"If the transaction was queued, this is the associated Smart Wallet transaction.\" ], \"type\": \"publicKey\" }, { \"name\": \"votingReward\", \"docs\": [ \"optional reward\" ], \"type\": { \"defined\": \"VotingReward\" } }, { \"name\": \"totalClaimedReward\", \"docs\": [ \"total claimed reward\" ], \"type\": \"u64\" }, { \"name\": \"proposalType\", \"type\": \"u8\" }, { \"name\": \"buffers\", \"docs\": [ \"buffers for future use\" ], \"type\": { \"array\": [ \"u128\", 10 ] } }, { \"name\": \"instructions\", \"docs\": [ \"The instructions associated with the proposal.\" ], \"type\": { \"vec\": { \"defined\": \"ProposalInstruction\" } } } ] } }, { \"name\": \"ProposalMeta\", \"docs\": [ \"Metadata about a proposal.\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"proposal\", \"docs\": [ \"The [Proposal].\" ], \"type\": \"publicKey\" }, { \"name\": \"title\", \"docs\": [ \"Title of the proposal.\" ], \"type\": \"string\" }, { \"name\": \"descriptionLink\", \"docs\": [ \"Link to a description of the proposal.\" ], \"type\": \"string\" } ] } }, { \"name\": \"OptionProposalMeta\", \"docs\": [ \"Metadata about an option proposal.\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"proposal\", \"docs\": [ \"The [Proposal].\" ], \"type\": \"publicKey\" }, { \"name\": \"optionDescriptions\", \"docs\": [ \"description for options\" ], \"type\": { \"vec\": \"string\" } } ] } }, { \"name\": \"Vote\", \"docs\": [ \"A [Vote] is a vote made by a `voter`\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"proposal\", \"docs\": [ \"The proposal being voted on.\" ], \"type\": \"publicKey\" }, { \"name\": \"voter\", \"docs\": [ \"The voter.\" ], \"type\": \"publicKey\" }, { \"name\": \"bump\", \"docs\": [ \"Bump seed\" ], \"type\": \"u8\" }, { \"name\": \"side\", \"docs\": [ \"The side of the vote taken.\" ], \"type\": \"u8\" }, { \"name\": \"votingPower\", \"docs\": [ \"The number of votes this vote holds.\" ], \"type\": \"u64\" }, { \"name\": \"claimed\", \"docs\": [ \"Flag to check whether voter has claim the reward or not\" ], \"type\": \"bool\" }, { \"name\": \"buffers\", \"docs\": [ \"buffers for future use\" ], \"type\": { \"array\": [ \"u8\", 32 ] } } ] } } ], \"types\": [ { \"name\": \"VotingReward\", \"docs\": [ \"Governance parameters.\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"rewardMint\", \"docs\": [ \"Reward mint\" ], \"type\": \"publicKey\" }, { \"name\": \"rewardVault\", \"docs\": [ \"Reward vault\" ], \"type\": \"publicKey\" }, { \"name\": \"rewardPerProposal\", \"docs\": [ \"Total reward per proposal\" ], \"type\": \"u64\" } ] } }, { \"name\": \"GovernanceParameters\", \"docs\": [ \"Governance parameters.\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"votingDelay\", \"docs\": [ \"The delay before voting on a proposal may take place, once proposed, in seconds\" ], \"type\": \"u64\" }, { \"name\": \"votingPeriod\", \"docs\": [ \"The duration of voting on a proposal, in seconds\" ], \"type\": \"u64\" }, { \"name\": \"quorumVotes\", \"docs\": [ \"The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed\" ], \"type\": \"u64\" }, { \"name\": \"timelockDelaySeconds\", \"docs\": [ \"The timelock delay of the DAO's created proposals.\" ], \"type\": \"i64\" } ] } }, { \"name\": \"ProposalInstruction\", \"docs\": [ \"Instruction.\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"programId\", \"docs\": [ \"Pubkey of the instruction processor that executes this instruction\" ], \"type\": \"publicKey\" }, { \"name\": \"keys\", \"docs\": [ \"Metadata for what accounts should be passed to the instruction processor\" ], \"type\": { \"vec\": { \"defined\": \"ProposalAccountMeta\" } } }, { \"name\": \"data\", \"docs\": [ \"Opaque data passed to the instruction processor\" ], \"type\": \"bytes\" } ] } }, { \"name\": \"ProposalAccountMeta\", \"docs\": [ \"Account metadata used to define Instructions\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"pubkey\", \"docs\": [ \"An account's public key\" ], \"type\": \"publicKey\" }, { \"name\": \"isSigner\", \"docs\": [ \"True if an Instruction requires a Transaction signature matching `pubkey`.\" ], \"type\": \"bool\" }, { \"name\": \"isWritable\", \"docs\": [ \"True if the `pubkey` can be loaded as a read-write account.\" ], \"type\": \"bool\" } ] } }, { \"name\": \"ProposalState\", \"docs\": [ \"The state of a proposal.\", \"\", \"The `expired` state from Compound is missing here, because the\", \"Smart Wallet handles execution.\" ], \"type\": { \"kind\": \"enum\", \"variants\": [ { \"name\": \"Draft\" }, { \"name\": \"Active\" }, { \"name\": \"Canceled\" }, { \"name\": \"Defeated\" }, { \"name\": \"Succeeded\" }, { \"name\": \"Queued\" } ] } }, { \"name\": \"ProposalType\", \"docs\": [ \"Proposal type\" ], \"type\": { \"kind\": \"enum\", \"variants\": [ { \"name\": \"YesNo\" }, { \"name\": \"Option\" } ] } } ], \"events\": [ { \"name\": \"ProposalActivateEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"proposal\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"votingEndsAt\", \"type\": \"i64\", \"index\": false } ] }, { \"name\": \"ProposalCancelEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"proposal\", \"type\": \"publicKey\", \"index\": false } ] }, { \"name\": \"ClaimRewardEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"voter\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"proposal\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"votingReward\", \"type\": \"u64\", \"index\": false } ] }, { \"name\": \"GovernorCreateEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"locker\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"smartWallet\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"parameters\", \"type\": { \"defined\": \"GovernanceParameters\" }, \"index\": false } ] }, { \"name\": \"OptionProposalMetaCreateEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"proposal\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"optionDescriptions\", \"type\": { \"vec\": \"string\" }, \"index\": false } ] }, { \"name\": \"ProposalMetaCreateEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"proposal\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"title\", \"type\": \"string\", \"index\": false }, { \"name\": \"descriptionLink\", \"type\": \"string\", \"index\": false } ] }, { \"name\": \"ProposalCreateEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"proposal\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"proposer\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"proposalType\", \"type\": \"u8\", \"index\": false }, { \"name\": \"maxOption\", \"type\": \"u8\", \"index\": false }, { \"name\": \"index\", \"type\": \"u64\", \"index\": false }, { \"name\": \"instructions\", \"type\": { \"vec\": { \"defined\": \"ProposalInstruction\" } }, \"index\": false } ] }, { \"name\": \"ProposalQueueEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"proposal\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"transaction\", \"type\": \"publicKey\", \"index\": false } ] }, { \"name\": \"GovernorSetParamsEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"prevParams\", \"type\": { \"defined\": \"GovernanceParameters\" }, \"index\": false }, { \"name\": \"params\", \"type\": { \"defined\": \"GovernanceParameters\" }, \"index\": false } ] }, { \"name\": \"GovernorSetVoterEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"prevLocker\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"newLocker\", \"type\": \"publicKey\", \"index\": false } ] }, { \"name\": \"VoteSetEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"proposal\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"voter\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"vote\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"side\", \"type\": \"u8\", \"index\": false }, { \"name\": \"votingPower\", \"type\": \"u64\", \"index\": false } ] }, { \"name\": \"GovernorSetVotingReward\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"rewardMint\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"rewardPerProposal\", \"type\": \"u64\", \"index\": false } ] } ], \"errors\": [ { \"code\": 6000, \"name\": \"InvalidVoteSide\", \"msg\": \"Invalid vote side.\" }, { \"code\": 6001, \"name\": \"InvalidProposalType\", \"msg\": \"Invalid proposal type.\" }, { \"code\": 6002, \"name\": \"GovernorNotFound\", \"msg\": \"The owner of the smart wallet doesn't match with current.\" }, { \"code\": 6003, \"name\": \"VotingDelayNotMet\", \"msg\": \"The proposal cannot be activated since it has not yet passed the voting delay.\" }, { \"code\": 6004, \"name\": \"ProposalNotDraft\", \"msg\": \"Only drafts can be canceled.\" }, { \"code\": 6005, \"name\": \"ProposalNotActive\", \"msg\": \"The proposal must be active.\" }, { \"code\": 6006, \"name\": \"InvalidMaxOption\", \"msg\": \"Max option is invalid\" }, { \"code\": 6007, \"name\": \"NotYesNoProposal\", \"msg\": \"Proposal is not YesNo.\" }, { \"code\": 6008, \"name\": \"NotOptionProposal\", \"msg\": \"Proposal is not Option.\" }, { \"code\": 6009, \"name\": \"InvalidOptionDescriptions\", \"msg\": \"Invalid option descriptions.\" } ] }" + } +} \ No newline at end of file diff --git a/tests/sol-anchor/jupiter-staking.json b/tests/sol-anchor/jupiter-staking.json new file mode 100644 index 0000000..e63c1e3 --- /dev/null +++ b/tests/sol-anchor/jupiter-staking.json @@ -0,0 +1,9 @@ +{ + "generator": "sol-anchor-beta", + "state": { + "name": "my_project", + "chainName": "solana-mainnet", + "initialBlockSet": true, + "idlString": "{ \"version\": \"0.2.0\", \"name\": \"locked_voter\", \"docs\": [ \"Locked voter program.\" ], \"metadata\": { \"address\": \"voTpe3tHQ7AjQHMapgSue2HJFAh2cGsdokqN3XqmVSj\" }, \"instructions\": [ { \"name\": \"newLocker\", \"docs\": [ \"Creates a new [Locker].\" ], \"accounts\": [ { \"name\": \"base\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Base.\" ] }, { \"name\": \"locker\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"[Locker].\" ] }, { \"name\": \"tokenMint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Mint of the token that can be used to join the [Locker].\" ] }, { \"name\": \"governor\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"[Governor] associated with the [Locker].\" ] }, { \"name\": \"payer\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"Payer of the initialization.\" ] }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"System program.\" ] } ], \"args\": [ { \"name\": \"params\", \"type\": { \"defined\": \"LockerParams\" } } ] }, { \"name\": \"newEscrow\", \"docs\": [ \"Creates a new [Escrow] for an account.\", \"\", \"A Vote Escrow, or [Escrow] for short, is an agreement between an account (known as the `authority`) and the DAO to\", \"lock up tokens for a specific period of time, in exchange for voting rights\", \"linearly proportional to the amount of votes given.\" ], \"accounts\": [ { \"name\": \"locker\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"[Locker].\" ] }, { \"name\": \"escrow\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"[Escrow].\" ] }, { \"name\": \"escrowOwner\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"payer\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"Payer of the initialization.\" ] }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"System program.\" ] } ], \"args\": [] }, { \"name\": \"increaseLockedAmount\", \"docs\": [ \"increase locked amount [Escrow].\" ], \"accounts\": [ { \"name\": \"locker\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"[Locker].\" ] }, { \"name\": \"escrow\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"[Escrow].\" ] }, { \"name\": \"escrowTokens\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Token account held by the [Escrow].\" ] }, { \"name\": \"payer\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Authority [Self::source_tokens], Anyone can increase amount for user\" ] }, { \"name\": \"sourceTokens\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The source of deposited tokens.\" ] }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Token program.\" ] } ], \"args\": [ { \"name\": \"amount\", \"type\": \"u64\" } ] }, { \"name\": \"extendLockDuration\", \"docs\": [ \"extend locked duration [Escrow].\" ], \"accounts\": [ { \"name\": \"locker\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"[Locker].\" ] }, { \"name\": \"escrow\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"[Escrow].\" ] }, { \"name\": \"escrowOwner\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Authority of the [Escrow] and\" ] } ], \"args\": [ { \"name\": \"duration\", \"type\": \"i64\" } ] }, { \"name\": \"toggleMaxLock\", \"docs\": [ \"toogle max lock [Escrow].\" ], \"accounts\": [ { \"name\": \"locker\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"[Locker].\" ] }, { \"name\": \"escrow\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"[Escrow].\" ] }, { \"name\": \"escrowOwner\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Authority of the [Escrow] and\" ] } ], \"args\": [ { \"name\": \"isMaxLock\", \"type\": \"bool\" } ] }, { \"name\": \"withdraw\", \"docs\": [ \"Exits the DAO; i.e., withdraws all staked tokens in an [Escrow] if the [Escrow] is unlocked.\" ], \"accounts\": [ { \"name\": \"locker\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Locker] being exited from.\" ] }, { \"name\": \"escrow\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Escrow] that is being closed.\" ] }, { \"name\": \"escrowOwner\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Authority of the [Escrow].\" ] }, { \"name\": \"escrowTokens\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Tokens locked up in the [Escrow].\" ] }, { \"name\": \"destinationTokens\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Destination for the tokens to unlock.\" ] }, { \"name\": \"payer\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"The payer to receive the rent refund.\" ] }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Token program.\" ] } ], \"args\": [] }, { \"name\": \"activateProposal\", \"docs\": [ \"Activates a proposal in token launch phase\" ], \"accounts\": [ { \"name\": \"locker\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [Locker].\" ] }, { \"name\": \"governor\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [Governor].\" ] }, { \"name\": \"proposal\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Proposal].\" ] }, { \"name\": \"governProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [govern] program.\" ] }, { \"name\": \"smartWallet\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The smart wallet on the [Governor].\" ] } ], \"args\": [] }, { \"name\": \"castVote\", \"docs\": [ \"Casts a vote.\" ], \"accounts\": [ { \"name\": \"locker\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [Locker].\" ] }, { \"name\": \"escrow\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [Escrow] that is voting.\" ] }, { \"name\": \"voteDelegate\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Vote delegate of the [Escrow].\" ] }, { \"name\": \"proposal\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Proposal] being voted on.\" ] }, { \"name\": \"vote\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Vote].\" ] }, { \"name\": \"governor\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [Governor].\" ] }, { \"name\": \"governProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [govern] program.\" ] } ], \"args\": [ { \"name\": \"side\", \"type\": \"u8\" } ] }, { \"name\": \"setVoteDelegate\", \"docs\": [ \"Delegate escrow vote.\" ], \"accounts\": [ { \"name\": \"escrow\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Escrow].\" ] }, { \"name\": \"escrowOwner\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The owner of the [Escrow].\" ] } ], \"args\": [ { \"name\": \"newDelegate\", \"type\": \"publicKey\" } ] }, { \"name\": \"setLockerParams\", \"docs\": [ \"Set locker params.\" ], \"accounts\": [ { \"name\": \"locker\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Locker].\" ] }, { \"name\": \"governor\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The [Governor].\" ] }, { \"name\": \"smartWallet\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The smart wallet on the [Governor].\" ] } ], \"args\": [ { \"name\": \"params\", \"type\": { \"defined\": \"LockerParams\" } } ] }, { \"name\": \"openPartialUnstaking\", \"docs\": [ \"Open partial unstaking\" ], \"accounts\": [ { \"name\": \"locker\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"[Locker].\" ] }, { \"name\": \"escrow\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"[Escrow].\" ] }, { \"name\": \"partialUnstake\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"[Escrow].\" ] }, { \"name\": \"owner\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"System program.\" ] } ], \"args\": [ { \"name\": \"amount\", \"type\": \"u64\" }, { \"name\": \"memo\", \"type\": \"string\" } ] }, { \"name\": \"mergePartialUnstaking\", \"docs\": [ \"Merge partial unstaking\" ], \"accounts\": [ { \"name\": \"locker\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"[Locker].\" ] }, { \"name\": \"escrow\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"[Escrow].\" ] }, { \"name\": \"partialUnstake\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [PartialUnstaking] that is being merged.\" ] }, { \"name\": \"owner\", \"isMut\": true, \"isSigner\": true } ], \"args\": [] }, { \"name\": \"withdrawPartialUnstaking\", \"docs\": [ \"Withdraw partial unstaking\" ], \"accounts\": [ { \"name\": \"locker\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Locker] being exited from.\" ] }, { \"name\": \"escrow\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [Escrow] that is being closed.\" ] }, { \"name\": \"partialUnstake\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The [PartialUnstaking] that is being withdraw.\" ] }, { \"name\": \"owner\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Authority of the [Escrow].\" ] }, { \"name\": \"escrowTokens\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Tokens locked up in the [Escrow].\" ] }, { \"name\": \"destinationTokens\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Destination for the tokens to unlock.\" ] }, { \"name\": \"payer\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"The payer to receive the rent refund.\" ] }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Token program.\" ] } ], \"args\": [] } ], \"accounts\": [ { \"name\": \"Locker\", \"docs\": [ \"A group of [Escrow]s.\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"base\", \"docs\": [ \"Base account used to generate signer seeds.\" ], \"type\": \"publicKey\" }, { \"name\": \"bump\", \"docs\": [ \"Bump seed.\" ], \"type\": \"u8\" }, { \"name\": \"tokenMint\", \"docs\": [ \"Mint of the token that must be locked in the [Locker].\" ], \"type\": \"publicKey\" }, { \"name\": \"lockedSupply\", \"docs\": [ \"Total number of tokens locked in [Escrow]s.\" ], \"type\": \"u64\" }, { \"name\": \"totalEscrow\", \"docs\": [ \"Total number of escrow\" ], \"type\": \"u64\" }, { \"name\": \"governor\", \"docs\": [ \"Governor associated with the [Locker].\" ], \"type\": \"publicKey\" }, { \"name\": \"params\", \"docs\": [ \"Mutable parameters of how a [Locker] should behave.\" ], \"type\": { \"defined\": \"LockerParams\" } }, { \"name\": \"buffers\", \"docs\": [ \"buffer for further use\" ], \"type\": { \"array\": [ \"u128\", 32 ] } } ] } }, { \"name\": \"Escrow\", \"docs\": [ \"Locks tokens on behalf of a user.\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"locker\", \"docs\": [ \"The [Locker] that this [Escrow] is part of.\" ], \"type\": \"publicKey\" }, { \"name\": \"owner\", \"docs\": [ \"The key of the account that is authorized to stake into/withdraw from this [Escrow].\" ], \"type\": \"publicKey\" }, { \"name\": \"bump\", \"docs\": [ \"Bump seed.\" ], \"type\": \"u8\" }, { \"name\": \"tokens\", \"docs\": [ \"The token account holding the escrow tokens.\" ], \"type\": \"publicKey\" }, { \"name\": \"amount\", \"docs\": [ \"Amount of tokens staked.\" ], \"type\": \"u64\" }, { \"name\": \"escrowStartedAt\", \"docs\": [ \"When the [Escrow::owner] started their escrow.\" ], \"type\": \"i64\" }, { \"name\": \"escrowEndsAt\", \"docs\": [ \"When the escrow unlocks; i.e. the [Escrow::owner] is scheduled to be allowed to withdraw their tokens.\" ], \"type\": \"i64\" }, { \"name\": \"voteDelegate\", \"docs\": [ \"Account that is authorized to vote on behalf of this [Escrow].\", \"Defaults to the [Escrow::owner].\" ], \"type\": \"publicKey\" }, { \"name\": \"isMaxLock\", \"docs\": [ \"Max lock\" ], \"type\": \"bool\" }, { \"name\": \"partialUnstakingAmount\", \"docs\": [ \"total amount of partial unstaking amount\" ], \"type\": \"u64\" }, { \"name\": \"padding\", \"docs\": [ \"padding for further use\" ], \"type\": \"u64\" }, { \"name\": \"buffers\", \"docs\": [ \"buffer for further use\" ], \"type\": { \"array\": [ \"u128\", 9 ] } } ] } }, { \"name\": \"PartialUnstaking\", \"docs\": [ \"Account to store infor for partial unstaking\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"escrow\", \"docs\": [ \"The [Escrow] pubkey.\" ], \"type\": \"publicKey\" }, { \"name\": \"amount\", \"docs\": [ \"Amount of this partial unstaking\" ], \"type\": \"u64\" }, { \"name\": \"expiration\", \"docs\": [ \"Timestamp when owner can withdraw the partial unstaking amount\" ], \"type\": \"i64\" }, { \"name\": \"buffers\", \"docs\": [ \"buffer for further use\" ], \"type\": { \"array\": [ \"u128\", 6 ] } }, { \"name\": \"memo\", \"docs\": [ \"Memo\" ], \"type\": \"string\" } ] } } ], \"types\": [ { \"name\": \"LockerParams\", \"docs\": [ \"Contains parameters for the [Locker].\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"maxStakeVoteMultiplier\", \"docs\": [ \"The weight of a maximum vote lock relative to the total number of tokens locked.\", \"For example, veCRV is 10 because 1 CRV locked for 4 years = 10 veCRV.\" ], \"type\": \"u8\" }, { \"name\": \"minStakeDuration\", \"docs\": [ \"Minimum staking duration.\" ], \"type\": \"u64\" }, { \"name\": \"maxStakeDuration\", \"docs\": [ \"Maximum staking duration.\" ], \"type\": \"u64\" }, { \"name\": \"proposalActivationMinVotes\", \"docs\": [ \"Minimum number of votes required to activate a proposal.\" ], \"type\": \"u64\" } ] } } ], \"events\": [ { \"name\": \"ExtendLockDurationEvent\", \"fields\": [ { \"name\": \"locker\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"escrowOwner\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"tokenMint\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"lockerSupply\", \"type\": \"u64\", \"index\": false }, { \"name\": \"duration\", \"type\": \"i64\", \"index\": false }, { \"name\": \"prevEscrowEndsAt\", \"type\": \"i64\", \"index\": false }, { \"name\": \"nextEscrowEndsAt\", \"type\": \"i64\", \"index\": false }, { \"name\": \"nextEscrowStartedAt\", \"type\": \"i64\", \"index\": false } ] }, { \"name\": \"IncreaseLockedAmountEvent\", \"fields\": [ { \"name\": \"locker\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"escrowOwner\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"tokenMint\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"amount\", \"type\": \"u64\", \"index\": false }, { \"name\": \"lockerSupply\", \"type\": \"u64\", \"index\": false } ] }, { \"name\": \"MergePartialUnstakingEvent\", \"fields\": [ { \"name\": \"partialUnstake\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"escrow\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"amount\", \"type\": \"u64\", \"index\": false } ] }, { \"name\": \"NewEscrowEvent\", \"fields\": [ { \"name\": \"escrow\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"escrowOwner\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"locker\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"timestamp\", \"type\": \"i64\", \"index\": false } ] }, { \"name\": \"NewLockerEvent\", \"fields\": [ { \"name\": \"governor\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"locker\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"tokenMint\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"params\", \"type\": { \"defined\": \"LockerParams\" }, \"index\": false } ] }, { \"name\": \"OpenPartialStakingEvent\", \"fields\": [ { \"name\": \"partialUnstake\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"escrow\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"amount\", \"type\": \"u64\", \"index\": false }, { \"name\": \"expiration\", \"type\": \"i64\", \"index\": false } ] }, { \"name\": \"LockerSetParamsEvent\", \"fields\": [ { \"name\": \"locker\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"prevParams\", \"type\": { \"defined\": \"LockerParams\" }, \"index\": false }, { \"name\": \"params\", \"type\": { \"defined\": \"LockerParams\" }, \"index\": false } ] }, { \"name\": \"SetVoteDelegateEvent\", \"fields\": [ { \"name\": \"escrowOwner\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"oldDelegate\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"newDelegate\", \"type\": \"publicKey\", \"index\": false } ] }, { \"name\": \"WithdrawPartialUnstakingEvent\", \"fields\": [ { \"name\": \"escrowOwner\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"locker\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"partialUnstaking\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"timestamp\", \"type\": \"i64\", \"index\": false }, { \"name\": \"lockerSupply\", \"type\": \"u64\", \"index\": false }, { \"name\": \"releasedAmount\", \"type\": \"u64\", \"index\": false } ] }, { \"name\": \"ExitEscrowEvent\", \"fields\": [ { \"name\": \"escrowOwner\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"locker\", \"type\": \"publicKey\", \"index\": false }, { \"name\": \"timestamp\", \"type\": \"i64\", \"index\": false }, { \"name\": \"lockerSupply\", \"type\": \"u64\", \"index\": false }, { \"name\": \"releasedAmount\", \"type\": \"u64\", \"index\": false } ] } ], \"errors\": [ { \"code\": 6000, \"name\": \"LockupDurationTooShort\", \"msg\": \"Lockup duration must at least be the min stake duration\" }, { \"code\": 6001, \"name\": \"LockupDurationTooLong\", \"msg\": \"Lockup duration must at most be the max stake duration\" }, { \"code\": 6002, \"name\": \"RefreshCannotShorten\", \"msg\": \"A voting escrow refresh cannot shorten the escrow time remaining\" }, { \"code\": 6003, \"name\": \"EscrowNotEnded\", \"msg\": \"Escrow has not ended\" }, { \"code\": 6004, \"name\": \"MaxLockIsSet\", \"msg\": \"Maxlock is set\" }, { \"code\": 6005, \"name\": \"ExpirationIsLessThanCurrentTime\", \"msg\": \"Cannot set expiration less than the current time\" }, { \"code\": 6006, \"name\": \"LockerIsExpired\", \"msg\": \"Locker is expired\" }, { \"code\": 6007, \"name\": \"ExpirationIsNotZero\", \"msg\": \"Expiration is not zero\" }, { \"code\": 6008, \"name\": \"AmountIsZero\", \"msg\": \"Amount is zero\" }, { \"code\": 6009, \"name\": \"MaxLockIsNotSet\", \"msg\": \"Maxlock is not set\" }, { \"code\": 6010, \"name\": \"InvalidAmountForPartialUnstaking\", \"msg\": \"Invalid amount for partial unstaking\" }, { \"code\": 6011, \"name\": \"EscrowHasBeenEnded\", \"msg\": \"Escrow has been ended\" }, { \"code\": 6012, \"name\": \"InvalidUnstakingLockDuration\", \"msg\": \"Invalid unstaking lock duration\" }, { \"code\": 6013, \"name\": \"PartialUnstakingAmountIsNotZero\", \"msg\": \"Partial unstaking amount is not zero\" }, { \"code\": 6014, \"name\": \"PartialUnstakingIsNotEnded\", \"msg\": \"Partial unstaking has not ended\" } ] }" + } +} \ No newline at end of file diff --git a/tests/sol-anchor/lifinity.json b/tests/sol-anchor/lifinity.json new file mode 100644 index 0000000..ed28762 --- /dev/null +++ b/tests/sol-anchor/lifinity.json @@ -0,0 +1,9 @@ +{ + "generator": "sol-anchor-beta", + "state": { + "name": "my_project", + "chainName": "solana-mainnet", + "initialBlockSet": true, + "idlString": "{ \"version\": \"0.1.0\", \"name\": \"lifinity_amm\", \"metadata\": { \"address\": \"EewxydAPCCVuNEyrVN68PuSYdQ7wKn27V9Gjeoi8dy3S\" }, \"instructions\": [ { \"name\": \"swap\", \"accounts\": [ { \"name\": \"authority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"amm\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"userTransferAuthority\", \"isMut\": false, \"isSigner\": true }, { \"name\": \"sourceInfo\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"destinationInfo\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"swapSource\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"swapDestination\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolMint\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"feeAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pythAccount\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pythPcAccount\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"configAccount\", \"isMut\": true, \"isSigner\": false } ], \"args\": [ { \"name\": \"amountIn\", \"type\": \"u64\" }, { \"name\": \"minimumAmountOut\", \"type\": \"u64\" } ] }, { \"name\": \"depositAllTokenTypes\", \"accounts\": [ { \"name\": \"amm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"authority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"userTransferAuthorityInfo\", \"isMut\": false, \"isSigner\": true }, { \"name\": \"sourceAInfo\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"sourceBInfo\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenA\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenB\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolMint\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"destination\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"configAccount\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"poolTokenAmount\", \"type\": \"u64\" }, { \"name\": \"maximumTokenAAmount\", \"type\": \"u64\" }, { \"name\": \"maximumTokenBAmount\", \"type\": \"u64\" } ] }, { \"name\": \"withdrawAllTokenTypes\", \"accounts\": [ { \"name\": \"amm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"authority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"userTransferAuthorityInfo\", \"isMut\": false, \"isSigner\": true }, { \"name\": \"sourceInfo\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenA\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenB\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolMint\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"destTokenAInfo\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"destTokenBInfo\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"feeAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"poolTokenAmount\", \"type\": \"u64\" }, { \"name\": \"minimumTokenAAmount\", \"type\": \"u64\" }, { \"name\": \"minimumTokenBAmount\", \"type\": \"u64\" } ] } ], \"accounts\": [ { \"name\": \"amm\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"initializerKey\", \"type\": \"publicKey\" }, { \"name\": \"initializerDepositTokenAccount\", \"type\": \"publicKey\" }, { \"name\": \"initializerReceiveTokenAccount\", \"type\": \"publicKey\" }, { \"name\": \"initializerAmount\", \"type\": \"u64\" }, { \"name\": \"takerAmount\", \"type\": \"u64\" }, { \"name\": \"isInitialized\", \"type\": \"bool\" }, { \"name\": \"bumpSeed\", \"type\": \"u8\" }, { \"name\": \"freezeTrade\", \"type\": \"u8\" }, { \"name\": \"freezeDeposit\", \"type\": \"u8\" }, { \"name\": \"freezeWithdraw\", \"type\": \"u8\" }, { \"name\": \"baseDecimals\", \"type\": \"u8\" }, { \"name\": \"tokenProgramId\", \"type\": \"publicKey\" }, { \"name\": \"tokenAAccount\", \"type\": \"publicKey\" }, { \"name\": \"tokenBAccount\", \"type\": \"publicKey\" }, { \"name\": \"poolMint\", \"type\": \"publicKey\" }, { \"name\": \"tokenAMint\", \"type\": \"publicKey\" }, { \"name\": \"tokenBMint\", \"type\": \"publicKey\" }, { \"name\": \"poolFeeAccount\", \"type\": \"publicKey\" }, { \"name\": \"pythAccount\", \"type\": \"publicKey\" }, { \"name\": \"pythPcAccount\", \"type\": \"publicKey\" }, { \"name\": \"configAccount\", \"type\": \"publicKey\" }, { \"name\": \"ammTemp1\", \"type\": \"publicKey\" }, { \"name\": \"ammTemp2\", \"type\": \"publicKey\" }, { \"name\": \"ammTemp3\", \"type\": \"publicKey\" }, { \"name\": \"fees\", \"type\": { \"defined\": \"FeesInput\" } }, { \"name\": \"curve\", \"type\": { \"defined\": \"CurveInput\" } } ] } }, { \"name\": \"config\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"concentrationRatio\", \"type\": \"u64\" }, { \"name\": \"lastPrice\", \"type\": \"u64\" }, { \"name\": \"adjustRatio\", \"type\": \"u64\" }, { \"name\": \"balanceRatio\", \"type\": \"u64\" }, { \"name\": \"lastBalancedPrice\", \"type\": \"u64\" }, { \"name\": \"configDenominator\", \"type\": \"u64\" }, { \"name\": \"pythConfidenceLimit\", \"type\": \"u64\" }, { \"name\": \"pythSlotLimit\", \"type\": \"u64\" }, { \"name\": \"volumeX\", \"type\": \"u64\" }, { \"name\": \"volumeY\", \"type\": \"u64\" }, { \"name\": \"volumeXInY\", \"type\": \"u64\" }, { \"name\": \"coefficientUp\", \"type\": \"u64\" }, { \"name\": \"coefficientDown\", \"type\": \"u64\" }, { \"name\": \"oracleStatus\", \"type\": \"u64\" }, { \"name\": \"tradeFeeLp\", \"type\": \"u64\" }, { \"name\": \"platformFeeLp\", \"type\": \"u64\" } ] } } ], \"types\": [ { \"name\": \"CurveFees\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"tradeFeeNumerator\", \"type\": \"u64\" }, { \"name\": \"tradeFeeDenominator\", \"type\": \"u64\" }, { \"name\": \"ownerTradeFeeNumerator\", \"type\": \"u64\" }, { \"name\": \"ownerTradeFeeDenominator\", \"type\": \"u64\" }, { \"name\": \"ownerWithdrawFeeNumerator\", \"type\": \"u64\" }, { \"name\": \"ownerWithdrawFeeDenominator\", \"type\": \"u64\" }, { \"name\": \"hostFeeNumerator\", \"type\": \"u64\" }, { \"name\": \"hostFeeDenominator\", \"type\": \"u64\" } ] } }, { \"name\": \"FeesInput\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"tradeFeeNumerator\", \"type\": \"u64\" }, { \"name\": \"tradeFeeDenominator\", \"type\": \"u64\" }, { \"name\": \"ownerTradeFeeNumerator\", \"type\": \"u64\" }, { \"name\": \"ownerTradeFeeDenominator\", \"type\": \"u64\" }, { \"name\": \"ownerWithdrawFeeNumerator\", \"type\": \"u64\" }, { \"name\": \"ownerWithdrawFeeDenominator\", \"type\": \"u64\" }, { \"name\": \"hostFeeNumerator\", \"type\": \"u64\" }, { \"name\": \"hostFeeDenominator\", \"type\": \"u64\" } ] } }, { \"name\": \"CurveInput\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"curveType\", \"type\": \"u8\" }, { \"name\": \"curveParameters\", \"type\": \"u64\" } ] } }, { \"name\": \"CurveType\", \"type\": { \"kind\": \"enum\", \"variants\": [ { \"name\": \"ConstantProduct\" }, { \"name\": \"Stable\" } ] } }, { \"name\": \"TradeDirection\", \"type\": { \"kind\": \"enum\", \"variants\": [ { \"name\": \"AtoB\" }, { \"name\": \"BtoA\" } ] } }, { \"name\": \"RoundDirection\", \"type\": { \"kind\": \"enum\", \"variants\": [ { \"name\": \"Floor\" }, { \"name\": \"Ceiling\" } ] } } ], \"errors\": [ { \"code\": 6000, \"name\": \"AlreadyInUse\", \"msg\": \"Swap account already in use\" }, { \"code\": 6001, \"name\": \"InvalidProgramAddress\", \"msg\": \"Invalid program address generated from bump seed and key\" }, { \"code\": 6002, \"name\": \"InvalidOwner\", \"msg\": \"Input account owner is not the program address\" }, { \"code\": 6003, \"name\": \"InvalidOutputOwner\", \"msg\": \"Output pool account owner cannot be the program address\" }, { \"code\": 6004, \"name\": \"ExpectedMint\", \"msg\": \"Deserialized account is not an SPL Token mint\" }, { \"code\": 6005, \"name\": \"ExpectedAccount\", \"msg\": \"Deserialized account is not an SPL Token account\" }, { \"code\": 6006, \"name\": \"EmptySupply\", \"msg\": \"Input token account empty\" }, { \"code\": 6007, \"name\": \"InvalidSupply\", \"msg\": \"Pool token mint has a non-zero supply\" }, { \"code\": 6008, \"name\": \"InvalidDelegate\", \"msg\": \"Token account has a delegate\" }, { \"code\": 6009, \"name\": \"InvalidInput\", \"msg\": \"InvalidInput\" }, { \"code\": 6010, \"name\": \"IncorrectSwapAccount\", \"msg\": \"Address of the provided swap token account is incorrect\" }, { \"code\": 6011, \"name\": \"IncorrectPoolMint\", \"msg\": \"Address of the provided pool token mint is incorrect\" }, { \"code\": 6012, \"name\": \"InvalidOutput\", \"msg\": \"InvalidOutput\" }, { \"code\": 6013, \"name\": \"CalculationFailure\", \"msg\": \"General calculation failure due to overflow or underflow\" }, { \"code\": 6014, \"name\": \"InvalidInstruction\", \"msg\": \"Invalid instruction\" }, { \"code\": 6015, \"name\": \"RepeatedMint\", \"msg\": \"Swap input token accounts have the same mint\" }, { \"code\": 6016, \"name\": \"ExceededSlippage\", \"msg\": \"Swap instruction exceeds desired slippage limit\" }, { \"code\": 6017, \"name\": \"InvalidCloseAuthority\", \"msg\": \"Token account has a close authority\" }, { \"code\": 6018, \"name\": \"InvalidFreezeAuthority\", \"msg\": \"Pool token mint has a freeze authority\" }, { \"code\": 6019, \"name\": \"IncorrectFeeAccount\", \"msg\": \"Pool fee token account incorrect\" }, { \"code\": 6020, \"name\": \"ZeroTradingTokens\", \"msg\": \"Given pool token amount results in zero trading tokens\" }, { \"code\": 6021, \"name\": \"FeeCalculationFailure\", \"msg\": \"Fee calculation failed due to overflow, underflow, or unexpected 0\" }, { \"code\": 6022, \"name\": \"ConversionFailure\", \"msg\": \"Conversion to u64 failed with an overflow or underflow\" }, { \"code\": 6023, \"name\": \"InvalidFee\", \"msg\": \"The provided fee does not match the program owner's constraints\" }, { \"code\": 6024, \"name\": \"IncorrectTokenProgramId\", \"msg\": \"The provided token program does not match the token program expected by the swap\" }, { \"code\": 6025, \"name\": \"IncorrectOracleAccount\", \"msg\": \"Address of the provided oracle account is incorrect\" }, { \"code\": 6026, \"name\": \"IncorrectConfigAccount\", \"msg\": \"Address of the provided config account is incorrect\" }, { \"code\": 6027, \"name\": \"UnsupportedCurveType\", \"msg\": \"The provided curve type is not supported by the program owner\" }, { \"code\": 6028, \"name\": \"InvalidCurve\", \"msg\": \"The provided curve parameters are invalid\" }, { \"code\": 6029, \"name\": \"UnsupportedCurveOperation\", \"msg\": \"The operation cannot be performed on the given curve\" }, { \"code\": 6030, \"name\": \"InvalidPythStatus\", \"msg\": \"Pyth oracle status is not 'trading'\" }, { \"code\": 6031, \"name\": \"InvalidPythPrice\", \"msg\": \"Could not retrieve updated price feed from the Pyth oracle\" }, { \"code\": 6032, \"name\": \"IncorrectSigner\", \"msg\": \"Address of the provided signer account is incorrect\" }, { \"code\": 6033, \"name\": \"ExceedPoolBalance\", \"msg\": \"Swap amount exceeds pool balance\" }, { \"code\": 6034, \"name\": \"ProgramIsFrozen\", \"msg\": \"Program is frozen\" }, { \"code\": 6035, \"name\": \"OracleConfidence\", \"msg\": \"Oracle confidence is too low\" }, { \"code\": 6036, \"name\": \"OverCapAmount\", \"msg\": \"Over Pool Cap Amount\" }, { \"code\": 6037, \"name\": \"InvalidUpdateAccount\", \"msg\": \"Invalid update wallet address\" } ] }" + } +} \ No newline at end of file diff --git a/tests/sol-anchor/oasis.json b/tests/sol-anchor/oasis.json new file mode 100644 index 0000000..3cfd292 --- /dev/null +++ b/tests/sol-anchor/oasis.json @@ -0,0 +1,9 @@ +{ + "generator": "sol-anchor-beta", + "state": { + "name": "my_project", + "chainName": "solana-mainnet", + "initialBlockSet": true, + "idlString": "{ \"version\": \"0.1.1\", \"name\": \"marcopolo\", \"instructions\": [ { \"name\": \"createPool\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"adminXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"projectOwner\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"lpFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"buybackFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"projectFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"mercantiFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"initialTokenX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"initialTokenY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"bump\", \"type\": \"u8\" } ] }, { \"name\": \"createProvider\", \"accounts\": [ { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"provider\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"owner\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"tokenXAmount\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"tokenYAmount\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"bump\", \"type\": \"u8\" } ] }, { \"name\": \"createState\", \"accounts\": [ { \"name\": \"state\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"bump\", \"type\": \"u8\" }, { \"name\": \"nonce\", \"type\": \"u8\" } ] }, { \"name\": \"addTokens\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"provider\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"owner\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"deltaX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"deltaY\", \"type\": { \"defined\": \"Token\" } } ] }, { \"name\": \"withdrawBuyback\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"buybackXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"buybackYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"swap\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"swapperXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"swapperYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"swapper\", \"isMut\": false, \"isSigner\": true }, { \"name\": \"referrerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"referrerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"referrer\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"deltaIn\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"priceLimit\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"xToY\", \"type\": \"bool\" } ] }, { \"name\": \"withdrawShares\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"provider\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"owner\", \"isMut\": false, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"shares\", \"type\": { \"defined\": \"Token\" } } ] }, { \"name\": \"withdrawLpFee\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"provider\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"ownerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"owner\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"withdrawProjectFee\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"projectOwnerXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"projectOwnerYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"projectOwner\", \"isMut\": false, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"createFarm\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"adminMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"supply\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"duration\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" } ] }, { \"name\": \"createDualFarm\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProjectFirst\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"adminMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"supplyMarco\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"supplyProjectFirst\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"duration\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" } ] }, { \"name\": \"createTripleFarm\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProjectFirst\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProjectSecond\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"adminMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"supplyMarco\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"supplyProjectFirst\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"supplyProjectSecond\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"duration\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" } ] }, { \"name\": \"withdrawRewards\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"provider\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"owner\", \"isMut\": false, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"closePool\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"buybackXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"buybackYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"withdrawMercantiFee\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"mercantiXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"mercantiYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolXAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"poolYAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": false, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] }, { \"name\": \"addSupply\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": false, \"isSigner\": true }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"supplyMarco\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"supplyProjectFirst\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"supplyProjectSecond\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"duration\", \"type\": \"u64\" } ] }, { \"name\": \"updateFees\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"newBuybackFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"newProjectFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"newProviderFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"newMercantiFee\", \"type\": { \"defined\": \"FixedPoint\" } } ] }, { \"name\": \"resetFarm\", \"accounts\": [ { \"name\": \"state\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"pool\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"farm\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenX\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenY\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarco\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"tokenProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminMarcoAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectFirstAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"adminProjectSecondAccount\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"admin\", \"isMut\": true, \"isSigner\": true }, { \"name\": \"programAuthority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false } ], \"args\": [] } ], \"accounts\": [ { \"name\": \"Farm\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"pool\", \"type\": \"publicKey\" }, { \"name\": \"tokens\", \"type\": { \"array\": [ \"publicKey\", 3 ] } }, { \"name\": \"tokenAccounts\", \"type\": { \"array\": [ \"publicKey\", 3 ] } }, { \"name\": \"supply\", \"type\": { \"array\": [ { \"defined\": \"Token\" }, 3 ] } }, { \"name\": \"supplyLeft\", \"type\": { \"array\": [ { \"defined\": \"Token\" }, 3 ] } }, { \"name\": \"accumulatedSecondsPerShare\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"offsetSecondsPerShare\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"startTime\", \"type\": \"u64\" }, { \"name\": \"endTime\", \"type\": \"u64\" }, { \"name\": \"lastUpdate\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" }, { \"name\": \"farmType\", \"type\": { \"defined\": \"FarmType\" } } ] } }, { \"name\": \"Pool\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"tokenX\", \"type\": \"publicKey\" }, { \"name\": \"tokenY\", \"type\": \"publicKey\" }, { \"name\": \"poolXAccount\", \"type\": \"publicKey\" }, { \"name\": \"poolYAccount\", \"type\": \"publicKey\" }, { \"name\": \"admin\", \"type\": \"publicKey\" }, { \"name\": \"projectOwner\", \"type\": \"publicKey\" }, { \"name\": \"tokenXReserve\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"tokenYReserve\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"selfShares\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"allShares\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"buybackAmountX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"buybackAmountY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"projectAmountX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"projectAmountY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"mercantiAmountX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"mercantiAmountY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"lpAccumulatorX\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lpAccumulatorY\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"constK\", \"type\": { \"defined\": \"Product\" } }, { \"name\": \"price\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lpFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"buybackFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"projectFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"mercantiFee\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"farmCount\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" } ] } }, { \"name\": \"Provider\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"tokenX\", \"type\": \"publicKey\" }, { \"name\": \"tokenY\", \"type\": \"publicKey\" }, { \"name\": \"owner\", \"type\": \"publicKey\" }, { \"name\": \"shares\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"lastFeeAccumulatorX\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lastFeeAccumulatorY\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lastSecondsPerShare\", \"type\": { \"defined\": \"FixedPoint\" } }, { \"name\": \"lastWithdrawTime\", \"type\": \"u64\" }, { \"name\": \"tokensOwedX\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"tokensOwedY\", \"type\": { \"defined\": \"Token\" } }, { \"name\": \"currentFarmCount\", \"type\": \"u64\" }, { \"name\": \"bump\", \"type\": \"u8\" } ] } }, { \"name\": \"State\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"admin\", \"type\": \"publicKey\" }, { \"name\": \"programAuthority\", \"type\": \"publicKey\" }, { \"name\": \"bump\", \"type\": \"u8\" }, { \"name\": \"nonce\", \"type\": \"u8\" } ] } } ], \"types\": [ { \"name\": \"FixedPoint\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"v\", \"type\": \"u128\" } ] } }, { \"name\": \"Token\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"v\", \"type\": \"u64\" } ] } }, { \"name\": \"Product\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"v\", \"type\": \"u128\" } ] } }, { \"name\": \"FarmType\", \"type\": { \"kind\": \"enum\", \"variants\": [ { \"name\": \"Single\" }, { \"name\": \"Dual\" }, { \"name\": \"Triple\" } ] } } ], \"errors\": [ { \"code\": 6000, \"name\": \"DeltaTooBig\", \"msg\": \"Delta greater than provider's tokens\" }, { \"code\": 6001, \"name\": \"TokenUnderflow\", \"msg\": \"Token amount underflow\" }, { \"code\": 6002, \"name\": \"WrongRatio\", \"msg\": \"Wrong tokens ratio\" }, { \"code\": 6003, \"name\": \"TooMuchShares\", \"msg\": \"Too much shares provided\" }, { \"code\": 6004, \"name\": \"SwapToBig\", \"msg\": \"Swap too big\" }, { \"code\": 6005, \"name\": \"FeeExceeded\", \"msg\": \"Fee exceeded 100%\" }, { \"code\": 6007, \"name\": \"ScalesNotEqual\", \"msg\": \"Scales have to be equal\" }, { \"code\": 6008, \"name\": \"FeeExceededDeltaOut\", \"msg\": \"Fees exceeded delta_out\" }, { \"code\": 6009, \"name\": \"PriceLimitExceeded\", \"msg\": \"Price limit exceeded\" }, { \"code\": 6010, \"name\": \"MintMismatch\", \"msg\": \"Mint mismatch\" }, { \"code\": 6011, \"name\": \"TokensAreTheSame\", \"msg\": \"Tokens are the same\" }, { \"code\": 6012, \"name\": \"WrongFarm\", \"msg\": \"Cannot add supply to wrong farm\" }, { \"code\": 6013, \"name\": \"RewardsExceedingSupply\", \"msg\": \"Cannot withdraw rewards exceeding supply left\" }, { \"code\": 6014, \"name\": \"FarmNotEnded\", \"msg\": \"Farm has not ended, cannot add additional rewards\" } ], \"metadata\": { \"address\": \"9tKE7Mbmj4mxDjWatikzGAtkoWosiiZX9y6J4Hfm2R8H\" } }" + } +} \ No newline at end of file diff --git a/tests/sol-anchor/raydium-cp-swap.json b/tests/sol-anchor/raydium-cp-swap.json new file mode 100644 index 0000000..8444b4d --- /dev/null +++ b/tests/sol-anchor/raydium-cp-swap.json @@ -0,0 +1,9 @@ +{ + "generator": "sol-anchor-beta", + "state": { + "name": "my_project", + "chainName": "solana-mainnet", + "initialBlockSet": true, + "idlString": "{ \"version\": \"0.1.0\", \"name\": \"raydium_cp_swap\", \"metadata\": { \"address\": \"CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C\" }, \"instructions\": [ { \"name\": \"createAmmConfig\", \"docs\": [ \"# Arguments\", \"\", \"* `ctx`- The accounts needed by instruction.\", \"* `index` - The index of amm config, there may be multiple config.\", \"* `trade_fee_rate` - Trade fee rate, can be changed.\", \"* `protocol_fee_rate` - The rate of protocol fee within tarde fee.\", \"* `fund_fee_rate` - The rate of fund fee within tarde fee.\", \"\" ], \"accounts\": [ { \"name\": \"owner\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"Address to be set as protocol owner.\" ] }, { \"name\": \"ammConfig\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Initialize config state account to store protocol owner address and fee rates.\" ] }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false } ], \"args\": [ { \"name\": \"index\", \"type\": \"u16\" }, { \"name\": \"tradeFeeRate\", \"type\": \"u64\" }, { \"name\": \"protocolFeeRate\", \"type\": \"u64\" }, { \"name\": \"fundFeeRate\", \"type\": \"u64\" }, { \"name\": \"createPoolFee\", \"type\": \"u64\" } ] }, { \"name\": \"updateAmmConfig\", \"docs\": [ \"Updates the owner of the amm config\", \"Must be called by the current owner or admin\", \"\", \"# Arguments\", \"\", \"* `ctx`- The context of accounts\", \"* `trade_fee_rate`- The new trade fee rate of amm config, be set when `param` is 0\", \"* `protocol_fee_rate`- The new protocol fee rate of amm config, be set when `param` is 1\", \"* `fund_fee_rate`- The new fund fee rate of amm config, be set when `param` is 2\", \"* `new_owner`- The config's new owner, be set when `param` is 3\", \"* `new_fund_owner`- The config's new fund owner, be set when `param` is 4\", \"* `param`- The vaule can be 0 | 1 | 2 | 3 | 4, otherwise will report a error\", \"\" ], \"accounts\": [ { \"name\": \"owner\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The amm config owner or admin\" ] }, { \"name\": \"ammConfig\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Amm config account to be changed\" ] } ], \"args\": [ { \"name\": \"param\", \"type\": \"u8\" }, { \"name\": \"value\", \"type\": \"u64\" } ] }, { \"name\": \"updatePoolStatus\", \"docs\": [ \"Update pool status for given vaule\", \"\", \"# Arguments\", \"\", \"* `ctx`- The context of accounts\", \"* `status` - The vaule of status\", \"\" ], \"accounts\": [ { \"name\": \"authority\", \"isMut\": false, \"isSigner\": true }, { \"name\": \"poolState\", \"isMut\": true, \"isSigner\": false } ], \"args\": [ { \"name\": \"status\", \"type\": \"u8\" } ] }, { \"name\": \"collectProtocolFee\", \"docs\": [ \"Collect the protocol fee accrued to the pool\", \"\", \"# Arguments\", \"\", \"* `ctx` - The context of accounts\", \"* `amount_0_requested` - The maximum amount of token_0 to send, can be 0 to collect fees in only token_1\", \"* `amount_1_requested` - The maximum amount of token_1 to send, can be 0 to collect fees in only token_0\", \"\" ], \"accounts\": [ { \"name\": \"owner\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Only admin or owner can collect fee now\" ] }, { \"name\": \"authority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"poolState\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Pool state stores accumulated protocol fee amount\" ] }, { \"name\": \"ammConfig\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Amm config account stores owner\" ] }, { \"name\": \"token0Vault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that holds pool tokens for token_0\" ] }, { \"name\": \"token1Vault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that holds pool tokens for token_1\" ] }, { \"name\": \"vault0Mint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of token_0 vault\" ] }, { \"name\": \"vault1Mint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of token_1 vault\" ] }, { \"name\": \"recipientToken0Account\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that receives the collected token_0 protocol fees\" ] }, { \"name\": \"recipientToken1Account\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that receives the collected token_1 protocol fees\" ] }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The SPL program to perform token transfers\" ] }, { \"name\": \"tokenProgram2022\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The SPL program 2022 to perform token transfers\" ] } ], \"args\": [ { \"name\": \"amount0Requested\", \"type\": \"u64\" }, { \"name\": \"amount1Requested\", \"type\": \"u64\" } ] }, { \"name\": \"collectFundFee\", \"docs\": [ \"Collect the fund fee accrued to the pool\", \"\", \"# Arguments\", \"\", \"* `ctx` - The context of accounts\", \"* `amount_0_requested` - The maximum amount of token_0 to send, can be 0 to collect fees in only token_1\", \"* `amount_1_requested` - The maximum amount of token_1 to send, can be 0 to collect fees in only token_0\", \"\" ], \"accounts\": [ { \"name\": \"owner\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Only admin or fund_owner can collect fee now\" ] }, { \"name\": \"authority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"poolState\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Pool state stores accumulated protocol fee amount\" ] }, { \"name\": \"ammConfig\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Amm config account stores fund_owner\" ] }, { \"name\": \"token0Vault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that holds pool tokens for token_0\" ] }, { \"name\": \"token1Vault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that holds pool tokens for token_1\" ] }, { \"name\": \"vault0Mint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of token_0 vault\" ] }, { \"name\": \"vault1Mint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of token_1 vault\" ] }, { \"name\": \"recipientToken0Account\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that receives the collected token_0 fund fees\" ] }, { \"name\": \"recipientToken1Account\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that receives the collected token_1 fund fees\" ] }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The SPL program to perform token transfers\" ] }, { \"name\": \"tokenProgram2022\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The SPL program 2022 to perform token transfers\" ] } ], \"args\": [ { \"name\": \"amount0Requested\", \"type\": \"u64\" }, { \"name\": \"amount1Requested\", \"type\": \"u64\" } ] }, { \"name\": \"initialize\", \"docs\": [ \"Creates a pool for the given token pair and the initial price\", \"\", \"# Arguments\", \"\", \"* `ctx`- The context of accounts\", \"* `init_amount_0` - the initial amount_0 to deposit\", \"* `init_amount_1` - the initial amount_1 to deposit\", \"* `open_time` - the timestamp allowed for swap\", \"\" ], \"accounts\": [ { \"name\": \"creator\", \"isMut\": true, \"isSigner\": true, \"docs\": [ \"Address paying to create the pool. Can be anyone\" ] }, { \"name\": \"ammConfig\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Which config the pool belongs to.\" ] }, { \"name\": \"authority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"poolState\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Initialize an account to store the pool state\" ] }, { \"name\": \"token0Mint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Token_0 mint, the key must smaller then token_1 mint.\" ] }, { \"name\": \"token1Mint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Token_1 mint, the key must grater then token_0 mint.\" ] }, { \"name\": \"lpMint\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"pool lp mint\" ] }, { \"name\": \"creatorToken0\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"payer token0 account\" ] }, { \"name\": \"creatorToken1\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"creator token1 account\" ] }, { \"name\": \"creatorLpToken\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"creator lp token account\" ] }, { \"name\": \"token0Vault\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"token1Vault\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"createPoolFee\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"create pool fee account\" ] }, { \"name\": \"observationState\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"an account to store oracle observations\" ] }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Program to create mint account and mint tokens\" ] }, { \"name\": \"token0Program\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Spl token program or token program 2022\" ] }, { \"name\": \"token1Program\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Spl token program or token program 2022\" ] }, { \"name\": \"associatedTokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Program to create an ATA for receiving position NFT\" ] }, { \"name\": \"systemProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"To create a new program account\" ] }, { \"name\": \"rent\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Sysvar for program account\" ] } ], \"args\": [ { \"name\": \"initAmount0\", \"type\": \"u64\" }, { \"name\": \"initAmount1\", \"type\": \"u64\" }, { \"name\": \"openTime\", \"type\": \"u64\" } ] }, { \"name\": \"deposit\", \"docs\": [ \"Creates a pool for the given token pair and the initial price\", \"\", \"# Arguments\", \"\", \"* `ctx`- The context of accounts\", \"* `lp_token_amount` - Pool token amount to transfer. token_a and token_b amount are set by the current exchange rate and size of the pool\", \"* `maximum_token_0_amount` - Maximum token 0 amount to deposit, prevents excessive slippage\", \"* `maximum_token_1_amount` - Maximum token 1 amount to deposit, prevents excessive slippage\", \"\" ], \"accounts\": [ { \"name\": \"owner\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Pays to mint the position\" ] }, { \"name\": \"authority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"poolState\", \"isMut\": true, \"isSigner\": false }, { \"name\": \"ownerLpToken\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Owner lp tokan account\" ] }, { \"name\": \"token0Account\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The payer's token account for token_0\" ] }, { \"name\": \"token1Account\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The payer's token account for token_1\" ] }, { \"name\": \"token0Vault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that holds pool tokens for token_0\" ] }, { \"name\": \"token1Vault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that holds pool tokens for token_1\" ] }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"token Program\" ] }, { \"name\": \"tokenProgram2022\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Token program 2022\" ] }, { \"name\": \"vault0Mint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of token_0 vault\" ] }, { \"name\": \"vault1Mint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of token_1 vault\" ] }, { \"name\": \"lpMint\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Lp token mint\" ] } ], \"args\": [ { \"name\": \"lpTokenAmount\", \"type\": \"u64\" }, { \"name\": \"maximumToken0Amount\", \"type\": \"u64\" }, { \"name\": \"maximumToken1Amount\", \"type\": \"u64\" } ] }, { \"name\": \"withdraw\", \"docs\": [ \"Withdraw lp for token0 ande token1\", \"\", \"# Arguments\", \"\", \"* `ctx`- The context of accounts\", \"* `lp_token_amount` - Amount of pool tokens to burn. User receives an output of token a and b based on the percentage of the pool tokens that are returned.\", \"* `minimum_token_0_amount` - Minimum amount of token 0 to receive, prevents excessive slippage\", \"* `minimum_token_1_amount` - Minimum amount of token 1 to receive, prevents excessive slippage\", \"\" ], \"accounts\": [ { \"name\": \"owner\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"Pays to mint the position\" ] }, { \"name\": \"authority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"poolState\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Pool state account\" ] }, { \"name\": \"ownerLpToken\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Owner lp token account\" ] }, { \"name\": \"token0Account\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The owner's token account for receive token_0\" ] }, { \"name\": \"token1Account\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The owner's token account for receive token_1\" ] }, { \"name\": \"token0Vault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that holds pool tokens for token_0\" ] }, { \"name\": \"token1Vault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The address that holds pool tokens for token_1\" ] }, { \"name\": \"tokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"token Program\" ] }, { \"name\": \"tokenProgram2022\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"Token program 2022\" ] }, { \"name\": \"vault0Mint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of token_0 vault\" ] }, { \"name\": \"vault1Mint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of token_1 vault\" ] }, { \"name\": \"lpMint\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"Pool lp token mint\" ] }, { \"name\": \"memoProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"memo program\" ] } ], \"args\": [ { \"name\": \"lpTokenAmount\", \"type\": \"u64\" }, { \"name\": \"minimumToken0Amount\", \"type\": \"u64\" }, { \"name\": \"minimumToken1Amount\", \"type\": \"u64\" } ] }, { \"name\": \"swapBaseInput\", \"docs\": [ \"Swap the tokens in the pool base input amount\", \"\", \"# Arguments\", \"\", \"* `ctx`- The context of accounts\", \"* `amount_in` - input amount to transfer, output to DESTINATION is based on the exchange rate\", \"* `minimum_amount_out` - Minimum amount of output token, prevents excessive slippage\", \"\" ], \"accounts\": [ { \"name\": \"payer\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The user performing the swap\" ] }, { \"name\": \"authority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"ammConfig\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The factory state to read protocol fees\" ] }, { \"name\": \"poolState\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The program account of the pool in which the swap will be performed\" ] }, { \"name\": \"inputTokenAccount\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The user token account for input token\" ] }, { \"name\": \"outputTokenAccount\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The user token account for output token\" ] }, { \"name\": \"inputVault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The vault token account for input token\" ] }, { \"name\": \"outputVault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The vault token account for output token\" ] }, { \"name\": \"inputTokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"SPL program for input token transfers\" ] }, { \"name\": \"outputTokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"SPL program for output token transfers\" ] }, { \"name\": \"inputTokenMint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of input token\" ] }, { \"name\": \"outputTokenMint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of output token\" ] }, { \"name\": \"observationState\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The program account for the most recent oracle observation\" ] } ], \"args\": [ { \"name\": \"amountIn\", \"type\": \"u64\" }, { \"name\": \"minimumAmountOut\", \"type\": \"u64\" } ] }, { \"name\": \"swapBaseOutput\", \"docs\": [ \"Swap the tokens in the pool base output amount\", \"\", \"# Arguments\", \"\", \"* `ctx`- The context of accounts\", \"* `max_amount_in` - input amount prevents excessive slippage\", \"* `amount_out` - amount of output token\", \"\" ], \"accounts\": [ { \"name\": \"payer\", \"isMut\": false, \"isSigner\": true, \"docs\": [ \"The user performing the swap\" ] }, { \"name\": \"authority\", \"isMut\": false, \"isSigner\": false }, { \"name\": \"ammConfig\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The factory state to read protocol fees\" ] }, { \"name\": \"poolState\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The program account of the pool in which the swap will be performed\" ] }, { \"name\": \"inputTokenAccount\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The user token account for input token\" ] }, { \"name\": \"outputTokenAccount\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The user token account for output token\" ] }, { \"name\": \"inputVault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The vault token account for input token\" ] }, { \"name\": \"outputVault\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The vault token account for output token\" ] }, { \"name\": \"inputTokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"SPL program for input token transfers\" ] }, { \"name\": \"outputTokenProgram\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"SPL program for output token transfers\" ] }, { \"name\": \"inputTokenMint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of input token\" ] }, { \"name\": \"outputTokenMint\", \"isMut\": false, \"isSigner\": false, \"docs\": [ \"The mint of output token\" ] }, { \"name\": \"observationState\", \"isMut\": true, \"isSigner\": false, \"docs\": [ \"The program account for the most recent oracle observation\" ] } ], \"args\": [ { \"name\": \"maxAmountIn\", \"type\": \"u64\" }, { \"name\": \"amountOut\", \"type\": \"u64\" } ] } ], \"accounts\": [ { \"name\": \"AmmConfig\", \"docs\": [ \"Holds the current owner of the factory\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"bump\", \"docs\": [ \"Bump to identify PDA\" ], \"type\": \"u8\" }, { \"name\": \"disableCreatePool\", \"docs\": [ \"Status to control if new pool can be create\" ], \"type\": \"bool\" }, { \"name\": \"index\", \"docs\": [ \"Config index\" ], \"type\": \"u16\" }, { \"name\": \"tradeFeeRate\", \"docs\": [ \"The trade fee, denominated in hundredths of a bip (10^-6)\" ], \"type\": \"u64\" }, { \"name\": \"protocolFeeRate\", \"docs\": [ \"The protocol fee\" ], \"type\": \"u64\" }, { \"name\": \"fundFeeRate\", \"docs\": [ \"The fund fee, denominated in hundredths of a bip (10^-6)\" ], \"type\": \"u64\" }, { \"name\": \"createPoolFee\", \"docs\": [ \"Fee for create a new pool\" ], \"type\": \"u64\" }, { \"name\": \"protocolOwner\", \"docs\": [ \"Address of the protocol fee owner\" ], \"type\": \"publicKey\" }, { \"name\": \"fundOwner\", \"docs\": [ \"Address of the fund fee owner\" ], \"type\": \"publicKey\" }, { \"name\": \"padding\", \"docs\": [ \"padding\" ], \"type\": { \"array\": [ \"u64\", 16 ] } } ] } }, { \"name\": \"ObservationState\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"initialized\", \"docs\": [ \"Whether the ObservationState is initialized\" ], \"type\": \"bool\" }, { \"name\": \"observationIndex\", \"docs\": [ \"the most-recently updated index of the observations array\" ], \"type\": \"u16\" }, { \"name\": \"poolId\", \"type\": \"publicKey\" }, { \"name\": \"observations\", \"docs\": [ \"observation array\" ], \"type\": { \"array\": [ { \"defined\": \"Observation\" }, 100 ] } }, { \"name\": \"padding\", \"docs\": [ \"padding for feature update\" ], \"type\": { \"array\": [ \"u64\", 4 ] } } ] } }, { \"name\": \"PoolState\", \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"ammConfig\", \"docs\": [ \"Which config the pool belongs\" ], \"type\": \"publicKey\" }, { \"name\": \"poolCreator\", \"docs\": [ \"pool creator\" ], \"type\": \"publicKey\" }, { \"name\": \"token0Vault\", \"docs\": [ \"Token A\" ], \"type\": \"publicKey\" }, { \"name\": \"token1Vault\", \"docs\": [ \"Token B\" ], \"type\": \"publicKey\" }, { \"name\": \"lpMint\", \"docs\": [ \"Pool tokens are issued when A or B tokens are deposited.\", \"Pool tokens can be withdrawn back to the original A or B token.\" ], \"type\": \"publicKey\" }, { \"name\": \"token0Mint\", \"docs\": [ \"Mint information for token A\" ], \"type\": \"publicKey\" }, { \"name\": \"token1Mint\", \"docs\": [ \"Mint information for token B\" ], \"type\": \"publicKey\" }, { \"name\": \"token0Program\", \"docs\": [ \"token_0 program\" ], \"type\": \"publicKey\" }, { \"name\": \"token1Program\", \"docs\": [ \"token_1 program\" ], \"type\": \"publicKey\" }, { \"name\": \"observationKey\", \"docs\": [ \"observation account to store oracle data\" ], \"type\": \"publicKey\" }, { \"name\": \"authBump\", \"type\": \"u8\" }, { \"name\": \"status\", \"docs\": [ \"Bitwise representation of the state of the pool\", \"bit0, 1: disable deposit(vaule is 1), 0: normal\", \"bit1, 1: disable withdraw(vaule is 2), 0: normal\", \"bit2, 1: disable swap(vaule is 4), 0: normal\" ], \"type\": \"u8\" }, { \"name\": \"lpMintDecimals\", \"type\": \"u8\" }, { \"name\": \"mint0Decimals\", \"docs\": [ \"mint0 and mint1 decimals\" ], \"type\": \"u8\" }, { \"name\": \"mint1Decimals\", \"type\": \"u8\" }, { \"name\": \"lpSupply\", \"docs\": [ \"lp mint supply\" ], \"type\": \"u64\" }, { \"name\": \"protocolFeesToken0\", \"docs\": [ \"The amounts of token_0 and token_1 that are owed to the liquidity provider.\" ], \"type\": \"u64\" }, { \"name\": \"protocolFeesToken1\", \"type\": \"u64\" }, { \"name\": \"fundFeesToken0\", \"type\": \"u64\" }, { \"name\": \"fundFeesToken1\", \"type\": \"u64\" }, { \"name\": \"openTime\", \"docs\": [ \"The timestamp allowed for swap in the pool.\" ], \"type\": \"u64\" }, { \"name\": \"padding\", \"docs\": [ \"padding for future updates\" ], \"type\": { \"array\": [ \"u64\", 32 ] } } ] } } ], \"types\": [ { \"name\": \"Observation\", \"docs\": [ \"The element of observations in ObservationState\" ], \"type\": { \"kind\": \"struct\", \"fields\": [ { \"name\": \"blockTimestamp\", \"docs\": [ \"The block timestamp of the observation\" ], \"type\": \"u64\" }, { \"name\": \"cumulativeToken0PriceX32\", \"docs\": [ \"the cumulative of token0 price during the duration time, Q32.32, the remaining 64 bit for overflow\" ], \"type\": \"u128\" }, { \"name\": \"cumulativeToken1PriceX32\", \"docs\": [ \"the cumulative of token1 price during the duration time, Q32.32, the remaining 64 bit for overflow\" ], \"type\": \"u128\" } ] } }, { \"name\": \"TradeDirection\", \"docs\": [ \"The direction of a trade, since curves can be specialized to treat each\", \"token differently (by adding offsets or weights)\" ], \"type\": { \"kind\": \"enum\", \"variants\": [ { \"name\": \"ZeroForOne\" }, { \"name\": \"OneForZero\" } ] } }, { \"name\": \"RoundDirection\", \"docs\": [ \"The direction to round. Used for pool token to trading token conversions to\", \"avoid losing value on any deposit or withdrawal.\" ], \"type\": { \"kind\": \"enum\", \"variants\": [ { \"name\": \"Floor\" }, { \"name\": \"Ceiling\" } ] } }, { \"name\": \"PoolStatusBitIndex\", \"type\": { \"kind\": \"enum\", \"variants\": [ { \"name\": \"Deposit\" }, { \"name\": \"Withdraw\" }, { \"name\": \"Swap\" } ] } }, { \"name\": \"PoolStatusBitFlag\", \"type\": { \"kind\": \"enum\", \"variants\": [ { \"name\": \"Enable\" }, { \"name\": \"Disable\" } ] } } ], \"events\": [ { \"name\": \"LpChangeEvent\", \"fields\": [ { \"name\": \"poolId\", \"type\": \"publicKey\", \"index\": true }, { \"name\": \"lpAmountBefore\", \"type\": \"u64\", \"index\": false }, { \"name\": \"token0VaultBefore\", \"type\": \"u64\", \"index\": false }, { \"name\": \"token1VaultBefore\", \"type\": \"u64\", \"index\": false }, { \"name\": \"token0Amount\", \"type\": \"u64\", \"index\": false }, { \"name\": \"token1Amount\", \"type\": \"u64\", \"index\": false }, { \"name\": \"token0TransferFee\", \"type\": \"u64\", \"index\": false }, { \"name\": \"token1TransferFee\", \"type\": \"u64\", \"index\": false }, { \"name\": \"changeType\", \"type\": \"u8\", \"index\": false } ] }, { \"name\": \"SwapEvent\", \"fields\": [ { \"name\": \"poolId\", \"type\": \"publicKey\", \"index\": true }, { \"name\": \"inputVaultBefore\", \"type\": \"u64\", \"index\": false }, { \"name\": \"outputVaultBefore\", \"type\": \"u64\", \"index\": false }, { \"name\": \"inputAmount\", \"type\": \"u64\", \"index\": false }, { \"name\": \"outputAmount\", \"type\": \"u64\", \"index\": false }, { \"name\": \"inputTransferFee\", \"type\": \"u64\", \"index\": false }, { \"name\": \"outputTransferFee\", \"type\": \"u64\", \"index\": false }, { \"name\": \"baseInput\", \"type\": \"bool\", \"index\": false } ] } ], \"errors\": [ { \"code\": 6000, \"name\": \"NotApproved\", \"msg\": \"Not approved\" }, { \"code\": 6001, \"name\": \"InvalidOwner\", \"msg\": \"Input account owner is not the program address\" }, { \"code\": 6002, \"name\": \"EmptySupply\", \"msg\": \"Input token account empty\" }, { \"code\": 6003, \"name\": \"InvalidInput\", \"msg\": \"InvalidInput\" }, { \"code\": 6004, \"name\": \"IncorrectLpMint\", \"msg\": \"Address of the provided lp token mint is incorrect\" }, { \"code\": 6005, \"name\": \"ExceededSlippage\", \"msg\": \"Exceeds desired slippage limit\" }, { \"code\": 6006, \"name\": \"ZeroTradingTokens\", \"msg\": \"Given pool token amount results in zero trading tokens\" }, { \"code\": 6007, \"name\": \"NotSupportMint\", \"msg\": \"Not support token_2022 mint extension\" }, { \"code\": 6008, \"name\": \"InvalidVault\", \"msg\": \"invaild vault\" }, { \"code\": 6009, \"name\": \"InitLpAmountTooLess\", \"msg\": \"Init lp amount is too less(Because 100 amount lp will be locked)\" } ] }" + } +} \ No newline at end of file diff --git a/tests/sol-anchor/sanctum.json b/tests/sol-anchor/sanctum.json new file mode 100644 index 0000000..bef6a7b --- /dev/null +++ b/tests/sol-anchor/sanctum.json @@ -0,0 +1,9 @@ +{ + "generator": "sol-anchor-beta", + "state": { + "name": "my_project", + "chainName": "solana-mainnet", + "initialBlockSet": true, + "idlString": "{\"version\":\"0.1.0\",\"name\":\"stakedex\",\"instructions\":[{\"name\":\"StakeWrappedSol\",\"accounts\":[{\"name\":\"user\",\"isMut\":false,\"isSigner\":true,\"desc\":\"The authority of wsol_account\"},{\"name\":\"wsolFrom\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The wrapped SOL token account to stake wrapped SOL from\"},{\"name\":\"destTokenTo\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The liquid staked SOL token account to receive the resulting tokens\"},{\"name\":\"wsolBridgeIn\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The PDA that serves as the wSOL account to bridge user's wSOL to SOL. Pubkey::create_with_seed(). base = sol_bridge_out.pubkey, seed = 'wsol_bridge_in'. owner = token_program\"},{\"name\":\"solBridgeOut\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The PDA that serves as the system account to bridge user's wSOL to SOL. Seeds = ['sol_bridge_out']\"},{\"name\":\"destTokenFeeTokenAccount\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The liquid staked SOL token account collecting fees. PDA. Seeds = ['fee', dest_token_mint.pubkey]\"},{\"name\":\"destTokenMint\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The liquid staked SOL mint\"},{\"name\":\"wsolMint\",\"isMut\":false,\"isSigner\":false,\"desc\":\"wSOL token mint\"},{\"name\":\"tokenProgram\",\"isMut\":false,\"isSigner\":false},{\"name\":\"systemProgram\",\"isMut\":false,\"isSigner\":false,\"desc\":\"System program. The deposit SOL accounts slice follows.\"}],\"args\":[{\"name\":\"amount\",\"type\":\"u64\"}],\"discriminant\":{\"type\":\"u8\",\"value\":0}},{\"name\":\"SwapViaStake\",\"accounts\":[{\"name\":\"user\",\"isMut\":true,\"isSigner\":true,\"desc\":\"The authority of src_token_from. Needs to be mutable to support marinade deposit stake.\"},{\"name\":\"srcTokenFrom\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The token account to swap src tokens from\"},{\"name\":\"destTokenTo\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The token account to receive dest tokens to\"},{\"name\":\"bridgeStake\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The bridge stake account thats withdrawn then deposited. PDA. seeds = ['bridge_stake', user.pubkey, SwapArgs.bridge_stake_seed]. Might be long-lived, make sure the seed is not already in use\"},{\"name\":\"destTokenFeeTokenAccount\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The dest_token_mint token account collecting fees. PDA. Seeds = ['fee', dest_token_mint.pubkey]\"},{\"name\":\"srcTokenMint\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Input token mint. If this is wrapped SOL, the account can be set to read-only\"},{\"name\":\"destTokenMint\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Output token mint. If this is wrapped SOL, the account can be set to read-only. The withdraw stake and deposit stake accounts slices follow.\"}],\"args\":[{\"name\":\"args\",\"type\":{\"defined\":\"SwapViaStakeArgs\"}}],\"discriminant\":{\"type\":\"u8\",\"value\":1}},{\"name\":\"CreateFeeTokenAccount\",\"accounts\":[{\"name\":\"payer\",\"isMut\":true,\"isSigner\":true,\"desc\":\"The person paying for the new fee token account. Can be anyone.\"},{\"name\":\"feeTokenAccount\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The self-owned fee token account to be created. Seeds = ['fee', mint_pubkey]\"},{\"name\":\"mint\",\"isMut\":false,\"isSigner\":false},{\"name\":\"tokenProgram\",\"isMut\":false,\"isSigner\":false},{\"name\":\"systemProgram\",\"isMut\":false,\"isSigner\":false}],\"args\":[],\"discriminant\":{\"type\":\"u8\",\"value\":2}},{\"name\":\"CloseFeeTokenAccount\",\"accounts\":[{\"name\":\"admin\",\"isMut\":false,\"isSigner\":true,\"desc\":\"The authorized program admin\"},{\"name\":\"feeTokenAccount\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The self-owned fee token account to close. Must be empty or wrapped SOL. Seeds = ['fee', mint_pubkey]\"},{\"name\":\"closeTo\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Refund fee_token_account's rent lamports to here\"},{\"name\":\"mint\",\"isMut\":false,\"isSigner\":false},{\"name\":\"tokenProgram\",\"isMut\":false,\"isSigner\":false}],\"args\":[],\"discriminant\":{\"type\":\"u8\",\"value\":3}},{\"name\":\"WithdrawFees\",\"accounts\":[{\"name\":\"admin\",\"isMut\":false,\"isSigner\":true,\"desc\":\"The authorized program admin\"},{\"name\":\"feeTokenAccount\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The self-owned fee token account to withdraw fees from. Seeds = ['fee', mint_pubkey]\"},{\"name\":\"withdrawTo\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Withdraw accumulated fees to here\"},{\"name\":\"mint\",\"isMut\":false,\"isSigner\":false},{\"name\":\"tokenProgram\",\"isMut\":false,\"isSigner\":false}],\"args\":[],\"discriminant\":{\"type\":\"u8\",\"value\":4}},{\"name\":\"DepositStake\",\"accounts\":[{\"name\":\"user\",\"isMut\":true,\"isSigner\":true,\"desc\":\"The withdraw authority of stake_account. Needs to be mutable to support marinade deposit stake.\"},{\"name\":\"stakeAccount\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The stake account to deposit\"},{\"name\":\"destTokenTo\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The token account to receive dest tokens to\"},{\"name\":\"destTokenFeeTokenAccount\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The dest_token_mint token account collecting fees. PDA. Seeds = ['fee', dest_token_mint.pubkey]\"},{\"name\":\"destTokenMint\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Output token mint. If this is wrapped SOL, the account can be set to read-only. The deposit stake accounts slice follows.\"}],\"args\":[],\"discriminant\":{\"type\":\"u8\",\"value\":5}},{\"name\":\"PrefundWithdrawStake\",\"accounts\":[{\"name\":\"user\",\"isMut\":true,\"isSigner\":true,\"desc\":\"The withdraw authority of stake_account. Needs to be mutable and system account to receive slumlord flash loan.\"},{\"name\":\"srcTokenFrom\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The token account to burn src tokens from in order to withdraw stake\"},{\"name\":\"bridgeStake\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The bridge stake account thats withdrawn and given to the user. PDA. seeds = ['bridge_stake', user.pubkey, SwapArgs.bridge_stake_seed]. Might be long-lived, make sure the seed is not already in use\"},{\"name\":\"srcTokenMint\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Input LST token mint\"},{\"name\":\"prefunder\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The system account PDA that contains enough SOL to prefund 2 stake accounts for withdrawal. Someone must send SOL to here to initialize it. Seeds = ['prefunder']\"},{\"name\":\"slumdogStake\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The slumdog stake account is split from bridge_stake upon stake withdraw and instant unstaked to repay slumlord's flash loan. create_with_seed(bridge_stake.pubkey, 'slumdog', stake_program). Might be long-lived, but should be not in use as long as bridge_stake is not in use\"},{\"name\":\"unstakeitProgram\",\"isMut\":false,\"isSigner\":false,\"desc\":\"Sanctum unstake program. unpXTU2Ndrc7WWNyEhQWe4udTzSibLPi25SXv2xbCHQ\"},{\"name\":\"unstakePool\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Sanctum unstake pool. FypPtwbY3FUfzJUtXHSyVRokVKG2jKtH29FmK4ebxRSd\"},{\"name\":\"poolSolReserves\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Sanctum unstake pool SOL reserves. 3rBnnH9TTgd3xwu48rnzGsaQkSr1hR64nY71DrDt6VrQ\"},{\"name\":\"unstakeFee\",\"isMut\":false,\"isSigner\":false,\"desc\":\"Sanctum unstake pool Fee account. 5Pcu8WeQa3VbBz2vdBT49Rj4gbS4hsnfzuL1LmuRaKFY\"},{\"name\":\"slumdogStakeAccRecord\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Sanctum unstake pool stake account record for slumdog stake. PDA of sanctum unstake program. Seeds = [unstakePool.pubkey, slumdogStake.pubkey].\"},{\"name\":\"unstakeProtocolFee\",\"isMut\":false,\"isSigner\":false,\"desc\":\"Sanctum unstake pool protocol fee account. 2hN9UhvRFVfPYKL6rZJ5YiLEPCLTpN755pgwDJHWgFbU\"},{\"name\":\"unstakeProtocolFeeDest\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Sanctum unstake pool protocol fee destination. unstakeProtocolFee.destination\"},{\"name\":\"clock\",\"isMut\":false,\"isSigner\":false,\"desc\":\"sysvar clock\"},{\"name\":\"stakeProgram\",\"isMut\":false,\"isSigner\":false,\"desc\":\"stake program\"},{\"name\":\"systemProgram\",\"isMut\":false,\"isSigner\":false,\"desc\":\"System program. The withdraw stake accounts slices follow.\"}],\"args\":[{\"name\":\"args\",\"type\":{\"defined\":\"SwapViaStakeArgs\"}}],\"discriminant\":{\"type\":\"u8\",\"value\":6}},{\"name\":\"PrefundSwapViaStake\",\"accounts\":[{\"name\":\"user\",\"isMut\":true,\"isSigner\":true,\"desc\":\"The authority of src_token_from, mutable system account\"},{\"name\":\"srcTokenFrom\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The token account to swap src tokens from\"},{\"name\":\"destTokenTo\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The token account to receive dest tokens to\"},{\"name\":\"bridgeStake\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The bridge stake account thats withdrawn then deposited. PDA. seeds = ['bridge_stake', user.pubkey, SwapArgs.bridge_stake_seed]. Might be long-lived, make sure the seed is not already in use\"},{\"name\":\"destTokenFeeTokenAccount\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The dest_token_mint token account collecting fees. PDA. Seeds = ['fee', dest_token_mint.pubkey]\"},{\"name\":\"srcTokenMint\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Input token mint. If this is wrapped SOL, the account can be set to read-only\"},{\"name\":\"destTokenMint\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Output token mint. If this is wrapped SOL, the account can be set to read-only\"},{\"name\":\"prefunder\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The system account PDA that contains enough SOL to prefund 2 stake accounts for withdrawal. Someone must send SOL to here to initialize it. Seeds = ['prefunder']\"},{\"name\":\"slumdogStake\",\"isMut\":true,\"isSigner\":false,\"desc\":\"The slumdog stake account is split from bridge_stake upon stake withdraw and instant unstaked to refund user. create_with_seed(bridge_stake.pubkey, 'slumdog', stake_program). Might be long-lived, but should be not in use as long as bridge_stake is not in use\"},{\"name\":\"unstakeitProgram\",\"isMut\":false,\"isSigner\":false,\"desc\":\"Sanctum unstake program. unpXTU2Ndrc7WWNyEhQWe4udTzSibLPi25SXv2xbCHQ\"},{\"name\":\"unstakePool\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Sanctum unstake pool. FypPtwbY3FUfzJUtXHSyVRokVKG2jKtH29FmK4ebxRSd\"},{\"name\":\"poolSolReserves\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Sanctum unstake pool SOL reserves. 3rBnnH9TTgd3xwu48rnzGsaQkSr1hR64nY71DrDt6VrQ\"},{\"name\":\"unstakeFee\",\"isMut\":false,\"isSigner\":false,\"desc\":\"Sanctum unstake pool Fee account. 5Pcu8WeQa3VbBz2vdBT49Rj4gbS4hsnfzuL1LmuRaKFY\"},{\"name\":\"slumdogStakeAccRecord\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Sanctum unstake pool stake account record for slumdog stake. PDA of sanctum unstake program. Seeds = [unstakePool.pubkey, slumdogStake.pubkey].\"},{\"name\":\"unstakeProtocolFee\",\"isMut\":false,\"isSigner\":false,\"desc\":\"Sanctum unstake pool protocol fee account. 2hN9UhvRFVfPYKL6rZJ5YiLEPCLTpN755pgwDJHWgFbU\"},{\"name\":\"unstakeProtocolFeeDest\",\"isMut\":true,\"isSigner\":false,\"desc\":\"Sanctum unstake pool protocol fee destination. unstakeProtocolFee.destination\"},{\"name\":\"clock\",\"isMut\":false,\"isSigner\":false,\"desc\":\"sysvar clock\"},{\"name\":\"stakeProgram\",\"isMut\":false,\"isSigner\":false,\"desc\":\"stake program\"},{\"name\":\"systemProgram\",\"isMut\":false,\"isSigner\":false,\"desc\":\"System program. The withdraw stake and deposit stake accounts slices follow.\"}],\"args\":[{\"name\":\"args\",\"type\":{\"defined\":\"SwapViaStakeArgs\"}}],\"discriminant\":{\"type\":\"u8\",\"value\":7}}],\"types\":[{\"name\":\"SwapViaStakeArgs\",\"type\":{\"kind\":\"struct\",\"fields\":[{\"name\":\"amount\",\"type\":\"u64\"},{\"name\":\"bridgeStakeSeed\",\"type\":\"u32\"}]}}],\"errors\":[{\"code\":0,\"name\":\"WrongWsolBridgeIn\",\"msg\":\"Wrong wsol_bridge_in account\"},{\"code\":1,\"name\":\"WrongSolBridgeOut\",\"msg\":\"Wrong sol_bridge_out account\"},{\"code\":2,\"name\":\"WrongFeeTokenAccount\",\"msg\":\"Wrong fee token account\"},{\"code\":3,\"name\":\"WrongTokenProgram\",\"msg\":\"Wrong token program\"},{\"code\":4,\"name\":\"NotSystemAccount\",\"msg\":\"Not system account\"},{\"code\":5,\"name\":\"NotWsolMint\",\"msg\":\"Not wSOL mint\"},{\"code\":6,\"name\":\"WrongStakePoolProgram\",\"msg\":\"Wrong stake pool program\"},{\"code\":7,\"name\":\"WrongBridgeStake\",\"msg\":\"Wrong bridge stake account\"},{\"code\":8,\"name\":\"WrongAdmin\",\"msg\":\"Wrong admin authority\"},{\"code\":9,\"name\":\"StakeAccInactive\",\"msg\":\"Stake account has no voter\"},{\"code\":10,\"name\":\"ValidatorNotPartOfStakePool\",\"msg\":\"Validator not part of stake pool\"},{\"code\":11,\"name\":\"NotSignedByAdmin\",\"msg\":\"Not signed by admin\"},{\"code\":12,\"name\":\"NumericalError\",\"msg\":\"Numerical error\"},{\"code\":13,\"name\":\"UnsupportedProgram\",\"msg\":\"Unsupported stake pool program\"},{\"code\":14,\"name\":\"UnreachableError\",\"msg\":\"If you see this, there's a serious bug somewhere\"},{\"code\":17,\"name\":\"SlumdogUnstakeTooSmall\",\"msg\":\"Instant unstake of slumdog stake was not enough to cover rent\"}],\"metadata\":{\"origin\":\"shank\",\"address\":\"stkitrT1Uoy18Dk1fTrgPw8W6MVzoCfYoAFT4MLsmhq\"}}" + } +} \ No newline at end of file