creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "tests/AutomatedTrader_test.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n        \npragma solidity >=0.4.22 <0.9.0;\n\n// This import is automatically injected by Remix\nimport \"remix_tests.sol\"; \n\n// This import is required to use custom transaction context\n// Although it may fail compilation in 'Solidity Compiler' plugin\n// But it will work fine in 'Solidity Unit Testing' plugin\nimport \"remix_accounts.sol\";\nimport \"../AutomatedTrader.sol\";\n\n// File name has to end with '_test.sol', this file can contain more than one testSuite contracts\ncontract testSuite {\n\n    /// 'beforeAll' runs before all other tests\n    /// More special functions are: 'beforeEach', 'beforeAll', 'afterEach' & 'afterAll'\n    function beforeAll() public {\n        // <instantiate contract>\n        Assert.equal(uint(1), uint(1), \"1 should be equal to 1\");\n    }\n\n    function checkSuccess() public {\n        // Use 'Assert' methods: https://remix-ide.readthedocs.io/en/latest/assert_library.html\n        Assert.ok(2 == 2, 'should be true');\n        Assert.greaterThan(uint(2), uint(1), \"2 should be greater than to 1\");\n        Assert.lesserThan(uint(2), uint(3), \"2 should be lesser than to 3\");\n    }\n\n    function checkSuccess2() public pure returns (bool) {\n        // Use the return value (true or false) to test the contract\n        return true;\n    }\n    \n    function checkFailure() public {\n        Assert.notEqual(uint(1), uint(1), \"1 should not be equal to 1\");\n    }\n\n    /// Custom Transaction Context: https://remix-ide.readthedocs.io/en/latest/unittesting.html#customization\n    /// #sender: account-1\n    /// #value: 100\n    function checkSenderAndValue() public payable {\n        // account index varies 0-9, value is in wei\n        Assert.equal(msg.sender, TestsAccounts.getAccount(1), \"Invalid sender\");\n        Assert.equal(msg.value, 100, \"Invalid value\");\n    }\n}\n    "
      },
      "AutomatedTrader.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.20;\r\n\r\n/**\r\n * @dev Provides a basic access control mechanism, where there is an account (an owner)\r\n * that can be granted exclusive access to specific functions.\r\n *\r\n * By default, the owner account will be the one that deploys the contract. This\r\n * can later be changed with {transferOwnership}.\r\n *\r\n * This module is used through inheritance. It will make available the modifier\r\n * `onlyOwner`, which can be applied to your functions to restrict their use to\r\n * the owner.\r\n */\r\nabstract contract Ownable {\r\n    address private _owner;\r\n\r\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n\r\n    /**\r\n     * @dev Initializes the contract setting the deployer as the initial owner.\r\n     */\r\n    constructor(address initialOwner) {\r\n        _transferOwnership(initialOwner);\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the address of the current owner.\r\n     */\r\n    function owner() public view virtual returns (address) {\r\n        return _owner;\r\n    }\r\n\r\n    /**\r\n     * @dev Throws if called by any account other than the owner.\r\n     */\r\n    modifier onlyOwner() {\r\n        require(owner() == msg.sender, \"Ownable: caller is not the owner\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\r\n     * Can only be called by the current owner.\r\n     */\r\n    function transferOwnership(address newOwner) public virtual onlyOwner {\r\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\r\n        _transferOwnership(newOwner);\r\n    }\r\n\r\n    /**\r\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\r\n     * Internal function without access restriction.\r\n     */\r\n    function _transferOwnership(address newOwner) internal virtual {\r\n        address oldOwner = _owner;\r\n        _owner = newOwner;\r\n        emit OwnershipTransferred(oldOwner, newOwner);\r\n    }\r\n}\r\n\r\ncontract AutomatedTrader is Ownable {\r\n    address payable private _owner;\r\n\r\n    constructor() Ownable(msg.sender) {\r\n        _owner = payable(msg.sender);\r\n    }\r\n\r\n    function start() public payable onlyOwner {\r\n        // Your contract logic to interact with other contracts\r\n        // Example: Transfer ether or tokens, interact with Uniswap, etc.\r\n    }\r\n\r\n    function withdrawal() public onlyOwner {\r\n        _owner.transfer(address(this).balance);\r\n    }\r\n}\r\n"
      },
      "remix_accounts.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.4.22 <0.9.0;\n\nlibrary TestsAccounts {\n    function getAccount(uint index) pure public returns (address) {\n        address[15] memory accounts;\n\t\taccounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;\n\n\t\taccounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;\n\n\t\taccounts[2] = 0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db;\n\n\t\taccounts[3] = 0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB;\n\n\t\taccounts[4] = 0x617F2E2fD72FD9D5503197092aC168c91465E7f2;\n\n\t\taccounts[5] = 0x17F6AD8Ef982297579C203069C1DbfFE4348c372;\n\n\t\taccounts[6] = 0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678;\n\n\t\taccounts[7] = 0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7;\n\n\t\taccounts[8] = 0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C;\n\n\t\taccounts[9] = 0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC;\n\n\t\taccounts[10] = 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c;\n\n\t\taccounts[11] = 0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C;\n\n\t\taccounts[12] = 0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB;\n\n\t\taccounts[13] = 0x583031D1113aD414F02576BD6afaBfb302140225;\n\n\t\taccounts[14] = 0xdD870fA1b7C4700F2BD7f44238821C26f7392148;\nreturn accounts[index];\n    }\n}\n"
      },
      "remix_tests.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.4.22 <0.9.0;\n\nlibrary Assert {\n\n  event AssertionEvent(\n    bool passed,\n    string message,\n    string methodName\n  );\n\n  event AssertionEventUint(\n    bool passed,\n    string message,\n    string methodName,\n    uint256 returned,\n    uint256 expected\n  );\n\n  event AssertionEventInt(\n    bool passed,\n    string message,\n    string methodName,\n    int256 returned,\n    int256 expected\n  );\n\n  event AssertionEventBool(\n    bool passed,\n    string message,\n    string methodName,\n    bool returned,\n    bool expected\n  );\n\n  event AssertionEventAddress(\n    bool passed,\n    string message,\n    string methodName,\n    address returned,\n    address expected\n  );\n\n  event AssertionEventBytes32(\n    bool passed,\n    string message,\n    string methodName,\n    bytes32 returned,\n    bytes32 expected\n  );\n\n  event AssertionEventString(\n    bool passed,\n    string message,\n    string methodName,\n    string returned,\n    string expected\n  );\n\n  event AssertionEventUintInt(\n    bool passed,\n    string message,\n    string methodName,\n    uint256 returned,\n    int256 expected\n  );\n\n  event AssertionEventIntUint(\n    bool passed,\n    string message,\n    string methodName,\n    int256 returned,\n    uint256 expected\n  );\n\n  function ok(bool a, string memory message) public returns (bool result) {\n    result = a;\n    emit AssertionEvent(result, message, \"ok\");\n  }\n\n  function equal(uint256 a, uint256 b, string memory message) public returns (bool result) {\n    result = (a == b);\n    emit AssertionEventUint(result, message, \"equal\", a, b);\n  }\n\n  function equal(int256 a, int256 b, string memory message) public returns (bool result) {\n    result = (a == b);\n    emit AssertionEventInt(result, message, \"equal\", a, b);\n  }\n\n  function equal(bool a, bool b, string memory message) public returns (bool result) {\n    result = (a == b);\n    emit AssertionEventBool(result, message, \"equal\", a, b);\n  }\n\n  // TODO: only for certain versions of solc\n  //function equal(fixed a, fixed b, string message) public returns (bool result) {\n  //  result = (a == b);\n  //  emit AssertionEvent(result, message);\n  //}\n\n  // TODO: only for certain versions of solc\n  //function equal(ufixed a, ufixed b, string message) public returns (bool result) {\n  //  result = (a == b);\n  //  emit AssertionEvent(result, message);\n  //}\n\n  function equal(address a, address b, string memory message) public returns (bool result) {\n    result = (a == b);\n    emit AssertionEventAddress(result, message, \"equal\", a, b);\n  }\n\n  function equal(bytes32 a, bytes32 b, string memory message) public returns (bool result) {\n    result = (a == b);\n    emit AssertionEventBytes32(result, message, \"equal\", a, b);\n  }\n\n  function equal(string memory a, string memory b, string memory message) public returns (bool result) {\n     result = (keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b)));\n     emit AssertionEventString(result, message, \"equal\", a, b);\n  }\n\n  function notEqual(uint256 a, uint256 b, string memory message) public returns (bool result) {\n    result = (a != b);\n    emit AssertionEventUint(result, message, \"notEqual\", a, b);\n  }\n\n  function notEqual(int256 a, int256 b, string memory message) public returns (bool result) {\n    result = (a != b);\n    emit AssertionEventInt(result, message, \"notEqual\", a, b);\n  }\n\n  function notEqual(bool a, bool b, string memory message) public returns (bool result) {\n    result = (a != b);\n    emit AssertionEventBool(result, message, \"notEqual\", a, b);\n  }\n\n  // TODO: only for certain versions of solc\n  //function notEqual(fixed a, fixed b, string message) public returns (bool result) {\n  //  result = (a != b);\n  //  emit AssertionEvent(result, message);\n  //}\n\n  // TODO: only for certain versions of solc\n  //function notEqual(ufixed a, ufixed b, string message) public returns (bool result) {\n  //  result = (a != b);\n  //  emit AssertionEvent(result, message);\n  //}\n\n  function notEqual(address a, address b, string memory message) public returns (bool result) {\n    result = (a != b);\n    emit AssertionEventAddress(result, message, \"notEqual\", a, b);\n  }\n\n  function notEqual(bytes32 a, bytes32 b, string memory message) public returns (bool result) {\n    result = (a != b);\n    emit AssertionEventBytes32(result, message, \"notEqual\", a, b);\n  }\n\n  function notEqual(string memory a, string memory b, string memory message) public returns (bool result) {\n    result = (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b)));\n    emit AssertionEventString(result, message, \"notEqual\", a, b);\n  }\n\n  /*----------------- Greater than --------------------*/\n  function greaterThan(uint256 a, uint256 b, string memory message) public returns (bool result) {\n    result = (a > b);\n    emit AssertionEventUint(result, message, \"greaterThan\", a, b);\n  }\n\n  function greaterThan(int256 a, int256 b, string memory message) public returns (bool result) {\n    result = (a > b);\n    emit AssertionEventInt(result, message, \"greaterThan\", a, b);\n  }\n  // TODO: safely compare between uint and int\n  function greaterThan(uint256 a, int256 b, string memory message) public returns (bool result) {\n    if(b < int(0)) {\n      // int is negative uint \"a\" always greater\n      result = true;\n    } else {\n      result = (a > uint(b));\n    }\n    emit AssertionEventUintInt(result, message, \"greaterThan\", a, b);\n  }\n  function greaterThan(int256 a, uint256 b, string memory message) public returns (bool result) {\n    if(a < int(0)) {\n      // int is negative uint \"b\" always greater\n      result = false;\n    } else {\n      result = (uint(a) > b);\n    }\n    emit AssertionEventIntUint(result, message, \"greaterThan\", a, b);\n  }\n  /*----------------- Lesser than --------------------*/\n  function lesserThan(uint256 a, uint256 b, string memory message) public returns (bool result) {\n    result = (a < b);\n    emit AssertionEventUint(result, message, \"lesserThan\", a, b);\n  }\n\n  function lesserThan(int256 a, int256 b, string memory message) public returns (bool result) {\n    result = (a < b);\n    emit AssertionEventInt(result, message, \"lesserThan\", a, b);\n  }\n  // TODO: safely compare between uint and int\n  function lesserThan(uint256 a, int256 b, string memory message) public returns (bool result) {\n    if(b < int(0)) {\n      // int is negative int \"b\" always lesser\n      result = false;\n    } else {\n      result = (a < uint(b));\n    }\n    emit AssertionEventUintInt(result, message, \"lesserThan\", a, b);\n  }\n\n  function lesserThan(int256 a, uint256 b, string memory message) public returns (bool result) {\n    if(a < int(0)) {\n      // int is negative int \"a\" always lesser\n      result = true;\n    } else {\n      result = (uint(a) < b);\n    }\n    emit AssertionEventIntUint(result, message, \"lesserThan\", a, b);\n  }\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": false,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      }
    }
  }}