diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8450af..4568ce6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,13 +23,7 @@ jobs: with: cache: pnpm node-version: latest - - name: Install foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - run: forge install - run: pnpm install - - run: pnpm wagmi generate - run: pnpm build - name: Lint run: pnpm lint @@ -46,13 +40,7 @@ jobs: with: cache: pnpm node-version: latest - - name: Install foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - run: forge install - run: pnpm install - - run: pnpm wagmi generate - run: pnpm build - name: Typecheck run: pnpm typecheck @@ -69,13 +57,7 @@ jobs: with: cache: pnpm node-version: latest - - name: Install foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - run: forge install - run: pnpm install - - run: pnpm wagmi generate - name: Build run: pnpm build @@ -91,12 +73,6 @@ jobs: with: cache: pnpm node-version: latest - - name: Install foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - run: forge install - run: pnpm install - - run: pnpm wagmi generate - name: Run tests run: pnpm test:ci diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index be8b15b..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "lib/panoptic-v1-core"] - path = lib/panoptic-v1-core - url = https://github.com/panoptic-labs/panoptic-v1-core diff --git a/lib/panoptic-v1-core b/lib/panoptic-v1-core deleted file mode 160000 index 0c4f905..0000000 --- a/lib/panoptic-v1-core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0c4f905a39026f990f97d9e52964464d2f184a0f diff --git a/package.json b/package.json index 6b55384..5bb1d08 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "license": "MIT", "devDependencies": { "@biomejs/biome": "^1.2.2", - "@wagmi/cli": "^1.5.1", "husky": "^8.0.3" } } diff --git a/packages/panoptic-sdk/README.md b/packages/panoptic-sdk/README.md index 05271cc..b182e23 100644 --- a/packages/panoptic-sdk/README.md +++ b/packages/panoptic-sdk/README.md @@ -43,19 +43,19 @@ Typescript SDK for Panoptic - Wallet Actions - - [ ] `simulatePanopticMintOptions` - - [ ] `simulatePanopticRollOptions` - - [ ] `simulatePanopticBurnOptions` - - [ ] `simulatePanopticForceExercise` - - [ ] `simulatePanopticLiquidateAccount` - - [ ] `simulatePanopticCollateralMint` - - [ ] `simulatePanopticCollateralDeposit` - - [ ] `simulatePanopticCollateralRedeem` - - [ ] `simulatePanopticCollateralWithdraw` + - [x] `writePanopticMintOptions` + - [x] `writePanopticRollOptions` + - [x] `writePanopticBurnOptions` + - [x] `writePanopticForceExercise` + - [x] `writePanopticLiquidateAccount` + - [x] `writePanopticCollateralMint` + - [x] `writePanopticCollateralDeposit` + - [x] `writePanopticCollateralRedeem` + - [x] `writePanopticCollateralWithdraw` - Chains - - [ ] `sepoliaPanoptic` + - [x] `sepoliaPanoptic` - ABIs diff --git a/packages/panoptic-sdk/package.json b/packages/panoptic-sdk/package.json index 20c3d89..a86aab8 100644 --- a/packages/panoptic-sdk/package.json +++ b/packages/panoptic-sdk/package.json @@ -22,19 +22,22 @@ "build": "tsup", "lint": "biome check .", "format": "biome format .", - "typecheck": "tsc --noEmit" + "typecheck": "tsc --noEmit", + "test": "vitest" }, "peerDependencies": { "viem": ">=1" }, "devDependencies": { "@biomejs/biome": "^1.2.2", + "@viem/anvil": "^0.0.6", "tsup": "^7.2.0", "typescript": "^5.2.2", - "viem": "^1.12.2" + "viem": "^1.12.2", + "vitest": "^0.34.5" }, "dependencies": { - "reverse-mirage": "1.0.0-next.2", + "reverse-mirage": "1.0.0-next.3", "tiny-invariant": "^1.3.1", "uniswap-v3-sdk": "workspace:*" } diff --git a/packages/panoptic-sdk/src/_test/bytecode/collateralTracker.ts b/packages/panoptic-sdk/src/_test/bytecode/collateralTracker.ts new file mode 100644 index 0000000..b2d000f --- /dev/null +++ b/packages/panoptic-sdk/src/_test/bytecode/collateralTracker.ts @@ -0,0 +1,2 @@ +export const collateralTrackerBytecode = + "0x6080604052600436106102855760003560e01c806394bf804d11610153578063c63d75b6116100cb578063d89db2fa1161007f578063dd62ed3e11610064578063dd62ed3e1461075f578063ef8b30f714610797578063fb29238b146107b757600080fd5b8063d89db2fa1461071f578063d905777e1461073f57600080fd5b8063cd806c8b116100b0578063cd806c8b146106bf578063ce96cb77146106df578063cfd59c97146106ff57600080fd5b8063c63d75b61461067f578063c6e6f5921461069f57600080fd5b8063ac9650d811610122578063b460af9411610107578063b460af941461061f578063ba0876521461063f578063c26f3acf1461065f57600080fd5b8063ac9650d8146105df578063b3d7f6b9146105ff57600080fd5b806394bf804d1461056a57806394fe14e11461058a57806395d89b41146105aa578063a9059cbb146105bf57600080fd5b806323b872dd116102015780634cdad506116101b55780636e553f651161019a5780636e553f65146104fd57806370a082311461051d57806376ab48341461054a57600080fd5b80634cdad506146104a857806368e7bb46146104c857600080fd5b806338d52e0f116101e657806338d52e0f146104335780633bec831b1461045b578063402d267d1461047b57600080fd5b806323b872dd146103ec578063313ce5671461040c57600080fd5b8063095ea7b31161025857806318160ddd1161023d57806318160ddd1461037c5780631e364a4e146103925780631ea11808146103cc57600080fd5b8063095ea7b31461032c5780630a28a4771461035c57600080fd5b806301e1d1141461028a57806306fdde03146102c857806307a2d13a146102ea578063083953d91461030a575b600080fd5b34801561029657600080fd5b50600854600160801b81046001600160801b0390811691811691909101165b6040519081526020015b60405180910390f35b3480156102d457600080fd5b506102dd6107ea565b6040516102bf9190614c61565b3480156102f657600080fd5b506102b5610305366004614c74565b6108fb565b34801561031657600080fd5b5061032a610325366004614cb7565b610940565b005b34801561033857600080fd5b5061034c610347366004614d1e565b610a65565b60405190151581526020016102bf565b34801561036857600080fd5b506102b5610377366004614c74565b610ad2565b34801561038857600080fd5b506102b560005481565b34801561039e57600080fd5b506103b26103ad366004614e9a565b610b09565b60408051600f9390930b83526020830191909152016102bf565b3480156103d857600080fd5b506102b56103e7366004614f58565b610da4565b3480156103f857600080fd5b5061034c610407366004614fc8565b611471565b34801561041857600080fd5b50610421611543565b60405160ff90911681526020016102bf565b34801561043f57600080fd5b506003546040516001600160a01b0390911681526020016102bf565b34801561046757600080fd5b5061032a610476366004614fc8565b6115df565b34801561048757600080fd5b506102b5610496366004615009565b506cffffffffffffffffffffffffff90565b3480156104b457600080fd5b506102b56104c3366004614c74565b611655565b3480156104d457600080fd5b506104e86104e3366004615026565b611660565b604080519283526020830191909152016102bf565b34801561050957600080fd5b506102b56105183660046150b4565b6118d0565b34801561052957600080fd5b506102b5610538366004615009565b60016020526000908152604090205481565b34801561055657600080fd5b506102b56105653660046150e4565b611a2d565b34801561057657600080fd5b506102b56105853660046150b4565b611c69565b34801561059657600080fd5b506102b56105a5366004615137565b611dc7565b3480156105b657600080fd5b506102dd611dde565b3480156105cb57600080fd5b5061034c6105da366004614d1e565b611e6f565b6105f26105ed3660046151aa565b611f36565b6040516102bf919061521f565b34801561060b57600080fd5b506102b561061a366004614c74565b612049565b34801561062b57600080fd5b506102b561063a36600461529f565b6120af565b34801561064b57600080fd5b506102b561065a36600461529f565b61227a565b34801561066b57600080fd5b5061032a61067a366004614fc8565b612446565b34801561068b57600080fd5b506102b561069a366004615009565b6124a8565b3480156106ab57600080fd5b506102b56106ba366004614c74565b6124db565b3480156106cb57600080fd5b5061032a6106da366004614fc8565b612512565b3480156106eb57600080fd5b506102b56106fa366004615009565b6125b3565b34801561070b57600080fd5b5061032a61071a3660046152e1565b612689565b34801561072b57600080fd5b5061032a61073a366004615311565b612b06565b34801561074b57600080fd5b506102b561075a366004615009565b612e47565b34801561076b57600080fd5b506102b561077a36600461532a565b600260209081526000928352604080842090915290825290205481565b3480156107a357600080fd5b506102b56107b2366004614c74565b612ec2565b3480156107c357600080fd5b506107cc612ef0565b604080519384526020840192909252600f0b908201526060016102bf565b60048054600554600954604080518082018252600781527f504f50542d563100000000000000000000000000000000000000000000000000602082015290517f82f40551000000000000000000000000000000000000000000000000000000008152606095735119fb06755ef49dfb04dc777ee4bcc34372e533956382f40551956108b1956001600160a01b0392831695928216947401000000000000000000000000000000000000000090920460ff1693630100000090910462ffffff16929101615358565b600060405180830381865af41580156108ce573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108f69190810190615397565b905090565b600080548015610937576109328361092c6008546001600160801b03808216600160801b9092048116919091011690565b83612f18565b610939565b825b9392505050565b6006546001600160a01b03163314610984576040517f2dd1912a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000819003600f90810b908486038403900b80158015906109b7575084600f0b60001415806109b7575085600f0b600014155b156109c157908101905b60008213156109e75760006109d5836124db565b90506109e18882612f36565b50610a0c565b6000821215610a0c5760006109fe836000036124db565b9050610a0a8882612faf565b505b50506008805494909303600f90810b600160801b6fffffffffffffffffffffffffffffffff19871693830b9490920b6001600160801b039687160393909301851691821781900485169290920390931602909117905550565b3360008181526002602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610ac09086815260200190565b60405180910390a35060015b92915050565b600080548015610937576109328382610b046008546001600160801b03808216600160801b9092048116919091011690565b613005565b60065460009081906001600160a01b03163314610b52576040517f2dd1912a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610b5f89898761302b565b9050600f86900b81036000811315610b97576000610b7c826124db565b9050610b91610b8b8d60301c90565b82612f36565b50610bc5565b6000811215610bc5576000610bae826000036124db565b9050610bc3610bbd8d60301c90565b82612faf565b505b60088054600160801b600f89810b6001600160801b03808516919091038c830b0181166fffffffffffffffffffffffffffffffff19909416841783900481168f8f0390920b9190910116021790556000610c1c8c90565b90506000610c2a8d60181c90565b9050600960069054906101000a900462ffffff1660020b610c4f82840360020b6130a5565b1315610c5f576127119550610c6a565b610c676130c0565b95505b5050845115610d33576000610cb086600188510381518110610c8e57610c8e61542b565b6020026020010151600160028110610ca857610ca861542b565b602002015190565b9050610cfc604086901b77ffffffffffffffffffffffffffffffff00000000000000001686016001600160801b0383165b9060801b6fffffffffffffffffffffffffffffffff19160190565b86600188510381518110610d1257610d1261542b565b6020026020010151600160028110610d2c57610d2c61542b565b6020020152505b610d48610d408c60301c90565b8c878b611dc7565b9250610d9461271080600c5403610d5f8660801c90565b6001600160801b03160281610d7657610d7661545a565b8591900460801b6fffffffffffffffffffffffffffffffff19160190565b9250505097509795505050505050565b60405163986cfba360e01b8152600286900b60048201526000908190819073d7dc1782dfeb60f788f00f53e488848b211b72779063986cfba390602401602060405180830381865af4158015610dfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e229190615489565b60405163986cfba360e01b8152600289900b600482015290915060009073d7dc1782dfeb60f788f00f53e488848b211b72779063986cfba390602401602060405180830381865af4158015610e7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9f9190615489565b905060005b610ead88613126565b81101561140157610ebe88826131db565b156113f9576000610ed48983603002604c011c90565b600954909150600090600290810b610eec8c866131f2565b0260020b81610efd57610efd61545a565b059050600081830360020b8d60020b1215610f36578160020b8d8385030360020b60020281610f2e57610f2e61545a565b059050610f66565b81830160020b8d60020b1315610f66578160020b82848f030360020b60020281610f6257610f6261545a565b0590505b868111610f735786610f75565b805b96506000610f838c86613206565b600954909150600090610f9e908e9088908f9060020b613219565b905060008073bde330b3cd62e2e77ffad1840fc98a1bba032fa863c72e160b8b73d7dc1782dfeb60f788f00f53e488848b211b727763986cfba3610fe28860e81c90565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815260029190910b6004820152602401602060405180830381865af4158015611039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105d9190615489565b73d7dc1782dfeb60f788f00f53e488848b211b727763986cfba36110818960d01c90565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815260029190910b6004820152602401602060405180830381865af41580156110d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fc9190615489565b876040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b1681526001600160a01b0394851660048201529284166024840152921660448201526001600160801b0390911660648201526084016040805180830381865af4158015611177573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119b91906154a6565b9150915060008073bde330b3cd62e2e77ffad1840fc98a1bba032fa863c72e160b8c73d7dc1782dfeb60f788f00f53e488848b211b727763986cfba36111e18a60e81c90565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815260029190910b6004820152602401602060405180830381865af4158015611238573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125c9190615489565b73d7dc1782dfeb60f788f00f53e488848b211b727763986cfba36112808b60d01c90565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815260029190910b6004820152602401602060405180830381865af41580156112d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112fb9190615489565b896040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b1681526001600160a01b0394851660048201529284166024840152921660448201526001600160801b0390911660648201526084016040805180830381865af4158015611376573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139a91906154a6565b915091508560001480156113ad57508083105b806113c257508560011480156113c257508184105b156113ef576113ec6113e58483036001600160801b03878603165b9060801b0190565b8f906135ba565b9d505b5050505050505050505b600101610ea4565b50600b54600160801b9004600f90810b841d900b611462612710826114268960801d90565b600f0b02816114375761143761545a565b056113dd612710848a600f0b02816114515761145161545a565b899190056001600160801b03160190565b9b9a5050505050505050505050565b6006546040517f7f96a0640000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301526000921690637f96a06490602401602060405180830381865afa1580156114d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f991906154ca565b15611530576040517f2501f81e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61153b848484613659565b949350505050565b6003546040517fc2711c7f0000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152600090735119fb06755ef49dfb04dc777ee4bcc34372e5339063c2711c7f90602401602060405180830381865af41580156115bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f691906154e3565b6006546001600160a01b03163314611623576040517f2dd1912a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008113156116445761163f838361163a846124db565b61374b565b505050565b61163f828461163a846000036124db565b6000610acc826108fb565b60008061166f888689866137db565b90506001600160a01b038416156118c5576000806001600160a01b0386166c01000000000000000000000000846001600160801b031602816116b3576116b361545a565b0491506116d2886001600160801b0316876001600160a01b0316613863565b8201905060006116fd6116e58a60801c90565b6001600160801b0316886001600160a01b0316613863565b876001600160a01b03166c0100000000000000000000000061171f8760801c90565b6001600160801b031602816117365761173661545a565b0401905060006001600160a01b038816836d27100000000000000000000000006001600160801b038816028161176e5761176e61545a565b048161177c5761177c61545a565b0490508183106117b8576040517f2a23f1ad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808b6001600160801b03166117cf8d60801c90565b6001600160801b03161061181257896001600160a01b03166c01000000000000000000000000846127100387870302028161180c5761180c61545a565b04611841565b896001600160a01b03166c0100000000000000000000000084612710038702028161183f5761183f61545a565b045b9150866001600160801b03166118578860801c90565b6001600160801b0316106118815761187c83868603028b6001600160a01b0316613863565b611896565b6118968386028b6001600160a01b0316613863565b90506118bc612710600f83810b829005916001600160801b039186900b05168a016113dd565b97505050505050505b965096945050505050565b60006cffffffffffffffffffffffffff831115611919576040517fc56d46d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600660009054906101000a90046001600160a01b03166001600160a01b031663f34f6c1a6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561196957600080fd5b505af115801561197d573d6000803e3d6000fd5b5050505061198a83612ec2565b6003546006549192506119ac916001600160a01b0391821691339116866138e9565b6119b68282612faf565b600880546001600160801b038082168601166fffffffffffffffffffffffffffffffff1990911617905560408051848152602081018390526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d791015b60405180910390a392915050565b60405163986cfba360e01b8152600283900b6004820152600090819073d7dc1782dfeb60f788f00f53e488848b211b72779063986cfba390602401602060405180830381865af4158015611a85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa99190615489565b6001600160a01b03871660009081526001602052604081205491925090611acf906108fb565b86600f0b0390506000811315611b1957611b10611aec8760801d90565b600f0b611af98385613978565b016001600160801b03600f89900b849003166113dd565b9250505061153b565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301528516906307a2d13a9082906370a0823190602401602060405180830381865afa158015611b80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba491906154ca565b6040518263ffffffff1660e01b8152600401611bc291815260200190565b602060405180830381865afa158015611bdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0391906154ca565b611c0d8760801d90565b600f0b0390506000811315611c5e57611b1086600f0b611c2d83856139d4565b01611c5083611c3c8a60801d90565b600f0b0360006135b390919063ffffffff16565b906001600160801b03160190565b509395945050505050565b600654604080517ff34f6c1a00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163f34f6c1a916004808301928692919082900301818387803b158015611cc757600080fd5b505af1158015611cdb573d6000803e3d6000fd5b50505050611ce883612049565b90506cffffffffffffffffffffffffff811115611d31576040517fc56d46d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600354600654611d50916001600160a01b0390811691339116846138e9565b611d5a8284612faf565b600880546001600160801b038082168401166fffffffffffffffffffffffffffffffff1990911617905560408051828152602081018590526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d79101611a1f565b6000611dd5858585856137db565b95945050505050565b600354604080518082018252600281527f706f000000000000000000000000000000000000000000000000000000000000602082015290517f61de447b000000000000000000000000000000000000000000000000000000008152606092735119fb06755ef49dfb04dc777ee4bcc34372e533926361de447b926108b1926001600160a01b03169190600401615506565b6006546040517f7f96a0640000000000000000000000000000000000000000000000000000000081523360048201526000916001600160a01b031690637f96a06490602401602060405180830381865afa158015611ed1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ef591906154ca565b15611f2c576040517f2501f81e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109398383613a48565b60608167ffffffffffffffff811115611f5157611f51614d4a565b604051908082528060200260200182016040528015611f8457816020015b6060815260200190600190039081611f6f5790505b50905060005b828110156120425760008030868685818110611fa857611fa861542b565b9050602002810190611fba9190615528565b604051611fc8929190615594565b600060405180830381855af49150503d8060008114612003576040519150601f19603f3d011682016040523d82523d6000602084013e612008565b606091505b50915091508161201a57805160208201fd5b8084848151811061202d5761202d61542b565b60209081029190910101525050600101611f8a565b5092915050565b600080548015612085576120808361207a6008546001600160801b03808216600160801b9092048116919091011690565b83613005565b612087565b825b60095461271069010000000000000000009091046001600160801b0316820204019392505050565b60006120ba826125b3565b8411156120f3576040517f20adf2ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600660009054906101000a90046001600160a01b03166001600160a01b031663f34f6c1a6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561214357600080fd5b505af1158015612157573d6000803e3d6000fd5b5050505061216484610ad2565b9050336001600160a01b038316146121d4576001600160a01b038216600090815260026020908152604080832033845290915290205460001981146121d2576121ad82826155d3565b6001600160a01b03841660009081526002602090815260408083203384529091529020555b505b6121de8282612f36565b600880546001600160801b03808216879003166fffffffffffffffffffffffffffffffff19909116179055600354600654612227916001600160a01b03908116911685876138e9565b60408051858152602081018390526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db91015b60405180910390a49392505050565b600654604080517ff34f6c1a00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163f34f6c1a916004808301928692919082900301818387803b1580156122d857600080fd5b505af11580156122ec573d6000803e3d6000fd5b505050506122f982612e47565b841115612332576040517f20adf2ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b038316146123a0576001600160a01b0382166000908152600260209081526040808320338452909152902054600019811461239e5761237985826155d3565b6001600160a01b03841660009081526002602090815260408083203384529091529020555b505b6123a984611655565b90506123b58285612f36565b600880546001600160801b03808216849003166fffffffffffffffffffffffffffffffff199091161790556003546006546123fe916001600160a01b03908116911685846138e9565b60408051828152602081018690526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910161226b565b6006546001600160a01b0316331461248a576040517f2dd1912a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612495826124db565b90506124a284848361374b565b50505050565b60006103e96124c36cffffffffffffffffffffffffff6124db565b6103e802816124d4576124d461545a565b0492915050565b60008054801561093757610932838261250d6008546001600160801b03808216600160801b9092048116919091011690565b612f18565b6006546001600160a01b03163314612556576040517f2dd1912a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612561826124db565b6001600160a01b038416600090815260016020526040902054909150808211156125a15761259084868361374b565b61259c85828403612faf565b6125ac565b6125ac84868461374b565b5050505050565b6008546001600160a01b03821660009081526001602052604081205490916001600160801b03169082906125e6906108fb565b6006546040517f7f96a0640000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152929350911690637f96a064906024015b602060405180830381865afa15801561264c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061267091906154ca565b1561267c57600061153b565b808211610939578161153b565b60035474010000000000000000000000000000000000000000900460ff16156126de576040517f8f02272600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055604080517f0dfe168100000000000000000000000000000000000000000000000000000000815290516000916001600160a01b03851691630dfe1681916004808201926020929091908290030181865afa15801561277f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127a39190615489565b90506000836001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156127e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128099190615489565b60078054337fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556003805482166001600160a01b03898116919091179091556006805490921686821617909155604080517fd0c93a7c00000000000000000000000000000000000000000000000000000000815290519293509086169163d0c93a7c916004818101926020929091908290030181865afa1580156128b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128db91906155e6565b600960006101000a81548162ffffff021916908360020b62ffffff16021790555060006064856001600160a01b031663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa15801561293e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129629190615603565b62ffffff16816129745761297461545a565b60098054600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03988916908117909155600580549789167fffffffffffffffffffffff000000000000000000000000000000000000000000909816979097179a909716909614740100000000000000000000000000000000000000000298909817909355613415600c556001600160801b0392046002818102900b929092167107d00000000000000000000000000000000017600a55507fffffffffffffff00000000000000000000000000000000ffffff000000ffffff909116630100000062ffffff909216919091027fffffffffffffff00000000000000000000000000000000ffffffffffffffffff1617690a000000000000000000177fffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff166708b600000000000017909255505071232800000000000000000000000000001388600d557ffffffffffffffffffffffffffffffc00000000000000000000000000000003e8600b55565b600760009054906101000a90046001600160a01b03166001600160a01b0316634273601c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b7d9190615489565b6001600160a01b0316336001600160a01b031614612bc7576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8035600c55612bdc6040820160208301615628565b600980546001600160801b03929092166901000000000000000000027fffffffffffffff00000000000000000000000000000000ffffffffffffffffff90921691909117908190556127109062ffffff63010000009091041660020b612c486060840160408501615628565b600f0b0281612c5957612c5961545a565b600a80546fffffffffffffffffffffffffffffffff1916929091056001600160801b0316919091179055612c936080820160608301615628565b600a80546001600160801b03928316600160801b02921691909117905560006107d0612cc56080840160608501615628565b03905064e8d4a51000600382600f0b0a61196e02600f0b81612ce957612ce961545a565b056305f5e100600283600f0b0a611e8402600f0b81612d0a57612d0a61545a565b056127106130d48402600f0b056108b6010101600960066101000a81548162ffffff021916908362ffffff16021790555050806080016020810190612d4f9190615628565b600b80546fffffffffffffffffffffffffffffffff19166001600160801b0392909216919091179055612d8860c0820160a08301615628565b600d80546fffffffffffffffffffffffffffffffff19166001600160801b0392909216919091179055612dc160e0820160c08301615628565b600d80546001600160801b03928316600160801b029216919091179055612def610100820160e08301615628565b600b80546001600160801b03928316600160801b0292169190911790556040517f298ce8a14a3764fa2988c07e721c9e1fd77539854691d6ba774de4357c7a7d5b90612e3c908390615643565b60405180910390a150565b6008546000908190612e61906001600160801b03166124db565b6001600160a01b03848116600081815260016020526040908190205460065491517f7f96a064000000000000000000000000000000000000000000000000000000008152600481019390935293945090911690637f96a0649060240161262f565b600954600090610acc9061271090690100000000000000000090046001600160801b031684020483036124db565b6008546001600160801b0380821691600160801b9004166000612f116130c0565b9050909192565b6000826000190484118302158202612f2f57600080fd5b5091020490565b6001600160a01b03821660009081526001602052604081208054839290612f5e9084906155d3565b90915550506000805482900381556040518281526001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b60008054820181556001600160a01b038316808252600160209081526040808420805486019055518481529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101612fa3565b600082600019048411830215820261301c57600080fd5b50910281810615159190040190565b60008383038203600f0b801561306d57600080821261305657600a5461271090600f0b830205613067565b600a5461271090600f0b8302600003055b82019250505b612710600f0b60098054906101000a9004600f0b86860102600f0b816130955761309561545a565b05600f0b82019150509392505050565b60008082136130bc576130b7826156dd565b610acc565b5090565b6000806130e66008546001600160801b03808216600160801b9092048116919091011690565b9050806000036130f857600091505090565b60085481906001600160801b03600160801b90910416612710028161311f5761311f61545a565b0491505090565b60007afe0000000000fe0000000000fe0000000000fe00000000000000008216680100000000000000008110156131605750600092915050565b6e0100000000000000000000000000008110156131805750600192915050565b740100000000000000000000000000000000000000008110156131a65750600292915050565b7a0100000000000000000000000000000000000000000000000000008110156131d25750600392915050565b50600492915050565b600060026048603084020184901c5b069392505050565b60006110006064603084020184901c6131ea565b600060026049603084020184901c6131ea565b60008080613228878786613ac0565b909250905060008061323a8989613bd6565b61324d906001600160801b038916615715565b90506132598989613be9565b6000036133ff5760405163986cfba360e01b8152600285900b600482015273bde330b3cd62e2e77ffad1840fc98a1bba032fa8906367df6e899073d7dc1782dfeb60f788f00f53e488848b211b72779063986cfba390602401602060405180830381865af41580156132cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132f39190615489565b60405163986cfba360e01b8152600287900b600482015273d7dc1782dfeb60f788f00f53e488848b211b72779063986cfba390602401602060405180830381865af4158015613346573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061336a9190615489565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401602060405180830381865af41580156133d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133f8919061572c565b915061359a565b60405163986cfba360e01b8152600285900b600482015273bde330b3cd62e2e77ffad1840fc98a1bba032fa8906308c0f7959073d7dc1782dfeb60f788f00f53e488848b211b72779063986cfba390602401602060405180830381865af415801561346e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134929190615489565b60405163986cfba360e01b8152600287900b600482015273d7dc1782dfeb60f788f00f53e488848b211b72779063986cfba390602401602060405180830381865af41580156134e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135099190615489565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401602060405180830381865af4158015613573573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613597919061572c565b91505b6135a685858585613bfc565b9998505050505050505050565b60801b0190565b6000806135c78360801d90565b600f0b6135d48560801d90565b600f0b03905080600084600f0b86600f0b03905060008190508383600f0b14158061360257508181600f0b14155b15613639576040517fd219017400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61364e836001600160801b03831687016113dd565b979650505050505050565b6001600160a01b038316600090815260026020908152604080832033845290915281205460001981146136b55761369083826155d3565b6001600160a01b03861660009081526002602090815260408083203384529091529020555b6001600160a01b038516600090815260016020526040812080548592906136dd9084906155d3565b90915550506001600160a01b03808516600081815260016020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906137389087815260200190565b60405180910390a3506001949350505050565b6001600160a01b038316600090815260016020526040812080548392906137739084906155d3565b90915550506001600160a01b03808316600081815260016020526040908190208054850190555190918516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906137ce9085815260200190565b60405180910390a3505050565b600080600084511115613824576137f28585613c3a565b9050600083600f0b121561382457612710836000036001600160801b0316600c5402816138215761382161545a565b04015b6001600160a01b03861660009081526001602052604090205461364e61384983613d00565b610ce1613855846108fb565b6001600160801b0316860190565b600080806000198486098486029250828110838203039150508060000361388f575060601c9050610acc565b806c01000000000000000000000000116138a857600080fd5b60006c0100000000000000000000000085870980840360601c9310909103740100000000000000000000000000000000000000000291909117949350505050565b60006040517f23b872dd0000000000000000000000000000000000000000000000000000000081528481600401528381602401528281604401526020600060648360008a5af13d15601f3d11600160005114161716915050806125ac576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006ffffec4b135bb7f32a81b33b5fb40724a826001600160a01b031610156139b8576139b1836002846001600160a01b03160a613d48565b9050610acc565b6139b1836139cf6001600160a01b03851680613dda565b613e5c565b60006ffffec4b135bb7f32a81b33b5fb40724a826001600160a01b03161015613a27576139b18378010000000000000000000000000000000000000000000000006002856001600160a01b03160a613ebf565b6139b183600160801b613a436001600160a01b03861680613dda565b613ebf565b33600090815260016020526040812080548391908390613a699084906155d3565b90915550506001600160a01b038316600081815260016020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610ac09086815260200190565b60008080613ace86866131f2565b90506000613ae18787603002604c011c90565b9050600085600281900b620d89e71981613afd57613afd61545a565b05029050600086600281900b620d89e881613b1a57613b1a61545a565b0502905060006002858902810b05808503975084810196509050600288810b9088900b81613b4a57613b4a61545a565b0760020b151580613b7257508760020b8660020b81613b6b57613b6b61545a565b0760020b15155b80613b8257508260020b8760020b125b80613b9257508160020b8660020b135b15613bc9576040517fc82825f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050935093915050565b600060806041603084020184901c6131ea565b600060026040603084020184901c6131ea565b60007cffffff000000000000000000000000000000000000000000000000000060d084901b166001600160801b038316860160e886901b0101611dd5565b8051600090815b81811015613cf8576000848281518110613c5d57613c5d61542b565b6020026020010151600060028110613c7757613c7761542b565b602002015190506000613c95868481518110610c8e57610c8e61542b565b90506000613cd3878581518110613cae57613cae61542b565b6020026020010151600160028110613cc857613cc861542b565b602002015160801c90565b90506000613ce384848b85613f71565b9690960195505060019092019150613c419050565b505092915050565b806001600160801b0381168114613d43576040517fb668004500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b6000808060001984860984860292508281108382030391505080600003613d74575060c01c9050610acc565b80780100000000000000000000000000000000000000000000000011613d9957600080fd5b6000780100000000000000000000000000000000000000000000000085870980840360c01c9310909103680100000000000000000291909117949350505050565b6000808060001984860984860292508281108382030391505080600003613e06575060401c9050610acc565b806801000000000000000011613e1b57600080fd5b60006801000000000000000085870980840360401c931090910378010000000000000000000000000000000000000000000000000291909117949350505050565b6000808060001984860984860292508281108382030391505080600003613e88575060801c9050610acc565b80600160801b11613e9857600080fd5b6000600160801b85870980840360801c9310909103600160801b0291909117949350505050565b6000808060001985870985870292508281108382030391505080600003613ef85760008411613eed57600080fd5b508290049050610939565b808411613f0457600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b60055460009074010000000000000000000000000000000000000000900460ff1681613f9c87613126565b905060005b81811015613fe45782613fb5576001613fb8565b60005b60ff16613fc58983613206565b03613fdc57613fd78882898989613fef565b840193505b600101613fa1565b505050949350505050565b600084613ffc878261402a565b146140135761400e868686868661403d565b614020565b61402086868686866140f1565b9695505050505050565b60006004604a603084020184901c6131ea565b60008061404a878761402a565b9050600061405888886131db565b9050600061406689846131db565b905060006140748a8a613206565b905060006140828b86613206565b905082841415801561409357508082145b156140bf57848a10156140bf576140ac8b8a8c886144b8565b95506140ba8b8a8c88614623565b860195505b82841480156140ce5750808214155b156140e3576140e08b8a8c8b8b6146c6565b95505b505050505095945050505050565b600954600090819061410b9088908790899060020b61470d565b905060006141198888613206565b905060008115614136576040856001600160801b0316901c614138565b845b9050600061414b8a8a603002604c011c90565b9050600083156141645761415f8560801c90565b614166565b845b905060006141748c8c6131db565b9050614181828286614795565b9650806000036144a95760008c81614199828f6131f2565b600954909150600290810b8202810b059250505080840160020b8a60020b121580156141c55750856001145b806141e0575080840360020b8a60020b1280156141e0575085155b6144a75760008660011461429b5773d7dc1782dfeb60f788f00f53e488848b211b727763986cfba361421b8d8803600202620d89e7196147fe565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815260029190910b6004820152602401602060405180830381865af4158015614272573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142969190615489565b614343565b73d7dc1782dfeb60f788f00f53e488848b211b727763986cfba36142c8878e03600202620d89e7196147fe565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815260029190910b6004820152602401602060405180830381865af415801561431f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143439190615489565b905060006143538760070b61481a565b600f0b61271003905082860360020b8c60020b1280156143735750876001145b8061438f575082860160020b8c60020b1215801561438f575087155b156143dd576001600160a01b0382166c010000000000000000000000000381026127106143c56001600160801b03881683613863565b816143d2576143d261545a565b048b019a50506144a4565b60405163986cfba360e01b81526002848102900b600482015260009073d7dc1782dfeb60f788f00f53e488848b211b72779063986cfba390602401602060405180830381865af4158015614435573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144599190615489565b9050600061448b838584036001600160a01b03166c01000000000000000000000000856001600160a01b031601613ebf565b90506127106001600160801b0388168202048c019b5050505b50505b505b50505050505095945050505050565b60095460009081906144d29087908790879060020b61470d565b6009549091506000906144ed9088908890879060020b61470d565b905081608081811c90839081901c60006145078c8b613206565b905060006145158d8c613be9565b905081811461458f578160000361455b57836001600160801b0316866001600160801b0316106145475783860361454b565b8584035b6001600160801b03169850614613565b826001600160801b0316856001600160801b03161061457c5782850361454b565b8483036001600160801b03169850614613565b6000806000846001036145b35750506001600160801b0380881691508516866145c6565b50506001600160801b0380871691508416875b8183106145ef5781816001600160801b031683850302816145e9576145e961545a565b0461460d565b82816001600160801b0316848403028161460b5761460b61545a565b045b9b505050505b5050505050505050949350505050565b60008061462f866148c4565b9050600061466761464088876131db565b60011461464d578761464f565b825b86886146608b89603002604c011c90565b60006140f1565b9050600061469861467889876131db565b6001146146855788614687565b835b86896146608c8b603002604c011c90565b90508082106146b0576146ab81836155d3565b6146ba565b6146ba82826155d3565b98975050505050505050565b6000604080836001600160801b0316901c60000367ffffffffffffffff166001600160801b0316901b8260000367ffffffffffffffff1601915061402086858786866140f1565b6000808061471c878686613ac0565b909250905060008061472e8988613be9565b60000361475f5761473f8988613bd6565b880291506147588285856147538d8c613be9565b6149c2565b9050614780565b6147698988613bd6565b8802905061477d8185856147538d8c613be9565b91505b6135a6816001600160801b0384168701610ce1565b6000826000036147ca5760006147ad8360070b61481a565b600f0b90506127106001600160801b038616820204915050610939565b826001036109395760006147e08360070b614b40565b600f0b90506127106001600160801b03861682020495945050505050565b60008160020b8360020b136148135781610939565b5090919050565b600d54600a54600091600f90810b91600160801b9004810b9084900b83131561485a57600281600f0b816148505761485061545a565b0590508360000393505b81600f0b84600f0b121561486f579392505050565b600d54600160801b9004600f90810b906127109086900b8212156148965795945050505050565b838203600f0b848703600f0b848303600f0b02816148b6576148b661545a565b048301945050505050919050565b60007afe0000000000fe0000000000fe0000000000fe00000000000000008216680100000000000000008110156148fd57506000614970565b6e01000000000000000000000000000081101561491c57506001614970565b7401000000000000000000000000000000000000000081101561494157506002614970565b7a01000000000000000000000000000000000000000000000000000081101561496c57506003614970565b5060045b7fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000816004036030027b01000000000001000000000001000000000001000000000000000000901c168318915050919050565b6000808215614a625760405163986cfba360e01b81526002868601810b819005900b6004820152614a5d906001600160801b0388169073d7dc1782dfeb60f788f00f53e488848b211b72779063986cfba390602401602060405180830381865af4158015614a34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a589190615489565b6139d4565b614af4565b60405163986cfba360e01b81526002868601810b819005900b6004820152614af4906001600160801b0388169073d7dc1782dfeb60f788f00f53e488848b211b72779063986cfba390602401602060405180830381865af4158015614acb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614aef9190615489565b613978565b9050801580614b0957506001600160801b0381115b15611dd5576040517f7d0a9ef300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600d54600b54600091600f90810b91810b9084900b831315614b7957600281600f0b81614b6f57614b6f61545a565b0590508360000393505b81600f0b84600f0b1215614b8e579392505050565b612710600f85900b1315614ba757506127109392505050565b600d54600160801b9004600f90810b9085900b811215614bde57600282600f0b81614bd457614bd461545a565b0595945050505050565b6002838203600f0b868303600f0b84600f0b0281614bfe57614bfe61545a565b048301600f0b81614bd457614bd461545a565b60005b83811015614c2c578181015183820152602001614c14565b50506000910152565b60008151808452614c4d816020860160208601614c11565b601f01601f19169290920160200192915050565b6020815260006109396020830184614c35565b600060208284031215614c8657600080fd5b5035919050565b6001600160a01b0381168114614ca257600080fd5b50565b8035600f81900b8114613d4357600080fd5b600080600080600060a08688031215614ccf57600080fd5b8535614cda81614c8d565b9450614ce860208701614ca5565b9350614cf660408701614ca5565b9250614d0460608701614ca5565b9150614d1260808701614ca5565b90509295509295909350565b60008060408385031215614d3157600080fd5b8235614d3c81614c8d565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715614d9c57614d9c614d4a565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715614dcb57614dcb614d4a565b604052919050565b6000601f8381840112614de557600080fd5b8235602067ffffffffffffffff821115614e0157614e01614d4a565b614e0f818360051b01614da2565b82815260069290921b85018101918181019087841115614e2e57600080fd5b8287015b84811015614e8e578886820112614e495760008081fd5b614e51614d79565b80604083018b811115614e645760008081fd5b835b81811015614e7d5780358452928701928701614e66565b505084525091830191604001614e32565b50979650505050505050565b600080600080600080600060e0888a031215614eb557600080fd5b87359650614ec560208901614ca5565b9550614ed360408901614ca5565b9450614ee160608901614ca5565b9350614eef60808901614ca5565b9250614efd60a08901614ca5565b915060c088013567ffffffffffffffff811115614f1957600080fd5b614f258a828b01614dd3565b91505092959891949750929550565b8060020b8114614ca257600080fd5b6001600160801b0381168114614ca257600080fd5b60008060008060008060c08789031215614f7157600080fd5b8635614f7c81614c8d565b95506020870135614f8c81614f34565b94506040870135614f9c81614f34565b9350606087013592506080870135614fb381614f43565b8092505060a087013590509295509295509295565b600080600060608486031215614fdd57600080fd5b8335614fe881614c8d565b92506020840135614ff881614c8d565b929592945050506040919091013590565b60006020828403121561501b57600080fd5b813561093981614c8d565b60008060008060008060c0878903121561503f57600080fd5b863561504a81614c8d565b9550602087013567ffffffffffffffff81111561506657600080fd5b61507289828a01614dd3565b95505060408701359350606087013561508a81614f34565b9250608087013561509a81614c8d565b91506150a860a08801614ca5565b90509295509295509295565b600080604083850312156150c757600080fd5b8235915060208301356150d981614c8d565b809150509250929050565b600080600080608085870312156150fa57600080fd5b843561510581614c8d565b935060208501359250604085013561511c81614f34565b9150606085013561512c81614c8d565b939692955090935050565b6000806000806080858703121561514d57600080fd5b843561515881614c8d565b9350602085013561516881614f34565b9250604085013567ffffffffffffffff81111561518457600080fd5b61519087828801614dd3565b92505061519f60608601614ca5565b905092959194509250565b600080602083850312156151bd57600080fd5b823567ffffffffffffffff808211156151d557600080fd5b818501915085601f8301126151e957600080fd5b8135818111156151f857600080fd5b8660208260051b850101111561520d57600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015615292577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452615280858351614c35565b94509285019290850190600101615246565b5092979650505050505050565b6000806000606084860312156152b457600080fd5b8335925060208401356152c681614c8d565b915060408401356152d681614c8d565b809150509250925092565b6000806000606084860312156152f657600080fd5b833561530181614c8d565b925060208401356152c681614c8d565b6000610100828403121561532457600080fd5b50919050565b6000806040838503121561533d57600080fd5b823561534881614c8d565b915060208301356150d981614c8d565b60006001600160a01b038088168352808716602084015250841515604083015262ffffff8416606083015260a0608083015261364e60a0830184614c35565b6000602082840312156153a957600080fd5b815167ffffffffffffffff808211156153c157600080fd5b818401915084601f8301126153d557600080fd5b8151818111156153e7576153e7614d4a565b6153fa6020601f19601f84011601614da2565b915080825285602082850101111561541157600080fd5b615422816020840160208601614c11565b50949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006020828403121561549b57600080fd5b815161093981614c8d565b600080604083850312156154b957600080fd5b505080516020909101519092909150565b6000602082840312156154dc57600080fd5b5051919050565b6000602082840312156154f557600080fd5b815160ff8116811461093957600080fd5b6001600160a01b038316815260406020820152600061153b6040830184614c35565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261555d57600080fd5b83018035915067ffffffffffffffff82111561557857600080fd5b60200191503681900382131561558d57600080fd5b9250929050565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610acc57610acc6155a4565b6000602082840312156155f857600080fd5b815161093981614f34565b60006020828403121561561557600080fd5b815162ffffff8116811461093957600080fd5b60006020828403121561563a57600080fd5b61093982614ca5565b81358152610100810161565860208401614ca5565b600f81810b602085015261566e60408601614ca5565b810b604085015261568160608601614ca5565b810b606085015261569460808601614ca5565b810b60808501526156a760a08601614ca5565b810b60a08501526156ba60c08601614ca5565b900b60c0840152506156ce60e08401614ca5565b61204260e0840182600f0b9052565b60007f8000000000000000000000000000000000000000000000000000000000000000820361570e5761570e6155a4565b5060000390565b8082028115828204841417610acc57610acc6155a4565b60006020828403121561573e57600080fd5b815161093981614f4356fea2646970667358221220d75f77c5de555fd03d8bccfe570cf2d5830917b2fa2f77fe24ef16bbad1304cb64736f6c63430008120033"; diff --git a/packages/panoptic-sdk/src/_test/bytecode/mockERC20.ts b/packages/panoptic-sdk/src/_test/bytecode/mockERC20.ts new file mode 100644 index 0000000..8fe4432 --- /dev/null +++ b/packages/panoptic-sdk/src/_test/bytecode/mockERC20.ts @@ -0,0 +1,2 @@ +export const mockERC20Bytecode = + "0x60e06040523480156200001157600080fd5b5060405162001252380380620012528339810160408190526200003491620001db565b8282826000620000458482620002ef565b506001620000548382620002ef565b5060ff81166080524660a0526200006a6200007a565b60c0525062000439945050505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620000ae9190620003bb565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200013e57600080fd5b81516001600160401b03808211156200015b576200015b62000116565b604051601f8301601f19908116603f0116810190828211818310171562000186576200018662000116565b81604052838152602092508683858801011115620001a357600080fd5b600091505b83821015620001c75785820183015181830184015290820190620001a8565b600093810190920192909252949350505050565b600080600060608486031215620001f157600080fd5b83516001600160401b03808211156200020957600080fd5b62000217878388016200012c565b945060208601519150808211156200022e57600080fd5b506200023d868287016200012c565b925050604084015160ff811681146200025557600080fd5b809150509250925092565b600181811c908216806200027557607f821691505b6020821081036200029657634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002ea57600081815260208120601f850160051c81016020861015620002c55750805b601f850160051c820191505b81811015620002e657828155600101620002d1565b5050505b505050565b81516001600160401b038111156200030b576200030b62000116565b62000323816200031c845462000260565b846200029c565b602080601f8311600181146200035b5760008415620003425750858301515b600019600386901b1c1916600185901b178555620002e6565b600085815260208120601f198616915b828110156200038c578886015182559484019460019091019084016200036b565b5085821015620003ab5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000808354620003cb8162000260565b60018281168015620003e65760018114620003fc576200042d565b60ff19841687528215158302870194506200042d565b8760005260208060002060005b85811015620004245781548a82015290840190820162000409565b50505082870194505b50929695505050505050565b60805160a05160c051610de96200046960003960006104e1015260006104ac0152600061015f0152610de96000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c5780639dc29fac116100665780639dc29fac146101f8578063a9059cbb1461020b578063d505accf1461021e578063dd62ed3e1461023157600080fd5b806370a08231146101b05780637ecebe00146101d057806395d89b41146101f057600080fd5b806323b872dd116100c857806323b872dd14610147578063313ce5671461015a5780633644e5151461019357806340c10f191461019b57600080fd5b806306fdde03146100ef578063095ea7b31461010d57806318160ddd14610130575b600080fd5b6100f761025c565b6040516101049190610a72565b60405180910390f35b61012061011b366004610b07565b6102ea565b6040519015158152602001610104565b61013960025481565b604051908152602001610104565b610120610155366004610b31565b610364565b6101817f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610104565b6101396104a8565b6101ae6101a9366004610b07565b610503565b005b6101396101be366004610b6d565b60036020526000908152604090205481565b6101396101de366004610b6d565b60056020526000908152604090205481565b6100f7610511565b6101ae610206366004610b07565b61051e565b610120610219366004610b07565b610528565b6101ae61022c366004610b8f565b6105ad565b61013961023f366004610c02565b600460209081526000928352604080842090915290825290205481565b6000805461026990610c35565b80601f016020809104026020016040519081016040528092919081815260200182805461029590610c35565b80156102e25780601f106102b7576101008083540402835291602001916102e2565b820191906000526020600020905b8154815290600101906020018083116102c557829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103529086815260200190565b60405180910390a35060015b92915050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526004602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146103f8576103c68382610cb7565b73ffffffffffffffffffffffffffffffffffffffff861660009081526004602090815260408083203384529091529020555b73ffffffffffffffffffffffffffffffffffffffff85166000908152600360205260408120805485929061042d908490610cb7565b909155505073ffffffffffffffffffffffffffffffffffffffff808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104959087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104de576104d96108d1565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b61050d828261096b565b5050565b6001805461026990610c35565b61050d82826109e4565b33600090815260036020526040812080548391908390610549908490610cb7565b909155505073ffffffffffffffffffffffffffffffffffffffff8316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103529086815260200190565b4284101561061c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b600060016106286104a8565b73ffffffffffffffffffffffffffffffffffffffff8a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e0830190915280519201919091207f190100000000000000000000000000000000000000000000000000000000000061010083015261010282019290925261012281019190915261014201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa15801561077a573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116158015906107f557508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b61085b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f494e56414c49445f5349474e45520000000000000000000000000000000000006044820152606401610613565b73ffffffffffffffffffffffffffffffffffffffff90811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60006040516109039190610cca565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b806002600082825461097d9190610da0565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91015b60405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff821660009081526003602052604081208054839290610a19908490610cb7565b909155505060028054829003905560405181815260009073ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016109d8565b600060208083528351808285015260005b81811015610a9f57858101830151858201604001528201610a83565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610b0257600080fd5b919050565b60008060408385031215610b1a57600080fd5b610b2383610ade565b946020939093013593505050565b600080600060608486031215610b4657600080fd5b610b4f84610ade565b9250610b5d60208501610ade565b9150604084013590509250925092565b600060208284031215610b7f57600080fd5b610b8882610ade565b9392505050565b600080600080600080600060e0888a031215610baa57600080fd5b610bb388610ade565b9650610bc160208901610ade565b95506040880135945060608801359350608088013560ff81168114610be557600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610c1557600080fd5b610c1e83610ade565b9150610c2c60208401610ade565b90509250929050565b600181811c90821680610c4957607f821691505b602082108103610c82577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561035e5761035e610c88565b600080835481600182811c915080831680610ce657607f831692505b60208084108203610d1e577f4e487b710000000000000000000000000000000000000000000000000000000086526022600452602486fd5b818015610d325760018114610d6557610d92565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0086168952841515850289019650610d92565b60008a81526020902060005b86811015610d8a5781548b820152908501908301610d71565b505084890196505b509498975050505050505050565b8082018082111561035e5761035e610c8856fea2646970667358221220b11b12f451d302ac1575430d5233aab5c5ffbeda9357098ad5151563725bec1964736f6c63430008120033"; diff --git a/packages/panoptic-sdk/src/_test/constants.ts b/packages/panoptic-sdk/src/_test/constants.ts new file mode 100644 index 0000000..6d5adfc --- /dev/null +++ b/packages/panoptic-sdk/src/_test/constants.ts @@ -0,0 +1,8 @@ +// Test accounts +export const ACCOUNTS = [ + "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", +] as const; + +// Named accounts +export const [ALICE, BOB] = ACCOUNTS; diff --git a/packages/panoptic-sdk/src/_test/globalSetup.ts b/packages/panoptic-sdk/src/_test/globalSetup.ts new file mode 100644 index 0000000..dbd686c --- /dev/null +++ b/packages/panoptic-sdk/src/_test/globalSetup.ts @@ -0,0 +1,8 @@ +import { startProxy } from "@viem/anvil"; + +export default async function () { + return await startProxy({ + port: 8545, // By default, the proxy will listen on port 8545. + host: "::", // By default, the proxy will listen on all interfaces. + }); +} diff --git a/packages/panoptic-sdk/src/_test/utils.ts b/packages/panoptic-sdk/src/_test/utils.ts new file mode 100644 index 0000000..3a79569 --- /dev/null +++ b/packages/panoptic-sdk/src/_test/utils.ts @@ -0,0 +1,59 @@ +import { createFraction } from "reverse-mirage"; +import { + http, + createPublicClient, + createTestClient, + createWalletClient, +} from "viem"; +import { foundry } from "viem/chains"; +import type { Chain } from "viem/chains"; +import type { PanopticCollateralParamters } from "../index.js"; +import { ALICE } from "./constants.js"; + +export const pool = Number(process.env.VITEST_POOL_ID ?? 1); +export const anvil = { + ...foundry, // We are using a mainnet fork for testing. + id: foundry.id, + rpcUrls: { + // These rpc urls are automatically used in the transports. + default: { + // Note how we append the worker id to the local rpc urls. + http: [`http://127.0.0.1:8545/${pool}`], + webSocket: [`ws://127.0.0.1:8545/${pool}`], + }, + public: { + // Note how we append the worker id to the local rpc urls. + http: [`http://127.0.0.1:8545/${pool}`], + webSocket: [`ws://127.0.0.1:8545/${pool}`], + }, + }, +} as const satisfies Chain; + +export const testClient = createTestClient({ + chain: anvil, + mode: "anvil", + transport: http(), +}); + +export const publicClient = createPublicClient({ + chain: anvil, + transport: http(), +}); + +export const walletClient = createWalletClient({ + chain: anvil, + transport: http(), + account: ALICE, +}); + +export const baseParameters: PanopticCollateralParamters = { + type: "panopticCollateralParameters", + maintenanceMarginRatio: createFraction(13_333, 10_000), + commissionFee: createFraction(10, 10_000), + ITMSpreadFee: createFraction(60, 10_000), + sellCollateralRatio: createFraction(2_000, 10_000), + buyCollateralRatio: createFraction(1_000, 10_000), + targetPoolUtilization: createFraction(5_000, 10_000), + saturatedPoolUtilization: createFraction(9_000, 10_000), + exerciseCost: createFraction(-1_024, 10_000), +}; diff --git a/packages/panoptic-sdk/src/abi/collateralTracker.ts b/packages/panoptic-sdk/src/abi/collateralTracker.ts new file mode 100644 index 0000000..3136fe3 --- /dev/null +++ b/packages/panoptic-sdk/src/abi/collateralTracker.ts @@ -0,0 +1,1166 @@ +export const collateralTrackerABI = [ + { + inputs: [], + name: "CastingError", + type: "error", + }, + { + inputs: [], + name: "CollateralTokenAlreadyInitialized", + type: "error", + }, + { + inputs: [], + name: "DepositTooLarge", + type: "error", + }, + { + inputs: [], + name: "ExceedsMaximumRedemption", + type: "error", + }, + { + inputs: [], + name: "InvalidNotionalValue", + type: "error", + }, + { + inputs: [], + name: "NotMarginCalled", + type: "error", + }, + { + inputs: [], + name: "NotOwner", + type: "error", + }, + { + inputs: [], + name: "NotPanopticPool", + type: "error", + }, + { + inputs: [], + name: "PositionCountNotZero", + type: "error", + }, + { + inputs: [], + name: "TicksNotInitializable", + type: "error", + }, + { + inputs: [], + name: "TransferFailed", + type: "error", + }, + { + inputs: [], + name: "UnderOverFlow", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "assets", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "shares", + type: "uint256", + }, + ], + name: "Deposit", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "maintenanceMarginRatio", + type: "uint256", + }, + { + internalType: "int128", + name: "commissionFee", + type: "int128", + }, + { + internalType: "int128", + name: "ITMSpreadFee", + type: "int128", + }, + { + internalType: "int128", + name: "sellCollateralRatio", + type: "int128", + }, + { + internalType: "int128", + name: "buyCollateralRatio", + type: "int128", + }, + { + internalType: "int128", + name: "targetPoolUtilization", + type: "int128", + }, + { + internalType: "int128", + name: "saturatedPoolUtilization", + type: "int128", + }, + { + internalType: "int128", + name: "exerciseCost", + type: "int128", + }, + ], + indexed: false, + internalType: "struct CollateralTracker.Parameters", + name: "newParameters", + type: "tuple", + }, + ], + name: "ParametersUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "receiver", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "assets", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "shares", + type: "uint256", + }, + ], + name: "Withdraw", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "allowance", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "asset", + outputs: [ + { + internalType: "address", + name: "assetTokenAddress", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256[2][]", + name: "positionBalanceArray", + type: "uint256[2][]", + }, + { + internalType: "uint256", + name: "otherTokenData", + type: "uint256", + }, + { + internalType: "int24", + name: "twapTick", + type: "int24", + }, + { + internalType: "uint160", + name: "sqrtPriceX96", + type: "uint160", + }, + { + internalType: "int128", + name: "premium", + type: "int128", + }, + ], + name: "computeBonus", + outputs: [ + { + internalType: "int256", + name: "bonusAmounts", + type: "int256", + }, + { + internalType: "uint256", + name: "tokenData", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "shares", + type: "uint256", + }, + ], + name: "convertToAssets", + outputs: [ + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + ], + name: "convertToShares", + outputs: [ + { + internalType: "uint256", + name: "shares", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "delegator", + type: "address", + }, + { + internalType: "address", + name: "delegatee", + type: "address", + }, + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + ], + name: "delegate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + ], + name: "deposit", + outputs: [ + { + internalType: "uint256", + name: "shares", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "optionOwner", + type: "address", + }, + { + internalType: "int128", + name: "longAmount", + type: "int128", + }, + { + internalType: "int128", + name: "shortAmount", + type: "int128", + }, + { + internalType: "int128", + name: "swappedAmount", + type: "int128", + }, + { + internalType: "int128", + name: "currentPositionPremium", + type: "int128", + }, + ], + name: "exercise", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "int24", + name: "currentTick", + type: "int24", + }, + { + internalType: "int24", + name: "medianTick", + type: "int24", + }, + { + internalType: "uint256", + name: "positionId", + type: "uint256", + }, + { + internalType: "uint128", + name: "positionBalance", + type: "uint128", + }, + { + internalType: "int256", + name: "longAmounts", + type: "int256", + }, + ], + name: "exerciseCost", + outputs: [ + { + internalType: "int256", + name: "exerciseFees", + type: "int256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + { + internalType: "int24", + name: "currentTick", + type: "int24", + }, + { + internalType: "uint256[2][]", + name: "positionBalanceArray", + type: "uint256[2][]", + }, + { + internalType: "int128", + name: "premiumAllPositions", + type: "int128", + }, + ], + name: "getAccountMarginDetails", + outputs: [ + { + internalType: "uint256", + name: "tokenData", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPoolData", + outputs: [ + { + internalType: "uint256", + name: "poolAssets", + type: "uint256", + }, + { + internalType: "uint256", + name: "insideAMM", + type: "uint256", + }, + { + internalType: "int128", + name: "currentPoolUtilization", + type: "int128", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "refunder", + type: "address", + }, + { + internalType: "int256", + name: "refundValues", + type: "int256", + }, + { + internalType: "int24", + name: "atTick", + type: "int24", + }, + { + internalType: "contract CollateralTracker", + name: "collateralToken1", + type: "address", + }, + ], + name: "getRefundAmounts", + outputs: [ + { + internalType: "int256", + name: "refundAmounts", + type: "int256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "maxDeposit", + outputs: [ + { + internalType: "uint256", + name: "maxAssets", + type: "uint256", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "maxMint", + outputs: [ + { + internalType: "uint256", + name: "maxShares", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "maxRedeem", + outputs: [ + { + internalType: "uint256", + name: "maxShares", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "maxWithdraw", + outputs: [ + { + internalType: "uint256", + name: "maxAssets", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "shares", + type: "uint256", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + ], + name: "mint", + outputs: [ + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "name", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + ], + name: "previewDeposit", + outputs: [ + { + internalType: "uint256", + name: "shares", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "shares", + type: "uint256", + }, + ], + name: "previewMint", + outputs: [ + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "shares", + type: "uint256", + }, + ], + name: "previewRedeem", + outputs: [ + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + ], + name: "previewWithdraw", + outputs: [ + { + internalType: "uint256", + name: "shares", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "shares", + type: "uint256", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "redeem", + outputs: [ + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "refunder", + type: "address", + }, + { + internalType: "address", + name: "refundee", + type: "address", + }, + { + internalType: "int256", + name: "assets", + type: "int256", + }, + ], + name: "refund", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "delegator", + type: "address", + }, + { + internalType: "address", + name: "delegatee", + type: "address", + }, + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + ], + name: "revoke", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "underlyingToken", + type: "address", + }, + { + internalType: "contract IUniswapV3Pool", + name: "uniswapPool", + type: "address", + }, + { + internalType: "contract PanopticPool", + name: "panopticPool", + type: "address", + }, + ], + name: "startToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "symbol", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "environmentContext", + type: "uint256", + }, + { + internalType: "int128", + name: "longAmount", + type: "int128", + }, + { + internalType: "int128", + name: "shortAmount", + type: "int128", + }, + { + internalType: "int128", + name: "portfolioPremium", + type: "int128", + }, + { + internalType: "int128", + name: "oldPositionPremia", + type: "int128", + }, + { + internalType: "int128", + name: "swappedAmount", + type: "int128", + }, + { + internalType: "uint256[2][]", + name: "positionBalanceArray", + type: "uint256[2][]", + }, + ], + name: "takeCommissionAddData", + outputs: [ + { + internalType: "int128", + name: "utilization", + type: "int128", + }, + { + internalType: "uint256", + name: "tokenData", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "totalAssets", + outputs: [ + { + internalType: "uint256", + name: "totalManagedAssets", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "maintenanceMarginRatio", + type: "uint256", + }, + { + internalType: "int128", + name: "commissionFee", + type: "int128", + }, + { + internalType: "int128", + name: "ITMSpreadFee", + type: "int128", + }, + { + internalType: "int128", + name: "sellCollateralRatio", + type: "int128", + }, + { + internalType: "int128", + name: "buyCollateralRatio", + type: "int128", + }, + { + internalType: "int128", + name: "targetPoolUtilization", + type: "int128", + }, + { + internalType: "int128", + name: "saturatedPoolUtilization", + type: "int128", + }, + { + internalType: "int128", + name: "exerciseCost", + type: "int128", + }, + ], + internalType: "struct CollateralTracker.Parameters", + name: "newParameters", + type: "tuple", + }, + ], + name: "updateParameters", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "assets", + type: "uint256", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "withdraw", + outputs: [ + { + internalType: "uint256", + name: "shares", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/packages/panoptic-sdk/src/abi/mockERC20.ts b/packages/panoptic-sdk/src/abi/mockERC20.ts new file mode 100644 index 0000000..9281062 --- /dev/null +++ b/packages/panoptic-sdk/src/abi/mockERC20.ts @@ -0,0 +1,356 @@ +export const mockERC20ABI = [ + { + inputs: [ + { + internalType: "string", + name: "_name", + type: "string", + }, + { + internalType: "string", + name: "_symbol", + type: "string", + }, + { + internalType: "uint8", + name: "_decimals", + type: "uint8", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [], + name: "DOMAIN_SEPARATOR", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "burn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "nonces", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + ], + name: "permit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/packages/panoptic-sdk/src/abi/panopticFactory.ts b/packages/panoptic-sdk/src/abi/panopticFactory.ts new file mode 100644 index 0000000..88d2ab7 --- /dev/null +++ b/packages/panoptic-sdk/src/abi/panopticFactory.ts @@ -0,0 +1,624 @@ +export const panopticFactoryABI = [ + { + inputs: [ + { + internalType: "address", + name: "_WETH9", + type: "address", + }, + { + internalType: "contract SemiFungiblePositionManager", + name: "_SFPM", + type: "address", + }, + { + internalType: "contract IUniswapV3Factory", + name: "_univ3Factory", + type: "address", + }, + { + internalType: "address", + name: "_poolReference", + type: "address", + }, + { + internalType: "address", + name: "_collateralReference", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "InvalidUniswapCallback", + type: "error", + }, + { + inputs: [], + name: "NotOwner", + type: "error", + }, + { + inputs: [], + name: "PoolAlreadyInitialized", + type: "error", + }, + { + inputs: [], + name: "TransferFailed", + type: "error", + }, + { + inputs: [], + name: "UniswapPoolNotInitialized", + type: "error", + }, + { + inputs: [], + name: "UniswapPoolNotSupported", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "contract PanopticPool", + name: "poolAddress", + type: "address", + }, + { + indexed: true, + internalType: "contract IUniswapV3Pool", + name: "uniswapPool", + type: "address", + }, + { + indexed: false, + internalType: "contract CollateralTracker", + name: "collateralTracker0", + type: "address", + }, + { + indexed: false, + internalType: "contract CollateralTracker", + name: "collateralTracker1", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "rareNftId", + type: "uint256", + }, + { + indexed: true, + internalType: "uint256", + name: "rarity", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount0", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount1", + type: "uint256", + }, + ], + name: "PoolDeployed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256[]", + name: "ids", + type: "uint256[]", + }, + { + indexed: false, + internalType: "uint256[]", + name: "values", + type: "uint256[]", + }, + ], + name: "TransferBatch", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "TransferSingle", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "value", + type: "string", + }, + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256", + }, + ], + name: "URI", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "accounts", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "ids", + type: "uint256[]", + }, + ], + name: "balanceOfBatch", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token0", + type: "address", + }, + { + internalType: "address", + name: "token1", + type: "address", + }, + { + internalType: "uint24", + name: "fee", + type: "uint24", + }, + { + internalType: "uint96", + name: "salt", + type: "uint96", + }, + ], + name: "deployNewPool", + outputs: [ + { + internalType: "contract PanopticPool", + name: "newPoolContract", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "factoryOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract IUniswapV3Pool", + name: "univ3pool", + type: "address", + }, + ], + name: "getPanopticPool", + outputs: [ + { + internalType: "contract PanopticPool", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token0", + type: "address", + }, + { + internalType: "address", + name: "token1", + type: "address", + }, + { + internalType: "uint24", + name: "fee", + type: "uint24", + }, + { + internalType: "uint96", + name: "salt", + type: "uint96", + }, + { + internalType: "address", + name: "deployer", + type: "address", + }, + { + internalType: "uint256", + name: "loops", + type: "uint256", + }, + { + internalType: "uint256", + name: "minTargetRarity", + type: "uint256", + }, + ], + name: "minePoolAddress", + outputs: [ + { + internalType: "uint96", + name: "bestSalt", + type: "uint96", + }, + { + internalType: "uint256", + name: "highestRarity", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256[]", + name: "ids", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeBatchTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "setOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4", + }, + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amount0Owed", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1Owed", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "uniswapV3MintCallback", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "uri", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/packages/panoptic-sdk/src/abi/panopticPool.ts b/packages/panoptic-sdk/src/abi/panopticPool.ts new file mode 100644 index 0000000..fbf3010 --- /dev/null +++ b/packages/panoptic-sdk/src/abi/panopticPool.ts @@ -0,0 +1,812 @@ +export const panopticPoolABI = [ + { + inputs: [ + { + internalType: "contract SemiFungiblePositionManager", + name: "_sfpm", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "BurnedTokenIdNotLastIndex", + type: "error", + }, + { + inputs: [], + name: "CastingError", + type: "error", + }, + { + inputs: [], + name: "EffectiveLiquidityAboveThreshold", + type: "error", + }, + { + inputs: [], + name: "InputListFail", + type: "error", + }, + { + inputs: [], + name: "InsufficientCollateralDecrease", + type: "error", + }, + { + inputs: [], + name: "InvalidNotionalValue", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "parameterType", + type: "uint256", + }, + ], + name: "InvalidTokenIdParameter", + type: "error", + }, + { + inputs: [], + name: "NoLegsExercisable", + type: "error", + }, + { + inputs: [], + name: "NotATokenRoll", + type: "error", + }, + { + inputs: [], + name: "NotEnoughCollateral", + type: "error", + }, + { + inputs: [], + name: "OptionsNotOTM", + type: "error", + }, + { + inputs: [], + name: "PoolAlreadyInitialized", + type: "error", + }, + { + inputs: [], + name: "PositionAlreadyMinted", + type: "error", + }, + { + inputs: [], + name: "TicksNotInitializable", + type: "error", + }, + { + inputs: [], + name: "TooManyPositionsOpen", + type: "error", + }, + { + inputs: [], + name: "UnderOverFlow", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "liquidator", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "liquidatee", + type: "address", + }, + { + indexed: false, + internalType: "int256", + name: "bonusAmounts", + type: "int256", + }, + { + indexed: false, + internalType: "int24", + name: "tickAt", + type: "int24", + }, + ], + name: "AccountLiquidated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "exercisor", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + indexed: false, + internalType: "int256", + name: "exerciseFee", + type: "int256", + }, + { + indexed: false, + internalType: "int24", + name: "tickAt", + type: "int24", + }, + ], + name: "ForcedExercised", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipient", + type: "address", + }, + { + indexed: false, + internalType: "uint128", + name: "positionSize", + type: "uint128", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + indexed: false, + internalType: "int24", + name: "tickAtBurn", + type: "int24", + }, + { + indexed: false, + internalType: "int256", + name: "premia", + type: "int256", + }, + ], + name: "OptionBurnt", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipient", + type: "address", + }, + { + indexed: false, + internalType: "uint128", + name: "positionSize", + type: "uint128", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + indexed: false, + internalType: "int24", + name: "tickAtMint", + type: "int24", + }, + { + indexed: false, + internalType: "uint128", + name: "poolUtilizations", + type: "uint128", + }, + ], + name: "OptionMinted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipient", + type: "address", + }, + { + indexed: false, + internalType: "uint128", + name: "positionSize", + type: "uint128", + }, + { + indexed: true, + internalType: "uint256", + name: "oldTokenId", + type: "uint256", + }, + { + indexed: true, + internalType: "uint256", + name: "newTokenId", + type: "uint256", + }, + { + indexed: false, + internalType: "int24", + name: "tickAtRoll", + type: "int24", + }, + { + indexed: false, + internalType: "uint128", + name: "poolUtilizations", + type: "uint128", + }, + { + indexed: false, + internalType: "int256", + name: "premia", + type: "int256", + }, + ], + name: "OptionRolled", + type: "event", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "int24", + name: "tickLimitLow", + type: "int24", + }, + { + internalType: "int24", + name: "tickLimitHigh", + type: "int24", + }, + ], + name: "burnOptions", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256[]", + name: "positionIdList", + type: "uint256[]", + }, + { + internalType: "int24", + name: "tickLimitLow", + type: "int24", + }, + { + internalType: "int24", + name: "tickLimitHigh", + type: "int24", + }, + ], + name: "burnOptions", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + { + internalType: "uint256[]", + name: "positionIdList", + type: "uint256[]", + }, + ], + name: "calculateAccumulatedFeesBatch", + outputs: [ + { + internalType: "int128", + name: "premium0", + type: "int128", + }, + { + internalType: "int128", + name: "premium1", + type: "int128", + }, + { + internalType: "uint256[2][]", + name: "", + type: "uint256[2][]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + { + internalType: "int24", + name: "atTick", + type: "int24", + }, + { + internalType: "uint256[]", + name: "positionIdList", + type: "uint256[]", + }, + ], + name: "calculatePortfolioValue", + outputs: [ + { + internalType: "int256", + name: "value0", + type: "int256", + }, + { + internalType: "int256", + name: "value1", + type: "int256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "collateralToken0", + outputs: [ + { + internalType: "contract CollateralTracker", + name: "collateralToken", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "collateralToken1", + outputs: [ + { + internalType: "contract CollateralTracker", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "int24", + name: "tickLimitLow", + type: "int24", + }, + { + internalType: "int24", + name: "tickLimitHigh", + type: "int24", + }, + { + internalType: "uint256[]", + name: "touchedId", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "idsToBurn", + type: "uint256[]", + }, + ], + name: "forceExercise", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "getPriceArray", + outputs: [ + { + internalType: "int24[]", + name: "priceArray", + type: "int24[]", + }, + { + internalType: "int24", + name: "medianTick", + type: "int24", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "int24", + name: "tickLimitLow", + type: "int24", + }, + { + internalType: "int24", + name: "tickLimitHigh", + type: "int24", + }, + { + internalType: "uint256[]", + name: "positionIdList", + type: "uint256[]", + }, + ], + name: "liquidateAccount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256[]", + name: "positionIdList", + type: "uint256[]", + }, + { + internalType: "uint128", + name: "positionSize", + type: "uint128", + }, + { + internalType: "uint64", + name: "effectiveLiquidityLimitX32", + type: "uint64", + }, + { + internalType: "int24", + name: "tickLimitLow", + type: "int24", + }, + { + internalType: "int24", + name: "tickLimitHigh", + type: "int24", + }, + ], + name: "mintOptions", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "numberOfPositions", + outputs: [ + { + internalType: "uint256", + name: "_numberOfPositions", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + name: "onERC1155BatchReceived", + outputs: [ + { + internalType: "bytes4", + name: "", + type: "bytes4", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + name: "onERC1155Received", + outputs: [ + { + internalType: "bytes4", + name: "", + type: "bytes4", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "optionPositionBalance", + outputs: [ + { + internalType: "uint128", + name: "balance", + type: "uint128", + }, + { + internalType: "uint64", + name: "poolUtilization0", + type: "uint64", + }, + { + internalType: "uint64", + name: "poolUtilization1", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pokeMedian", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "oldTokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "newTokenId", + type: "uint256", + }, + { + internalType: "uint256[]", + name: "positionIdList", + type: "uint256[]", + }, + { + internalType: "uint64", + name: "effectiveLiquidityLimitX32", + type: "uint64", + }, + { + internalType: "int24", + name: "tickLimitLow", + type: "int24", + }, + { + internalType: "int24", + name: "tickLimitHigh", + type: "int24", + }, + ], + name: "rollOptions", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract IUniswapV3Pool", + name: "univ3pool", + type: "address", + }, + { + internalType: "int24", + name: "tickSpacing", + type: "int24", + }, + { + internalType: "int24", + name: "currentTick", + type: "int24", + }, + { + internalType: "address", + name: "token0", + type: "address", + }, + { + internalType: "address", + name: "token1", + type: "address", + }, + { + internalType: "contract CollateralTracker", + name: "collateralTracker0", + type: "address", + }, + { + internalType: "contract CollateralTracker", + name: "collateralTracker1", + type: "address", + }, + ], + name: "startPool", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4", + }, + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "univ3pool", + outputs: [ + { + internalType: "contract IUniswapV3Pool", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/packages/panoptic-sdk/src/abi/semiFungiblePositionManager.ts b/packages/panoptic-sdk/src/abi/semiFungiblePositionManager.ts new file mode 100644 index 0000000..2d96957 --- /dev/null +++ b/packages/panoptic-sdk/src/abi/semiFungiblePositionManager.ts @@ -0,0 +1,853 @@ +export const semiFungiblePositionManagerABI = [ + { + inputs: [ + { + internalType: "contract IUniswapV3Factory", + name: "_factory", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "CastingError", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "parameterType", + type: "uint256", + }, + ], + name: "InvalidTokenIdParameter", + type: "error", + }, + { + inputs: [], + name: "InvalidUniswapCallback", + type: "error", + }, + { + inputs: [], + name: "NotATokenRoll", + type: "error", + }, + { + inputs: [], + name: "NotAuthorized", + type: "error", + }, + { + inputs: [], + name: "NotEnoughLiquidity", + type: "error", + }, + { + inputs: [], + name: "OptionsBalanceZero", + type: "error", + }, + { + inputs: [], + name: "PositionTooLarge", + type: "error", + }, + { + inputs: [], + name: "PriceBoundFail", + type: "error", + }, + { + inputs: [], + name: "ReentrantCall", + type: "error", + }, + { + inputs: [], + name: "TicksNotInitializable", + type: "error", + }, + { + inputs: [], + name: "TransferFailed", + type: "error", + }, + { + inputs: [], + name: "UnderOverFlow", + type: "error", + }, + { + inputs: [], + name: "UniswapPoolNotInitialized", + type: "error", + }, + { + inputs: [], + name: "UnsafeRecipient", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "uniswapPool", + type: "address", + }, + ], + name: "PoolInitialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipient", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint128", + name: "positionSize", + type: "uint128", + }, + ], + name: "TokenizedPositionBurnt", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "caller", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint128", + name: "positionSize", + type: "uint128", + }, + ], + name: "TokenizedPositionMinted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipient", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "oldTokenId", + type: "uint256", + }, + { + indexed: true, + internalType: "uint256", + name: "newTokenId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint128", + name: "positionSize", + type: "uint128", + }, + ], + name: "TokenizedPositionRolled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256[]", + name: "ids", + type: "uint256[]", + }, + { + indexed: false, + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + name: "TransferBatch", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "TransferSingle", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "owners", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "ids", + type: "uint256[]", + }, + ], + name: "balanceOfBatch", + outputs: [ + { + internalType: "uint256[]", + name: "balances", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint128", + name: "positionSize", + type: "uint128", + }, + { + internalType: "int24", + name: "slippageTickLimitLow", + type: "int24", + }, + { + internalType: "int24", + name: "slippageTickLimitHigh", + type: "int24", + }, + ], + name: "burnTokenizedPosition", + outputs: [ + { + internalType: "int256", + name: "totalCollected", + type: "int256", + }, + { + internalType: "int256", + name: "totalSwapped", + type: "int256", + }, + { + internalType: "int24", + name: "newTick", + type: "int24", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "univ3pool", + type: "address", + }, + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "tokenType", + type: "uint256", + }, + { + internalType: "int24", + name: "tickLower", + type: "int24", + }, + { + internalType: "int24", + name: "tickUpper", + type: "int24", + }, + ], + name: "getAccountFeesBase", + outputs: [ + { + internalType: "int128", + name: "feesBase0", + type: "int128", + }, + { + internalType: "int128", + name: "feesBase1", + type: "int128", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "univ3pool", + type: "address", + }, + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "tokenType", + type: "uint256", + }, + { + internalType: "int24", + name: "tickLower", + type: "int24", + }, + { + internalType: "int24", + name: "tickUpper", + type: "int24", + }, + ], + name: "getAccountLiquidity", + outputs: [ + { + internalType: "uint256", + name: "accountLiquidities", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "univ3pool", + type: "address", + }, + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "tokenType", + type: "uint256", + }, + { + internalType: "int24", + name: "tickLower", + type: "int24", + }, + { + internalType: "int24", + name: "tickUpper", + type: "int24", + }, + { + internalType: "int24", + name: "atTick", + type: "int24", + }, + { + internalType: "uint256", + name: "isLong", + type: "uint256", + }, + ], + name: "getAccountPremium", + outputs: [ + { + internalType: "uint128", + name: "premiumToken0", + type: "uint128", + }, + { + internalType: "uint128", + name: "premiumToken1", + type: "uint128", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "univ3pool", + type: "address", + }, + ], + name: "getPoolId", + outputs: [ + { + internalType: "uint64", + name: "poolId", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token0", + type: "address", + }, + { + internalType: "address", + name: "token1", + type: "address", + }, + { + internalType: "uint24", + name: "fee", + type: "uint24", + }, + ], + name: "initializeAMMPool", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "approvedForAll", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint128", + name: "positionSize", + type: "uint128", + }, + { + internalType: "int24", + name: "slippageTickLimitLow", + type: "int24", + }, + { + internalType: "int24", + name: "slippageTickLimitHigh", + type: "int24", + }, + ], + name: "mintTokenizedPosition", + outputs: [ + { + internalType: "int256", + name: "totalCollected", + type: "int256", + }, + { + internalType: "int256", + name: "totalSwapped", + type: "int256", + }, + { + internalType: "int24", + name: "newTick", + type: "int24", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "oldTokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "newTokenId", + type: "uint256", + }, + { + internalType: "uint128", + name: "positionSize", + type: "uint128", + }, + { + internalType: "int24", + name: "slippageTickLimitLow", + type: "int24", + }, + { + internalType: "int24", + name: "slippageTickLimitHigh", + type: "int24", + }, + ], + name: "rollTokenizedPositions", + outputs: [ + { + internalType: "int256", + name: "totalCollectedBurn", + type: "int256", + }, + { + internalType: "int256", + name: "totalSwappedBurn", + type: "int256", + }, + { + internalType: "int256", + name: "totalCollectedMint", + type: "int256", + }, + { + internalType: "int256", + name: "totalSwappedMint", + type: "int256", + }, + { + internalType: "int24", + name: "newTick", + type: "int24", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256[]", + name: "ids", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeBatchTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4", + }, + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amount0Owed", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1Owed", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "uniswapV3MintCallback", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "int256", + name: "amount0Delta", + type: "int256", + }, + { + internalType: "int256", + name: "amount1Delta", + type: "int256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "uniswapV3SwapCallback", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/packages/panoptic-sdk/src/chains/sepolia.ts b/packages/panoptic-sdk/src/chains/sepolia.ts new file mode 100644 index 0000000..cc5c5aa --- /dev/null +++ b/packages/panoptic-sdk/src/chains/sepolia.ts @@ -0,0 +1,21 @@ +import { sepoliaTokens } from "reverse-mirage"; +import { sepoliaUniswapV3 } from "uniswap-v3-sdk"; +import type { PanopticFactory } from "../types/PanopticFactory.js"; + +export const sepoliaPanoptic = { + factory: { + type: "panopticFactory", + address: "0x96A75826485c5B993114F72Eb79C718cF06DF56E", + owner: "0x5c7a7b47739e8aa5b13fba45d7c43d508d0d2fc3", + weth: sepoliaTokens.weth, + collateralTrackerReference: "0x9E34995E520E438c4520Cd55941f0869EDDD6822", + panopticPoolReference: "0xEEb093D6Cb13db88F342c868Ad97574F077fB62C", + semiFungiblePositionManager: { + type: "panopticSemiFungiblePositionManager", + address: "0x928eCD2e55E7042B5b920B352A84f156AdeDB037", + blockCreated: 4199935n, + }, + uniswapFactory: sepoliaUniswapV3.factory, + blockCreated: 4199935n, + }, +} as const satisfies { factory: PanopticFactory }; diff --git a/packages/panoptic-sdk/src/decorator/walletActions.ts b/packages/panoptic-sdk/src/decorator/walletActions.ts index e69de29..5959cd7 100644 --- a/packages/panoptic-sdk/src/decorator/walletActions.ts +++ b/packages/panoptic-sdk/src/decorator/walletActions.ts @@ -0,0 +1,98 @@ +import type { Account, Chain, Client, Transport } from "viem"; +import type { PanopticCollateral } from "../types/index.js"; +import { + type WritePanopticCollateralDepositParameters, + writePanopticCollateralDeposit, +} from "../walletActions/collateralTracker/writePanopticCollateralDeposit.js"; +import { + type WritePanopticCollateralMintParameters, + writePanopticCollateralMint, +} from "../walletActions/collateralTracker/writePanopticCollateralMint.js"; +import { + type WritePanopticCollateralRedeemParameters, + writePanopticCollateralRedeem, +} from "../walletActions/collateralTracker/writePanopticCollateralRedeem.js"; +import { + type WritePanopticCollateralWithdrawParameters, + writePanopticCollateralWithdraw, +} from "../walletActions/collateralTracker/writePanopticCollateralWithdraw.js"; +import { + type WritePanopticBurnOptionsParameters, + writePanopticBurnOptions, +} from "../walletActions/writeBurnOptions.js"; +import { + type WritePanopticForceExerciseParameters, + writePanopticForceExercise, +} from "../walletActions/writeForceExercise.js"; +import { + type WritePanopticLiquidateAccountParameters, + writePanopticLiquidateAccount, +} from "../walletActions/writeLiquidateAccount.js"; +import { + type WritePanopticMintOptionsParameters, + writePanopticMintOptions, +} from "../walletActions/writeMintOptions.js"; +import { + type WritePanopticRollOptionsParameters, + writePanopticRollOptions, +} from "../walletActions/writeRollOptions.js"; + +export const walletActionPanoptic = < + TChain extends Chain = Chain, + TAccount extends Account | undefined = Account | undefined, +>( + client: Client, +) => ({ + writePanopticCollateralDeposit: < + TPanopticCollateral extends PanopticCollateral, + >( + args: WritePanopticCollateralDepositParameters< + TPanopticCollateral, + TChain, + TAccount + >, + ) => writePanopticCollateralDeposit(client, args), + writePanopticCollateralMint: < + TPanopticCollateral extends PanopticCollateral, + >( + args: WritePanopticCollateralMintParameters< + TPanopticCollateral, + TChain, + TAccount + >, + ) => writePanopticCollateralMint(client, args), + writePanopticCollateralWithdraw: < + TPanopticCollateral extends PanopticCollateral, + >( + args: WritePanopticCollateralWithdrawParameters< + TPanopticCollateral, + TChain, + TAccount + >, + ) => writePanopticCollateralWithdraw(client, args), + writePanopticCollateralRedeem: < + TPanopticCollateral extends PanopticCollateral, + >( + args: WritePanopticCollateralRedeemParameters< + TPanopticCollateral, + TChain, + TAccount + >, + ) => writePanopticCollateralRedeem(client, args), + + writePanopticMintOptions: ( + args: WritePanopticMintOptionsParameters, + ) => writePanopticMintOptions(client, args), + writePanopticRollOptions: ( + args: WritePanopticRollOptionsParameters, + ) => writePanopticRollOptions(client, args), + writePanopticBurnOptions: ( + args: WritePanopticBurnOptionsParameters, + ) => writePanopticBurnOptions(client, args), + writePanopticForceExercise: ( + args: WritePanopticForceExerciseParameters, + ) => writePanopticForceExercise(client, args), + writePanopticLiquidateAccount: ( + args: WritePanopticLiquidateAccountParameters, + ) => writePanopticLiquidateAccount(client, args), +}); diff --git a/packages/panoptic-sdk/src/index.ts b/packages/panoptic-sdk/src/index.ts index fed6a61..415882f 100644 --- a/packages/panoptic-sdk/src/index.ts +++ b/packages/panoptic-sdk/src/index.ts @@ -16,11 +16,22 @@ export { getPanopticCollateralPositionData } from "./publicActions/getPanopticCo export { getPanopticPoolData } from "./publicActions/getPanopticPoolData.js"; export { getPanopticPositionData } from "./publicActions/getPanopticPositionData.js"; +export { writePanopticCollateralDeposit } from "./walletActions/collateralTracker/writePanopticCollateralDeposit.js"; +export { writePanopticCollateralWithdraw } from "./walletActions/collateralTracker/writePanopticCollateralWithdraw.js"; +export { writePanopticCollateralMint } from "./walletActions/collateralTracker/writePanopticCollateralMint.js"; +export { writePanopticCollateralRedeem } from "./walletActions/collateralTracker/writePanopticCollateralRedeem.js"; +export { writePanopticMintOptions } from "./walletActions/writeMintOptions.js"; +export { writePanopticRollOptions } from "./walletActions/writeRollOptions.js"; +export { writePanopticBurnOptions } from "./walletActions/writeBurnOptions.js"; +export { writePanopticForceExercise } from "./walletActions/writeForceExercise.js"; +export { writePanopticLiquidateAccount } from "./walletActions/writeLiquidateAccount.js"; + export { publicActionPanoptic } from "./decorator/publicActions.js"; +export { walletActionPanoptic } from "./decorator/walletActions.js"; + +export { sepoliaPanoptic } from "./chains/sepolia.js"; -export { - semiFungiblePositionManagerABI, - panopticFactoryABI, - panopticPoolABI, - collateralTrackerABI, -} from "./generated.js"; +export { collateralTrackerABI } from "./abi/collateralTracker.js"; +export { semiFungiblePositionManagerABI } from "./abi/semiFungiblePositionManager.js"; +export { panopticFactoryABI } from "./abi/panopticFactory.js"; +export { panopticPoolABI } from "./abi/panopticPool.js"; diff --git a/packages/panoptic-sdk/src/publicActions/getPanopticCollateralData.ts b/packages/panoptic-sdk/src/publicActions/getPanopticCollateralData.ts index beff109..902ab78 100644 --- a/packages/panoptic-sdk/src/publicActions/getPanopticCollateralData.ts +++ b/packages/panoptic-sdk/src/publicActions/getPanopticCollateralData.ts @@ -1,7 +1,7 @@ import { createAmountFromRaw } from "reverse-mirage"; import type { Chain, Client, ReadContractParameters, Transport } from "viem"; import { readContract } from "viem/actions"; -import { collateralTrackerABI } from "../generated.js"; +import { collateralTrackerABI } from "../abi/collateralTracker.js"; import type { PanopticCollateral, PanopticCollateralData, diff --git a/packages/panoptic-sdk/src/publicActions/getPanopticCollateralPositionData.ts b/packages/panoptic-sdk/src/publicActions/getPanopticCollateralPositionData.ts index e197c45..ac642c4 100644 --- a/packages/panoptic-sdk/src/publicActions/getPanopticCollateralPositionData.ts +++ b/packages/panoptic-sdk/src/publicActions/getPanopticCollateralPositionData.ts @@ -6,7 +6,7 @@ import type { ReadContractParameters, Transport, } from "viem"; -import type { collateralTrackerABI } from "../generated.js"; +import type { collateralTrackerABI } from "../abi/collateralTracker.js"; import type { PanopticCollateral, PanopticCollateralPositionData, diff --git a/packages/panoptic-sdk/src/publicActions/getPanopticPoolData.ts b/packages/panoptic-sdk/src/publicActions/getPanopticPoolData.ts index 386e669..01e8fc7 100644 --- a/packages/panoptic-sdk/src/publicActions/getPanopticPoolData.ts +++ b/packages/panoptic-sdk/src/publicActions/getPanopticPoolData.ts @@ -1,6 +1,6 @@ import { getUniswapV3PoolData } from "uniswap-v3-sdk"; import type { Chain, Client, ReadContractParameters, Transport } from "viem"; -import { collateralTrackerABI } from "../generated.js"; +import { collateralTrackerABI } from "../abi/collateralTracker.js"; import type { PanopticPool, PanopticPoolData } from "../types/PanopticPool.js"; import { getPanopticCollateralData } from "./getPanopticCollateralData.js"; diff --git a/packages/panoptic-sdk/src/publicActions/getPanopticPositionData.ts b/packages/panoptic-sdk/src/publicActions/getPanopticPositionData.ts index b99291f..27cc698 100644 --- a/packages/panoptic-sdk/src/publicActions/getPanopticPositionData.ts +++ b/packages/panoptic-sdk/src/publicActions/getPanopticPositionData.ts @@ -2,7 +2,7 @@ import { createFraction } from "reverse-mirage"; import type { UniswapV3Tick } from "uniswap-v3-sdk"; import type { Chain, Client, ReadContractParameters, Transport } from "viem"; import { readContract } from "viem/actions"; -import { panopticPoolABI } from "../generated.js"; +import { panopticPoolABI } from "../abi/panopticPool.js"; import type { PanopticPosition, PanopticPositionData, diff --git a/packages/panoptic-sdk/src/publicActions/getPanoptionLegData.ts b/packages/panoptic-sdk/src/publicActions/getPanoptionLegData.ts index c8e4f03..52f9671 100644 --- a/packages/panoptic-sdk/src/publicActions/getPanoptionLegData.ts +++ b/packages/panoptic-sdk/src/publicActions/getPanoptionLegData.ts @@ -7,10 +7,8 @@ import type { Transport, } from "viem"; import { readContract } from "viem/actions"; -import { - panopticPoolABI, - semiFungiblePositionManagerABI, -} from "../generated.js"; +import { panopticPoolABI } from "../abi/panopticPool.js"; +import { semiFungiblePositionManagerABI } from "../abi/semiFungiblePositionManager.js"; import type { PanopticPool } from "../types/PanopticPool.js"; import type { PanoptionLeg, diff --git a/packages/panoptic-sdk/src/types/PanopticFactory.ts b/packages/panoptic-sdk/src/types/PanopticFactory.ts index c09aed3..105c2e7 100644 --- a/packages/panoptic-sdk/src/types/PanopticFactory.ts +++ b/packages/panoptic-sdk/src/types/PanopticFactory.ts @@ -9,6 +9,8 @@ export type PanopticFactory = { owner: Address; uniswapFactory: UniswapV3Factory; semiFungiblePositionManager: PanopticSemiFungiblePositionManager; + collateralTrackerReference: Address; + panopticPoolReference: Address; weth: WETH; blockCreated: bigint; }; diff --git a/packages/panoptic-sdk/src/types/PanopticSemiFungiblePositionManager.ts b/packages/panoptic-sdk/src/types/PanopticSemiFungiblePositionManager.ts index eb43587..197b685 100644 --- a/packages/panoptic-sdk/src/types/PanopticSemiFungiblePositionManager.ts +++ b/packages/panoptic-sdk/src/types/PanopticSemiFungiblePositionManager.ts @@ -1,9 +1,7 @@ -import type { UniswapV3Factory } from "uniswap-v3-sdk"; import type { Address } from "viem/accounts"; export type PanopticSemiFungiblePositionManager = { type: "panopticSemiFungiblePositionManager"; address: Address; - uniswapFactory: UniswapV3Factory; blockCreated: bigint; }; diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateBurn.test.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateBurn.test.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateBurn.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateBurn.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateDeposit.test.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateDeposit.test.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateDeposit.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateDeposit.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateMint.test.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateMint.test.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateMint.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateMint.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateWithdraw.test.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateWithdraw.test.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateWithdraw.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/simulateWithdraw.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralDeposit.test.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralDeposit.test.ts new file mode 100644 index 0000000..1e7eded --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralDeposit.test.ts @@ -0,0 +1,82 @@ +import { createAmountFromString, createERC20 } from "reverse-mirage"; +import invariant from "tiny-invariant"; +import { type Hex, parseEther } from "viem"; +import { foundry } from "viem/chains"; +import { beforeEach, test } from "vitest"; +import { collateralTrackerBytecode } from "../../_test/bytecode/collateralTracker.js"; +import { mockERC20Bytecode } from "../../_test/bytecode/mockERC20.js"; +import { ALICE } from "../../_test/constants.js"; +import { + baseParameters, + publicClient, + testClient, + walletClient, +} from "../../_test/utils.js"; +import { mockERC20ABI } from "../../abi/mockERC20.js"; +import type { PanopticCollateral } from "../../index.js"; +import { createPanopticCollateral } from "../../utils/createPanopticCollateral.js"; +import { writePanopticCollateralDeposit } from "./writePanopticCollateralDeposit.js"; + +let id: Hex | undefined = undefined; + +let collat: PanopticCollateral; + +beforeEach(async () => { + if (id === undefined) { + const deployHash = await walletClient.deployContract({ + account: ALICE, + abi: mockERC20ABI, + bytecode: mockERC20Bytecode, + args: ["name", "symbol", 18], + }); + + const { contractAddress } = await publicClient.waitForTransactionReceipt({ + hash: deployHash, + }); + invariant(contractAddress); + const erc20 = createERC20( + contractAddress, + "name", + "symbol", + 18, + foundry.id, + ); + + testClient.setCode({ + address: "0xe846c6fcf817734ca4527b28ccb4aea2b6663c79", + bytecode: collateralTrackerBytecode, + }); + + collat = createPanopticCollateral( + "0xe846c6fcf817734ca4527b28ccb4aea2b6663c79", + "name", + "symbol", + 18, + foundry.id, + erc20, + baseParameters, + ); + + const mintHash = await walletClient.writeContract({ + abi: mockERC20ABI, + functionName: "mint", + address: contractAddress, + args: [ALICE, parseEther("1")], + }); + await publicClient.waitForTransactionReceipt({ hash: mintHash }); + } else { + await testClient.revert({ id }); + } + id = await testClient.snapshot(); +}); + +test("deposit", async () => { + const hash = await writePanopticCollateralDeposit(walletClient, { + args: { + amount: createAmountFromString(collat.underlyingToken, "0.5"), + to: ALICE, + }, + }); + + await publicClient.waitForTransactionReceipt({ hash }); +}); diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralDeposit.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralDeposit.ts new file mode 100644 index 0000000..e8c0d1b --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralDeposit.ts @@ -0,0 +1,67 @@ +import type { ERC20Amount } from "reverse-mirage"; +import type { + Account, + Address, + Chain, + Client, + Transport, + WriteContractParameters, + WriteContractReturnType, +} from "viem"; +import { writeContract } from "viem/contract"; +import { collateralTrackerABI } from "../../abi/collateralTracker.js"; +import type { PanopticCollateral } from "../../types/PanopticCollateral.js"; + +export type PanopticCollateralDepositParameters< + TPanopticCollateral extends PanopticCollateral, +> = { + amount: ERC20Amount; + to: Address; +}; + +export type WritePanopticCollateralDepositParameters< + TPanopticCollateral extends PanopticCollateral, + TChain extends Chain | undefined = Chain, + TAccount extends Account | undefined = Account | undefined, + TChainOverride extends Chain | undefined = Chain | undefined, +> = Omit< + WriteContractParameters< + typeof collateralTrackerABI, + "deposit", + TChain, + TAccount, + TChainOverride + >, + "args" | "address" | "abi" | "functionName" +> & { args: PanopticCollateralDepositParameters }; + +export const writePanopticCollateralDeposit = < + TPanopticCollateral extends PanopticCollateral, + TChain extends Chain | undefined, + TAccount extends Account | undefined, + TChainOverride extends Chain | undefined, +>( + client: Client, + { + args: { amount, to }, + ...request + }: WritePanopticCollateralDepositParameters< + TPanopticCollateral, + TChain, + TAccount, + TChainOverride + >, +): Promise => + writeContract(client, { + address: amount.token.address, + abi: collateralTrackerABI, + functionName: "deposit", + args: [amount.amount, to], + ...request, + } as unknown as WriteContractParameters< + typeof collateralTrackerABI, + "deposit", + TChain, + TAccount, + TChainOverride + >); diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralMint.test.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralMint.test.ts new file mode 100644 index 0000000..9277079 --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralMint.test.ts @@ -0,0 +1,82 @@ +import { createAmountFromString, createERC20 } from "reverse-mirage"; +import invariant from "tiny-invariant"; +import { type Hex, parseEther } from "viem"; +import { foundry } from "viem/chains"; +import { beforeEach, test } from "vitest"; +import { collateralTrackerBytecode } from "../../_test/bytecode/collateralTracker.js"; +import { mockERC20Bytecode } from "../../_test/bytecode/mockERC20.js"; +import { ALICE } from "../../_test/constants.js"; +import { + baseParameters, + publicClient, + testClient, + walletClient, +} from "../../_test/utils.js"; +import { mockERC20ABI } from "../../abi/mockERC20.js"; +import type { PanopticCollateral } from "../../index.js"; +import { createPanopticCollateral } from "../../utils/createPanopticCollateral.js"; +import { writePanopticCollateralMint } from "./writePanopticCollateralMint.js"; + +let id: Hex | undefined = undefined; + +let collat: PanopticCollateral; + +beforeEach(async () => { + if (id === undefined) { + const deployHash = await walletClient.deployContract({ + account: ALICE, + abi: mockERC20ABI, + bytecode: mockERC20Bytecode, + args: ["name", "symbol", 18], + }); + + const { contractAddress } = await publicClient.waitForTransactionReceipt({ + hash: deployHash, + }); + invariant(contractAddress); + const erc20 = createERC20( + contractAddress, + "name", + "symbol", + 18, + foundry.id, + ); + + testClient.setCode({ + address: "0xe846c6fcf817734ca4527b28ccb4aea2b6663c79", + bytecode: collateralTrackerBytecode, + }); + + collat = createPanopticCollateral( + "0xe846c6fcf817734ca4527b28ccb4aea2b6663c79", + "name", + "symbol", + 18, + foundry.id, + erc20, + baseParameters, + ); + + const mintHash = await walletClient.writeContract({ + abi: mockERC20ABI, + functionName: "mint", + address: contractAddress, + args: [ALICE, parseEther("1")], + }); + await publicClient.waitForTransactionReceipt({ hash: mintHash }); + } else { + await testClient.revert({ id }); + } + id = await testClient.snapshot(); +}); + +test("Mint", async () => { + const hash = await writePanopticCollateralMint(walletClient, { + args: { + amount: createAmountFromString(collat, "0.5"), + to: ALICE, + }, + }); + + await publicClient.waitForTransactionReceipt({ hash }); +}); diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralMint.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralMint.ts new file mode 100644 index 0000000..dc66793 --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralMint.ts @@ -0,0 +1,67 @@ +import type { ERC20Amount } from "reverse-mirage"; +import type { + Account, + Address, + Chain, + Client, + Transport, + WriteContractParameters, + WriteContractReturnType, +} from "viem"; +import { writeContract } from "viem/contract"; +import { collateralTrackerABI } from "../../abi/collateralTracker.js"; +import type { PanopticCollateral } from "../../types/PanopticCollateral.js"; + +export type PanopticCollateralMintParameters< + TPanopticCollateral extends PanopticCollateral, +> = { + amount: ERC20Amount; + to: Address; +}; + +export type WritePanopticCollateralMintParameters< + TPanopticCollateral extends PanopticCollateral, + TChain extends Chain | undefined = Chain, + TAccount extends Account | undefined = Account | undefined, + TChainOverride extends Chain | undefined = Chain | undefined, +> = Omit< + WriteContractParameters< + typeof collateralTrackerABI, + "mint", + TChain, + TAccount, + TChainOverride + >, + "args" | "address" | "abi" | "functionName" +> & { args: PanopticCollateralMintParameters }; + +export const writePanopticCollateralMint = < + TPanopticCollateral extends PanopticCollateral, + TChain extends Chain | undefined, + TAccount extends Account | undefined, + TChainOverride extends Chain | undefined, +>( + client: Client, + { + args: { amount, to }, + ...request + }: WritePanopticCollateralMintParameters< + TPanopticCollateral, + TChain, + TAccount, + TChainOverride + >, +): Promise => + writeContract(client, { + address: amount.token.address, + abi: collateralTrackerABI, + functionName: "mint", + args: [amount.amount, to], + ...request, + } as unknown as WriteContractParameters< + typeof collateralTrackerABI, + "mint", + TChain, + TAccount, + TChainOverride + >); diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralRedeem.test.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralRedeem.test.ts new file mode 100644 index 0000000..17cd5dc --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralRedeem.test.ts @@ -0,0 +1,93 @@ +import { createAmountFromString, createERC20 } from "reverse-mirage"; +import invariant from "tiny-invariant"; +import { type Hex, parseEther } from "viem"; +import { foundry } from "viem/chains"; +import { beforeEach, test } from "vitest"; +import { collateralTrackerBytecode } from "../../_test/bytecode/collateralTracker.js"; +import { mockERC20Bytecode } from "../../_test/bytecode/mockERC20.js"; +import { ALICE } from "../../_test/constants.js"; +import { + baseParameters, + publicClient, + testClient, + walletClient, +} from "../../_test/utils.js"; +import { mockERC20ABI } from "../../abi/mockERC20.js"; +import type { PanopticCollateral } from "../../index.js"; +import { createPanopticCollateral } from "../../utils/createPanopticCollateral.js"; +import { writePanopticCollateralDeposit } from "./writePanopticCollateralDeposit.js"; +import { writePanopticCollateralRedeem } from "./writePanopticCollateralRedeem.js"; + +let id: Hex | undefined = undefined; + +let collat: PanopticCollateral; + +beforeEach(async () => { + if (id === undefined) { + const deployHash = await walletClient.deployContract({ + account: ALICE, + abi: mockERC20ABI, + bytecode: mockERC20Bytecode, + args: ["name", "symbol", 18], + }); + + const { contractAddress } = await publicClient.waitForTransactionReceipt({ + hash: deployHash, + }); + invariant(contractAddress); + const erc20 = createERC20( + contractAddress, + "name", + "symbol", + 18, + foundry.id, + ); + + testClient.setCode({ + address: "0xe846c6fcf817734ca4527b28ccb4aea2b6663c79", + bytecode: collateralTrackerBytecode, + }); + + collat = createPanopticCollateral( + "0xe846c6fcf817734ca4527b28ccb4aea2b6663c79", + "name", + "symbol", + 18, + foundry.id, + erc20, + baseParameters, + ); + + const mintHash = await walletClient.writeContract({ + abi: mockERC20ABI, + functionName: "mint", + address: contractAddress, + args: [ALICE, parseEther("1")], + }); + await publicClient.waitForTransactionReceipt({ hash: mintHash }); + + const hash = await writePanopticCollateralDeposit(walletClient, { + args: { + amount: createAmountFromString(collat.underlyingToken, "1"), + to: ALICE, + }, + }); + + await publicClient.waitForTransactionReceipt({ hash }); + } else { + await testClient.revert({ id }); + } + id = await testClient.snapshot(); +}); + +test("Redeem", async () => { + const hash = await writePanopticCollateralRedeem(walletClient, { + args: { + amount: createAmountFromString(collat, "0.5"), + from: ALICE, + to: ALICE, + }, + }); + + await publicClient.waitForTransactionReceipt({ hash }); +}); diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralRedeem.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralRedeem.ts new file mode 100644 index 0000000..22fffa4 --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralRedeem.ts @@ -0,0 +1,68 @@ +import type { ERC20Amount } from "reverse-mirage"; +import type { + Account, + Address, + Chain, + Client, + Transport, + WriteContractParameters, + WriteContractReturnType, +} from "viem"; +import { writeContract } from "viem/contract"; +import { collateralTrackerABI } from "../../abi/collateralTracker.js"; +import type { PanopticCollateral } from "../../types/PanopticCollateral.js"; + +export type PanopticCollateralRedeemParameters< + TPanopticCollateral extends PanopticCollateral, +> = { + amount: ERC20Amount; + from: Address; + to: Address; +}; + +export type WritePanopticCollateralRedeemParameters< + TPanopticCollateral extends PanopticCollateral, + TChain extends Chain | undefined = Chain, + TAccount extends Account | undefined = Account | undefined, + TChainOverride extends Chain | undefined = Chain | undefined, +> = Omit< + WriteContractParameters< + typeof collateralTrackerABI, + "redeem", + TChain, + TAccount, + TChainOverride + >, + "args" | "address" | "abi" | "functionName" +> & { args: PanopticCollateralRedeemParameters }; + +export const writePanopticCollateralRedeem = < + TPanopticCollateral extends PanopticCollateral, + TChain extends Chain | undefined, + TAccount extends Account | undefined, + TChainOverride extends Chain | undefined, +>( + client: Client, + { + args: { amount, to, from }, + ...request + }: WritePanopticCollateralRedeemParameters< + TPanopticCollateral, + TChain, + TAccount, + TChainOverride + >, +): Promise => + writeContract(client, { + address: amount.token.address, + abi: collateralTrackerABI, + functionName: "redeem", + args: [amount.amount, from, to], + ...request, + } as unknown as WriteContractParameters< + typeof collateralTrackerABI, + "redeem", + TChain, + TAccount, + TChainOverride + >); diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralWithdraw.test.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralWithdraw.test.ts new file mode 100644 index 0000000..732e001 --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralWithdraw.test.ts @@ -0,0 +1,93 @@ +import { createAmountFromString, createERC20 } from "reverse-mirage"; +import invariant from "tiny-invariant"; +import { type Hex, parseEther } from "viem"; +import { foundry } from "viem/chains"; +import { beforeEach, test } from "vitest"; +import { collateralTrackerBytecode } from "../../_test/bytecode/collateralTracker.js"; +import { mockERC20Bytecode } from "../../_test/bytecode/mockERC20.js"; +import { ALICE } from "../../_test/constants.js"; +import { + baseParameters, + publicClient, + testClient, + walletClient, +} from "../../_test/utils.js"; +import { mockERC20ABI } from "../../abi/mockERC20.js"; +import type { PanopticCollateral } from "../../index.js"; +import { createPanopticCollateral } from "../../utils/createPanopticCollateral.js"; +import { writePanopticCollateralDeposit } from "./writePanopticCollateralDeposit.js"; +import { writePanopticCollateralWithdraw } from "./writePanopticCollateralWithdraw.js"; + +let id: Hex | undefined = undefined; + +let collat: PanopticCollateral; + +beforeEach(async () => { + if (id === undefined) { + const deployHash = await walletClient.deployContract({ + account: ALICE, + abi: mockERC20ABI, + bytecode: mockERC20Bytecode, + args: ["name", "symbol", 18], + }); + + const { contractAddress } = await publicClient.waitForTransactionReceipt({ + hash: deployHash, + }); + invariant(contractAddress); + const erc20 = createERC20( + contractAddress, + "name", + "symbol", + 18, + foundry.id, + ); + + testClient.setCode({ + address: "0xe846c6fcf817734ca4527b28ccb4aea2b6663c79", + bytecode: collateralTrackerBytecode, + }); + + collat = createPanopticCollateral( + "0xe846c6fcf817734ca4527b28ccb4aea2b6663c79", + "name", + "symbol", + 18, + foundry.id, + erc20, + baseParameters, + ); + + const mintHash = await walletClient.writeContract({ + abi: mockERC20ABI, + functionName: "mint", + address: contractAddress, + args: [ALICE, parseEther("1")], + }); + await publicClient.waitForTransactionReceipt({ hash: mintHash }); + + const hash = await writePanopticCollateralDeposit(walletClient, { + args: { + amount: createAmountFromString(collat.underlyingToken, "1"), + to: ALICE, + }, + }); + + await publicClient.waitForTransactionReceipt({ hash }); + } else { + await testClient.revert({ id }); + } + id = await testClient.snapshot(); +}); + +test("WithwritePanopticCollateralWithdraw", async () => { + const hash = await writePanopticCollateralWithdraw(walletClient, { + args: { + amount: createAmountFromString(collat.underlyingToken, "0.5"), + from: ALICE, + to: ALICE, + }, + }); + + await publicClient.waitForTransactionReceipt({ hash }); +}); diff --git a/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralWithdraw.ts b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralWithdraw.ts new file mode 100644 index 0000000..a07ebe0 --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/collateralTracker/writePanopticCollateralWithdraw.ts @@ -0,0 +1,68 @@ +import type { ERC20Amount } from "reverse-mirage"; +import type { + Account, + Address, + Chain, + Client, + Transport, + WriteContractParameters, + WriteContractReturnType, +} from "viem"; +import { writeContract } from "viem/contract"; +import { collateralTrackerABI } from "../../abi/collateralTracker.js"; +import type { PanopticCollateral } from "../../types/PanopticCollateral.js"; + +export type PanopticCollateralWithdrawParameters< + TPanopticCollateral extends PanopticCollateral, +> = { + amount: ERC20Amount; + from: Address; + to: Address; +}; + +export type WritePanopticCollateralWithdrawParameters< + TPanopticCollateral extends PanopticCollateral, + TChain extends Chain | undefined = Chain, + TAccount extends Account | undefined = Account | undefined, + TChainOverride extends Chain | undefined = Chain | undefined, +> = Omit< + WriteContractParameters< + typeof collateralTrackerABI, + "withdraw", + TChain, + TAccount, + TChainOverride + >, + "args" | "address" | "abi" | "functionName" +> & { args: PanopticCollateralWithdrawParameters }; + +export const writePanopticCollateralWithdraw = < + TPanopticCollateral extends PanopticCollateral, + TChain extends Chain | undefined, + TAccount extends Account | undefined, + TChainOverride extends Chain | undefined, +>( + client: Client, + { + args: { amount, from, to }, + ...request + }: WritePanopticCollateralWithdrawParameters< + TPanopticCollateral, + TChain, + TAccount, + TChainOverride + >, +): Promise => + writeContract(client, { + address: amount.token.address, + abi: collateralTrackerABI, + functionName: "withdraw", + args: [amount.amount, from, to], + ...request, + } as unknown as WriteContractParameters< + typeof collateralTrackerABI, + "withdraw", + TChain, + TAccount, + TChainOverride + >); diff --git a/packages/panoptic-sdk/src/walletActions/simulateBurnOptions.test.ts b/packages/panoptic-sdk/src/walletActions/simulateBurnOptions.test.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/simulateBurnOptions.ts b/packages/panoptic-sdk/src/walletActions/simulateBurnOptions.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/simulateForceExercise.test.ts b/packages/panoptic-sdk/src/walletActions/simulateForceExercise.test.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/simulateForceExercise.ts b/packages/panoptic-sdk/src/walletActions/simulateForceExercise.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/simulateLiquidateAccount.test.ts b/packages/panoptic-sdk/src/walletActions/simulateLiquidateAccount.test.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/simulateLiquidateAccount.ts b/packages/panoptic-sdk/src/walletActions/simulateLiquidateAccount.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/simulateMintOptions.test.ts b/packages/panoptic-sdk/src/walletActions/simulateMintOptions.test.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/simulateMintOptions.ts b/packages/panoptic-sdk/src/walletActions/simulateMintOptions.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/simulateRollOptions.test.ts b/packages/panoptic-sdk/src/walletActions/simulateRollOptions.test.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/simulateRollOptions.ts b/packages/panoptic-sdk/src/walletActions/simulateRollOptions.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/panoptic-sdk/src/walletActions/writeBurnOptions.ts b/packages/panoptic-sdk/src/walletActions/writeBurnOptions.ts new file mode 100644 index 0000000..b6dcc5a --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/writeBurnOptions.ts @@ -0,0 +1,55 @@ +import type { + Account, + Chain, + Client, + Transport, + WriteContractParameters, + WriteContractReturnType, +} from "viem"; +import { writeContract } from "viem/contract"; +import { panopticPoolABI } from "../abi/panopticPool.js"; +import type { PanopticPosition } from "../types/PanopticPosition.js"; + +export type PanopticBurnOptionsParameters = { + position: PanopticPosition; +}; + +export type WritePanopticBurnOptionsParameters< + TChain extends Chain | undefined = Chain, + TAccount extends Account | undefined = Account | undefined, + TChainOverride extends Chain | undefined = Chain | undefined, +> = Omit< + WriteContractParameters< + typeof panopticPoolABI, + "burnOptions", + TChain, + TAccount, + TChainOverride + >, + "args" | "address" | "abi" | "functionName" +> & { args: PanopticBurnOptionsParameters }; + +export const writePanopticBurnOptions = < + TChain extends Chain | undefined, + TAccount extends Account | undefined, + TChainOverride extends Chain | undefined, +>( + client: Client, + { + args: { position }, + ...request + }: WritePanopticBurnOptionsParameters, +): Promise => + writeContract(client, { + address: position.pool.address, + abi: panopticPoolABI, + functionName: "burnOptions", + args: [position.id, 0, 0], + ...request, + } as unknown as WriteContractParameters< + typeof panopticPoolABI, + "burnOptions", + TChain, + TAccount, + TChainOverride + >); diff --git a/packages/panoptic-sdk/src/walletActions/writeForceExercise.ts b/packages/panoptic-sdk/src/walletActions/writeForceExercise.ts new file mode 100644 index 0000000..6ccb7e3 --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/writeForceExercise.ts @@ -0,0 +1,55 @@ +import type { + Account, + Chain, + Client, + Transport, + WriteContractParameters, + WriteContractReturnType, +} from "viem"; +import { writeContract } from "viem/contract"; +import { panopticPoolABI } from "../abi/panopticPool.js"; +import type { PanopticPosition } from "../types/PanopticPosition.js"; + +export type PanopticForceExerciseParameters = { + position: PanopticPosition; +}; + +export type WritePanopticForceExerciseParameters< + TChain extends Chain | undefined = Chain, + TAccount extends Account | undefined = Account | undefined, + TChainOverride extends Chain | undefined = Chain | undefined, +> = Omit< + WriteContractParameters< + typeof panopticPoolABI, + "forceExercise", + TChain, + TAccount, + TChainOverride + >, + "args" | "address" | "abi" | "functionName" +> & { args: PanopticForceExerciseParameters }; + +export const writePanopticForceExercise = < + TChain extends Chain | undefined, + TAccount extends Account | undefined, + TChainOverride extends Chain | undefined, +>( + client: Client, + { + args: { position }, + ...request + }: WritePanopticForceExerciseParameters, +): Promise => + writeContract(client, { + address: position.pool.address, + abi: panopticPoolABI, + functionName: "forceExercise", + args: [position.owner, 0, 0, [position.id], []], + ...request, + } as unknown as WriteContractParameters< + typeof panopticPoolABI, + "forceExercise", + TChain, + TAccount, + TChainOverride + >); diff --git a/packages/panoptic-sdk/src/walletActions/writeLiquidateAccount.ts b/packages/panoptic-sdk/src/walletActions/writeLiquidateAccount.ts new file mode 100644 index 0000000..3a2a057 --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/writeLiquidateAccount.ts @@ -0,0 +1,55 @@ +import type { + Account, + Chain, + Client, + Transport, + WriteContractParameters, + WriteContractReturnType, +} from "viem"; +import { writeContract } from "viem/contract"; +import { panopticPoolABI } from "../abi/panopticPool.js"; +import type { PanopticPosition } from "../types/PanopticPosition.js"; + +export type PanopticLiquidateAccountParameters = { + position: PanopticPosition; +}; + +export type WritePanopticLiquidateAccountParameters< + TChain extends Chain | undefined = Chain, + TAccount extends Account | undefined = Account | undefined, + TChainOverride extends Chain | undefined = Chain | undefined, +> = Omit< + WriteContractParameters< + typeof panopticPoolABI, + "liquidateAccount", + TChain, + TAccount, + TChainOverride + >, + "args" | "address" | "abi" | "functionName" +> & { args: PanopticLiquidateAccountParameters }; + +export const writePanopticLiquidateAccount = < + TChain extends Chain | undefined, + TAccount extends Account | undefined, + TChainOverride extends Chain | undefined, +>( + client: Client, + { + args: { position }, + ...request + }: WritePanopticLiquidateAccountParameters, +): Promise => + writeContract(client, { + address: position.pool.address, + abi: panopticPoolABI, + functionName: "liquidateAccount", + args: [position.owner, 0, 0, [position.id]], + ...request, + } as unknown as WriteContractParameters< + typeof panopticPoolABI, + "liquidateAccount", + TChain, + TAccount, + TChainOverride + >); diff --git a/packages/panoptic-sdk/src/walletActions/writeMintOptions.ts b/packages/panoptic-sdk/src/walletActions/writeMintOptions.ts new file mode 100644 index 0000000..91f1102 --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/writeMintOptions.ts @@ -0,0 +1,56 @@ +import type { + Account, + Chain, + Client, + Transport, + WriteContractParameters, + WriteContractReturnType, +} from "viem"; +import { writeContract } from "viem/contract"; +import { panopticPoolABI } from "../abi/panopticPool.js"; +import type { PanopticPosition } from "../types/PanopticPosition.js"; + +export type PanopticMintOptionsParameters = { + position: PanopticPosition; + amount: bigint; +}; + +export type WritePanopticMintOptionsParameters< + TChain extends Chain | undefined = Chain, + TAccount extends Account | undefined = Account | undefined, + TChainOverride extends Chain | undefined = Chain | undefined, +> = Omit< + WriteContractParameters< + typeof panopticPoolABI, + "mintOptions", + TChain, + TAccount, + TChainOverride + >, + "args" | "address" | "abi" | "functionName" +> & { args: PanopticMintOptionsParameters }; + +export const writePanopticMintOptions = < + TChain extends Chain | undefined, + TAccount extends Account | undefined, + TChainOverride extends Chain | undefined, +>( + client: Client, + { + args: { position, amount }, + ...request + }: WritePanopticMintOptionsParameters, +): Promise => + writeContract(client, { + address: position.pool.address, + abi: panopticPoolABI, + functionName: "mintOptions", + args: [[position.id], amount, 0n, 0, 0], + ...request, + } as unknown as WriteContractParameters< + typeof panopticPoolABI, + "mintOptions", + TChain, + TAccount, + TChainOverride + >); diff --git a/packages/panoptic-sdk/src/walletActions/writeRollOptions.ts b/packages/panoptic-sdk/src/walletActions/writeRollOptions.ts new file mode 100644 index 0000000..9777436 --- /dev/null +++ b/packages/panoptic-sdk/src/walletActions/writeRollOptions.ts @@ -0,0 +1,56 @@ +import type { + Account, + Chain, + Client, + Transport, + WriteContractParameters, + WriteContractReturnType, +} from "viem"; +import { writeContract } from "viem/contract"; +import { panopticPoolABI } from "../abi/panopticPool.js"; +import type { PanopticPosition } from "../types/PanopticPosition.js"; + +export type PanopticRollOptionsParameters = { + oldPosition: PanopticPosition; + newPosition: PanopticPosition; +}; + +export type WritePanopticRollOptionsParameters< + TChain extends Chain | undefined = Chain, + TAccount extends Account | undefined = Account | undefined, + TChainOverride extends Chain | undefined = Chain | undefined, +> = Omit< + WriteContractParameters< + typeof panopticPoolABI, + "rollOptions", + TChain, + TAccount, + TChainOverride + >, + "args" | "address" | "abi" | "functionName" +> & { args: PanopticRollOptionsParameters }; + +export const writePanopticRollOptions = < + TChain extends Chain | undefined, + TAccount extends Account | undefined, + TChainOverride extends Chain | undefined, +>( + client: Client, + { + args: { oldPosition, newPosition }, + ...request + }: WritePanopticRollOptionsParameters, +): Promise => + writeContract(client, { + address: newPosition.pool.address, + abi: panopticPoolABI, + functionName: "rollOptions", + args: [oldPosition.id, newPosition.id, [oldPosition.id], 0, 0], + ...request, + } as unknown as WriteContractParameters< + typeof panopticPoolABI, + "rollOptions", + TChain, + TAccount, + TChainOverride + >); diff --git a/packages/panoptic-sdk/tsup.config.ts b/packages/panoptic-sdk/tsup.config.ts index 72e46f8..1eb74fc 100644 --- a/packages/panoptic-sdk/tsup.config.ts +++ b/packages/panoptic-sdk/tsup.config.ts @@ -9,4 +9,6 @@ export default defineConfig({ sourcemap: true, dts: true, clean: true, + minify: true, + treeshake: true, }); diff --git a/packages/panoptic-sdk/vitest.config.ts b/packages/panoptic-sdk/vitest.config.ts new file mode 100644 index 0000000..c130c81 --- /dev/null +++ b/packages/panoptic-sdk/vitest.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + environment: "node", + include: ["**/*.test.ts"], + testTimeout: 10_000, + globalSetup: ["src/_test/globalSetup.ts"], + coverage: { + reporter: process.env.CI ? ["lcov"] : ["text", "json", "html"], + exclude: [ + "**/dist/**", + "**/*.test.ts", + "**/*.test-d.ts", + "**/_test/**", + "src/generated.ts", + ], + }, + }, +}); diff --git a/packages/uniswap-v3-sdk/package.json b/packages/uniswap-v3-sdk/package.json index 605ddd8..8bec063 100644 --- a/packages/uniswap-v3-sdk/package.json +++ b/packages/uniswap-v3-sdk/package.json @@ -41,7 +41,7 @@ "vitest": "^0.34.5" }, "dependencies": { - "reverse-mirage": "1.0.0-next.2", + "reverse-mirage": "1.0.0-next.3", "tiny-invariant": "^1.3.1" } } diff --git a/packages/uniswap-v3-sdk/src/chains/sepolia.ts b/packages/uniswap-v3-sdk/src/chains/sepolia.ts new file mode 100644 index 0000000..af5f0ad --- /dev/null +++ b/packages/uniswap-v3-sdk/src/chains/sepolia.ts @@ -0,0 +1,9 @@ +import type { UniswapV3Factory } from "../types/uniswapV3Factory.js"; + +export const sepoliaUniswapV3 = { + factory: { + address: "0x0227628f3F023bb0B980b67D528571c95c6DaC1c", + owner: "0x1a9C8182C09F50C8318d769245beA52c32BE35BC", + blockCreated: 3518270n, + }, +} as const satisfies { factory: UniswapV3Factory }; diff --git a/packages/uniswap-v3-sdk/src/index.ts b/packages/uniswap-v3-sdk/src/index.ts index 2d45207..87f55b5 100644 --- a/packages/uniswap-v3-sdk/src/index.ts +++ b/packages/uniswap-v3-sdk/src/index.ts @@ -39,6 +39,7 @@ export { } from "./publicActions/index.js"; export { mainnetUniswapV3 } from "./chains/mainnet.js"; +export { sepoliaUniswapV3 } from "./chains/sepolia.js"; export { uniswapV3FactoryABI } from "./abi/uniswapV3FactoryABI.js"; export { uniswapV3PoolABI } from "./abi/uniswapV3PoolABI.js"; diff --git a/packages/uniswap-v3-sdk/tsup.config.ts b/packages/uniswap-v3-sdk/tsup.config.ts index 882260b..f6bab13 100644 --- a/packages/uniswap-v3-sdk/tsup.config.ts +++ b/packages/uniswap-v3-sdk/tsup.config.ts @@ -9,4 +9,6 @@ export default defineConfig({ sourcemap: true, dts: true, clean: true, + minify: true, + treeshake: true, }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b1c53da..3f198c2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,9 +11,6 @@ importers: '@biomejs/biome': specifier: ^1.2.2 version: 1.2.2 - '@wagmi/cli': - specifier: ^1.5.1 - version: 1.5.1(typescript@5.2.2) husky: specifier: ^8.0.3 version: 8.0.3 @@ -21,8 +18,8 @@ importers: packages/panoptic-sdk: dependencies: reverse-mirage: - specifier: 1.0.0-next.2 - version: 1.0.0-next.2(viem@1.12.2) + specifier: 1.0.0-next.3 + version: 1.0.0-next.3(viem@1.12.2) tiny-invariant: specifier: ^1.3.1 version: 1.3.1 @@ -33,6 +30,9 @@ importers: '@biomejs/biome': specifier: ^1.2.2 version: 1.2.2 + '@viem/anvil': + specifier: ^0.0.6 + version: 0.0.6 tsup: specifier: ^7.2.0 version: 7.2.0(typescript@5.2.2) @@ -41,13 +41,16 @@ importers: version: 5.2.2 viem: specifier: ^1.12.2 - version: 1.12.2(typescript@5.2.2)(zod@3.22.2) + version: 1.12.2(typescript@5.2.2) + vitest: + specifier: ^0.34.5 + version: 0.34.5 packages/uniswap-v3-sdk: dependencies: reverse-mirage: - specifier: 1.0.0-next.2 - version: 1.0.0-next.2(viem@1.12.2) + specifier: 1.0.0-next.3 + version: 1.0.0-next.3(viem@1.12.2) tiny-invariant: specifier: ^1.3.1 version: 1.3.1 @@ -193,15 +196,6 @@ packages: case: 1.6.3 dev: true - /@esbuild/android-arm64@0.16.17: - resolution: {integrity: sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm64@0.18.20: resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} @@ -211,15 +205,6 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.16.17: - resolution: {integrity: sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm@0.18.20: resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} @@ -229,15 +214,6 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.16.17: - resolution: {integrity: sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-x64@0.18.20: resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} @@ -247,15 +223,6 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.16.17: - resolution: {integrity: sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-arm64@0.18.20: resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} @@ -265,15 +232,6 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.16.17: - resolution: {integrity: sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-x64@0.18.20: resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} @@ -283,15 +241,6 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.16.17: - resolution: {integrity: sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-arm64@0.18.20: resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} @@ -301,15 +250,6 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.16.17: - resolution: {integrity: sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-x64@0.18.20: resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} @@ -319,15 +259,6 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.16.17: - resolution: {integrity: sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm64@0.18.20: resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} @@ -337,15 +268,6 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.16.17: - resolution: {integrity: sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm@0.18.20: resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} @@ -355,15 +277,6 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.16.17: - resolution: {integrity: sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ia32@0.18.20: resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} @@ -373,15 +286,6 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.16.17: - resolution: {integrity: sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-loong64@0.18.20: resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} @@ -391,15 +295,6 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.16.17: - resolution: {integrity: sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-mips64el@0.18.20: resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} @@ -409,15 +304,6 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.16.17: - resolution: {integrity: sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ppc64@0.18.20: resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} @@ -427,15 +313,6 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.16.17: - resolution: {integrity: sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-riscv64@0.18.20: resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} @@ -445,15 +322,6 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.16.17: - resolution: {integrity: sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-s390x@0.18.20: resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} @@ -463,15 +331,6 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.16.17: - resolution: {integrity: sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-x64@0.18.20: resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} @@ -481,15 +340,6 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.16.17: - resolution: {integrity: sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/netbsd-x64@0.18.20: resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} @@ -499,15 +349,6 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.16.17: - resolution: {integrity: sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/openbsd-x64@0.18.20: resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} @@ -517,15 +358,6 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.16.17: - resolution: {integrity: sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - /@esbuild/sunos-x64@0.18.20: resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} @@ -535,15 +367,6 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.16.17: - resolution: {integrity: sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-arm64@0.18.20: resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} @@ -553,15 +376,6 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.16.17: - resolution: {integrity: sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-ia32@0.18.20: resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} @@ -571,15 +385,6 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.16.17: - resolution: {integrity: sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-x64@0.18.20: resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} @@ -1521,6 +1326,19 @@ packages: '@uniswap/v3-periphery': 1.4.3 dev: true + /@viem/anvil@0.0.6: + resolution: {integrity: sha512-OjKR/+FVwzuygXYFqP8MBal1SXG8bT2gbZwqqB0XuLw81LNBBvmE/Repm6+5kkBh4IUj0PhYdrqOsnayS14Gtg==} + dependencies: + execa: 7.2.0 + get-port: 6.1.2 + http-proxy: 1.18.1 + ws: 8.13.0 + transitivePeerDependencies: + - bufferutil + - debug + - utf-8-validate + dev: true + /@vitest/coverage-v8@0.34.5(vitest@0.34.5): resolution: {integrity: sha512-97xjhRTSdmeeHCm2nNHhT3hLsMYkAhHXm/rwj6SZ3voka8xiCJrwgtfIjoZIFEL4OO0KezGmVuHWQXcMunULIA==} peerDependencies: @@ -1580,62 +1398,18 @@ packages: pretty-format: 29.7.0 dev: true - /@wagmi/cli@1.5.1(typescript@5.2.2): - resolution: {integrity: sha512-Ow7KDQsD2Mj1QovssihWsOoeI9qPlcXfsrTFXbb4s3jssW17NJHeJZ8+7b3LervJp5YDDMfhaCxxMTjFV/jZMQ==} - engines: {node: '>=14'} - hasBin: true + /abitype@0.9.8(typescript@5.2.2): + resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} peerDependencies: - '@wagmi/core': '>=1.0.0' typescript: '>=5.0.4' - wagmi: '>=1.0.0' + zod: ^3 >=3.19.1 peerDependenciesMeta: - '@wagmi/core': - optional: true typescript: optional: true - wagmi: - optional: true - dependencies: - abitype: 0.8.7(typescript@5.2.2)(zod@3.22.2) - abort-controller: 3.0.0 - bundle-require: 3.1.2(esbuild@0.16.17) - cac: 6.7.14 - change-case: 4.1.2 - chokidar: 3.5.3 - dedent: 0.7.0 - detect-package-manager: 2.0.1 - dotenv: 16.3.1 - dotenv-expand: 10.0.0 - esbuild: 0.16.17 - execa: 6.1.0 - find-up: 6.3.0 - fs-extra: 10.1.0 - globby: 13.2.2 - node-fetch: 3.3.2 - ora: 6.3.1 - pathe: 1.1.1 - picocolors: 1.0.0 - prettier: 2.8.8 - typescript: 5.2.2 - viem: 1.12.2(typescript@5.2.2)(zod@3.22.2) - zod: 3.22.2 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - dev: true - - /abitype@0.8.7(typescript@5.2.2)(zod@3.22.2): - resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} - peerDependencies: - typescript: '>=5.0.4' - zod: ^3 >=3.19.1 - peerDependenciesMeta: zod: optional: true dependencies: typescript: 5.2.2 - zod: 3.22.2 - dev: true /abitype@0.9.8(typescript@5.2.2)(zod@3.22.2): resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} @@ -1650,12 +1424,6 @@ packages: dependencies: typescript: 5.2.2 zod: 3.22.2 - - /abort-controller@3.0.0: - resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} - engines: {node: '>=6.5'} - dependencies: - event-target-shim: 5.0.1 dev: true /abstract-level@1.0.3: @@ -1730,11 +1498,6 @@ packages: engines: {node: '>=8'} dev: true - /ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - dev: true - /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -1815,14 +1578,6 @@ packages: engines: {node: '>=8'} dev: true - /bl@5.1.0: - resolution: {integrity: sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==} - dependencies: - buffer: 6.0.3 - inherits: 2.0.4 - readable-stream: 3.6.2 - dev: true - /blakejs@1.2.1: resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} dev: true @@ -1912,16 +1667,6 @@ packages: ieee754: 1.2.1 dev: true - /bundle-require@3.1.2(esbuild@0.16.17): - resolution: {integrity: sha512-Of6l6JBAxiyQ5axFxUM6dYeP/W7X2Sozeo/4EYB9sJhL+dqL7TKjg+shwxp6jlu/6ZSERfsYtIpSJ1/x3XkAEA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - peerDependencies: - esbuild: '>=0.13' - dependencies: - esbuild: 0.16.17 - load-tsconfig: 0.2.5 - dev: true - /bundle-require@4.0.1(esbuild@0.18.20): resolution: {integrity: sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -1949,26 +1694,11 @@ packages: engines: {node: '>=8'} dev: true - /camel-case@4.1.2: - resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==} - dependencies: - pascal-case: 3.1.2 - tslib: 2.6.2 - dev: true - /camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} dev: true - /capital-case@1.0.4: - resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - upper-case-first: 2.0.2 - dev: true - /case@1.6.3: resolution: {integrity: sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==} engines: {node: '>= 0.8.0'} @@ -2009,28 +1739,6 @@ packages: supports-color: 7.2.0 dev: true - /chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - dev: true - - /change-case@4.1.2: - resolution: {integrity: sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==} - dependencies: - camel-case: 4.1.2 - capital-case: 1.0.4 - constant-case: 3.0.4 - dot-case: 3.0.4 - header-case: 2.0.4 - no-case: 3.0.4 - param-case: 3.0.4 - pascal-case: 3.1.2 - path-case: 3.0.4 - sentence-case: 3.0.4 - snake-case: 3.0.4 - tslib: 2.6.2 - dev: true - /check-error@1.0.2: resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} dev: true @@ -2078,18 +1786,6 @@ packages: engines: {node: '>=6'} dev: true - /cli-cursor@4.0.0: - resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - restore-cursor: 4.0.0 - dev: true - - /cli-spinners@2.9.1: - resolution: {integrity: sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ==} - engines: {node: '>=6'} - dev: true - /cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} dependencies: @@ -2098,11 +1794,6 @@ packages: wrap-ansi: 7.0.0 dev: true - /clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - dev: true - /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: @@ -2141,14 +1832,6 @@ packages: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: true - /constant-case@3.0.4: - resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - upper-case: 2.0.2 - dev: true - /convert-source-map@1.9.0: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} dev: true @@ -2194,9 +1877,16 @@ packages: which: 2.0.2 dev: true - /data-uri-to-buffer@4.0.1: - resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} - engines: {node: '>= 12'} + /debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 dev: true /debug@4.3.4(supports-color@8.1.1): @@ -2221,10 +1911,6 @@ packages: resolution: {integrity: sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==} dev: true - /dedent@0.7.0: - resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} - dev: true - /deep-eql@4.1.3: resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} engines: {node: '>=6'} @@ -2232,24 +1918,11 @@ packages: type-detect: 4.0.8 dev: true - /defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - dependencies: - clone: 1.0.4 - dev: true - /depd@2.0.0: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} dev: true - /detect-package-manager@2.0.1: - resolution: {integrity: sha512-j/lJHyoLlWi6G1LDdLgvUtz60Zo5GEj+sVYtTVXnYLDPuzgC3llMxonXym9zIwhhUII8vjdw0LXxavpLqTbl1A==} - engines: {node: '>=12'} - dependencies: - execa: 5.1.1 - dev: true - /diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2267,28 +1940,11 @@ packages: path-type: 4.0.0 dev: true - /dot-case@3.0.4: - resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - dev: true - - /dotenv-expand@10.0.0: - resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==} - engines: {node: '>=12'} - dev: true - /dotenv@14.3.2: resolution: {integrity: sha512-vwEppIphpFdvaMCaHfCEv9IgwcxMljMw2TnAQBB4VWPvzXQLTb82jwmdOKzlEVUL3gNFT4l4TPKO+Bn+sqcrVQ==} engines: {node: '>=12'} dev: true - /dotenv@16.3.1: - resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} - engines: {node: '>=12'} - dev: true - /elliptic@6.5.4: resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} dependencies: @@ -2318,36 +1974,6 @@ packages: engines: {node: '>=6'} dev: true - /esbuild@0.16.17: - resolution: {integrity: sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/android-arm': 0.16.17 - '@esbuild/android-arm64': 0.16.17 - '@esbuild/android-x64': 0.16.17 - '@esbuild/darwin-arm64': 0.16.17 - '@esbuild/darwin-x64': 0.16.17 - '@esbuild/freebsd-arm64': 0.16.17 - '@esbuild/freebsd-x64': 0.16.17 - '@esbuild/linux-arm': 0.16.17 - '@esbuild/linux-arm64': 0.16.17 - '@esbuild/linux-ia32': 0.16.17 - '@esbuild/linux-loong64': 0.16.17 - '@esbuild/linux-mips64el': 0.16.17 - '@esbuild/linux-ppc64': 0.16.17 - '@esbuild/linux-riscv64': 0.16.17 - '@esbuild/linux-s390x': 0.16.17 - '@esbuild/linux-x64': 0.16.17 - '@esbuild/netbsd-x64': 0.16.17 - '@esbuild/openbsd-x64': 0.16.17 - '@esbuild/sunos-x64': 0.16.17 - '@esbuild/win32-arm64': 0.16.17 - '@esbuild/win32-ia32': 0.16.17 - '@esbuild/win32-x64': 0.16.17 - dev: true - /esbuild@0.18.20: resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} engines: {node: '>=12'} @@ -2487,9 +2113,8 @@ packages: strip-hex-prefix: 1.0.0 dev: true - /event-target-shim@5.0.1: - resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} - engines: {node: '>=6'} + /eventemitter3@4.0.7: + resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} dev: true /evp_bytestokey@1.0.3: @@ -2514,13 +2139,13 @@ packages: strip-final-newline: 2.0.0 dev: true - /execa@6.1.0: - resolution: {integrity: sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /execa@7.2.0: + resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==} + engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} dependencies: cross-spawn: 7.0.3 get-stream: 6.0.1 - human-signals: 3.0.1 + human-signals: 4.3.1 is-stream: 3.0.0 merge-stream: 2.0.0 npm-run-path: 5.1.0 @@ -2546,14 +2171,6 @@ packages: reusify: 1.0.4 dev: true - /fetch-blob@3.2.0: - resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} - engines: {node: ^12.20 || >= 14.13} - dependencies: - node-domexception: 1.0.0 - web-streams-polyfill: 3.2.1 - dev: true - /fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} @@ -2576,20 +2193,12 @@ packages: path-exists: 4.0.0 dev: true - /find-up@6.3.0: - resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - locate-path: 7.2.0 - path-exists: 5.0.0 - dev: true - /flat@5.0.2: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true dev: true - /follow-redirects@1.15.3(debug@4.3.4): + /follow-redirects@1.15.3: resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} engines: {node: '>=4.0'} peerDependencies: @@ -2597,15 +2206,18 @@ packages: peerDependenciesMeta: debug: optional: true - dependencies: - debug: 4.3.4(supports-color@8.1.1) dev: true - /formdata-polyfill@4.0.10: - resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} - engines: {node: '>=12.20.0'} + /follow-redirects@1.15.3(debug@4.3.4): + resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true dependencies: - fetch-blob: 3.2.0 + debug: 4.3.4(supports-color@8.1.1) dev: true /fp-ts@1.19.3: @@ -2622,15 +2234,6 @@ packages: rimraf: 2.7.1 dev: true - /fs-extra@10.1.0: - resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} - engines: {node: '>=12'} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.0 - dev: true - /fs-extra@7.0.1: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} @@ -2665,6 +2268,11 @@ packages: resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} dev: true + /get-port@6.1.2: + resolution: {integrity: sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -2722,17 +2330,6 @@ packages: slash: 3.0.0 dev: true - /globby@13.2.2: - resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - dir-glob: 3.0.1 - fast-glob: 3.3.1 - ignore: 5.2.4 - merge2: 1.4.1 - slash: 4.0.0 - dev: true - /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: true @@ -2844,13 +2441,6 @@ packages: hasBin: true dev: true - /header-case@2.0.4: - resolution: {integrity: sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==} - dependencies: - capital-case: 1.0.4 - tslib: 2.6.2 - dev: true - /hmac-drbg@1.0.1: resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} dependencies: @@ -2874,6 +2464,17 @@ packages: toidentifier: 1.0.1 dev: true + /http-proxy@1.18.1: + resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.7 + follow-redirects: 1.15.3 + requires-port: 1.0.0 + transitivePeerDependencies: + - debug + dev: true + /https-proxy-agent@5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} @@ -2889,9 +2490,9 @@ packages: engines: {node: '>=10.17.0'} dev: true - /human-signals@3.0.1: - resolution: {integrity: sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==} - engines: {node: '>=12.20.0'} + /human-signals@4.3.1: + resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} + engines: {node: '>=14.18.0'} dev: true /husky@8.0.3: @@ -2976,11 +2577,6 @@ packages: engines: {node: '>=6.5.0', npm: '>=3'} dev: true - /is-interactive@2.0.0: - resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} - engines: {node: '>=12'} - dev: true - /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -3006,11 +2602,6 @@ packages: engines: {node: '>=10'} dev: true - /is-unicode-supported@1.3.0: - resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==} - engines: {node: '>=12'} - dev: true - /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true @@ -3095,14 +2686,6 @@ packages: graceful-fs: 4.2.11 dev: true - /jsonfile@6.1.0: - resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} - dependencies: - universalify: 2.0.0 - optionalDependencies: - graceful-fs: 4.2.11 - dev: true - /keccak@3.0.4: resolution: {integrity: sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==} engines: {node: '>=10.0.0'} @@ -3174,13 +2757,6 @@ packages: p-locate: 5.0.0 dev: true - /locate-path@7.2.0: - resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - p-locate: 6.0.0 - dev: true - /lodash.sortby@4.7.0: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} dev: true @@ -3197,26 +2773,12 @@ packages: is-unicode-supported: 0.1.0 dev: true - /log-symbols@5.1.0: - resolution: {integrity: sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==} - engines: {node: '>=12'} - dependencies: - chalk: 5.3.0 - is-unicode-supported: 1.3.0 - dev: true - /loupe@2.3.6: resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} dependencies: get-func-name: 2.0.0 dev: true - /lower-case@2.0.2: - resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} - dependencies: - tslib: 2.6.2 - dev: true - /lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} dependencies: @@ -3403,31 +2965,10 @@ packages: resolution: {integrity: sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==} dev: true - /no-case@3.0.4: - resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} - dependencies: - lower-case: 2.0.2 - tslib: 2.6.2 - dev: true - /node-addon-api@2.0.2: resolution: {integrity: sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==} dev: true - /node-domexception@1.0.0: - resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} - engines: {node: '>=10.5.0'} - dev: true - - /node-fetch@3.3.2: - resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - data-uri-to-buffer: 4.0.1 - fetch-blob: 3.2.0 - formdata-polyfill: 4.0.10 - dev: true - /node-gyp-build@4.6.1: resolution: {integrity: sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==} hasBin: true @@ -3481,21 +3022,6 @@ packages: mimic-fn: 4.0.0 dev: true - /ora@6.3.1: - resolution: {integrity: sha512-ERAyNnZOfqM+Ao3RAvIXkYh5joP220yf59gVe2X/cI6SiCxIdi4c9HZKZD8R6q/RDXEje1THBju6iExiSsgJaQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - chalk: 5.3.0 - cli-cursor: 4.0.0 - cli-spinners: 2.9.1 - is-interactive: 2.0.0 - is-unicode-supported: 1.3.0 - log-symbols: 5.1.0 - stdin-discarder: 0.1.0 - strip-ansi: 7.1.0 - wcwidth: 1.0.1 - dev: true - /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} @@ -3536,13 +3062,6 @@ packages: p-limit: 3.1.0 dev: true - /p-locate@6.0.0: - resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - p-limit: 4.0.0 - dev: true - /p-map@4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} @@ -3555,27 +3074,6 @@ packages: engines: {node: '>=4'} dev: true - /param-case@3.0.4: - resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} - dependencies: - dot-case: 3.0.4 - tslib: 2.6.2 - dev: true - - /pascal-case@3.1.2: - resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - dev: true - - /path-case@3.0.4: - resolution: {integrity: sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==} - dependencies: - dot-case: 3.0.4 - tslib: 2.6.2 - dev: true - /path-exists@3.0.0: resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} engines: {node: '>=4'} @@ -3586,11 +3084,6 @@ packages: engines: {node: '>=8'} dev: true - /path-exists@5.0.0: - resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: true - /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} @@ -3681,12 +3174,6 @@ packages: source-map-js: 1.0.2 dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} - hasBin: true - dev: true - /pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -3751,6 +3238,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /requires-port@1.0.0: + resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + dev: true + /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} @@ -3762,26 +3253,18 @@ packages: path-parse: 1.0.7 dev: true - /restore-cursor@4.0.0: - resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - dev: true - /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} dev: true - /reverse-mirage@1.0.0-next.2(viem@1.12.2): - resolution: {integrity: sha512-u/EPlejSgzLM6b5Ugh2RYXco6sKPPrkdDgLHv3mfztYx86qBWe5XkpnIDwI73LyFWXWL80eRafElZpXyRTpVzQ==} + /reverse-mirage@1.0.0-next.3(viem@1.12.2): + resolution: {integrity: sha512-/DjgvYB+HpI6p57SZCYbD8LCVGNL19kzNaibEbd/rqoBWLyBIB2vHiNabSoRib+6xptpxgxRY7ztma3ifLeh0A==} peerDependencies: viem: '>=1' dependencies: tiny-invariant: 1.3.1 - viem: 1.12.2(typescript@5.2.2)(zod@3.22.2) + viem: 1.12.2(typescript@5.2.2) dev: false /rimraf@2.7.1: @@ -3873,14 +3356,6 @@ packages: lru-cache: 6.0.0 dev: true - /sentence-case@3.0.4: - resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - upper-case-first: 2.0.2 - dev: true - /serialize-javascript@6.0.0: resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} dependencies: @@ -3928,18 +3403,6 @@ packages: engines: {node: '>=8'} dev: true - /slash@4.0.0: - resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} - engines: {node: '>=12'} - dev: true - - /snake-case@3.0.4: - resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} - dependencies: - dot-case: 3.0.4 - tslib: 2.6.2 - dev: true - /solc@0.7.3(debug@4.3.4): resolution: {integrity: sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==} engines: {node: '>=8.0.0'} @@ -4002,13 +3465,6 @@ packages: resolution: {integrity: sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==} dev: true - /stdin-discarder@0.1.0: - resolution: {integrity: sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - bl: 5.1.0 - dev: true - /streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} @@ -4036,13 +3492,6 @@ packages: ansi-regex: 5.0.1 dev: true - /strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - dependencies: - ansi-regex: 6.0.1 - dev: true - /strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} @@ -4191,10 +3640,6 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true - /tsort@0.0.1: resolution: {integrity: sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==} dev: true @@ -4218,7 +3663,7 @@ packages: bundle-require: 4.0.1(esbuild@0.18.20) cac: 6.7.14 chokidar: 3.5.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 esbuild: 0.18.20 execa: 5.1.1 globby: 11.1.0 @@ -4279,28 +3724,11 @@ packages: engines: {node: '>= 4.0.0'} dev: true - /universalify@2.0.0: - resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} - engines: {node: '>= 10.0.0'} - dev: true - /unpipe@1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} dev: true - /upper-case-first@2.0.2: - resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} - dependencies: - tslib: 2.6.2 - dev: true - - /upper-case@2.0.2: - resolution: {integrity: sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==} - dependencies: - tslib: 2.6.2 - dev: true - /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true @@ -4319,6 +3747,29 @@ packages: convert-source-map: 1.9.0 dev: true + /viem@1.12.2(typescript@5.2.2): + resolution: {integrity: sha512-aCaUCyg72ES+jK4s6tVYOMnOt4if71RwzgiUAUpAuaCgvHFfh9DCnwuEfwkxEZLE2vafOsirgJ3fcn7nsDVQoQ==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@adraffy/ens-normalize': 1.9.4 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@scure/bip32': 1.3.2 + '@scure/bip39': 1.2.1 + '@types/ws': 8.5.5 + abitype: 0.9.8(typescript@5.2.2) + isomorphic-ws: 5.0.0(ws@8.13.0) + typescript: 5.2.2 + ws: 8.13.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + /viem@1.12.2(typescript@5.2.2)(zod@3.22.2): resolution: {integrity: sha512-aCaUCyg72ES+jK4s6tVYOMnOt4if71RwzgiUAUpAuaCgvHFfh9DCnwuEfwkxEZLE2vafOsirgJ3fcn7nsDVQoQ==} peerDependencies: @@ -4341,6 +3792,7 @@ packages: - bufferutil - utf-8-validate - zod + dev: true /vite-node@0.34.5(@types/node@20.6.5): resolution: {integrity: sha512-RNZ+DwbCvDoI5CbCSQSyRyzDTfFvFauvMs6Yq4ObJROKlIKuat1KgSX/Ako5rlDMfVCyMcpMRMTkJBxd6z8YRA==} @@ -4348,7 +3800,7 @@ packages: hasBin: true dependencies: cac: 6.7.14 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 @@ -4443,7 +3895,7 @@ packages: acorn-walk: 8.2.0 cac: 6.7.14 chai: 4.3.8 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 local-pkg: 0.4.3 magic-string: 0.30.3 pathe: 1.1.1 @@ -4465,17 +3917,6 @@ packages: - terser dev: true - /wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - dependencies: - defaults: 1.0.4 - dev: true - - /web-streams-polyfill@3.2.1: - resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==} - engines: {node: '>= 8'} - dev: true - /webidl-conversions@4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} dev: true @@ -4618,3 +4059,4 @@ packages: /zod@3.22.2: resolution: {integrity: sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==} + dev: true diff --git a/wagmi.config.ts b/wagmi.config.ts deleted file mode 100644 index 9ccee53..0000000 --- a/wagmi.config.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { defineConfig } from "@wagmi/cli"; -import { foundry } from "@wagmi/cli/plugins"; - -export default defineConfig([ - { - out: "packages/panoptic-sdk/src/generated.ts", - contracts: [], - plugins: [ - foundry({ - project: "lib/panoptic-v1-core/", - include: [ - "SemiFungiblePositionManager.sol/**", - "PanopticFactory.sol/**", - "PanopticPool.sol/**", - "CollateralTracker.sol/**", - ], - }), - ], - }, -]);