creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/Agent.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity ^0.8.0;\n\n/// @title A user's agent contract created by the router\n/// @notice A proxy for delegating calls to the immutable agent implementation contract\ncontract Agent {\n    address internal immutable _implementation;\n\n    /// @dev Create an initialized agent\n    constructor(address implementation) {\n        _implementation = implementation;\n        (bool ok, ) = implementation.delegatecall(abi.encodeWithSignature('initialize()'));\n        require(ok);\n    }\n\n    receive() external payable {}\n\n    /// @notice Delegate all function calls to `_implementation`\n    fallback() external payable {\n        _delegate(_implementation);\n    }\n\n    /// @notice Delegate the call to `_implementation`\n    /// @dev Referenced from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.1/contracts/proxy/Proxy.sol#L22\n    /// @param implementation The address of the implementation contract that this agent delegates calls to\n    function _delegate(address implementation) internal {\n        assembly {\n            // Copy msg.data. We take full control of memory in this inline assembly\n            // block because it will not return to Solidity code. We overwrite the\n            // Solidity scratch pad at memory position 0.\n            calldatacopy(0, 0, calldatasize())\n\n            // Call the implementation.\n            // out and outsize are 0 because we don't know the size yet.\n            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n            // Copy the returned data.\n            returndatacopy(0, 0, returndatasize())\n\n            switch result\n            // delegatecall returns 0 on error.\n            case 0 {\n                revert(0, returndatasize())\n            }\n            default {\n                return(0, returndatasize())\n            }\n        }\n    }\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "forge-std/=lib/forge-std/src/",
        "create3-factory/=lib/create3-factory/src/",
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "erc4626-tests/=lib/create3-factory/lib/openzeppelin-contracts/lib/erc4626-tests/",
        "forge-gas-snapshot/=lib/permit2/lib/forge-gas-snapshot/src/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/",
        "openzeppelin/=lib/create3-factory/lib/openzeppelin-contracts/contracts/",
        "permit2/=lib/permit2/",
        "solmate/=lib/permit2/lib/solmate/src/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 1000000
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "libraries": {}
    }
  }}