[
  {
    "name": "evm-counter-baseline",
    "lane": "evm",
    "templateId": "counter",
    "edition": "baseline",
    "source": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.30;\n\ncontract Counter {\n    uint256 public count;\n    address public owner;\n\n    constructor() {\n        owner = msg.sender;\n    }\n\n    function increment(uint256 by) external {\n        require(msg.sender == owner, \"Owner only\");\n        count += by;\n    }\n}\n",
    "files": {},
    "programAddress": null,
    "scenario": {
      "schema": "chainwright-evm-scenarios-v1",
      "name": "Authority counter",
      "lane": "evm",
      "steps": [
        {
          "name": "Owner getter records deployer",
          "function": "owner",
          "args": [],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "success",
            "returnValue": "owner"
          }
        },
        {
          "name": "Increment persists seven units",
          "function": "increment(uint256)",
          "args": [
            "7"
          ],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "success",
            "storage": {
              "0": "7"
            }
          }
        },
        {
          "name": "Unauthorized write reverts with state retained",
          "function": "increment(uint256)",
          "args": [
            "1"
          ],
          "caller": "other",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "Owner only",
            "storage": {
              "0": "7"
            }
          }
        },
        {
          "name": "Checked uint256 overflow reverts",
          "function": "increment(uint256)",
          "args": [
            "115792089237316195423570985008687907853269984665640564039457584007913129639935"
          ],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "revert",
            "returnDataPrefix": "4e487b71",
            "storage": {
              "0": "7"
            }
          }
        },
        {
          "name": "Zero increment keeps seven",
          "function": "increment(uint256)",
          "args": [
            "0"
          ],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "success",
            "storage": {
              "0": "7"
            }
          }
        },
        {
          "name": "Second increment persists eight",
          "function": "increment(uint256)",
          "args": [
            "1"
          ],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "success",
            "storage": {
              "0": "8"
            }
          }
        },
        {
          "name": "Getter confirms final state",
          "function": "count",
          "args": [],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "success",
            "returnValue": "8"
          }
        }
      ]
    }
  },
  {
    "name": "evm-counter-optimized",
    "lane": "evm",
    "templateId": "counter",
    "edition": "optimized",
    "source": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.30;\n\ncontract Counter {\n    uint256 public count;\n    address public immutable owner;\n\n    constructor() {\n        owner = msg.sender;\n    }\n\n    function increment(uint256 by) external {\n        require(msg.sender == owner, \"Owner only\");\n        count += by;\n    }\n}\n",
    "files": {},
    "programAddress": null,
    "scenario": {
      "schema": "chainwright-evm-scenarios-v1",
      "name": "Authority counter",
      "lane": "evm",
      "steps": [
        {
          "name": "Owner getter records deployer",
          "function": "owner",
          "args": [],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "success",
            "returnValue": "owner"
          }
        },
        {
          "name": "Increment persists seven units",
          "function": "increment(uint256)",
          "args": [
            "7"
          ],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "success",
            "storage": {
              "0": "7"
            }
          }
        },
        {
          "name": "Unauthorized write reverts with state retained",
          "function": "increment(uint256)",
          "args": [
            "1"
          ],
          "caller": "other",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "Owner only",
            "storage": {
              "0": "7"
            }
          }
        },
        {
          "name": "Checked uint256 overflow reverts",
          "function": "increment(uint256)",
          "args": [
            "115792089237316195423570985008687907853269984665640564039457584007913129639935"
          ],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "revert",
            "returnDataPrefix": "4e487b71",
            "storage": {
              "0": "7"
            }
          }
        },
        {
          "name": "Zero increment keeps seven",
          "function": "increment(uint256)",
          "args": [
            "0"
          ],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "success",
            "storage": {
              "0": "7"
            }
          }
        },
        {
          "name": "Second increment persists eight",
          "function": "increment(uint256)",
          "args": [
            "1"
          ],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "success",
            "storage": {
              "0": "8"
            }
          }
        },
        {
          "name": "Getter confirms final state",
          "function": "count",
          "args": [],
          "caller": "owner",
          "value": "0",
          "expect": {
            "status": "success",
            "returnValue": "8"
          }
        }
      ]
    }
  },
  {
    "name": "evm-fee-hook-baseline",
    "lane": "evm",
    "templateId": "fee-hook",
    "edition": "baseline",
    "source": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.30;\n\n// ABI mirrors Uniswap v4-core PoolKey / SwapParams / BeforeSwapDelta.\n// Reference: v4-core@bea7f6d1c11cd5dc4f0d5151ffa37a1c239feee6.\nstruct PoolKey {\n    address currency0;\n    address currency1;\n    uint24 fee;\n    int24 tickSpacing;\n    address hooks;\n}\nstruct SwapParams {\n    bool zeroForOne;\n    int256 amountSpecified;\n    uint160 sqrtPriceLimitX96;\n}\ntype BeforeSwapDelta is int256;\n\ncontract SizeFeeHook {\n    address public poolManager;\n    uint24 public constant LOW_FEE = 3_000;      // 0.30%\n    uint24 public constant LARGE_FEE = 8_000;    // 0.80%\n    uint256 public constant THRESHOLD = 1_000_000; // raw input units\n\n    constructor(address manager) {\n        require(manager != address(0), \"Manager required\");\n        require(uint160(address(this)) & 0x3fff == 0x0080,\n            \"Hook address flags\"); // beforeSwap only\n        poolManager = manager;\n    }\n\n    function beforeSwap(\n        address, PoolKey calldata key,\n        SwapParams calldata params, bytes calldata\n    ) external view returns (bytes4, BeforeSwapDelta, uint24) {\n        require(msg.sender == poolManager, \"PoolManager only\");\n        require(key.hooks == address(this), \"Wrong hook\");\n        require(key.fee == 0x800000, \"Dynamic fee pool required\");\n        require(params.amountSpecified < 0, \"Exact input only\");\n\n        uint256 inputAmount = uint256(-params.amountSpecified);\n        uint24 lpFee = inputAmount >= THRESHOLD ? LARGE_FEE : LOW_FEE;\n        return (this.beforeSwap.selector, BeforeSwapDelta.wrap(0),\n            lpFee | 0x400000);\n    }\n}\n",
    "files": {},
    "programAddress": null,
    "scenario": {
      "schema": "chainwright-evm-scenarios-v1",
      "name": "v4 beforeSwap permission and fee callback",
      "lane": "evm",
      "steps": [
        {
          "name": "Below-threshold exact input selects low fee",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4197304"
            ]
          }
        },
        {
          "name": "Threshold exact input selects high fee",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4202304"
            ]
          }
        },
        {
          "name": "Only PoolManager may call",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "other",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "PoolManager only"
          }
        },
        {
          "name": "Static fee pool is rejected",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 3000,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "Dynamic fee pool required"
          }
        },
        {
          "name": "Pool key must name this hook",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "other"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "Wrong hook"
          }
        },
        {
          "name": "Exact output request is rejected",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "1000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "Exact input only"
          }
        },
        {
          "name": "Callback returns the flagged fee override",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4202304"
            ]
          }
        },
        {
          "name": "Boundary input -1",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4197304"
            ]
          }
        },
        {
          "name": "Boundary input -999999",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-999999",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4197304"
            ]
          }
        },
        {
          "name": "Boundary input -1000001",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000001",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4202304"
            ]
          }
        },
        {
          "name": "Rejected boundary 0",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "0",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "Exact input only"
          }
        },
        {
          "name": "Rejected boundary -57896044618658097711785492504343953926634992332820282019728792003956564819968",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-57896044618658097711785492504343953926634992332820282019728792003956564819968",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "revert",
            "returnDataPrefix": "4e487b71"
          }
        }
      ]
    }
  },
  {
    "name": "evm-fee-hook-optimized",
    "lane": "evm",
    "templateId": "fee-hook",
    "edition": "optimized",
    "source": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.30;\n\n// ABI mirrors Uniswap v4-core PoolKey / SwapParams / BeforeSwapDelta.\n// Reference: v4-core@bea7f6d1c11cd5dc4f0d5151ffa37a1c239feee6.\nstruct PoolKey {\n    address currency0;\n    address currency1;\n    uint24 fee;\n    int24 tickSpacing;\n    address hooks;\n}\nstruct SwapParams {\n    bool zeroForOne;\n    int256 amountSpecified;\n    uint160 sqrtPriceLimitX96;\n}\ntype BeforeSwapDelta is int256;\n\ncontract SizeFeeHook {\n    address public immutable poolManager;\n    uint24 public constant LOW_FEE = 3_000;      // 0.30%\n    uint24 public constant LARGE_FEE = 8_000;    // 0.80%\n    uint256 public constant THRESHOLD = 1_000_000; // raw input units\n\n    constructor(address manager) {\n        require(manager != address(0), \"Manager required\");\n        require(uint160(address(this)) & 0x3fff == 0x0080,\n            \"Hook address flags\"); // beforeSwap only\n        poolManager = manager;\n    }\n\n    function beforeSwap(\n        address, PoolKey calldata key,\n        SwapParams calldata params, bytes calldata\n    ) external view returns (bytes4, BeforeSwapDelta, uint24) {\n        require(msg.sender == poolManager, \"PoolManager only\");\n        require(key.hooks == address(this), \"Wrong hook\");\n        require(key.fee == 0x800000, \"Dynamic fee pool required\");\n        require(params.amountSpecified < 0, \"Exact input only\");\n\n        uint256 inputAmount = uint256(-params.amountSpecified);\n        uint24 lpFee = inputAmount >= THRESHOLD ? LARGE_FEE : LOW_FEE;\n        return (this.beforeSwap.selector, BeforeSwapDelta.wrap(0),\n            lpFee | 0x400000);\n    }\n}\n",
    "files": {},
    "programAddress": null,
    "scenario": {
      "schema": "chainwright-evm-scenarios-v1",
      "name": "v4 beforeSwap permission and fee callback",
      "lane": "evm",
      "steps": [
        {
          "name": "Below-threshold exact input selects low fee",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4197304"
            ]
          }
        },
        {
          "name": "Threshold exact input selects high fee",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4202304"
            ]
          }
        },
        {
          "name": "Only PoolManager may call",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "other",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "PoolManager only"
          }
        },
        {
          "name": "Static fee pool is rejected",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 3000,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "Dynamic fee pool required"
          }
        },
        {
          "name": "Pool key must name this hook",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "other"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "Wrong hook"
          }
        },
        {
          "name": "Exact output request is rejected",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "1000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "Exact input only"
          }
        },
        {
          "name": "Callback returns the flagged fee override",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000000",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4202304"
            ]
          }
        },
        {
          "name": "Boundary input -1",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4197304"
            ]
          }
        },
        {
          "name": "Boundary input -999999",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-999999",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4197304"
            ]
          }
        },
        {
          "name": "Boundary input -1000001",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-1000001",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "success",
            "returnDataPrefix": "0x575e24b4",
            "returnValue": [
              "0x575e24b4",
              "0",
              "4202304"
            ]
          }
        },
        {
          "name": "Rejected boundary 0",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "0",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "revert",
            "revertMessage": "Exact input only"
          }
        },
        {
          "name": "Rejected boundary -57896044618658097711785492504343953926634992332820282019728792003956564819968",
          "function": "beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes)",
          "args": [
            "owner",
            {
              "currency0": "0x0000000000000000000000000000000000000001",
              "currency1": "0x0000000000000000000000000000000000000002",
              "fee": 8388608,
              "tickSpacing": 60,
              "hooks": "contract"
            },
            {
              "zeroForOne": true,
              "amountSpecified": "-57896044618658097711785492504343953926634992332820282019728792003956564819968",
              "sqrtPriceLimitX96": "1"
            },
            "0x"
          ],
          "caller": "manager",
          "value": "0",
          "expect": {
            "status": "revert",
            "returnDataPrefix": "4e487b71"
          }
        }
      ]
    }
  },
  {
    "name": "solana-counter",
    "lane": "solana",
    "templateId": "counter",
    "source": "import { type Init, type Mut, type Pubkey, type Signer,\n  type SystemProgram, type u8, type u64, require } from \"typesol\";\n\nexport interface Counter {\n  authority: Pubkey;\n  count: u64;\n  bump: u8;\n}\n\nexport enum CounterError {\n  Unauthorized = \"Only the authority can change this counter\",\n}\n\nexport function initialize(\n  authority: Mut<Signer>, counter: Init<Counter>,\n  systemProgram: SystemProgram,\n): void {\n  counter.bump = counter.create(authority, [\"counter\", authority.key]);\n  counter.authority = authority.key;\n  counter.count = 0n;\n}\n\nexport function increment(\n  authority: Signer, counter: Mut<Counter>, by: u64,\n): void {\n  require(counter.authority === authority.key, CounterError.Unauthorized);\n  counter.count += by;\n}\n",
    "files": {},
    "programAddress": "Fg6PaFpoGXkYsidMpWxTWqkZ8YNKqxoGEAd8QG4Ssd1w"
  },
  {
    "name": "solana-escrow",
    "lane": "solana",
    "templateId": "escrow",
    "source": "import { type Init, type Mut, type Pubkey, type Signer,\n  type SystemAccount, type SystemProgram, type u8, type u64,\n  require } from \"typesol\";\n\nexport interface Escrow {\n  authority: Pubkey;\n  beneficiary: Pubkey;\n  amount: u64;\n  released: boolean;\n  bump: u8;\n}\n\nexport function initialize(\n  authority: Mut<Signer>, escrow: Init<Escrow>,\n  systemProgram: SystemProgram, beneficiary: Pubkey,\n): void {\n  escrow.bump = escrow.create(authority, [\"escrow\", authority.key]);\n  escrow.authority = authority.key;\n  escrow.beneficiary = beneficiary;\n  escrow.amount = 0n;\n  escrow.released = false;\n}\n\nexport function deposit(\n  authority: Mut<Signer>, escrow: Mut<Escrow>,\n  systemProgram: SystemProgram, amount: u64,\n): void {\n  require(escrow.authority === authority.key, \"Owner only\");\n  require(!escrow.released, \"Already released\");\n  require(amount > 0n, \"Amount must be positive\");\n  systemProgram.transfer(authority, escrow, amount);\n  escrow.amount += amount;\n}\n\nexport function release(\n  authority: Signer, escrow: Mut<Escrow>,\n  beneficiary: Mut<SystemAccount>,\n): void {\n  require(escrow.authority === authority.key, \"Owner only\");\n  require(escrow.beneficiary === beneficiary.key, \"Wrong beneficiary\");\n  require(!escrow.released, \"Already released\");\n  require(escrow.amount > 0n, \"Nothing to release\");\n  escrow.released = true;\n  beneficiary.lamports += escrow.amount;\n  escrow.lamports -= escrow.amount;\n  escrow.amount = 0n;\n}\n",
    "files": {},
    "programAddress": "Fg6PaFpoGXkYsidMpWxTWqkZ8YNKqxoGEAd8QG4Ssd1w"
  },
  {
    "name": "solana-vault",
    "lane": "solana",
    "templateId": "vault",
    "source": "import {\n  type Init,\n  type Mut,\n  type Pubkey,\n  type Signer,\n  type SystemProgram,\n  type u8,\n  type u64,\n  close,\n  minimumBalance,\n  require,\n} from \"typesol\";\n\n/** A personal SOL vault at PDA [\"vault\", owner]. Lamports above rent are the balance. */\nexport interface Vault {\n  owner: Pubkey;\n  deposited: u64;\n  withdrawn: u64;\n  bump: u8;\n}\n\nexport enum VaultError {\n  NotOwner = \"Only the vault owner can do this\",\n  ZeroAmount = \"Amount must be greater than zero\",\n  InsufficientFunds = \"Withdrawal would dip below the rent-exempt minimum\",\n}\n\nexport function open(owner: Mut<Signer>, vault: Init<Vault>, systemProgram: SystemProgram): void {\n  vault.bump = vault.create(owner, [\"vault\", owner.key]);\n  vault.owner = owner.key;\n}\n\nexport function deposit(owner: Mut<Signer>, vault: Mut<Vault>, systemProgram: SystemProgram, amount: u64): void {\n  require(amount > 0n, VaultError.ZeroAmount);\n  require(vault.owner === owner.key, VaultError.NotOwner);\n  systemProgram.transfer(owner, vault, amount);\n  vault.deposited += amount;\n}\n\nexport function withdraw(owner: Mut<Signer>, vault: Mut<Vault>, amount: u64): void {\n  require(amount > 0n, VaultError.ZeroAmount);\n  require(vault.owner === owner.key, VaultError.NotOwner);\n  const floor = minimumBalance(vault);\n  require(vault.lamports - amount >= floor, VaultError.InsufficientFunds);\n  // The vault is owned by this program, so it can move lamports directly.\n  vault.lamports -= amount;\n  owner.lamports += amount;\n  vault.withdrawn += amount;\n}\n\n/** Close the vault and return everything, rent included, to the owner. */\nexport function shut(owner: Mut<Signer>, vault: Mut<Vault>): void {\n  require(vault.owner === owner.key, VaultError.NotOwner);\n  close(vault, owner);\n}\n",
    "files": {},
    "programAddress": "Fg6PaFpoGXkYsidMpWxTWqkZ8YNKqxoGEAd8QG4Ssd1w"
  }
]
