Contract 0xBa1428c302cE818865beb857FaF7Ab513C1e3a40

 
Ad
Ad
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x70f312c227912eee826e1c02ec057c5b5f050c5b53502a68a7e3264d95e35668Claim Liquidity186149032021-09-01 6:16:4219 days 5 hrs ago0x06bd36f8b400e54d7d74f487d55aa55137d05977 IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.000064768064
0x64709e47a83964c95c31e5ef33a7ada77aa9c8b9625bf0682326b617588d036cClaim Liquidity186148742021-09-01 6:15:4419 days 5 hrs ago0x06bd36f8b400e54d7d74f487d55aa55137d05977 IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.000192744795
0x9625fbf25f166f0640894418a490160c257049c2946a175629be91c13d4d27f8Claim Liquidity186145422021-09-01 6:01:5019 days 5 hrs ago0xf6600ff630e142cef3eeab1f9440df308af4299e IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.00008549376
0xf3cd7eb99245a6c636a82d1d62e9370267e7c6ce9e90a635beee0700bd9e5eaaClaim Liquidity186144782021-09-01 5:59:3819 days 5 hrs ago0xf6600ff630e142cef3eeab1f9440df308af4299e IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.00009677976
0x61910c56067c0f725696641d03ddeb25767831b920924f5d0a93f41ce2ac41c3Claim Liquidity186144012021-09-01 5:57:0019 days 5 hrs ago0xf6600ff630e142cef3eeab1f9440df308af4299e IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.000078218
0x0a13a0bdee736a95052def0b6242a6848ba0bbdbdf5545d106da3c20f77b9787Claim Liquidity186139932021-09-01 5:36:3219 days 6 hrs ago0xbd44406696a562a6ce005bb8d669a300fbe16a2a IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.000073318
0xe9ec568ede644485cf3746e45480e549df6c4dfdf1b0beb14d91f1b8eb9803c7Claim Liquidity186139212021-09-01 5:34:0419 days 6 hrs ago0xa83b33cdcaf662385d5de01bd746d5cf2a627fac IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.000078218
0xa06e8f50f2db61f09ab64986e5b402baabae8d7c5a1d275bf37351819a0165dfClaim Liquidity186126692021-09-01 4:42:2719 days 7 hrs ago0x1c481c5c8e78afccb94442b91361e18d3de74a89 IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.00078218
0x91c988ce71b22ac2716345ae73b5009bc1f585a123f0a38f2e6607147e77fe6aAdd Liquidity MA...185603172021-08-30 16:54:0620 days 18 hrs ago0x1c481c5c8e78afccb94442b91361e18d3de74a89 IN  0xba1428c302ce818865beb857faf7ab513c1e3a401 MATIC0.00043690452
0xbca2aaed1ddfdb6ec2caef1f55c75ef825cd2f4a31855ef1c16c77518e4d9de4Claim Liquidity181404952021-08-19 1:29:2432 days 10 hrs ago0x60b2aed9239b50e639277adf08274f34d2937183 IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.00073318
0x5a52a715e552a6ce199bf99c766634c0605499e53f7ff3a5ac76981034aa93d5Add Liquidity MA...180841452021-08-17 13:23:1233 days 22 hrs ago0xa83b33cdcaf662385d5de01bd746d5cf2a627fac IN  0xba1428c302ce818865beb857faf7ab513c1e3a401 MATIC0.000595399999
0x91e686e7effad048eeb66e84e02ea43eaf9d543af460b448f7e78a25f45baca2Claim Liquidity180615482021-08-16 22:41:2634 days 13 hrs ago0x60b2aed9239b50e639277adf08274f34d2937183 IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.00073318
0xb2b500ffa07891e480c2eb05cc9badcc9b4776ba6ddaa7face9ddcf72c5b6d0cClaim Liquidity179228652021-08-13 1:39:3638 days 10 hrs ago0x60b2aed9239b50e639277adf08274f34d2937183 IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.00064768
0xaafe03580370b25f74866c9d563079b86424d96ec5c7599508d1d23160459e44Claim Liquidity179228502021-08-13 1:39:0638 days 10 hrs ago0x60b2aed9239b50e639277adf08274f34d2937183 IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.00073318
0xd0e2ee68a8ee93a06854b3d041e0022006445122a4809f66f25fb0be394bdaa0Claim Liquidity178438782021-08-10 21:11:4440 days 14 hrs ago0x60b2aed9239b50e639277adf08274f34d2937183 IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.00078218
0xac224f9bc7394930cc704e57bfae15b4a0d30bd9acb451d04c0c6067c29bc735Claim Liquidity177343982021-08-07 23:05:3443 days 12 hrs ago0x60b2aed9239b50e639277adf08274f34d2937183 IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.00069668
0x7c6dbf66223372140c008932e51e817b7647f06ca41216506fd493717d465031Claim Liquidity177343452021-08-07 23:03:4843 days 12 hrs ago0x60b2aed9239b50e639277adf08274f34d2937183 IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.00078218
0x68f6309fe328f40215ca34e90ba92b07e69b23a0f51473866d375ad0e9306861Claim Liquidity177218392021-08-07 14:46:4143 days 20 hrs ago0x1fdce410206fd3f0b379fe43bfd8cfb3e1a848ac IN  0xba1428c302ce818865beb857faf7ab513c1e3a400 MATIC0.0000879816
0x059fa1e4957a09734c9a330888a147969707078833d6f7e0831684fa3fbe164fAdd Liquidity MA...175542232021-08-03 1:16:5748 days 10 hrs ago0x770c13284eb073f07d7c88fb787c319d533f785a IN  0xba1428c302ce818865beb857faf7ab513c1e3a40500 MATIC0.000357252
0x5e53399b820f97a97885424e88905d54b9b21dc5928975c6bcf889acf13fdc0eAdd Liquidity MA...175541482021-08-03 1:14:2348 days 10 hrs ago0x770c13284eb073f07d7c88fb787c319d533f785a IN  0xba1428c302ce818865beb857faf7ab513c1e3a40500 MATIC0.000374352
0x312787c926e82c8b727810694b96dcb2cc1d49b8903cadf0a1a4c9f8c7b950a3Add Liquidity MA...173689312021-07-28 20:43:1753 days 15 hrs ago0x802aa8c1ecba61ff97946287311916f33babf8b5 IN  0xba1428c302ce818865beb857faf7ab513c1e3a402,015 MATIC0.00037457
0xbd2268df98c684dab95e82b2ee3561ad1d95317ac6ad2dc169f2d36f53696696Add Liquidity MA...170820022021-07-20 19:23:5361 days 16 hrs ago0x22c1082797927cb8978aec3216f692e90f44de0f IN  0xba1428c302ce818865beb857faf7ab513c1e3a40100 MATIC0.002713323147
0x632b75ea0f05112c92e5be5d89e3024250c21dad66c79f35b25f4d633e3663c8Add Liquidity MA...157700832021-06-16 4:42:5596 days 7 hrs ago0x057cfdeefff35aaff54ac852c52efc3e2ffeafa3 IN  0xba1428c302ce818865beb857faf7ab513c1e3a40100 MATIC0.000070576
0x9fcfd632b46bc6961553445cf1161d5e1ae6c3e6cd47c93ccbd69e378c6bdbcdAdd Liquidity MA...155405192021-06-10 8:53:14102 days 2 hrs ago0xa11e04460ec463211503a11ddb93a6248b174063 IN  0xba1428c302ce818865beb857faf7ab513c1e3a400.44 MATIC0.000357676
0x02614965727b23dbce117e5f729f7bdf130405a3c94cdab3e37d8cedd5c50dc3Add Liquidity MA...155404922021-06-10 8:52:20102 days 2 hrs ago0xa11e04460ec463211503a11ddb93a6248b174063 IN  0xba1428c302ce818865beb857faf7ab513c1e3a401 MATIC0.000374776
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x91c988ce71b22ac2716345ae73b5009bc1f585a123f0a38f2e6607147e77fe6a185603172021-08-30 16:54:0620 days 18 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token1 MATIC
0x5a52a715e552a6ce199bf99c766634c0605499e53f7ff3a5ac76981034aa93d5180841452021-08-17 13:23:1233 days 22 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token1 MATIC
0x059fa1e4957a09734c9a330888a147969707078833d6f7e0831684fa3fbe164f175542232021-08-03 1:16:5748 days 10 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token500 MATIC
0x5e53399b820f97a97885424e88905d54b9b21dc5928975c6bcf889acf13fdc0e175541482021-08-03 1:14:2348 days 10 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token500 MATIC
0x312787c926e82c8b727810694b96dcb2cc1d49b8903cadf0a1a4c9f8c7b950a3173689312021-07-28 20:43:1753 days 15 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token2,015 MATIC
0xbd2268df98c684dab95e82b2ee3561ad1d95317ac6ad2dc169f2d36f53696696170820022021-07-20 19:23:5361 days 16 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token100 MATIC
0x632b75ea0f05112c92e5be5d89e3024250c21dad66c79f35b25f4d633e3663c8157700832021-06-16 4:42:5596 days 7 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token100 MATIC
0x9fcfd632b46bc6961553445cf1161d5e1ae6c3e6cd47c93ccbd69e378c6bdbcd155405192021-06-10 8:53:14102 days 2 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token0.44 MATIC
0x02614965727b23dbce117e5f729f7bdf130405a3c94cdab3e37d8cedd5c50dc3155404922021-06-10 8:52:20102 days 2 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token1 MATIC
0x2f0816873f256a4aeafdf98745d7ea394f9cfa71956793b62dc10aa96b281dcf151276222021-05-30 19:09:31112 days 16 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token0.1 MATIC
0x07a01a326425fc5222eaae9374ec71527131ec51435b978d5a28ed2d6c83b78b149602972021-05-26 18:16:11116 days 17 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token100 MATIC
0x4f727de3bd0e63e85e6f8f716959dd741e34f65d1727ca4479d49ed1815b0831147698882021-05-21 18:47:28121 days 16 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token10 MATIC
0xb885e13beb416a89ac376de79ccbf9f4469aa7f441d1093bfa5964199fe5fb9b147208952021-05-20 12:07:02122 days 23 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token600 MATIC
0xfe142374aa0c1df36fae64dfbb005f174ff6dba85ee7c44812a7e3c47d280d4b146573882021-05-18 21:37:04124 days 14 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token1 MATIC
0x1d3e02491a8ce20fd0b1dde7dfe15f1f37e69e35e47e45f0c86951bee20e9e7c146566032021-05-18 21:08:59124 days 14 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token1 MATIC
0xe3206b1e044324025d6348d06ac136cbf22270e9057ed316cd2fe237d2fa20f1146552892021-05-18 20:19:28124 days 15 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token900 MATIC
0x4b392f3e5f46f4a04dfe43042c9e74f4fc73354db6499ffb6745e45d32f7e220146546552021-05-18 19:57:10124 days 15 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token10 MATIC
0x3bca432c0a1bbd2fc2b015776504397fe9d1ed410b335a240b1d7983ec968073146517132021-05-18 18:11:06124 days 17 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token950 MATIC
0x1d397bc9f71c07ac7ae4cd2399426d255d0e952062431e0945d6762f0e68401c146516422021-05-18 18:08:36124 days 17 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token660 MATIC
0x267e63c5ecf13b9a78435c36c0f09e5b857127409db8e560c24282ab679b0fee146509572021-05-18 17:44:47124 days 18 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token880 MATIC
0xa1535ad356e4db36f19f291d618c035eac3d6a269e51a513367f17dee2a03ccd146506552021-05-18 17:33:52124 days 18 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token875 MATIC
0xcc1d4f5f377f22673309ae920052aae6f14f2765b9505fd349bb71848ba90c52146503752021-05-18 17:22:24124 days 18 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token235 MATIC
0xb4e6374fcdf91f53235bec12917869005c4d1cb4d08581d4be8ded10788e8212146503742021-05-18 17:22:20124 days 18 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token235 MATIC
0xe7182328f981133e4974d4cd2e1ad1f55c58fb996c9c259a88ea9f94ea769575146503742021-05-18 17:22:20124 days 18 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token240 MATIC
0x9d9bfbab2861910c2c2cdc9d01373b17ffd87ec56c2d5138eef759a6b57a48c7146503742021-05-18 17:22:20124 days 18 hrs ago 0xba1428c302ce818865beb857faf7ab513c1e3a40 Polygon: WMATIC Token240 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FonticulusTraunchTwo

Compiler Version
v0.8.3+commit.8d00100c

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at polygonscan.com on 2021-06-30
*/

// Sources flattened with hardhat v2.2.0 https://hardhat.org

// File @uniswap/v2-periphery/contracts/interfaces/[email protected]

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}


// File @uniswap/v2-periphery/contracts/interfaces/[email protected]

pragma solidity >=0.6.2;

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}


// File @openzeppelin/contracts/token/ERC20/[email protected]

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}


// File @openzeppelin/contracts/utils/[email protected]

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}


// File @openzeppelin/contracts/token/ERC20/utils/[email protected]

pragma solidity ^0.8.0;


/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}


// File @openzeppelin/contracts/utils/introspection/[email protected]

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}


// File @openzeppelin/contracts/token/ERC1155/[email protected]

pragma solidity ^0.8.0;

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data) external;
}


// File @openzeppelin/contracts/token/ERC1155/[email protected]

pragma solidity ^0.8.0;

/**
 * _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {

    /**
        @dev Handles the receipt of a single ERC1155 token type. This function is
        called at the end of a `safeTransferFrom` after the balance has been updated.
        To accept the transfer, this must return
        `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
        (i.e. 0xf23a6e61, or its own function selector).
        @param operator The address which initiated the transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param id The ID of the token being transferred
        @param value The amount of tokens being transferred
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
    */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    )
        external
        returns(bytes4);

    /**
        @dev Handles the receipt of a multiple ERC1155 token types. This function
        is called at the end of a `safeBatchTransferFrom` after the balances have
        been updated. To accept the transfer(s), this must return
        `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
        (i.e. 0xbc197c81, or its own function selector).
        @param operator The address which initiated the batch transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param ids An array containing ids of each token being transferred (order and length must match values array)
        @param values An array containing amounts of each token being transferred (order and length must match ids array)
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
    */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    )
        external
        returns(bytes4);
}


// File @openzeppelin/contracts/token/ERC1155/extensions/[email protected]

pragma solidity ^0.8.0;

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}


// File @openzeppelin/contracts/utils/[email protected]

pragma solidity ^0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}


// File @openzeppelin/contracts/utils/introspection/[email protected]

pragma solidity ^0.8.0;

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}


// File @openzeppelin/contracts/token/ERC1155/[email protected]

pragma solidity ^0.8.0;






/**
 *
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Mapping from token ID to account balances
    mapping (uint256 => mapping(address => uint256)) private _balances;

    // Mapping from account to operator approvals
    mapping (address => mapping(address => bool)) private _operatorApprovals;

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor (string memory uri_) {
        _setURI(uri_);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155).interfaceId
            || interfaceId == type(IERC1155MetadataURI).interfaceId
            || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: balance query for the zero address");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] memory accounts,
        uint256[] memory ids
    )
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(_msgSender() != operator, "ERC1155: setting approval status for self");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC1155-isApprovedForAll}.
     */
    function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[account][operator];
    }

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    )
        public
        virtual
        override
    {
        require(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        _balances[id][from] = fromBalance - amount;
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    )
        public
        virtual
        override
    {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: transfer caller is not owner nor approved"
        );

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            _balances[id][from] = fromBalance - amount;
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `account`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(address account, uint256 id, uint256 amount, bytes memory data) internal virtual {
        require(account != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data);

        _balances[id][account] += amount;
        emit TransferSingle(operator, address(0), account, id, amount);

        _doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `account`
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens of token type `id`.
     */
    function _burn(address account, uint256 id, uint256 amount) internal virtual {
        require(account != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");

        uint256 accountBalance = _balances[id][account];
        require(accountBalance >= amount, "ERC1155: burn amount exceeds balance");
        _balances[id][account] = accountBalance - amount;

        emit TransferSingle(operator, account, address(0), id, amount);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(address account, uint256[] memory ids, uint256[] memory amounts) internal virtual {
        require(account != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, account, address(0), ids, amounts, "");

        for (uint i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 accountBalance = _balances[id][account];
            require(accountBalance >= amount, "ERC1155: burn amount exceeds balance");
            _balances[id][account] = accountBalance - amount;
        }

        emit TransferBatch(operator, account, address(0), ids, amounts);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    )
        internal
        virtual
    { }

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    )
        private
    {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver(to).onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    )
        private
    {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (bytes4 response) {
                if (response != IERC1155Receiver(to).onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}


// File @openzeppelin/contracts/utils/[email protected]

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }
}


// File @openzeppelin/contracts/access/[email protected]

pragma solidity ^0.8.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev 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.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}


// File @openzeppelin/contracts/utils/structs/[email protected]

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}


// File @uniswap/v2-core/contracts/interfaces/[email protected]

pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}


// File contracts/libraries/UniswapV2Library.sol

pragma solidity >=0.8.0;

// direct port of the uniswap library but with an upgraded SafeMath

library UniswapV2Library {
    // returns sorted token addresses, used to handle return values from pairs sorted in this order
    function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
        require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
    }

    // calculates the CREATE2 address for a pair without making any external calls
    function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
        (address token0, address token1) = sortTokens(tokenA, tokenB);
        pair = address(uint160(uint256(keccak256(abi.encodePacked(
                hex'ff',
                factory,
                keccak256(abi.encodePacked(token0, token1)),
                hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
            )))));
    }

    // fetches and sorts the reserves for a pair
    function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
        (address token0,) = sortTokens(tokenA, tokenB);
        (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
        (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
    }

    // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
    function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
        require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
        require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        amountB = (amountA * reserveB) / reserveA;
    }

    // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
        require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint amountInWithFee = amountIn * 997;
        uint numerator = amountInWithFee * reserveOut;
        uint denominator = reserveIn * 1000 + amountInWithFee;
        amountOut = numerator / denominator;
    }

    // given an output amount of an asset and pair reserves, returns a required input amount of the other asset
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
        require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint numerator = reserveIn * amountOut * 1000;
        uint denominator = (reserveOut - amountOut) * 997;
        amountIn = (numerator / denominator) + 1;
    }

    // performs chained getAmountOut calculations on any number of pairs
    function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[0] = amountIn;
        for (uint i; i < path.length - 1; i++) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
            amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
        }
    }

    // performs chained getAmountIn calculations on any number of pairs
    function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[amounts.length - 1] = amountOut;
        for (uint i = path.length - 1; i > 0; i--) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
            amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
        }
    }
}


// File contracts/FonticulusTraunchTwo.sol

pragma solidity >=0.8.0;






// import "hardhat/console.sol";

interface MaticWrapper is IERC20 {
    function deposit() external payable;
}

contract FonticulusTraunchTwo is ERC1155, Ownable {
    using SafeERC20 for IERC20;
    using SafeERC20 for MaticWrapper;
    using Counters for Counters.Counter;
    using EnumerableSet for EnumerableSet.UintSet;

    uint32 public constant ONE_HUNDRED_PERCENT = 100000;
    uint32 public percentMatched = 90000; // percent out of 100000

    mapping(address => EnumerableSet.UintSet) private _userTokens;

    uint256 public constant PERP_CONTRACTS = 0;
    uint256 constant MAX_UINT = (2**255) - 1;

    uint256 immutable genesisBlock;
    IERC20 immutable wrappedPTG;
    MaticWrapper immutable wrappedMatic; // for example MATIC

    IUniswapV2Router02 immutable router;

    struct LockedLPToken {
        address uniswapPool;
        uint256 amount;
        uint256 depositedAt;
    }
    Counters.Counter private _tokenIds;
    mapping(uint256 => LockedLPToken) public tokens;

    constructor(
        address router_,
        address wrappedPTGAddress_,
        address wrappedMaticAddress_
    ) ERC1155("") {
        genesisBlock = block.number;
        router = IUniswapV2Router02(router_);
        IERC20 _wrappedPTG = IERC20(wrappedPTGAddress_);
        _wrappedPTG.approve(router_, MAX_UINT);
        wrappedPTG = _wrappedPTG;

        MaticWrapper _wrappedMatic = MaticWrapper(wrappedMaticAddress_);
        _wrappedMatic.approve(router_, MAX_UINT);
        wrappedMatic = _wrappedMatic;
        // use everything *after* 0 for the LockedLPTokens
        // but keep 0 as an erc20-like perpetual contract token
        _tokenIds.increment();
    }

    function setMatchPercentage(uint32 percentage) public onlyOwner {
        percentMatched = percentage;
    }

    function price(uint256 amountIn) public view returns (uint256 amountOut) {
        (uint256 reserveIn, uint256 reserveOut) =
            UniswapV2Library.getReserves(
                router.factory(),
                address(wrappedMatic),
                address(wrappedPTG)
            );
        return UniswapV2Library.quote(amountIn, reserveIn, reserveOut);
    }

    function outPrice(uint256 amountIn) public view returns (uint256 amountOut) {
        (uint256 reserveIn, uint256 reserveOut) =
            UniswapV2Library.getReserves(
                router.factory(),
                address(wrappedMatic),
                address(wrappedPTG)
            );
        return UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut);
    }

    function addLiquidityMATIC(uint256 minPTGAmount, uint256 deadline)
        external
        payable
        returns (uint256 tokenId)
    {
        wrappedMatic.deposit{value: msg.value}();
        return _addLiquidity(msg.value, minPTGAmount, deadline);
    }

    function addLiquidity(
        uint256 amount,
        uint256 minPTGAmount,
        uint256 deadline
    ) public returns (uint256 tokenId) {
        wrappedMatic.safeTransferFrom(msg.sender, address(this), amount);
        return _addLiquidity(amount, minPTGAmount, deadline);
    }

    function _buyMatic(
        uint amount,
        uint deadline
    ) private returns (uint256 amountPtg) {
        address[] memory path = new address[](2);
        path[0] = address(wrappedMatic);
        path[1] = address(wrappedPTG);
        // console.log('out price from buy: ', outPrice(amount));
        uint256[] memory amounts = router.swapExactTokensForTokens(amount, outPrice(amount), path, address(this), deadline);
        // console.log('bought matic: ', amounts[0], amounts[1]);
        return amounts[1];
    }

    function _addLiquidity(
        uint256 amount,
        uint256 minPTGAmount,
        uint256 deadline
    ) private returns (uint256 tokenId) {
        uint256 maticToMatch = (amount * percentMatched) / ONE_HUNDRED_PERCENT;
        _buyMatic(amount - (amount * percentMatched) / ONE_HUNDRED_PERCENT, deadline);
        // console.log('matching matic: ', maticToMatch, ' price: ', price(maticToMatch));
        // provide liquidity to the router
        (uint256 maticAdded, uint256 tokenAdded, uint256 liquidity) =
            router.addLiquidity(
                address(wrappedMatic),
                address(wrappedPTG),
                maticToMatch,
                price(maticToMatch),
                maticToMatch,
                minPTGAmount,
                address(this),
                deadline
            );
        // give the user back their cash that didn't get used.
        if (maticToMatch < tokenAdded) {
            uint256 change = maticToMatch - maticAdded;
            if (change > 0) {
                // console.log("change: amount / added: ", maticToMatch, maticAdded);
                wrappedMatic.safeTransfer(address(this), change);
            }
        }

        address pair =
            UniswapV2Library.pairFor(
                router.factory(),
                address(wrappedMatic),
                address(wrappedPTG)
            );
        // console.log("lp/matic/ptg", liquidity, maticAdded, tokenAdded);
        _tokenIds.increment();
        uint256 newItemId = _tokenIds.current();
        _mint(msg.sender, newItemId, 1, "");
        LockedLPToken storage lpToken = tokens[newItemId];
        lpToken.uniswapPool = pair;
        lpToken.amount = liquidity;
        lpToken.depositedAt = block.timestamp;
        // console.log('return');
        return newItemId;
    }

    function userTokens(address user) public view returns (uint256[] memory ids) {
        uint len = _userTokens[user].length();
        ids = new uint[](len);
        for (uint i; i < len; i++) {
            ids[i] = _userTokens[user].at(i);
        }
        return ids;
    }

    function canRemove(uint256 depositedAt) internal view returns (bool) {
        return block.timestamp > (depositedAt + 90 days);
    }

    function claimLiquidity(uint256 tokenId) public {
        LockedLPToken memory lpToken = tokens[tokenId];
        require(canRemove(lpToken.depositedAt), "LP:Locked");
        _burn(msg.sender, tokenId, 1);
        delete tokens[tokenId];

        // console.log('amount: ', lpToken.amount);
        IERC20(lpToken.uniswapPool).safeTransfer(msg.sender, lpToken.amount);
        delete tokens[tokenId];
    }

    function emergencyRemoveIncentives(address to) onlyOwner public {
        uint256 balance = wrappedPTG.balanceOf(address(this));
        wrappedPTG.safeTransfer(to, balance);
    }

    function _beforeTokenTransfer(address, address from, address to, uint256[] memory ids, uint256[] memory, bytes memory) internal override {
        for (uint i; i < ids.length; i++) {
            _userTokens[from].remove(ids[i]);
            _userTokens[to].add(ids[i]);
        }
    }
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"router_","type":"address"},{"internalType":"address","name":"wrappedPTGAddress_","type":"address"},{"internalType":"address","name":"wrappedMaticAddress_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"ONE_HUNDRED_PERCENT","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERP_CONTRACTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minPTGAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minPTGAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidityMATIC","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"claimLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"emergencyRemoveIncentives","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"outPrice","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"percentMatched","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"price","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"percentage","type":"uint32"}],"name":"setMatchPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"address","name":"uniswapPool","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"depositedAt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userTokens","outputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"stateMutability":"view","type":"function"}]

6101006040526003805463ffffffff60a01b19166115f960a41b1790553480156200002957600080fd5b50604051620037c9380380620037c98339810160408190526200004c9162000316565b604080516020810190915260008152620000668162000231565b50600380546001600160a01b0319163390811790915560405181906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35043608052606083901b6001600160601b03191660e05260405163095ea7b360e01b81526001600160a01b0380851660048301526001600160ff1b03602483015283919082169063095ea7b390604401602060405180830381600087803b1580156200011457600080fd5b505af115801562000129573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200014f91906200035f565b50606081901b6001600160601b03191660a05260405163095ea7b360e01b81526001600160a01b0385811660048301526001600160ff1b03602483015283919082169063095ea7b390604401602060405180830381600087803b158015620001b657600080fd5b505af1158015620001cb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f191906200035f565b50806001600160a01b031660c0816001600160a01b031660601b815250506200022660056200024a60201b6200140a1760201c565b5050505050620003c5565b80516200024690600290602084019062000253565b5050565b80546001019055565b828054620002619062000388565b90600052602060002090601f016020900481019282620002855760008555620002d0565b82601f10620002a057805160ff1916838001178555620002d0565b82800160010185558215620002d0579182015b82811115620002d0578251825591602001919060010190620002b3565b50620002de929150620002e2565b5090565b5b80821115620002de5760008155600101620002e3565b80516001600160a01b03811681146200031157600080fd5b919050565b6000806000606084860312156200032b578283fd5b6200033684620002f9565b92506200034660208501620002f9565b91506200035660408501620002f9565b90509250925092565b60006020828403121562000371578081fd5b8151801515811462000381578182fd5b9392505050565b600181811c908216806200039d57607f821691505b60208210811415620003bf57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160601c60c05160601c60e05160601c61335b6200046e6000396000818161065d015281816107540152818161199901528181611b1901526123130152600081816106ee01528181610a9e01528181610f0f015281816119c801528181611ae901528181611baa015261225601526000818161070f01528181610e4f01528181610ee0015281816119e901528181611bcb01526122b801526000505061335b6000f3fe60806040526004361061013f5760003560e01c8063715018a6116100b6578063dd0081c71161006f578063dd0081c7146103d8578063e985e9c514610404578063ed498fa81461044d578063f112cb111461046d578063f242432a14610491578063f2fde38b146104b15761013f565b8063715018a61461032e57806374be1d2614610343578063805ae72414610363578063882b6eeb146103765780638da5cb5b1461038b578063a22cb465146103b85761013f565b80632eb2c2d6116101085780632eb2c2d614610214578063422f1043146102365780634e1273f4146102565780634f64b2be1461028357806357ca1d90146102ee5780635e648eff1461030e5761013f565b8062fdd58e1461014457806301ffc9a7146101775780630e89341c146101a757806311fca43d146101d457806326a49e37146101f4575b600080fd5b34801561015057600080fd5b5061016461015f366004612a9b565b6104d1565b6040519081526020015b60405180910390f35b34801561018357600080fd5b50610197610192366004612c4c565b61056b565b604051901515815260200161016e565b3480156101b357600080fd5b506101c76101c2366004612cca565b6105bf565b60405161016e9190612eea565b3480156101e057600080fd5b506101646101ef366004612cca565b610653565b34801561020057600080fd5b5061016461020f366004612cca565b61074a565b34801561022057600080fd5b5061023461022f36600461295d565b6107ba565b005b34801561024257600080fd5b50610164610251366004612d1b565b610a8f565b34801561026257600080fd5b50610276610271366004612ac6565b610adb565b60405161016e9190612ea9565b34801561028f57600080fd5b506102c961029e366004612cca565b6006602052600090815260409020805460018201546002909201546001600160a01b03909116919083565b604080516001600160a01b03909416845260208401929092529082015260600161016e565b3480156102fa57600080fd5b50610234610309366004612d73565b610c3d565b34801561031a57600080fd5b50610234610329366004612cca565b610c92565b34801561033a57600080fd5b50610234610d8f565b34801561034f57600080fd5b5061023461035e3660046128ed565b610e08565b610164610371366004612cfa565b610f0b565b34801561038257600080fd5b50610164600081565b34801561039757600080fd5b506103a0610f8c565b6040516001600160a01b03909116815260200161016e565b3480156103c457600080fd5b506102346103d3366004612a6e565b610f9c565b3480156103e457600080fd5b506103ef620186a081565b60405163ffffffff909116815260200161016e565b34801561041057600080fd5b5061019761041f366004612925565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561045957600080fd5b506102766104683660046128ed565b611080565b34801561047957600080fd5b506003546103ef90600160a01b900463ffffffff1681565b34801561049d57600080fd5b506102346104ac366004612a07565b61116b565b3480156104bd57600080fd5b506102346104cc3660046128ed565b61131a565b60006001600160a01b0383166105425760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061059c57506001600160e01b031982166303a24d0760e21b145b806105b757506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b6060600280546105ce9061317f565b80601f01602080910402602001604051908101604052809291908181526020018280546105fa9061317f565b80156106475780601f1061061c57610100808354040283529160200191610647565b820191906000526020600020905b81548152906001019060200180831161062a57829003601f168201915b50505050509050919050565b60008060006107337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106b457600080fd5b505afa1580156106c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ec9190612909565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611413565b915091506107428483836114ec565b949350505050565b60008060006107ab7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106b457600080fd5b915091506107428483836115cb565b815183511461081c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610539565b6001600160a01b0384166108425760405162461bcd60e51b815260040161053990612f45565b6001600160a01b03851633148061085e575061085e853361041f565b6108c55760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608401610539565b336108d481878787878761166b565b60005b8451811015610a2157600085828151811061090257634e487b7160e01b600052603260045260246000fd5b60200260200101519050600085838151811061092e57634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600084815280835260408082206001600160a01b038e16835290935291909120549091508181101561097e5760405162461bcd60e51b815260040161053990612fd2565b610988828261313c565b60008085815260200190815260200160002060008c6001600160a01b03166001600160a01b03168152602001908152602001600020819055508160008085815260200190815260200160002060008b6001600160a01b03166001600160a01b031681526020019081526020016000206000828254610a0691906130e5565b9250508190555050505080610a1a906131e7565b90506108d7565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610a71929190612ebc565b60405180910390a4610a87818787878787611747565b505050505050565b6000610ac66001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330876118b2565b610ad1848484611923565b90505b9392505050565b60608151835114610b405760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610539565b6000835167ffffffffffffffff811115610b6a57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610b93578160200160208202803683370190505b50905060005b8451811015610c3557610bfa858281518110610bc557634e487b7160e01b600052603260045260246000fd5b6020026020010151858381518110610bed57634e487b7160e01b600052603260045260246000fd5b60200260200101516104d1565b828281518110610c1a57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610c2e816131e7565b9050610b99565b509392505050565b33610c46610f8c565b6001600160a01b031614610c6c5760405162461bcd60e51b81526004016105399061301c565b6003805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600081815260066020908152604091829020825160608101845281546001600160a01b031681526001820154928101929092526002015491810182905290610cd990611c6e565b610d115760405162461bcd60e51b815260206004820152600960248201526813140e931bd8dad95960ba1b6044820152606401610539565b610d1d33836001611c85565b6000828152600660209081526040822080546001600160a01b031916815560018101839055600201919091558101518151610d65916001600160a01b03909116903390611e06565b50600090815260066020526040812080546001600160a01b03191681556001810182905560020155565b33610d98610f8c565b6001600160a01b031614610dbe5760405162461bcd60e51b81526004016105399061301c565b6003546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600380546001600160a01b0319169055565b33610e11610f8c565b6001600160a01b031614610e375760405162461bcd60e51b81526004016105399061301c565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015610e9957600080fd5b505afa158015610ead573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed19190612ce2565b9050610f076001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168383611e06565b5050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610f6857600080fd5b505af1158015610f7c573d6000803e3d6000fd5b5050505050610ad4348484611923565b6003546001600160a01b03165b90565b336001600160a01b03831614156110075760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610539565b3360008181526001602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611074911515815260200190565b60405180910390a35050565b6001600160a01b0381166000908152600460205260408120606091906110a590611e3b565b90508067ffffffffffffffff8111156110ce57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156110f7578160200160208202803683370190505b50915060005b81811015611164576001600160a01b03841660009081526004602052604090206111279082611e45565b83828151811061114757634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061115c816131e7565b9150506110fd565b5050919050565b6001600160a01b0384166111915760405162461bcd60e51b815260040161053990612f45565b6001600160a01b0385163314806111ad57506111ad853361041f565b61120b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610539565b3361122a81878761121b88611e51565b61122488611e51565b8761166b565b6000848152602081815260408083206001600160a01b038a1684529091529020548381101561126b5760405162461bcd60e51b815260040161053990612fd2565b611275848261313c565b6000868152602081815260408083206001600160a01b038c811685529252808320939093558816815290812080548692906112b19084906130e5565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611311828888888888611eaa565b50505050505050565b33611323610f8c565b6001600160a01b0316146113495760405162461bcd60e51b81526004016105399061301c565b6001600160a01b0381166113ae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610539565b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b80546001019055565b60008060006114228585611f74565b50905060008061143388888861206c565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561146b57600080fd5b505afa15801561147f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a39190612c84565b506001600160701b031691506001600160701b03169150826001600160a01b0316876001600160a01b0316146114da5780826114dd565b81815b90999098509650505050505050565b60008084116115515760405162461bcd60e51b815260206004820152602b60248201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4960448201526a1394155517d05353d5539560aa1b6064820152608401610539565b6000831180156115615750600082115b61157d5760405162461bcd60e51b815260040161053990612f8a565b600061158b856103e561311d565b90506000611599848361311d565b90506000826115aa876103e861311d565b6115b491906130e5565b90506115c081836130fd565b979650505050505050565b600080841161162a5760405162461bcd60e51b815260206004820152602560248201527f556e697377617056324c6962726172793a20494e53554646494349454e545f416044820152641353d5539560da1b6064820152608401610539565b60008311801561163a5750600082115b6116565760405162461bcd60e51b815260040161053990612f8a565b82611661838661311d565b610ad191906130fd565b60005b8351811015611311576116d584828151811061169a57634e487b7160e01b600052603260045260246000fd5b602002602001015160046000896001600160a01b03166001600160a01b0316815260200190815260200160002061214590919063ffffffff16565b506117348482815181106116f957634e487b7160e01b600052603260045260246000fd5b602002602001015160046000886001600160a01b03166001600160a01b0316815260200190815260200160002061215190919063ffffffff16565b508061173f816131e7565b91505061166e565b6001600160a01b0384163b15610a875760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061178b9089908990889088908890600401612e11565b602060405180830381600087803b1580156117a557600080fd5b505af19250505080156117d5575060408051601f3d908101601f191682019092526117d291810190612c68565b60015b611882576117e161322e565b806308c379a0141561181b57506117f6613245565b80611801575061181d565b8060405162461bcd60e51b81526004016105399190612eea565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610539565b6001600160e01b0319811663bc197c8160e01b146113115760405162461bcd60e51b815260040161053990612efd565b6040516001600160a01b038085166024830152831660448201526064810182905261191d9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261215d565b50505050565b6003546000908190620186a09061194790600160a01b900463ffffffff168761311d565b61195191906130fd565b60035490915061199190620186a09061197790600160a01b900463ffffffff168861311d565b61198191906130fd565b61198b908761313c565b8461222f565b5060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e8e337007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000087611a128961074a565b6040516001600160e01b031960e087901b1681526001600160a01b039485166004820152939092166024840152604483015260648201526084810187905260a481018a90523060c482015260e4810189905261010401606060405180830381600087803b158015611a8257600080fd5b505af1158015611a96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aba9190612d46565b92509250925081841015611b12576000611ad4848661313c565b90508015611b1057611b106001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163083611e06565b505b6000611bef7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015611b7057600080fd5b505afa158015611b84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba89190612909565b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061206c565b9050611bff600580546001019055565b6000611c0a60055490565b9050611c2833826001604051806020016040528060008152506123f0565b600081815260066020526040902080546001600160a01b0319166001600160a01b0393909316929092178255600182019290925542600290910155979650505050505050565b6000611c7d826276a7006130e5565b421192915050565b6001600160a01b038316611ce75760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610539565b33611d1681856000611cf887611e51565b611d0187611e51565b6040518060200160405280600081525061166b565b6000838152602081815260408083206001600160a01b038816845290915290205482811015611d935760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610539565b611d9d838261313c565b6000858152602081815260408083206001600160a01b038a811680865291845282852095909555815189815292830188905292938616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b6040516001600160a01b038316602482015260448101829052611e3690849063a9059cbb60e01b906064016118e6565b505050565b60006105b7825490565b6000610ad483836124f8565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611e9957634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b15610a875760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611eee9089908990889088908890600401612e6f565b602060405180830381600087803b158015611f0857600080fd5b505af1925050508015611f38575060408051601f3d908101601f19168201909252611f3591810190612c68565b60015b611f44576117e161322e565b6001600160e01b0319811663f23a6e6160e01b146113115760405162461bcd60e51b815260040161053990612efd565b600080826001600160a01b0316846001600160a01b03161415611fe75760405162461bcd60e51b815260206004820152602560248201527f556e697377617056324c6962726172793a204944454e544943414c5f41444452604482015264455353455360d81b6064820152608401610539565b826001600160a01b0316846001600160a01b03161061200757828461200a565b83835b90925090506001600160a01b0382166120655760405162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f4144445245535300006044820152606401610539565b9250929050565b600080600061207b8585611f74565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b16603482015291935091508690604801604051602081830303815290604052805190602001206040516020016121239291906001600160f81b0319815260609290921b6bffffffffffffffffffffffff1916600183015260158201527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f603582015260550190565b60408051601f1981840301815291905280516020909101209695505050505050565b6000610ad4838361258c565b6000610ad483836126a9565b60006121b2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126f89092919063ffffffff16565b805190915015611e3657808060200190518101906121d09190612c30565b611e365760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610539565b604080516002808252606082018352600092839291906020830190803683370190505090507f00000000000000000000000000000000000000000000000000000000000000008160008151811061229657634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000000000000000000000000000000000000000000000816001815181106122f857634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526000907f0000000000000000000000000000000000000000000000000000000000000000166338ed17398661234281610653565b8530896040518663ffffffff1660e01b8152600401612365959493929190613051565b600060405180830381600087803b15801561237f57600080fd5b505af1158015612393573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526123bb9190810190612b93565b9050806001815181106123de57634e487b7160e01b600052603260045260246000fd5b60200260200101519250505092915050565b6001600160a01b0384166124505760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610539565b336124618160008761121b88611e51565b6000848152602081815260408083206001600160a01b0389168452909152812080548592906124919084906130e5565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46124f181600087878787611eaa565b5050505050565b815460009082106125565760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401610539565b82600001828154811061257957634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6000818152600183016020526040812054801561269f5760006125b060018361313c565b85549091506000906125c49060019061313c565b905060008660000182815481106125eb57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508087600001848154811061261c57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001556126338360016130e5565b6000828152600189016020526040902055865487908061266357634e487b7160e01b600052603160045260246000fd5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610565565b6000915050610565565b60008181526001830160205260408120546126f057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610565565b506000610565565b6060610ad1848460008585843b6127515760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610539565b600080866001600160a01b0316858760405161276d9190612df5565b60006040518083038185875af1925050503d80600081146127aa576040519150601f19603f3d011682016040523d82523d6000602084013e6127af565b606091505b50915091506115c0828286606083156127c9575081610ad4565b8251156127d95782518084602001fd5b8160405162461bcd60e51b81526004016105399190612eea565b600082601f830112612803578081fd5b81356020612810826130c1565b60405161281d82826131ba565b8381528281019150858301600585901b8701840188101561283c578586fd5b855b8581101561285a5781358452928401929084019060010161283e565b5090979650505050505050565b600082601f830112612877578081fd5b813567ffffffffffffffff81111561289157612891613218565b6040516128a8601f8301601f1916602001826131ba565b8181528460208386010111156128bc578283fd5b816020850160208301379081016020019190915292915050565b80516001600160701b03811681146105ba57600080fd5b6000602082840312156128fe578081fd5b8135610ad4816132d7565b60006020828403121561291a578081fd5b8151610ad4816132d7565b60008060408385031215612937578081fd5b8235612942816132d7565b91506020830135612952816132d7565b809150509250929050565b600080600080600060a08688031215612974578081fd5b853561297f816132d7565b9450602086013561298f816132d7565b9350604086013567ffffffffffffffff808211156129ab578283fd5b6129b789838a016127f3565b945060608801359150808211156129cc578283fd5b6129d889838a016127f3565b935060808801359150808211156129ed578283fd5b506129fa88828901612867565b9150509295509295909350565b600080600080600060a08688031215612a1e578081fd5b8535612a29816132d7565b94506020860135612a39816132d7565b93506040860135925060608601359150608086013567ffffffffffffffff811115612a62578182fd5b6129fa88828901612867565b60008060408385031215612a80578182fd5b8235612a8b816132d7565b91506020830135612952816132ef565b60008060408385031215612aad578182fd5b8235612ab8816132d7565b946020939093013593505050565b60008060408385031215612ad8578182fd5b823567ffffffffffffffff80821115612aef578384fd5b818501915085601f830112612b02578384fd5b81356020612b0f826130c1565b604051612b1c82826131ba565b8381528281019150858301600585901b870184018b1015612b3b578889fd5b8896505b84871015612b66578035612b52816132d7565b835260019690960195918301918301612b3f565b5096505086013592505080821115612b7c578283fd5b50612b89858286016127f3565b9150509250929050565b60006020808385031215612ba5578182fd5b825167ffffffffffffffff811115612bbb578283fd5b8301601f81018513612bcb578283fd5b8051612bd6816130c1565b604051612be382826131ba565b8281528481019150838501600584901b85018601891015612c02578687fd5b8694505b83851015612c24578051835260019490940193918501918501612c06565b50979650505050505050565b600060208284031215612c41578081fd5b8151610ad4816132ef565b600060208284031215612c5d578081fd5b8135610ad4816132fd565b600060208284031215612c79578081fd5b8151610ad4816132fd565b600080600060608486031215612c98578081fd5b612ca1846128d6565b9250612caf602085016128d6565b91506040840151612cbf81613313565b809150509250925092565b600060208284031215612cdb578081fd5b5035919050565b600060208284031215612cf3578081fd5b5051919050565b60008060408385031215612d0c578182fd5b50508035926020909101359150565b600080600060608486031215612d2f578081fd5b505081359360208301359350604090920135919050565b600080600060608486031215612d5a578081fd5b8351925060208401519150604084015190509250925092565b600060208284031215612d84578081fd5b8135610ad481613313565b6000815180845260208085019450808401835b83811015612dbe57815187529582019590820190600101612da2565b509495945050505050565b60008151808452612de1816020860160208601613153565b601f01601f19169290920160200192915050565b60008251612e07818460208701613153565b9190910192915050565b6001600160a01b0386811682528516602082015260a060408201819052600090612e3d90830186612d8f565b8281036060840152612e4f8186612d8f565b90508281036080840152612e638185612dc9565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906115c090830184612dc9565b600060208252610ad46020830184612d8f565b600060408252612ecf6040830185612d8f565b8281036020840152612ee18185612d8f565b95945050505050565b600060208252610ad46020830184612dc9565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526028908201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4c604082015267495155494449545960c01b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156130a05784516001600160a01b03168352938301939183019160010161307b565b50506001600160a01b03969096166060850152505050608001529392505050565b600067ffffffffffffffff8211156130db576130db613218565b5060051b60200190565b600082198211156130f8576130f8613202565b500190565b60008261311857634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561313757613137613202565b500290565b60008282101561314e5761314e613202565b500390565b60005b8381101561316e578181015183820152602001613156565b8381111561191d5750506000910152565b600181811c9082168061319357607f821691505b602082108114156131b457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f1916810167ffffffffffffffff811182821017156131e0576131e0613218565b6040525050565b60006000198214156131fb576131fb613202565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115610f9957600481823e5160e01c90565b600060443d101561325557610f99565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715613287575050505050610f99565b82850191508151818111156132a157505050505050610f99565b843d87010160208285010111156132bd57505050505050610f99565b6132cc602082860101876131ba565b509094505050505090565b6001600160a01b03811681146132ec57600080fd5b50565b80151581146132ec57600080fd5b6001600160e01b0319811681146132ec57600080fd5b63ffffffff811681146132ec57600080fdfea26469706673582212209261249c35a2151a8dd6919f249bf34a75b023062e2d3f4f4b522714282379f964736f6c63430008030033000000000000000000000000a5e0829caced8ffdd4de3c43696c57f7d7a678ff000000000000000000000000c0f14c88250e680ecd70224b7fba82b7c6560d120000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000a5e0829caced8ffdd4de3c43696c57f7d7a678ff000000000000000000000000c0f14c88250e680ecd70224b7fba82b7c6560d120000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270

-----Decoded View---------------
Arg [0] : router_ (address): 0xa5e0829caced8ffdd4de3c43696c57f7d7a678ff
Arg [1] : wrappedPTGAddress_ (address): 0xc0f14c88250e680ecd70224b7fba82b7c6560d12
Arg [2] : wrappedMaticAddress_ (address): 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000a5e0829caced8ffdd4de3c43696c57f7d7a678ff
Arg [1] : 000000000000000000000000c0f14c88250e680ecd70224b7fba82b7c6560d12
Arg [2] : 0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.