creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/adapters/BridgeInitiator.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// Cowri Labs Inc.\n\npragma solidity ^0.8.19;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"../interfaces/IConnext.sol\";\n\n\ncontract BridgeInitiator {\n\n    // The connext contract on the origin domain.\n    IConnext public immutable connext;\n\n    // domain ID\n    uint32 public immutable domainId; \n\n    constructor(IConnext _connext, uint32 _domainId) {\n        connext = _connext;\n        domainId = _domainId;\n    }\n\n    function bridgeOceanAction(\n        address _target,\n        address _token,\n        address _receiver,\n        uint256 _interactionType,\n        uint256 _amount\n    ) external payable {\n        // User sends funds to this contract\n        IERC20(_token).transferFrom(msg.sender, address(this), _amount);\n\n        IERC20(_token).approve(address(connext), _amount);\n\n        // Include the address of this contract so Pong will know where to send the \"callback\"\n        bytes memory _callData = abi.encode(_receiver, _interactionType);\n        \n        connext.xcall{value: msg.value}(\n            domainId, // _destination: Domain ID of the destination chain\n            _target, // _to: address of the target contract (Pong)\n            _token, // _asset: address of the token contract\n            msg.sender, // _delegate: address that can revert or forceLocal on destination\n            _amount, // _amount: amount of tokens to transfer\n            0, // _slippage: the maximum amount of slippage the user will accept in BPS, in this case 0.3%\n            _callData // _callData: the encoded calldata to send\n        );\n    }\n\n}"
      },
      "node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
      },
      "src/interfaces/IConnext.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// Cowri Labs Inc.\n\npragma solidity ^0.8.19;\n\ninterface IConnext {\n    function xcall(\n    uint32 _destination,\n    address _to,\n    address _asset,\n    address _delegate,\n    uint256 _amount,\n    uint256 _slippage,\n    bytes calldata _callData\n  ) external payable returns (bytes32);\n}"
      }
    },
    "settings": {
      "remappings": [
        "@prb/test/=lib/prb-test/src/",
        "forge-std/=lib/forge-std/src/",
        "@sablier/v2-core/=lib/v2-core/",
        "balancer-v2-monorepo/=lib/balancer-v2-monorepo/",
        "src/=src/",
        "@openzeppelin/=node_modules/@openzeppelin/",
        "@shell-v2-ocean/=node_modules/shell-v2-ocean/",
        "abdk-libraries-solidity/=node_modules/abdk-libraries-solidity/",
        "@balancer-labs/=lib/balancer-v2-monorepo/../../node_modules/@balancer-labs/",
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "prb-math/=lib/prb-math/src/",
        "prb-test/=lib/prb-test/src/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 10000
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "none",
        "appendCBOR": false
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "viaIR": true,
      "libraries": {}
    }
  }}