{
  "address": "0xBd52b2A76cA864F2D03365bDe418353e2A859ecA",
  "abi": [
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_peronio",
          "type": "address"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "constructor"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "previousOwner",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "OwnershipTransferred",
      "type": "event"
    },
    {
      "inputs": [],
      "name": "autoCompound",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "lastExecuted",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "owner",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "renounceOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "transferOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }
  ],
  "transactionHash": "0x49facec1c27301eb810fab5d2a8de7c8b5dfbc49dee9a600cc5db08a10aac0a6",
  "receipt": {
    "to": null,
    "from": "0xA15EaB321F68FfE4800F1BA22dCD4bfDf644a809",
    "contractAddress": "0xBd52b2A76cA864F2D03365bDe418353e2A859ecA",
    "transactionIndex": 18,
    "gasUsed": "338101",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000008800000000000000100000000000000000000000000004000000000000800001000000000000000100000000000000000000020000000000000000000800000000000000000080000000000000400000010000000000000000000000000000000000000000000000000000000000200000000100000000000000000000000000000000000000000000000000004000000000000000000001000000000000000048000000000000100000020020000000000000000000000000000000000002000000000000000000000000100000",
    "blockHash": "0x89157f7653a1425be8a047b0cb04850c93afd246299c881581835839a9f0a761",
    "transactionHash": "0x49facec1c27301eb810fab5d2a8de7c8b5dfbc49dee9a600cc5db08a10aac0a6",
    "logs": [
      {
        "transactionIndex": 18,
        "blockNumber": 26395545,
        "transactionHash": "0x49facec1c27301eb810fab5d2a8de7c8b5dfbc49dee9a600cc5db08a10aac0a6",
        "address": "0xBd52b2A76cA864F2D03365bDe418353e2A859ecA",
        "topics": [
          "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
          "0x0000000000000000000000000000000000000000000000000000000000000000",
          "0x000000000000000000000000a15eab321f68ffe4800f1ba22dcd4bfdf644a809"
        ],
        "data": "0x",
        "logIndex": 62,
        "blockHash": "0x89157f7653a1425be8a047b0cb04850c93afd246299c881581835839a9f0a761"
      },
      {
        "transactionIndex": 18,
        "blockNumber": 26395545,
        "transactionHash": "0x49facec1c27301eb810fab5d2a8de7c8b5dfbc49dee9a600cc5db08a10aac0a6",
        "address": "0x0000000000000000000000000000000000001010",
        "topics": [
          "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63",
          "0x0000000000000000000000000000000000000000000000000000000000001010",
          "0x000000000000000000000000a15eab321f68ffe4800f1ba22dcd4bfdf644a809",
          "0x000000000000000000000000959c65b72147faf3450d8b50a0de57e72ffc5e0d"
        ],
        "data": "0x000000000000000000000000000000000000000000000000003d428df1f1163900000000000000000000000000000000000000000000008eec78f43acfa400a400000000000000000000000000000000000000000000000a954057f538d02b6000000000000000000000000000000000000000000000008eec3bb1acddb2ea6b00000000000000000000000000000000000000000000000a957d9a832ac14199",
        "logIndex": 63,
        "blockHash": "0x89157f7653a1425be8a047b0cb04850c93afd246299c881581835839a9f0a761"
      }
    ],
    "blockNumber": 26395545,
    "cumulativeGasUsed": "3183891",
    "status": 1,
    "byzantium": true
  },
  "args": [
    "0xc2768beF7a6BB57F0FfA169a9ED4017c09696FF1"
  ],
  "numDeployments": 1,
  "solcInputHash": "64f365930fca704292896b4fa2e86b92",
  "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_peronio\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"autoCompound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastExecuted\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/AutoCompounder.sol\":\"AutoCompounder\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts_latest/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n    address private _owner;\\n\\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n    /**\\n     * @dev Initializes the contract setting the deployer as the initial owner.\\n     */\\n    constructor() {\\n        _setOwner(_msgSender());\\n    }\\n\\n    /**\\n     * @dev Returns the address of the current owner.\\n     */\\n    function owner() public view virtual returns (address) {\\n        return _owner;\\n    }\\n\\n    /**\\n     * @dev Throws if called by any account other than the owner.\\n     */\\n    modifier onlyOwner() {\\n        require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n        _;\\n    }\\n\\n    /**\\n     * @dev Leaves the contract without owner. It will not be possible to call\\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\\n     *\\n     * NOTE: Renouncing ownership will leave the contract without an owner,\\n     * thereby removing any functionality that is only available to the owner.\\n     */\\n    function renounceOwnership() public virtual onlyOwner {\\n        _setOwner(address(0));\\n    }\\n\\n    /**\\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n     * Can only be called by the current owner.\\n     */\\n    function transferOwnership(address newOwner) public virtual onlyOwner {\\n        require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n        _setOwner(newOwner);\\n    }\\n\\n    function _setOwner(address newOwner) private {\\n        address oldOwner = _owner;\\n        _owner = newOwner;\\n        emit OwnershipTransferred(oldOwner, newOwner);\\n    }\\n}\\n\",\"keccak256\":\"0x6bb804a310218875e89d12c053e94a13a4607cdf7cc2052f3e52bd32a0dc50a1\",\"license\":\"MIT\"},\"@openzeppelin/contracts_latest/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n    function _msgSender() internal view virtual returns (address) {\\n        return msg.sender;\\n    }\\n\\n    function _msgData() internal view virtual returns (bytes calldata) {\\n        return msg.data;\\n    }\\n}\\n\",\"keccak256\":\"0x90565a39ae45c80f0468dc96c7b20d0afc3055f344c8203a0c9258239f350b9f\",\"license\":\"MIT\"},\"contracts/AutoCompounder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.2;\\n\\nimport \\\"./IPeronio.sol\\\";\\nimport \\\"@openzeppelin/contracts_latest/access/Ownable.sol\\\";\\n\\ncontract AutoCompounder is Ownable {\\n  IPeronio peronio;\\n\\n  constructor(address _peronio) {\\n    peronio = IPeronio(_peronio);\\n  }\\n\\n  uint256 public lastExecuted;\\n\\n  function lastExec() internal view returns (bool) {\\n    return ((block.timestamp - lastExecuted) > 43200); // 12 hours\\n  }\\n\\n  function autoCompound() public onlyOwner {\\n    require(lastExec(), \\\"autoCompound: Time not elapsed\\\");\\n\\n    peronio.claimRewards();\\n    peronio.compoundRewards();\\n\\n    lastExecuted = block.timestamp;\\n  }\\n}\\n\",\"keccak256\":\"0xcdb15edde6956d0c1869ec986e5c9e8e352e044333a42180280553b191804e78\",\"license\":\"MIT\"},\"contracts/IPeronio.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.2;\\n\\ninterface IPeronio {\\n  function USDC_ADDRESS() external view returns (address);\\n\\n  function MAI_ADDRESS() external view returns (address);\\n\\n  function LP_ADDRESS() external view returns (address);\\n\\n  function QUICKSWAP_ROUTER_ADDRESS() external view returns (address);\\n\\n  function QIDAO_FARM_ADDRESS() external view returns (address);\\n\\n  function QI_ADDRESS() external view returns (address);\\n\\n  function QIDAO_POOL_ID() external view returns (uint256);\\n\\n  // Markup\\n  function MARKUP_DECIMALS() external view returns (uint8);\\n\\n  function markup() external view returns (uint256);\\n\\n  function swapFee() external view returns (uint256);\\n\\n  // Initialization can only be run once\\n  function initialized() external view returns (bool);\\n\\n  // Roles\\n  function MARKUP_ROLE() external view returns (bytes32);\\n\\n  function REWARDS_ROLE() external view returns (bytes32);\\n\\n  // Events\\n  event Initialized(address owner, uint256 collateral, uint256 startingRatio);\\n  event Minted(\\n    address indexed to,\\n    uint256 collateralAmount,\\n    uint256 tokenAmount\\n  );\\n  event Withdrawal(\\n    address indexed to,\\n    uint256 collateralAmount,\\n    uint256 tokenAmount\\n  );\\n  event MarkupUpdated(address operator, uint256 markup);\\n  event CompoundRewards(uint256 qi, uint256 usdc, uint256 lp);\\n  event HarvestedMatic(uint256 wmatic, uint256 collateral);\\n\\n  function decimals() external view returns (uint8);\\n\\n  function initialize(uint256 usdcAmount, uint256 startingRatio) external;\\n\\n  function setMarkup(uint256 markup_) external;\\n\\n  function mint(\\n    address to,\\n    uint256 usdcAmount,\\n    uint256 minReceive\\n  ) external returns (uint256 peAmount);\\n\\n  function withdraw(address to, uint256 peAmount) external;\\n\\n  function claimRewards() external;\\n\\n  function compoundRewards()\\n    external\\n    returns (uint256 usdcAmount, uint256 lpAmount);\\n\\n  function stakedBalance() external view returns (uint256);\\n\\n  function stakedValue() external view returns (uint256 totalUSDC);\\n\\n  function usdcPrice() external view returns (uint256);\\n\\n  function buyingPrice() external view returns (uint256);\\n\\n  function collateralRatio() external view returns (uint256);\\n\\n  function getPendingRewardsAmount() external view returns (uint256 amount);\\n\\n  function getLpReserves()\\n    external\\n    view\\n    returns (uint112 usdcReserves, uint112 maiReserves);\\n}\\n\",\"keccak256\":\"0x6108da56f527c5d32b687757b47795e67fba4142b2e9f98765af7698d83501bd\",\"license\":\"MIT\"}},\"version\":1}",
  "bytecode": "0x608060405234801561001057600080fd5b5060405161052c38038061052c83398101604081905261002f916100ad565b6100383361005d565b600180546001600160a01b0319166001600160a01b03929092169190911790556100db565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100be578081fd5b81516001600160a01b03811681146100d4578182fd5b9392505050565b610442806100ea6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80631c15ff771461005c578063715018a614610078578063821c0576146100825780638da5cb5b1461008a578063f2fde38b146100a5575b600080fd5b61006560025481565b6040519081526020015b60405180910390f35b6100806100b8565b005b6100806100f7565b6000546040516001600160a01b03909116815260200161006f565b6100806100b3366004610363565b61025f565b6000546001600160a01b031633146100eb5760405162461bcd60e51b81526004016100e2906103b4565b60405180910390fd5b6100f560006102fa565b565b6000546001600160a01b031633146101215760405162461bcd60e51b81526004016100e2906103b4565b61012961034a565b6101755760405162461bcd60e51b815260206004820152601e60248201527f6175746f436f6d706f756e643a2054696d65206e6f7420656c6170736564000060448201526064016100e2565b600160009054906101000a90046001600160a01b03166001600160a01b031663372500ab6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156101c557600080fd5b505af11580156101d9573d6000803e3d6000fd5b50506001546040805163c00c9f7f60e01b815281516001600160a01b03909316945063c00c9f7f9350600480820193918290030181600087803b15801561021f57600080fd5b505af1158015610233573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102579190610391565b505042600255565b6000546001600160a01b031633146102895760405162461bcd60e51b81526004016100e2906103b4565b6001600160a01b0381166102ee5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100e2565b6102f7816102fa565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600061a8c06002544261035d91906103e9565b11905090565b600060208284031215610374578081fd5b81356001600160a01b038116811461038a578182fd5b9392505050565b600080604083850312156103a3578081fd5b505080516020909101519092909150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008282101561040757634e487b7160e01b81526011600452602481fd5b50039056fea2646970667358221220532fdbe66e4f05e85b1858a1bb08d1c7b34cec2b95ca5687c8fa45b110630eb664736f6c63430008040033",
  "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c80631c15ff771461005c578063715018a614610078578063821c0576146100825780638da5cb5b1461008a578063f2fde38b146100a5575b600080fd5b61006560025481565b6040519081526020015b60405180910390f35b6100806100b8565b005b6100806100f7565b6000546040516001600160a01b03909116815260200161006f565b6100806100b3366004610363565b61025f565b6000546001600160a01b031633146100eb5760405162461bcd60e51b81526004016100e2906103b4565b60405180910390fd5b6100f560006102fa565b565b6000546001600160a01b031633146101215760405162461bcd60e51b81526004016100e2906103b4565b61012961034a565b6101755760405162461bcd60e51b815260206004820152601e60248201527f6175746f436f6d706f756e643a2054696d65206e6f7420656c6170736564000060448201526064016100e2565b600160009054906101000a90046001600160a01b03166001600160a01b031663372500ab6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156101c557600080fd5b505af11580156101d9573d6000803e3d6000fd5b50506001546040805163c00c9f7f60e01b815281516001600160a01b03909316945063c00c9f7f9350600480820193918290030181600087803b15801561021f57600080fd5b505af1158015610233573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102579190610391565b505042600255565b6000546001600160a01b031633146102895760405162461bcd60e51b81526004016100e2906103b4565b6001600160a01b0381166102ee5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100e2565b6102f7816102fa565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600061a8c06002544261035d91906103e9565b11905090565b600060208284031215610374578081fd5b81356001600160a01b038116811461038a578182fd5b9392505050565b600080604083850312156103a3578081fd5b505080516020909101519092909150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008282101561040757634e487b7160e01b81526011600452602481fd5b50039056fea2646970667358221220532fdbe66e4f05e85b1858a1bb08d1c7b34cec2b95ca5687c8fa45b110630eb664736f6c63430008040033",
  "devdoc": {
    "kind": "dev",
    "methods": {
      "owner()": {
        "details": "Returns the address of the current owner."
      },
      "renounceOwnership()": {
        "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner."
      },
      "transferOwnership(address)": {
        "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
      }
    },
    "version": 1
  },
  "userdoc": {
    "kind": "user",
    "methods": {},
    "version": 1
  },
  "storageLayout": {
    "storage": [
      {
        "astId": 387,
        "contract": "contracts/AutoCompounder.sol:AutoCompounder",
        "label": "_owner",
        "offset": 0,
        "slot": "0",
        "type": "t_address"
      },
      {
        "astId": 3680,
        "contract": "contracts/AutoCompounder.sol:AutoCompounder",
        "label": "peronio",
        "offset": 0,
        "slot": "1",
        "type": "t_contract(IPeronio)3931"
      },
      {
        "astId": 3694,
        "contract": "contracts/AutoCompounder.sol:AutoCompounder",
        "label": "lastExecuted",
        "offset": 0,
        "slot": "2",
        "type": "t_uint256"
      }
    ],
    "types": {
      "t_address": {
        "encoding": "inplace",
        "label": "address",
        "numberOfBytes": "20"
      },
      "t_contract(IPeronio)3931": {
        "encoding": "inplace",
        "label": "contract IPeronio",
        "numberOfBytes": "20"
      },
      "t_uint256": {
        "encoding": "inplace",
        "label": "uint256",
        "numberOfBytes": "32"
      }
    }
  }
}