Contract 0x72cc6E4DE47f673062c41C67505188144a0a3D84 10

 
Txn Hash Method
Index
From
To
Value
0x5c624bd37a3ea3143df499e3cc7a9b125c03d7600100c194916245960aa76de5Create86382752022-05-20 1:59:088 hrs 1 min ago0x913b32ecbe0c65fc6fb2892fcba07712ce9107ed IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0003006099760.001
0x352dd2daa963a87844918ed2ce9aaa212cfed7bdc3ad04d76150d3da0f79b26fCreate85092192022-05-18 5:59:052 days 4 hrs ago0x9228fbac8165e7d18d60a5eaf03545a45c77139c IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0001844762950.001
0x5e1c08b3cce2b88c11aa7a31c4fecccb9073dd3717692611c6be17f44f81f1b0Create83972202022-05-16 10:32:473 days 23 hrs ago0x966211e4a01e0e479e86f24f9d3209b8cc8a7993 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0001208438960.001
0xeda18ece5d12893df4fd67a30b73a671524d8c47ce080c4cb47346c921a85d8eCreate73348392022-05-08 1:40:0212 days 8 hrs ago0x4a88849479a7c3c58d2d1b3038ef05bdb98170e1 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0001407558750.001
0x9dbbb7041c52bea2181218454bb00662c5854bb79d4d7ec7dfd0db9ad5ec6ac8Create72961982022-05-07 13:25:1712 days 20 hrs ago0xdb45cf5eac5dc3d59e0877c8995ac35b9d541811 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0002249201170.001
0x82924e45be2f97f300325b07fd980ce107db6b39cbb7ce7c5768cfe846148369Create72958992022-05-07 13:19:1612 days 20 hrs ago0xdb45cf5eac5dc3d59e0877c8995ac35b9d541811 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0002947331120.001
0xab5033e71a2c3109133e1c757edfc4e939fe1097c1c05ea7a4027c46c6ed0f60Create72871262022-05-07 10:18:0412 days 23 hrs ago0x7b7f8e146b2d9ad4897b50e833071ae72597cec8 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0001642615360.001
0x8e5acdc53a06648908785beb206cbe9ae178ebcfa43a2fb71d579e0f088bcb7fCreate72811332022-05-07 8:29:4713 days 1 hr ago0x7b7f8e146b2d9ad4897b50e833071ae72597cec8 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0001567141770.001
0x8e77414779c14f314e1eee09061ad0f8146a4ce0f02eeb36340f2fd3b4f9996dCreate71994532022-05-06 10:11:4513 days 23 hrs ago0xf31df2dcd4083ee57f0d33d386656cfbd1e859a1 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0005582673040.001
0x277befa089540bd7db05bb0d4809d8988261b91d3444c4b7a2bb58f68517469dCreate70611112022-05-04 16:54:1515 days 17 hrs ago0xbb4cb19202af995a43568f87462f7193db693208 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0003163454740.001
0x8f984b280b8f8c51669ac3c330d7446877b4e0e10351925d03e435f055d07d77Create70255322022-05-04 7:32:5116 days 2 hrs ago0xbe533f7b30e2283b50e2d5fd3e2dba765c2fb013 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0002688381140.001
0x9c49e958609ff9bb95f0e08c3ddc4ba4ced3bd12b0c9d207ab898210a493cfb4Create69517732022-05-02 22:14:3617 days 11 hrs ago0x050691b0a5e186bab19ca6dec706ef3b097a8d41 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0005547660960.001
0xf75f6a2a5be373844c2c63e94e5361de44673c6bc663019b3e0598bbf264752fCreate69302132022-05-02 13:53:2617 days 20 hrs ago0x4eb5ad5fdb7d9c05120d884695cd5ffaf8a01220 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0003348526110.001
0xe033f2ede4225b09cbb81a51adf2e8d5cd5555517f6be2955a3b56f5ec7a9e30Create69206262022-05-02 11:10:4917 days 22 hrs ago0x9877b3014694f5e41e1d858721f266fbea944656 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0002938041320.001
0x31913ae3fc6421852a41f0fd8566791d7f8703c3530602c419ee9552c24b02b4Create69203102022-05-02 11:02:4317 days 22 hrs ago0x9877b3014694f5e41e1d858721f266fbea944656 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0003306535080.001
0x5e6f8f142bedaaca9bf8621fad5e8eb026888b0b8a88584fdef63090bb8232d6Create69202282022-05-02 11:00:1917 days 23 hrs ago0x9877b3014694f5e41e1d858721f266fbea944656 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0003306535080.001
0xdb55889c6aaf8d07eeda8820954d2e3a4ffbfbe9efee0aa12a55c582218fbad8Create69201972022-05-02 10:58:5417 days 23 hrs ago0x9877b3014694f5e41e1d858721f266fbea944656 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0003306535080.001
0x07908467132b50d8c39a1f0a70af38c214488f40a68a4754ea03e4b5d5b3b710Create69110672022-05-02 7:54:2118 days 2 hrs ago0x81af902e66d3857f64164108cc5a11e5320f2371 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0003320077420.001
0x16111d6227cc8c8564e18f394bc5e0657f35ef115c4adba43209355cfcedb461Create67650922022-04-30 0:11:2120 days 9 hrs ago0x31555bfd9be0a0c432e05ec4ac34cd9606cda71e IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0003005760540.001
0xfd6cf28fe207f71b8f30042b101d7c66a5c0bc64c348aa64826b17250975e75cCreate67649752022-04-30 0:08:0320 days 9 hrs ago0x31555bfd9be0a0c432e05ec4ac34cd9606cda71e IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0002422488880.001
0x9c0c20f31e9b464262ec759a4ab0060b3ee9e46a70defddb0b62fcb671cc0c9fCreate66408682022-04-28 5:59:4422 days 4 hrs ago0xce73e37eb67f94dba779ed5770b5be8f0b676660 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.000176204860.001
0xc23bbe5fe30ff8561383309d3485a7e992272c8780a296135630577653149feaCreate65198012022-04-26 20:18:0123 days 13 hrs ago0xc24423e4e112125571e6c679306b2df4e3df3e61 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0006381180720.001
0x3d410189b4d2ce1bc188bdd9031a4b144ef8ae7146d82894fd2eeea8c1af58f8Create65129032022-04-26 19:02:1123 days 14 hrs ago0x242c7f2279a3187279fd61605004a4b477b63a78 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0004303086730.001
0xdf3053424bba602b361c58fe7917c963cc0d1e2d49a9b28b940b1ec42d83a2d7Create63166672022-04-23 17:26:5426 days 16 hrs ago0xcc15ee1229a5c3f10f696c981ea0f01d098a5465 IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.0003392917980.001
0x174816d57935ed44c487daf0bdd9b77724a97ee3669f5fdb9127bb1c64bba918Create60748722022-04-20 10:42:2729 days 23 hrs ago0xbbac61fa8e3bbe854cd2d36a300bdb1493d6402c IN  0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether0.000239868280.001
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x5c624bd37a3ea3143df499e3cc7a9b125c03d7600100c194916245960aa76de586382752022-05-20 1:59:088 hrs 1 min ago 0xcb6de47926b22cdb28f15ee3e6da433e3ff23376 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0x5c624bd37a3ea3143df499e3cc7a9b125c03d7600100c194916245960aa76de586382752022-05-20 1:59:088 hrs 1 min ago 0x72cc6e4de47f673062c41c67505188144a0a3d84  Contract Creation0 Ether
0x352dd2daa963a87844918ed2ce9aaa212cfed7bdc3ad04d76150d3da0f79b26f85092192022-05-18 5:59:052 days 4 hrs ago 0x2e00a2c625d1856d3c8e249094416c9f2164107a 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0x352dd2daa963a87844918ed2ce9aaa212cfed7bdc3ad04d76150d3da0f79b26f85092192022-05-18 5:59:052 days 4 hrs ago 0x72cc6e4de47f673062c41c67505188144a0a3d84  Contract Creation0 Ether
0x5e1c08b3cce2b88c11aa7a31c4fecccb9073dd3717692611c6be17f44f81f1b083972202022-05-16 10:32:473 days 23 hrs ago 0x6758359582ec5c602f5121095807b062a15a9d5d 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0x5e1c08b3cce2b88c11aa7a31c4fecccb9073dd3717692611c6be17f44f81f1b083972202022-05-16 10:32:473 days 23 hrs ago 0x72cc6e4de47f673062c41c67505188144a0a3d84  Contract Creation0 Ether
0xeda18ece5d12893df4fd67a30b73a671524d8c47ce080c4cb47346c921a85d8e73348392022-05-08 1:40:0212 days 8 hrs ago 0x29d475151033466eebc11ec1fdb10960827ab83f 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0xeda18ece5d12893df4fd67a30b73a671524d8c47ce080c4cb47346c921a85d8e73348392022-05-08 1:40:0212 days 8 hrs ago 0x72cc6e4de47f673062c41c67505188144a0a3d84  Contract Creation0 Ether
0x9dbbb7041c52bea2181218454bb00662c5854bb79d4d7ec7dfd0db9ad5ec6ac872961982022-05-07 13:25:1712 days 20 hrs ago 0xaa9c3356be7717d38d6e1621068b8815695988f6 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0x9dbbb7041c52bea2181218454bb00662c5854bb79d4d7ec7dfd0db9ad5ec6ac872961982022-05-07 13:25:1712 days 20 hrs ago 0x72cc6e4de47f673062c41c67505188144a0a3d84  Contract Creation0 Ether
0x82924e45be2f97f300325b07fd980ce107db6b39cbb7ce7c5768cfe84614836972958992022-05-07 13:19:1612 days 20 hrs ago 0xb32c3eafa583abe97b25397f69aff945137eb116 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0x82924e45be2f97f300325b07fd980ce107db6b39cbb7ce7c5768cfe84614836972958992022-05-07 13:19:1612 days 20 hrs ago 0x72cc6e4de47f673062c41c67505188144a0a3d84  Contract Creation0 Ether
0xab5033e71a2c3109133e1c757edfc4e939fe1097c1c05ea7a4027c46c6ed0f6072871262022-05-07 10:18:0412 days 23 hrs ago 0x80dbd572a3a4a09d2bfeec1b3ba5bafd307f1e27 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0xab5033e71a2c3109133e1c757edfc4e939fe1097c1c05ea7a4027c46c6ed0f6072871262022-05-07 10:18:0412 days 23 hrs ago 0x72cc6e4de47f673062c41c67505188144a0a3d84  Contract Creation0 Ether
0x8e5acdc53a06648908785beb206cbe9ae178ebcfa43a2fb71d579e0f088bcb7f72811332022-05-07 8:29:4713 days 1 hr ago 0xac1931b30f306e02d375ff3c025a0325122ee997 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0x8e5acdc53a06648908785beb206cbe9ae178ebcfa43a2fb71d579e0f088bcb7f72811332022-05-07 8:29:4713 days 1 hr ago 0x72cc6e4de47f673062c41c67505188144a0a3d84  Contract Creation0 Ether
0x8e77414779c14f314e1eee09061ad0f8146a4ce0f02eeb36340f2fd3b4f9996d71994532022-05-06 10:11:4513 days 23 hrs ago 0xca807d809f9639cefb3d31a7951cec3ab405a2fd 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0x8e77414779c14f314e1eee09061ad0f8146a4ce0f02eeb36340f2fd3b4f9996d71994532022-05-06 10:11:4513 days 23 hrs ago 0x72cc6e4de47f673062c41c67505188144a0a3d84  Contract Creation0 Ether
0x12bf85fcb04cb17e80ea3498dc40582532955d1a675e52e5e871160d06804e5d70614112022-05-04 16:58:3715 days 17 hrs ago 0xca49ecf7e7bb9bbc9d1d295384663f6ba5c0e366 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0x12bf85fcb04cb17e80ea3498dc40582532955d1a675e52e5e871160d06804e5d70614112022-05-04 16:58:3715 days 17 hrs ago 0xc03481c01f6b8123418b9530e83da3b07baf28b1 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0x277befa089540bd7db05bb0d4809d8988261b91d3444c4b7a2bb58f68517469d70611112022-05-04 16:54:1515 days 17 hrs ago 0xc03481c01f6b8123418b9530e83da3b07baf28b1 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0x277befa089540bd7db05bb0d4809d8988261b91d3444c4b7a2bb58f68517469d70611112022-05-04 16:54:1515 days 17 hrs ago 0x72cc6e4de47f673062c41c67505188144a0a3d84  Contract Creation0 Ether
0x8f984b280b8f8c51669ac3c330d7446877b4e0e10351925d03e435f055d07d7770255322022-05-04 7:32:5116 days 2 hrs ago 0x6e1c818a4d58e2062dfdf3bc8457cd48e5e39604 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
0x8f984b280b8f8c51669ac3c330d7446877b4e0e10351925d03e435f055d07d7770255322022-05-04 7:32:5116 days 2 hrs ago 0x72cc6e4de47f673062c41c67505188144a0a3d84  Contract Creation0 Ether
0x723f0e7c7c8dd31473f98aa90a6d2ee9427ac2ddea2099fac2e16ec0e810094969524052022-05-02 22:33:4717 days 11 hrs ago 0x4c3394b1a52ee6f45d860bfd18cd416d80865d2d 0x72cc6e4de47f673062c41c67505188144a0a3d840 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Factory

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 16 : Factory.sol
/*
██   ██ ██████   █████   ██████      ███████  █████   ██████ ████████  ██████  ██████  ██    ██ 
 ██ ██  ██   ██ ██   ██ ██    ██     ██      ██   ██ ██         ██    ██    ██ ██   ██  ██  ██  
  ███   ██   ██ ███████ ██    ██     █████   ███████ ██         ██    ██    ██ ██████    ████   
 ██ ██  ██   ██ ██   ██ ██    ██     ██      ██   ██ ██         ██    ██    ██ ██   ██    ██    
██   ██ ██████  ██   ██  ██████      ██      ██   ██  ██████    ██     ██████  ██   ██    ██    
*/
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.6;

import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "./Dao.sol";

contract Factory is Ownable {
    using EnumerableSet for EnumerableSet.AddressSet;
    using SafeERC20 for IERC20;

    address public immutable shop;

    address public immutable xdao;

    mapping(address => uint256) public subscriptions;

    uint256 public monthlyCost;

    uint256 public freeTrial;

    function subscribe(address _dao) external returns (bool) {
        require(daos.contains(_dao));

        if (subscriptions[_dao] < block.timestamp) {
            subscriptions[_dao] = block.timestamp + 30 days;
        } else {
            subscriptions[_dao] += 30 days;
        }

        IERC20(xdao).safeTransferFrom(msg.sender, owner(), monthlyCost);

        return true;
    }

    function changeMonthlyCost(uint256 _m) external onlyOwner returns (bool) {
        monthlyCost = _m;

        return true;
    }

    function changeFreeTrial(uint256 _freeTrial)
        external
        onlyOwner
        returns (bool)
    {
        freeTrial = _freeTrial;

        return true;
    }

    event DaoCreated(address indexed dao);

    constructor(address _shop, address _xdao) {
        shop = _shop;
        xdao = _xdao;
    }

    EnumerableSet.AddressSet private daos;

    function create(
        string memory _daoName,
        string memory _daoSymbol,
        uint8 _quorum,
        address[] memory _partners,
        uint256[] memory _shares
    ) external returns (bool) {
        Dao dao = new Dao(_daoName, _daoSymbol, _quorum, _partners, _shares);

        subscriptions[address(dao)] = block.timestamp + freeTrial;

        require(daos.add(address(dao)));

        emit DaoCreated(address(dao));

        return true;
    }

    /*----VIEW FUNCTIONS---------------------------------*/

    function daoAt(uint256 _i) external view returns (address) {
        return daos.at(_i);
    }

    function containsDao(address _dao) external view returns (bool) {
        return daos.contains(_dao);
    }

    function numberOfDaos() external view returns (uint256) {
        return daos.length();
    }

    function getDaos() external view returns (address[] memory) {
        uint256 daosLength = daos.length();

        if (daosLength == 0) {
            return new address[](0);
        } else {
            address[] memory daosArray = new address[](daosLength);

            for (uint256 i = 0; i < daosLength; i++) {
                daosArray[i] = daos.at(i);
            }

            return daosArray;
        }
    }
}

File 2 of 16 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)

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;

            if (lastIndex != toDeleteIndex) {
                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] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // 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) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // 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);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // 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))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // 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));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 3 of 16 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @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() {
        _transferOwnership(_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 {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 4 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

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 5 of 16 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @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'
        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
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 6 of 16 : Dao.sol
/*
██   ██ ██████   █████   ██████      ██████   █████   ██████  
 ██ ██  ██   ██ ██   ██ ██    ██     ██   ██ ██   ██ ██    ██ 
  ███   ██   ██ ███████ ██    ██     ██   ██ ███████ ██    ██ 
 ██ ██  ██   ██ ██   ██ ██    ██     ██   ██ ██   ██ ██    ██ 
██   ██ ██████  ██   ██  ██████      ██████  ██   ██  ██████  
*/
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.6;

import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

import "../interfaces/ILP.sol";
import "../interfaces/IAdapter.sol";
import "../interfaces/IFactory.sol";

contract Dao is ReentrancyGuard, ERC20 {
    using EnumerableSet for EnumerableSet.AddressSet;
    using SafeERC20 for IERC20;
    using Address for address;
    using Address for address payable;
    using ECDSA for bytes32;

    uint32 public constant VOTING_DURATION = 3 days;

    /*----STATE------------------------------------------*/

    // These addresses can rule without voting
    EnumerableSet.AddressSet private permitted;

    // These contracts help burn LP's
    EnumerableSet.AddressSet private adapters;

    // Factory Address
    address public immutable factory;

    // Shop Address
    address public immutable shop;

    // LP Token Address
    address public lp = address(0);

    // Quorum >=1 <=100
    uint8 public quorum;

    // Executed Voting
    struct ExecutedVoting {
        address target;
        bytes data;
        uint256 value;
        uint256 nonce;
        uint256 timestamp;
        uint256 executionTimestamp;
        bytes32 txHash;
        bytes[] sigs;
    }

    ExecutedVoting[] internal executedVoting;

    mapping(bytes32 => bool) public executedTx;

    struct ExecutedPermitted {
        address target;
        bytes data;
        uint256 value;
        uint256 executionTimestamp;
        address executor;
    }

    ExecutedPermitted[] public executedPermitted;

    // GT
    bool public mintable = true;
    bool public burnable = true;

    /*----EVENTS-----------------------------------------*/

    event Executed(
        address indexed target,
        bytes data,
        uint256 value,
        uint256 indexed nonce,
        uint256 timestamp,
        uint256 executionTimestamp,
        bytes32 txHash,
        bytes[] sigs
    );

    event ExecutedP(
        address indexed target,
        bytes data,
        uint256 value,
        address indexed executor
    );

    /*----MODIFIERS--------------------------------------*/

    modifier onlyDao() {
        require(
            msg.sender == address(this),
            "DAO: this function is only for DAO"
        );
        _;
    }

    /*----CONSTRUCTOR------------------------------------*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _quorum,
        address[] memory _partners,
        uint256[] memory _shares
    ) ERC20(_name, _symbol) {
        factory = msg.sender;

        shop = IFactory(msg.sender).shop();

        require(
            _quorum >= 1 && _quorum <= 100,
            "DAO: quorum should be 1 <= q <= 100"
        );

        quorum = _quorum;

        require(
            _partners.length > 0 && _partners.length == _shares.length,
            "DAO: shares distribution is invalid"
        );

        for (uint256 i = 0; i < _partners.length; i++) {
            _mint(_partners[i], _shares[i]);
        }
    }

    /*----MAIN FUNCTIONS TO RULE--------------------------*/

    function executePermitted(
        address _target,
        bytes calldata _data,
        uint256 _value
    ) external nonReentrant returns (bool) {
        require(checkSubscription(), "DAO: subscription not paid");

        require(permitted.contains(msg.sender), "DAO: only for permitted");

        executedPermitted.push(
            ExecutedPermitted({
                target: _target,
                data: _data,
                value: _value,
                executionTimestamp: block.timestamp,
                executor: msg.sender
            })
        );

        emit ExecutedP(_target, _data, _value, msg.sender);

        if (_data.length == 0) {
            payable(_target).sendValue(_value);
        } else {
            if (_value == 0) {
                _target.functionCall(_data);
            } else {
                _target.functionCallWithValue(_data, _value);
            }
        }

        return true;
    }

    function execute(
        address _target,
        bytes calldata _data,
        uint256 _value,
        uint256 _nonce,
        uint256 _timestamp,
        bytes[] memory _sigs
    ) external nonReentrant returns (bool) {
        require(checkSubscription(), "DAO: subscription not paid");

        require(balanceOf(msg.sender) > 0, "DAO: only for members");

        require(
            _timestamp + VOTING_DURATION >= block.timestamp,
            "DAO: voting is over"
        );

        bytes32 txHash = getTxHash(_target, _data, _value, _nonce, _timestamp);

        require(!executedTx[txHash], "DAO: voting already executed");

        require(_checkSigs(_sigs, txHash), "DAO: quorum is not reached");

        executedTx[txHash] = true;

        executedVoting.push(
            ExecutedVoting({
                target: _target,
                data: _data,
                value: _value,
                nonce: _nonce,
                timestamp: _timestamp,
                executionTimestamp: block.timestamp,
                txHash: txHash,
                sigs: _sigs
            })
        );

        emit Executed(
            _target,
            _data,
            _value,
            _nonce,
            _timestamp,
            block.timestamp,
            txHash,
            _sigs
        );

        if (_data.length == 0) {
            payable(_target).sendValue(_value);
        } else {
            if (_value == 0) {
                _target.functionCall(_data);
            } else {
                _target.functionCallWithValue(_data, _value);
            }
        }

        return true;
    }

    function getTxHash(
        address _target,
        bytes calldata _data,
        uint256 _value,
        uint256 _nonce,
        uint256 _timestamp
    ) public view returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    address(this),
                    _target,
                    _data,
                    _value,
                    _nonce,
                    _timestamp,
                    block.chainid
                )
            );
    }

    function _checkSigs(bytes[] memory _sigs, bytes32 _txHash)
        internal
        view
        returns (bool)
    {
        bytes32 ethSignedHash = _txHash.toEthSignedMessageHash();

        uint256 share = 0;

        address[] memory signers = new address[](_sigs.length);

        for (uint256 i = 0; i < _sigs.length; i++) {
            address signer = ethSignedHash.recover(_sigs[i]);

            signers[i] = signer;
        }

        require(!_hasDuplicate(signers), "DAO: signatures are not unique");

        for (uint256 i = 0; i < signers.length; i++) {
            share += balanceOf(signers[i]);
        }

        if (share * 100 < totalSupply() * quorum) {
            return false;
        }

        return true;
    }

    function checkSubscription() public view returns (bool) {
        if (
            IFactory(factory).monthlyCost() > 0 &&
            IFactory(factory).subscriptions(address(this)) < block.timestamp
        ) {
            return false;
        }

        return true;
    }

    /*----BURN LP TOKENS---------------------------------*/

    function burnLp(
        address _recipient,
        uint256 _share,
        address[] memory _tokens,
        address[] memory _adapters,
        address[] memory _pools
    ) external nonReentrant returns (bool) {
        require(lp != address(0), "DAO: LP not set yet");

        require(msg.sender == lp, "DAO: only for LP");

        require(
            !_hasDuplicate(_tokens),
            "DAO: duplicates are prohibited (tokens)"
        );

        for (uint256 i = 0; i < _tokens.length; i++) {
            require(
                _tokens[i] != lp && _tokens[i] != address(this),
                "DAO: LP and GT cannot be part of a share"
            );
        }

        require(_adapters.length == _pools.length, "DAO: adapters error");

        if (_adapters.length > 0) {
            uint256 length = _adapters.length;

            if (length > 1) {
                for (uint256 i = 0; i < length - 1; i++) {
                    for (uint256 j = i + 1; j < length; j++) {
                        require(
                            !(_adapters[i] == _adapters[j] &&
                                _pools[i] == _pools[j]),
                            "DAO: duplicates are prohibited (adapters)"
                        );
                    }
                }
            }
        }

        // ETH

        payable(_recipient).sendValue((address(this).balance * _share) / 1e18);

        // Tokens

        if (_tokens.length > 0) {
            uint256[] memory _tokenShares = new uint256[](_tokens.length);

            for (uint256 i = 0; i < _tokens.length; i++) {
                _tokenShares[i] = ((IERC20(_tokens[i]).balanceOf(
                    address(this)
                ) * _share) / 1e18);
            }

            for (uint256 i = 0; i < _tokens.length; i++) {
                IERC20(_tokens[i]).safeTransfer(_recipient, _tokenShares[i]);
            }
        }

        // Adapters

        if (_adapters.length > 0) {
            uint256 length = _adapters.length;

            for (uint256 i = 0; i < length; i++) {
                require(
                    adapters.contains(_adapters[i]),
                    "DAO: this is not an adapter"
                );

                require(
                    permitted.contains(_adapters[i]),
                    "DAO: this adapter is not permitted"
                );

                bool b = IAdapter(_adapters[i]).withdraw(
                    _recipient,
                    _pools[i],
                    _share
                );

                require(b, "DAO: withdrawal error");
            }
        }

        return true;
    }

    /*----GT MANAGEMENT----------------------------------*/

    function mint(address _to, uint256 _amount)
        external
        onlyDao
        returns (bool)
    {
        require(mintable, "DAO: GT minting is disabled");
        _mint(_to, _amount);
        return true;
    }

    function burn(address _to, uint256 _amount)
        external
        onlyDao
        returns (bool)
    {
        require(burnable, "DAO: GT burning is disabled");
        _burn(_to, _amount);
        return true;
    }

    function move(
        address _sender,
        address _recipient,
        uint256 _amount
    ) external onlyDao returns (bool) {
        _transfer(_sender, _recipient, _amount);
        return true;
    }

    function disableMinting() external onlyDao returns (bool) {
        mintable = false;
        return true;
    }

    function disableBurning() external onlyDao returns (bool) {
        burnable = false;
        return true;
    }

    /*----ADAPTERS & PERMITTED---------------------------*/

    function addAdapter(address a) external onlyDao returns (bool) {
        require(adapters.add(a), "DAO: already an adapter");

        permitted.add(a);

        return true;
    }

    function removeAdapter(address a) external onlyDao returns (bool) {
        require(adapters.remove(a), "DAO: not an adapter");

        permitted.remove(a);

        return true;
    }

    function addPermitted(address p) external onlyDao returns (bool) {
        require(permitted.add(p), "DAO: already permitted");

        return true;
    }

    function removePermitted(address p) external onlyDao returns (bool) {
        require(permitted.remove(p), "DAO: not a permitted");

        return true;
    }

    /*----LP---------------------------------------------*/

    function setLp(address _lp) external returns (bool) {
        require(lp == address(0), "DAO: LP address has already been set");

        require(msg.sender == shop, "DAO: only Shop can set LP");

        lp = _lp;

        return true;
    }

    /*----QUORUM-----------------------------------------*/

    function changeQuorum(uint8 _q) external onlyDao returns (bool) {
        require(_q >= 1 && _q <= 100, "DAO: quorum should be 1 <= q <= 100");

        quorum = _q;

        return true;
    }

    /*----VIEW FUNCTIONS---------------------------------*/

    function executedVotingByIndex(uint256 _index)
        external
        view
        returns (ExecutedVoting memory)
    {
        return executedVoting[_index];
    }

    function getExecutedVoting()
        external
        view
        returns (ExecutedVoting[] memory)
    {
        return executedVoting;
    }

    function getExecutedPermitted()
        external
        view
        returns (ExecutedPermitted[] memory)
    {
        return executedPermitted;
    }

    function numberOfAdapters() external view returns (uint256) {
        return adapters.length();
    }

    function containsAdapter(address a) external view returns (bool) {
        return adapters.contains(a);
    }

    function getAdapters() external view returns (address[] memory) {
        uint256 adaptersLength = adapters.length();

        if (adaptersLength == 0) {
            return new address[](0);
        } else {
            address[] memory adaptersArray = new address[](adaptersLength);

            for (uint256 i = 0; i < adaptersLength; i++) {
                adaptersArray[i] = adapters.at(i);
            }

            return adaptersArray;
        }
    }

    function numberOfPermitted() external view returns (uint256) {
        return permitted.length();
    }

    function containsPermitted(address p) external view returns (bool) {
        return permitted.contains(p);
    }

    function getPermitted() external view returns (address[] memory) {
        uint256 permittedLength = permitted.length();

        if (permittedLength == 0) {
            return new address[](0);
        } else {
            address[] memory permittedArray = new address[](permittedLength);

            for (uint256 i = 0; i < permittedLength; i++) {
                permittedArray[i] = permitted.at(i);
            }

            return permittedArray;
        }
    }

    /*----PURE FUNCTIONS---------------------------------*/

    function _hasDuplicate(address[] memory A) internal pure returns (bool) {
        if (A.length <= 1) {
            return false;
        } else {
            for (uint256 i = 0; i < A.length - 1; i++) {
                address current = A[i];
                for (uint256 j = i + 1; j < A.length; j++) {
                    if (current == A[j]) {
                        return true;
                    }
                }
            }
        }

        return false;
    }

    function transfer(address, uint256) public pure override returns (bool) {
        revert("GT: transfer is prohibited");
    }

    function transferFrom(
        address,
        address,
        uint256
    ) public pure override returns (bool) {
        revert("GT: transferFrom is prohibited");
    }

    /*----RECEIVE ETH------------------------------------*/

    event Received(address indexed, uint256);

    receive() external payable {
        emit Received(msg.sender, msg.value);
    }
}

File 7 of 16 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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) {
        return msg.data;
    }
}

File 8 of 16 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

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;
        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");

        (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");

        (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");

        (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");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 9 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 10 of 16 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 11 of 16 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 12 of 16 : ILP.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;

interface ILP {
    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function burn(address _to, uint256 _amount) external returns (bool);

    function mint(address _to, uint256 _amount) external returns (bool);

    function mintable() external view returns (bool);

    function burnable() external view returns (bool);

    function mintableStatusFrozen() external view returns (bool);

    function burnableStatusFrozen() external view returns (bool);
}

File 13 of 16 : IAdapter.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;

interface IAdapter {
    function withdraw(
        address _recipient,
        address _pool,
        uint256 _share // multiplied by 1e18, for example 20% = 2e17
    ) external returns (bool);
}

File 14 of 16 : IFactory.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;

interface IFactory {
    function getDaos() external view returns (address[] memory);

    function shop() external view returns (address);

    function monthlyCost() external view returns (uint256);

    function subscriptions(address _dao) external view returns (uint256);

    function containsDao(address _dao) external view returns (bool);
}

File 15 of 16 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 16 of 16 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_shop","type":"address"},{"internalType":"address","name":"_xdao","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"dao","type":"address"}],"name":"DaoCreated","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"},{"inputs":[{"internalType":"uint256","name":"_freeTrial","type":"uint256"}],"name":"changeFreeTrial","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_m","type":"uint256"}],"name":"changeMonthlyCost","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_dao","type":"address"}],"name":"containsDao","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_daoName","type":"string"},{"internalType":"string","name":"_daoSymbol","type":"string"},{"internalType":"uint8","name":"_quorum","type":"uint8"},{"internalType":"address[]","name":"_partners","type":"address[]"},{"internalType":"uint256[]","name":"_shares","type":"uint256[]"}],"name":"create","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_i","type":"uint256"}],"name":"daoAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freeTrial","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDaos","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"monthlyCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberOfDaos","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shop","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_dao","type":"address"}],"name":"subscribe","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"subscriptions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xdao","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60c060405234801561001057600080fd5b506040516200604238038062006042833981016040819052610031916100c4565b61003a33610058565b6001600160601b0319606092831b8116608052911b1660a0526100f7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100bf57600080fd5b919050565b600080604083850312156100d757600080fd5b6100e0836100a8565b91506100ee602084016100a8565b90509250929050565b60805160601c60a05160601c615f186200012a600039600081816101f40152610393015260006101200152615f186000f3fe60806040523480156200001157600080fd5b5060043610620001155760003560e01c8063862bb2bd11620000a3578063b2dabed4116200006e578063b2dabed41462000258578063df4f1410146200026f578063f046395a1462000286578063f2fde38b14620002a957600080fd5b8063862bb2bd14620001ee5780638da5cb5b146200021657806396d054e51462000228578063a1d36ce7146200023f57600080fd5b806355a569d711620000e457806355a569d714620001b75780635bb4d1a114620001ce5780636d61d1f514620001d8578063715018a614620001e257600080fd5b80630881fa0d146200011a57806324f2ff16146200015f57806341a7726a14620001785780634349de9014620001a0575b600080fd5b620001427f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b62000169620002c0565b60405190815260200162000156565b6200018f6200018936600462000c55565b620002d3565b604051901515815260200162000156565b6200018f620001b136600462000d6d565b620003c4565b6200018f620001c836600462000c97565b62000409565b6200016960035481565b6200016960025481565b620001ec620004d0565b005b620001427f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031662000142565b6200018f6200023936600462000c55565b6200050b565b6200024962000520565b60405162000156919062000e19565b620001426200026936600462000d6d565b620005f9565b6200018f6200028036600462000d6d565b62000608565b620001696200029736600462000c55565b60016020526000908152604090205481565b620001ec620002ba36600462000c55565b6200063f565b6000620002ce6004620006e1565b905090565b6000620002e2600483620006ec565b620002ec57600080fd5b6001600160a01b0382166000908152600160205260409020544211156200033b576200031c4262278d0062000f63565b6001600160a01b0383166000908152600160205260409020556200036e565b6001600160a01b0382166000908152600160205260408120805462278d0092906200036890849062000f63565b90915550505b620003bc33620003866000546001600160a01b031690565b6002546001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692919062000711565b506001919050565b600080546001600160a01b03163314620003fb5760405162461bcd60e51b8152600401620003f29062000ed3565b60405180910390fd5b50600381905560015b919050565b60008086868686866040516200041f9062000ace565b6200042f95949392919062000e43565b604051809103906000f0801580156200044c573d6000803e3d6000fd5b509050600354426200045f919062000f63565b6001600160a01b0382166000908152600160205260409020556200048560048262000773565b6200048f57600080fd5b6040516001600160a01b038216907f87fc1796dbc913ab997ce574688bcad88f5eb317373be9ec71de2bde33e5c83090600090a25060019695505050505050565b6000546001600160a01b03163314620004fd5760405162461bcd60e51b8152600401620003f29062000ed3565b6200050960006200078a565b565b60006200051a600483620006ec565b92915050565b60606000620005306004620006e1565b9050806200054c57505060408051600081526020810190915290565b60008167ffffffffffffffff8111156200056a576200056a62000ff7565b60405190808252806020026020018201604052801562000594578160200160208202803683370190505b50905060005b82811015620005f257620005b0600482620007da565b828281518110620005c557620005c562000fe1565b6001600160a01b039092166020928302919091019091015280620005e98162000fad565b9150506200059a565b5092915050565b60006200051a600483620007da565b600080546001600160a01b03163314620006365760405162461bcd60e51b8152600401620003f29062000ed3565b50600255600190565b6000546001600160a01b031633146200066c5760405162461bcd60e51b8152600401620003f29062000ed3565b6001600160a01b038116620006d35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620003f2565b620006de816200078a565b50565b60006200051a825490565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526200076d908590620007e8565b50505050565b60006200070a836001600160a01b038416620008c6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006200070a838362000918565b60006200083f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620009459092919063ffffffff16565b805190915015620008c1578080602001905181019062000860919062000c73565b620008c15760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401620003f2565b505050565b60008181526001830160205260408120546200090f575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200051a565b5060006200051a565b600082600001828154811062000932576200093262000fe1565b9060005260206000200154905092915050565b60606200095684846000856200095e565b949350505050565b606082471015620009c15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401620003f2565b843b62000a115760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620003f2565b600080866001600160a01b0316858760405162000a2f919062000dfb565b60006040518083038185875af1925050503d806000811462000a6e576040519150601f19603f3d011682016040523d82523d6000602084013e62000a73565b606091505b509150915062000a8582828662000a90565b979650505050505050565b6060831562000aa15750816200070a565b82511562000ab25782518084602001fd5b8160405162461bcd60e51b8152600401620003f2919062000e2e565b614ed5806200100e83390190565b80356001600160a01b03811681146200040457600080fd5b600082601f83011262000b0657600080fd5b8135602062000b1f62000b198362000f3c565b62000f08565b80838252828201915082860187848660051b890101111562000b4057600080fd5b60005b8581101562000b6a5762000b578262000adc565b8452928401929084019060010162000b43565b5090979650505050505050565b600082601f83011262000b8957600080fd5b8135602062000b9c62000b198362000f3c565b80838252828201915082860187848660051b890101111562000bbd57600080fd5b60005b8581101562000b6a5781358452928401929084019060010162000bc0565b600082601f83011262000bf057600080fd5b813567ffffffffffffffff81111562000c0d5762000c0d62000ff7565b62000c22601f8201601f191660200162000f08565b81815284602083860101111562000c3857600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121562000c6857600080fd5b6200070a8262000adc565b60006020828403121562000c8657600080fd5b815180151581146200070a57600080fd5b600080600080600060a0868803121562000cb057600080fd5b853567ffffffffffffffff8082111562000cc957600080fd5b62000cd789838a0162000bde565b9650602088013591508082111562000cee57600080fd5b62000cfc89838a0162000bde565b95506040880135915060ff8216821462000d1557600080fd5b9093506060870135908082111562000d2c57600080fd5b62000d3a89838a0162000af4565b9350608088013591508082111562000d5157600080fd5b5062000d608882890162000b77565b9150509295509295909350565b60006020828403121562000d8057600080fd5b5035919050565b600081518084526020808501945080840160005b8381101562000dc25781516001600160a01b03168752958201959082019060010162000d9b565b509495945050505050565b6000815180845262000de781602086016020860162000f7e565b601f01601f19169290920160200192915050565b6000825162000e0f81846020870162000f7e565b9190910192915050565b6020815260006200070a602083018462000d87565b6020815260006200070a602083018462000dcd565b60a08152600062000e5860a083018862000dcd565b60208382038185015262000e6d828962000dcd565b915060ff87166040850152838203606085015262000e8c828762000d87565b8481036080860152855180825282870193509082019060005b8181101562000ec35784518352938301939183019160010162000ea5565b50909a9950505050505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b604051601f8201601f1916810167ffffffffffffffff8111828210171562000f345762000f3462000ff7565b604052919050565b600067ffffffffffffffff82111562000f595762000f5962000ff7565b5060051b60200190565b6000821982111562000f795762000f7962000fcb565b500190565b60005b8381101562000f9b57818101518382015260200162000f81565b838111156200076d5750506000910152565b600060001982141562000fc45762000fc462000fcb565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe60c0604052600a80546001600160a01b0319169055600e805461ffff19166101011790553480156200003057600080fd5b5060405162004ed538038062004ed58339810160408190526200005391620005d4565b6001600055845185908590620000719060049060208501906200036d565b508051620000879060059060208401906200036d565b50505033606081901b60805260408051630881fa0d60e01b81529051630881fa0d91600480820192602092909190829003018186803b158015620000ca57600080fd5b505afa158015620000df573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001059190620005af565b60601b6001600160601b03191660a052600160ff8416108015906200012e575060648360ff1611155b6200018c5760405162461bcd60e51b815260206004820152602360248201527f44414f3a2071756f72756d2073686f756c642062652031203c3d2071203c3d2060448201526203130360ec1b60648201526084015b60405180910390fd5b600a805460ff60a01b1916600160a01b60ff861602179055815115801590620001b6575080518251145b620002105760405162461bcd60e51b815260206004820152602360248201527f44414f3a2073686172657320646973747269627574696f6e20697320696e76616044820152621b1a5960ea1b606482015260840162000183565b60005b82518110156200027c57620002678382815181106200023657620002366200078d565b60200260200101518383815181106200025357620002536200078d565b60200260200101516200028860201b60201c565b80620002738162000759565b91505062000213565b505050505050620007b9565b6001600160a01b038216620002e05760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640162000183565b8060036000828254620002f4919062000701565b90915550506001600160a01b038216600090815260016020526040812080548392906200032390849062000701565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b8280546200037b906200071c565b90600052602060002090601f0160209004810192826200039f5760008555620003ea565b82601f10620003ba57805160ff1916838001178555620003ea565b82800160010185558215620003ea579182015b82811115620003ea578251825591602001919060010190620003cd565b50620003f8929150620003fc565b5090565b5b80821115620003f85760008155600101620003fd565b80516001600160a01b03811681146200042b57600080fd5b919050565b600082601f8301126200044257600080fd5b815160206200045b6200045583620006db565b620006a8565b80838252828201915082860187848660051b89010111156200047c57600080fd5b60005b85811015620004a657620004938262000413565b845292840192908401906001016200047f565b5090979650505050505050565b600082601f830112620004c557600080fd5b81516020620004d86200045583620006db565b80838252828201915082860187848660051b8901011115620004f957600080fd5b60005b85811015620004a657815184529284019290840190600101620004fc565b600082601f8301126200052c57600080fd5b81516001600160401b03811115620005485762000548620007a3565b60206200055e601f8301601f19168201620006a8565b82815285828487010111156200057357600080fd5b60005b838110156200059357858101830151828201840152820162000576565b83811115620005a55760008385840101525b5095945050505050565b600060208284031215620005c257600080fd5b620005cd8262000413565b9392505050565b600080600080600060a08688031215620005ed57600080fd5b85516001600160401b03808211156200060557600080fd5b6200061389838a016200051a565b965060208801519150808211156200062a57600080fd5b6200063889838a016200051a565b95506040880151915060ff821682146200065157600080fd5b6060880151919450808211156200066757600080fd5b6200067589838a0162000430565b935060808801519150808211156200068c57600080fd5b506200069b88828901620004b3565b9150509295509295909350565b604051601f8201601f191681016001600160401b0381118282101715620006d357620006d3620007a3565b604052919050565b60006001600160401b03821115620006f757620006f7620007a3565b5060051b60200190565b6000821982111562000717576200071762000777565b500190565b600181811c908216806200073157607f821691505b602082108114156200075357634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141562000770576200077062000777565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60805160601c60a05160601c6146db620007fa6000396000818161032001526120830152600081816107c4015281816112d7015261138501526146db6000f3fe6080604052600436106102765760003560e01c806360d54d411161014f578063a457c2d7116100c1578063cdb2c0421161007a578063cdb2c042146107e6578063d1e3002514610816578063d293aba414610836578063dd62ed3e14610856578063f4c2baa91461089c578063fba4e62e146108bc57600080fd5b8063a457c2d71461071d578063a9059cbb1461073d578063aafd338b1461075d578063b82e16e31461077d578063bb35783b14610792578063c45a0155146107b257600080fd5b806393435d501161011357806393435d501461066857806395d89b411461068857806398603cca1461069d5780639dc29fac146106b2578063a07c7ce4146106d2578063a438d208146106f157600080fd5b806360d54d41146105c65780636e2e9c18146105e657806370a08231146105fb57806372376b8d146106315780637e5cd5c11461065357600080fd5b8063313c06a0116101e857806340c10f19116101ac57806340c10f19146105205780634a1d18ce146105405780634bf365df146105625780634faa2e7b1461057c57806356d6b2d014610591578063585cd34b146105a657600080fd5b8063313c06a01461048c578063313ce567146104ac5780633372358f146104c057806339509351146104e05780633d4581831461050057600080fd5b806314197ed01161023a57806314197ed01461039a5780631703a018146103c757806318160ddd146103fa5780631854063d1461041957806323b872dd1461043b578063251664d41461045b57600080fd5b806305cf79b9146102b757806306fdde03146102ec5780630881fa0d1461030e578063095ea7b31461035a5780630c9562441461037a57600080fd5b366102b25760405134815233907f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258749060200160405180910390a2005b600080fd5b3480156102c357600080fd5b506102d76102d2366004614069565b6108dc565b60405190151581526020015b60405180910390f35b3480156102f857600080fd5b50610301610997565b6040516102e3919061442a565b34801561031a57600080fd5b506103427f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102e3565b34801561036657600080fd5b506102d7610375366004613f49565b610a29565b34801561038657600080fd5b506102d7610395366004613c77565b610a40565b3480156103a657600080fd5b506103ba6103b5366004614037565b610a4d565b6040516102e391906144b6565b3480156103d357600080fd5b50600a546103e890600160a01b900460ff1681565b60405160ff90911681526020016102e3565b34801561040657600080fd5b506003545b6040519081526020016102e3565b34801561042557600080fd5b5061042e610c88565b6040516102e39190614264565b34801561044757600080fd5b506102d7610456366004613cc5565b610d73565b34801561046757600080fd5b5061047b610476366004614037565b610dbe565b6040516102e3959493929190614223565b34801561049857600080fd5b50600a54610342906001600160a01b031681565b3480156104b857600080fd5b5060126103e8565b3480156104cc57600080fd5b5061040b6104db366004613d5a565b610e9d565b3480156104ec57600080fd5b506102d76104fb366004613f49565b610ee0565b34801561050c57600080fd5b506102d761051b366004613c77565b610f1c565b34801561052c57600080fd5b506102d761053b366004613f49565b610f29565b34801561054c57600080fd5b50610555610fa6565b6040516102e39190614358565b34801561056e57600080fd5b50600e546102d79060ff1681565b34801561058857600080fd5b5061040b6111b9565b34801561059d57600080fd5b5061040b6111ca565b3480156105b257600080fd5b506102d76105c1366004613c77565b6111d6565b3480156105d257600080fd5b506102d76105e1366004613c77565b61124f565b3480156105f257600080fd5b506102d76112d2565b34801561060757600080fd5b5061040b610616366004613c77565b6001600160a01b031660009081526001602052604090205490565b34801561063d57600080fd5b5061064661141a565b6040516102e391906142b1565b34801561065f57600080fd5b506102d7611545565b34801561067457600080fd5b506102d7610683366004613c77565b611576565b34801561069457600080fd5b506103016115ed565b3480156106a957600080fd5b506102d76115fc565b3480156106be57600080fd5b506102d76106cd366004613f49565b61162e565b3480156106de57600080fd5b50600e546102d790610100900460ff1681565b3480156106fd57600080fd5b506107086203f48081565b60405163ffffffff90911681526020016102e3565b34801561072957600080fd5b506102d7610738366004613f49565b6116b0565b34801561074957600080fd5b506102d7610758366004613f49565b611749565b34801561076957600080fd5b506102d7610778366004613c77565b611794565b34801561078957600080fd5b5061042e611805565b34801561079e57600080fd5b506102d76107ad366004613cc5565b6118b9565b3480156107be57600080fd5b506103427f000000000000000000000000000000000000000000000000000000000000000081565b3480156107f257600080fd5b506102d7610801366004614037565b600c6020526000908152604090205460ff1681565b34801561082257600080fd5b506102d7610831366004613dc6565b6118ec565b34801561084257600080fd5b506102d7610851366004613d01565b611d35565b34801561086257600080fd5b5061040b610871366004613c92565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b3480156108a857600080fd5b506102d76108b7366004613c77565b612010565b3480156108c857600080fd5b506102d76108d7366004613f73565b612116565b60003330146109065760405162461bcd60e51b81526004016108fd9061443d565b60405180910390fd5b60018260ff161015801561091e575060648260ff1611155b6109765760405162461bcd60e51b815260206004820152602360248201527f44414f3a2071756f72756d2073686f756c642062652031203c3d2071203c3d2060448201526203130360ec1b60648201526084016108fd565b50600a805460ff60a01b1916600160a01b60ff84160217905560015b919050565b6060600480546109a6906145b8565b80601f01602080910402602001604051908101604052809291908181526020018280546109d2906145b8565b8015610a1f5780601f106109f457610100808354040283529160200191610a1f565b820191906000526020600020905b815481529060010190602001808311610a0257829003601f168201915b5050505050905090565b6000610a363384846128f9565b5060015b92915050565b6000610a3a600683612a1e565b610aa160405180610100016040528060006001600160a01b03168152602001606081526020016000815260200160008152602001600081526020016000815260200160008019168152602001606081525090565b600b8281548110610ab457610ab4614650565b600091825260209182902060408051610100810190915260089092020180546001600160a01b031682526001810180549293919291840191610af5906145b8565b80601f0160208091040260200160405190810160405280929190818152602001828054610b21906145b8565b8015610b6e5780601f10610b4357610100808354040283529160200191610b6e565b820191906000526020600020905b815481529060010190602001808311610b5157829003601f168201915b50505050508152602001600282015481526020016003820154815260200160048201548152602001600582015481526020016006820154815260200160078201805480602002602001604051908101604052809291908181526020016000905b82821015610c7a578382906000526020600020018054610bed906145b8565b80601f0160208091040260200160405190810160405280929190818152602001828054610c19906145b8565b8015610c665780601f10610c3b57610100808354040283529160200191610c66565b820191906000526020600020905b815481529060010190602001808311610c4957829003601f168201915b505050505081526020019060010190610bce565b505050915250909392505050565b60606000610c966006612a40565b905080610cd05760005b604051908082528060200260200182016040528015610cc9578160200160208202803683370190505b5091505090565b6000816001600160401b03811115610cea57610cea614666565b604051908082528060200260200182016040528015610d13578160200160208202803683370190505b50905060005b82811015610d6857610d2c600682612a4a565b828281518110610d3e57610d3e614650565b6001600160a01b039092166020928302919091019091015280610d60816145f3565b915050610d19565b5092915050565b5090565b60405162461bcd60e51b815260206004820152601e60248201527f47543a207472616e7366657246726f6d2069732070726f68696269746564000060448201526000906064016108fd565b600d8181548110610dce57600080fd5b6000918252602090912060059091020180546001820180546001600160a01b03909216935090610dfd906145b8565b80601f0160208091040260200160405190810160405280929190818152602001828054610e29906145b8565b8015610e765780601f10610e4b57610100808354040283529160200191610e76565b820191906000526020600020905b815481529060010190602001808311610e5957829003601f168201915b5050505060028301546003840154600490940154929390929091506001600160a01b031685565b60003087878787878746604051602001610ebe9897969594939291906141cf565b6040516020818303038152906040528051906020012090509695505050505050565b3360008181526002602090815260408083206001600160a01b03871684529091528120549091610a36918590610f1790869061451c565b6128f9565b6000610a3a600883612a1e565b6000333014610f4a5760405162461bcd60e51b81526004016108fd9061443d565b600e5460ff16610f9c5760405162461bcd60e51b815260206004820152601b60248201527f44414f3a204754206d696e74696e672069732064697361626c6564000000000060448201526064016108fd565b610a368383612a56565b6060600b805480602002602001604051908101604052809291908181526020016000905b828210156111b05760008481526020908190206040805161010081019091526008850290910180546001600160a01b031682526001810180549293919291840191611014906145b8565b80601f0160208091040260200160405190810160405280929190818152602001828054611040906145b8565b801561108d5780601f106110625761010080835404028352916020019161108d565b820191906000526020600020905b81548152906001019060200180831161107057829003601f168201915b50505050508152602001600282015481526020016003820154815260200160048201548152602001600582015481526020016006820154815260200160078201805480602002602001604051908101604052809291908181526020016000905b8282101561119957838290600052602060002001805461110c906145b8565b80601f0160208091040260200160405190810160405280929190818152602001828054611138906145b8565b80156111855780601f1061115a57610100808354040283529160200191611185565b820191906000526020600020905b81548152906001019060200180831161116857829003601f168201915b5050505050815260200190600101906110ed565b505050508152505081526020019060010190610fca565b50505050905090565b60006111c56008612a40565b905090565b60006111c56006612a40565b60003330146111f75760405162461bcd60e51b81526004016108fd9061443d565b611202600883612b35565b6112445760405162461bcd60e51b81526020600482015260136024820152722220a79d103737ba1030b71030b230b83a32b960691b60448201526064016108fd565b610a36600683612b35565b60003330146112705760405162461bcd60e51b81526004016108fd9061443d565b61127b600883612b4a565b6112c75760405162461bcd60e51b815260206004820152601760248201527f44414f3a20616c726561647920616e206164617074657200000000000000000060448201526064016108fd565b610a36600683612b4a565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636d61d1f56040518163ffffffff1660e01b815260040160206040518083038186803b15801561132e57600080fd5b505afa158015611342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113669190614050565b11801561140957506040516378231cad60e11b815230600482015242907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f046395a9060240160206040518083038186803b1580156113cf57600080fd5b505afa1580156113e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114079190614050565b105b156114145750600090565b50600190565b6060600d805480602002602001604051908101604052809291908181526020016000905b828210156111b05760008481526020908190206040805160a081019091526005850290910180546001600160a01b031682526001810180549293919291840191611487906145b8565b80601f01602080910402602001604051908101604052809291908181526020018280546114b3906145b8565b80156115005780601f106114d557610100808354040283529160200191611500565b820191906000526020600020905b8154815290600101906020018083116114e357829003601f168201915b50505091835250506002820154602080830191909152600383015460408301526004909201546001600160a01b0316606090910152908252600192909201910161143e565b60003330146115665760405162461bcd60e51b81526004016108fd9061443d565b50600e805460ff19169055600190565b60003330146115975760405162461bcd60e51b81526004016108fd9061443d565b6115a2600683612b35565b6115e55760405162461bcd60e51b8152602060048201526014602482015273111053ce881b9bdd0818481c195c9b5a5d1d195960621b60448201526064016108fd565b506001919050565b6060600580546109a6906145b8565b600033301461161d5760405162461bcd60e51b81526004016108fd9061443d565b50600e805461ff0019169055600190565b600033301461164f5760405162461bcd60e51b81526004016108fd9061443d565b600e54610100900460ff166116a65760405162461bcd60e51b815260206004820152601b60248201527f44414f3a204754206275726e696e672069732064697361626c6564000000000060448201526064016108fd565b610a368383612b5f565b3360009081526002602090815260408083206001600160a01b0386168452909152812054828110156117325760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016108fd565b61173f33858584036128f9565b5060019392505050565b60405162461bcd60e51b815260206004820152601a60248201527f47543a207472616e736665722069732070726f6869626974656400000000000060448201526000906064016108fd565b60003330146117b55760405162461bcd60e51b81526004016108fd9061443d565b6117c0600683612b4a565b6115e55760405162461bcd60e51b8152602060048201526016602482015275111053ce88185b1c9958591e481c195c9b5a5d1d195960521b60448201526064016108fd565b606060006118136008612a40565b905080611821576000610ca0565b6000816001600160401b0381111561183b5761183b614666565b604051908082528060200260200182016040528015611864578160200160208202803683370190505b50905060005b82811015610d685761187d600882612a4a565b82828151811061188f5761188f614650565b6001600160a01b0390921660209283029190910190910152806118b1816145f3565b91505061186a565b60003330146118da5760405162461bcd60e51b81526004016108fd9061443d565b61173f848484612caa565b9392505050565b6000600260005414156119115760405162461bcd60e51b81526004016108fd9061447f565b600260005561191e6112d2565b61196a5760405162461bcd60e51b815260206004820152601a60248201527f44414f3a20737562736372697074696f6e206e6f74207061696400000000000060448201526064016108fd565b33600090815260016020526040812054116119bf5760405162461bcd60e51b815260206004820152601560248201527444414f3a206f6e6c7920666f72206d656d6265727360581b60448201526064016108fd565b426119cd6203f4808561451c565b1015611a115760405162461bcd60e51b81526020600482015260136024820152722220a79d103b37ba34b7339034b99037bb32b960691b60448201526064016108fd565b6000611a21898989898989610e9d565b6000818152600c602052604090205490915060ff1615611a835760405162461bcd60e51b815260206004820152601c60248201527f44414f3a20766f74696e6720616c72656164792065786563757465640000000060448201526064016108fd565b611a8d8382612e7a565b611ad95760405162461bcd60e51b815260206004820152601a60248201527f44414f3a2071756f72756d206973206e6f74207265616368656400000000000060448201526064016108fd565b6000818152600c6020908152604091829020805460ff191660011790558151610100810183526001600160a01b038c1681528251601f8b01839004830281018301909352898352600b92909182810191908c908c9081908401838280828437600092018290525093855250505060208083018b9052604083018a90526060830189905242608084015260a0830186905260c090920187905283546001808201865594825290829020835160089092020180546001600160a01b0319166001600160a01b0390921691909117815582820151805193949193611bc293928501929190910190613a61565b5060408201516002820155606082015160038201556080820151600482015560a0820151600582015560c0820151600682015560e08201518051611c10916007840191602090910190613ae1565b50505084896001600160a01b03167fbd456668f700390d892b45c86161989dd1c22b58f45c8427d29e45dca046fafc8a8a8a8942888b604051611c5997969594939291906143de565b60405180910390a386611c7e57611c796001600160a01b038a168761309c565b611d20565b85611cd357611ccd88888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506001600160a01b038d16929150506131b5565b50611d20565b611d1e88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050506001600160a01b038c16919050886131f7565b505b60019150506001600055979650505050505050565b600060026000541415611d5a5760405162461bcd60e51b81526004016108fd9061447f565b6002600055611d676112d2565b611db35760405162461bcd60e51b815260206004820152601a60248201527f44414f3a20737562736372697074696f6e206e6f74207061696400000000000060448201526064016108fd565b611dbe600633612a1e565b611e0a5760405162461bcd60e51b815260206004820152601760248201527f44414f3a206f6e6c7920666f72207065726d697474656400000000000000000060448201526064016108fd565b600d6040518060a00160405280876001600160a01b0316815260200186868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525093855250505060208083018790524260408401523360609093019290925283546001808201865594825290829020835160059092020180546001600160a01b0319166001600160a01b0390921691909117815582820151805193949193611ec793928501929190910190613a61565b50604082810151600283015560608301516003830155608090920151600490910180546001600160a01b0319166001600160a01b03928316179055905133918716907f2fcf7d8fdbdd29355c4dd2538a3202ab25781f676add9a36bcfe961319efbaa790611f3a908890889088906143ba565b60405180910390a382611f5f57611f5a6001600160a01b0386168361309c565b612001565b81611fb457611fae84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506001600160a01b038916929150506131b5565b50612001565b611fff84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050506001600160a01b038816919050846131f7565b505b50600180600055949350505050565b600a546000906001600160a01b0316156120785760405162461bcd60e51b8152602060048201526024808201527f44414f3a204c5020616464726573732068617320616c7265616479206265656e604482015263081cd95d60e21b60648201526084016108fd565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146120f05760405162461bcd60e51b815260206004820152601960248201527f44414f3a206f6e6c792053686f702063616e20736574204c500000000000000060448201526064016108fd565b50600a80546001600160a01b0319166001600160a01b0392909216919091179055600190565b60006002600054141561213b5760405162461bcd60e51b81526004016108fd9061447f565b6002600055600a546001600160a01b031661218e5760405162461bcd60e51b8152602060048201526013602482015272111053ce881314081b9bdd081cd95d081e595d606a1b60448201526064016108fd565b600a546001600160a01b031633146121db5760405162461bcd60e51b815260206004820152601060248201526f044414f3a206f6e6c7920666f72204c560841b60448201526064016108fd565b6121e484613225565b156122415760405162461bcd60e51b815260206004820152602760248201527f44414f3a206475706c696361746573206172652070726f686962697465642028604482015266746f6b656e732960c81b60648201526084016108fd565b60005b845181101561232957600a5485516001600160a01b039091169086908390811061227057612270614650565b60200260200101516001600160a01b0316141580156122ba5750306001600160a01b03168582815181106122a6576122a6614650565b60200260200101516001600160a01b031614155b6123175760405162461bcd60e51b815260206004820152602860248201527f44414f3a204c5020616e642047542063616e6e6f742062652070617274206f66604482015267206120736861726560c01b60648201526084016108fd565b80612321816145f3565b915050612244565b5081518351146123715760405162461bcd60e51b81526020600482015260136024820152722220a79d1030b230b83a32b9399032b93937b960691b60448201526064016108fd565b8251156124ce57825160018111156124cc5760005b612391600183614575565b8110156124ca5760006123a582600161451c565b90505b828110156124b7578581815181106123c2576123c2614650565b60200260200101516001600160a01b03168683815181106123e5576123e5614650565b60200260200101516001600160a01b0316148015612446575084818151811061241057612410614650565b60200260200101516001600160a01b031685838151811061243357612433614650565b60200260200101516001600160a01b0316145b156124a55760405162461bcd60e51b815260206004820152602960248201527f44414f3a206475706c696361746573206172652070726f68696269746564202860448201526861646170746572732960b81b60648201526084016108fd565b806124af816145f3565b9150506123a8565b50806124c2816145f3565b915050612386565b505b505b6124fe670de0b6b3a76400006124e48747614556565b6124ee9190614534565b6001600160a01b0388169061309c565b8351156126ac57600084516001600160401b0381111561252057612520614666565b604051908082528060200260200182016040528015612549578160200160208202803683370190505b50905060005b855181101561263a57670de0b6b3a76400008787838151811061257457612574614650565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b1580156125bf57600080fd5b505afa1580156125d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125f79190614050565b6126019190614556565b61260b9190614534565b82828151811061261d5761261d614650565b602090810291909101015280612632816145f3565b91505061254f565b5060005b85518110156126a9576126978883838151811061265d5761265d614650565b602002602001015188848151811061267757612677614650565b60200260200101516001600160a01b03166132f79092919063ffffffff16565b806126a1816145f3565b91505061263e565b50505b8251156128e957825160005b818110156128e6576126ed8582815181106126d5576126d5614650565b60200260200101516008612a1e90919063ffffffff16565b6127395760405162461bcd60e51b815260206004820152601b60248201527f44414f3a2074686973206973206e6f7420616e2061646170746572000000000060448201526064016108fd565b61276685828151811061274e5761274e614650565b60200260200101516006612a1e90919063ffffffff16565b6127bd5760405162461bcd60e51b815260206004820152602260248201527f44414f3a20746869732061646170746572206973206e6f74207065726d697474604482015261195960f21b60648201526084016108fd565b60008582815181106127d1576127d1614650565b60200260200101516001600160a01b031663d9caed128a8785815181106127fa576127fa614650565b60209081029190910101516040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604481018b9052606401602060405180830381600087803b15801561285457600080fd5b505af1158015612868573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061288c9190614015565b9050806128d35760405162461bcd60e51b81526020600482015260156024820152742220a79d103bb4ba34323930bbb0b61032b93937b960591b60448201526064016108fd565b50806128de816145f3565b9150506126b8565b50505b5060018060005595945050505050565b6001600160a01b03831661295b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108fd565b6001600160a01b0382166129bc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108fd565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038116600090815260018301602052604081205415156118e5565b6000610a3a825490565b60006118e58383613349565b6001600160a01b038216612aac5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016108fd565b8060036000828254612abe919061451c565b90915550506001600160a01b03821660009081526001602052604081208054839290612aeb90849061451c565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b60006118e5836001600160a01b038416613373565b60006118e5836001600160a01b038416613466565b6001600160a01b038216612bbf5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016108fd565b6001600160a01b03821660009081526001602052604090205481811015612c335760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016108fd565b6001600160a01b0383166000908152600160205260408120838303905560038054849290612c62908490614575565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612a11565b505050565b6001600160a01b038316612d0e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016108fd565b6001600160a01b038216612d705760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016108fd565b6001600160a01b03831660009081526001602052604090205481811015612de85760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016108fd565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290612e1f90849061451c565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612e6b91815260200190565b60405180910390a35b50505050565b600080612ed4836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b905060008085516001600160401b03811115612ef257612ef2614666565b604051908082528060200260200182016040528015612f1b578160200160208202803683370190505b50905060005b8651811015612f98576000612f58888381518110612f4157612f41614650565b6020026020010151866134b590919063ffffffff16565b905080838381518110612f6d57612f6d614650565b6001600160a01b03909216602092830291909101909101525080612f90816145f3565b915050612f21565b50612fa281613225565b15612fef5760405162461bcd60e51b815260206004820152601e60248201527f44414f3a207369676e61747572657320617265206e6f7420756e69717565000060448201526064016108fd565b60005b81518110156130515761303382828151811061301057613010614650565b60200260200101516001600160a01b031660009081526001602052604090205490565b61303d908461451c565b925080613049816145f3565b915050612ff2565b50600a5460ff600160a01b9091041661306960035490565b6130739190614556565b61307e836064614556565b10156130905760009350505050610a3a565b50600195945050505050565b804710156130ec5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016108fd565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613139576040519150601f19603f3d011682016040523d82523d6000602084013e61313e565b606091505b5050905080612ca55760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016108fd565b60606118e583836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c656400008152506134d9565b606061321d84848460405180606001604052806029815260200161467d602991396134e4565b949350505050565b6000600182511161323857506000919050565b60005b600183516132499190614575565b8110156132ee57600083828151811061326457613264614650565b60200260200101519050600082600161327d919061451c565b90505b84518110156132d95784818151811061329b5761329b614650565b60200260200101516001600160a01b0316826001600160a01b031614156132c757506001949350505050565b806132d1816145f3565b915050613280565b505080806132e6906145f3565b91505061323b565b50506000919050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612ca590849061360c565b600082600001828154811061336057613360614650565b9060005260206000200154905092915050565b6000818152600183016020526040812054801561345c576000613397600183614575565b85549091506000906133ab90600190614575565b90508181146134105760008660000182815481106133cb576133cb614650565b90600052602060002001549050808760000184815481106133ee576133ee614650565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806134215761342161463a565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a3a565b6000915050610a3a565b60008181526001830160205260408120546134ad57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a3a565b506000610a3a565b60008060006134c485856136de565b915091506134d18161374e565b509392505050565b606061321d84846000855b6060824710156135455760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016108fd565b843b6135935760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108fd565b600080866001600160a01b031685876040516135af91906141b3565b60006040518083038185875af1925050503d80600081146135ec576040519150601f19603f3d011682016040523d82523d6000602084013e6135f1565b606091505b509150915061360182828661390c565b979650505050505050565b6000613661826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134d99092919063ffffffff16565b805190915015612ca5578080602001905181019061367f9190614015565b612ca55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016108fd565b6000808251604114156137155760208301516040840151606085015160001a61370987828585613945565b94509450505050613747565b82516040141561373f5760208301516040840151613734868383613a32565b935093505050613747565b506000905060025b9250929050565b600081600481111561376257613762614624565b141561376b5750565b600181600481111561377f5761377f614624565b14156137cd5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108fd565b60028160048111156137e1576137e1614624565b141561382f5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108fd565b600381600481111561384357613843614624565b141561389c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108fd565b60048160048111156138b0576138b0614624565b14156139095760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016108fd565b50565b6060831561391b5750816118e5565b82511561392b5782518084602001fd5b8160405162461bcd60e51b81526004016108fd919061442a565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561397c5750600090506003613a29565b8460ff16601b1415801561399457508460ff16601c14155b156139a55750600090506004613a29565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156139f9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613a2257600060019250925050613a29565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01613a5387828885613945565b935093505050935093915050565b828054613a6d906145b8565b90600052602060002090601f016020900481019282613a8f5760008555613ad5565b82601f10613aa857805160ff1916838001178555613ad5565b82800160010185558215613ad5579182015b82811115613ad5578251825591602001919060010190613aba565b50610d6f929150613b3a565b828054828255906000526020600020908101928215613b2e579160200282015b82811115613b2e5782518051613b1e918491602090910190613a61565b5091602001919060010190613b01565b50610d6f929150613b4f565b5b80821115610d6f5760008155600101613b3b565b80821115610d6f576000613b638282613b6c565b50600101613b4f565b508054613b78906145b8565b6000825580601f10613b88575050565b601f0160209004906000526020600020908101906139099190613b3a565b80356001600160a01b038116811461099257600080fd5b600082601f830112613bce57600080fd5b81356020613be3613bde836144f9565b6144c9565b80838252828201915082860187848660051b8901011115613c0357600080fd5b60005b85811015613c2957613c1782613ba6565b84529284019290840190600101613c06565b5090979650505050505050565b60008083601f840112613c4857600080fd5b5081356001600160401b03811115613c5f57600080fd5b60208301915083602082850101111561374757600080fd5b600060208284031215613c8957600080fd5b6118e582613ba6565b60008060408385031215613ca557600080fd5b613cae83613ba6565b9150613cbc60208401613ba6565b90509250929050565b600080600060608486031215613cda57600080fd5b613ce384613ba6565b9250613cf160208501613ba6565b9150604084013590509250925092565b60008060008060608587031215613d1757600080fd5b613d2085613ba6565b935060208501356001600160401b03811115613d3b57600080fd5b613d4787828801613c36565b9598909750949560400135949350505050565b60008060008060008060a08789031215613d7357600080fd5b613d7c87613ba6565b955060208701356001600160401b03811115613d9757600080fd5b613da389828a01613c36565b979a90995096976040810135976060820135975060809091013595509350505050565b600080600080600080600060c0888a031215613de157600080fd5b613dea88613ba6565b96506001600160401b0360208901351115613e0457600080fd5b613e148960208a01358a01613c36565b90965094506040880135935060608801359250608088013591506001600160401b0360a08901351115613e4657600080fd5b60a0880135880189601f820112613e5c57600080fd5b613e69613bde82356144f9565b8082358252602082019150602083018c6020853560051b8601011115613e8e57600080fd5b60005b8435811015613f35576001600160401b0382351115613eaf57600080fd5b8d603f833587010112613ec157600080fd5b60208235860101356001600160401b03811115613ee057613ee0614666565b613ef3601f8201601f19166020016144c9565b8181528f60408386358a0101011115613f0b57600080fd5b81604085358901016020830137600060209282018301528552938401939190910190600101613e91565b505080935050505092959891949750929550565b60008060408385031215613f5c57600080fd5b613f6583613ba6565b946020939093013593505050565b600080600080600060a08688031215613f8b57600080fd5b613f9486613ba6565b94506020860135935060408601356001600160401b0380821115613fb757600080fd5b613fc389838a01613bbd565b94506060880135915080821115613fd957600080fd5b613fe589838a01613bbd565b93506080880135915080821115613ffb57600080fd5b5061400888828901613bbd565b9150509295509295909350565b60006020828403121561402757600080fd5b815180151581146118e557600080fd5b60006020828403121561404957600080fd5b5035919050565b60006020828403121561406257600080fd5b5051919050565b60006020828403121561407b57600080fd5b813560ff811681146118e557600080fd5b600081518084526020808501808196508360051b8101915082860160005b858110156140d45782840389526140c284835161410a565b988501989350908401906001016140aa565b5091979650505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845261412281602086016020860161458c565b601f01601f19169290920160200192915050565b600061010060018060a01b038351168452602083015181602086015261415e8286018261410a565b91505060408301516040850152606083015160608501526080830151608085015260a083015160a085015260c083015160c085015260e083015184820360e08601526141aa828261408c565b95945050505050565b600082516141c581846020870161458c565b9190910192915050565b6001600160a01b0389811682528816602082015260e0604082018190526000906141fc908301888a6140e1565b90508560608301528460808301528360a08301528260c08301529998505050505050505050565b600060018060a01b03808816835260a0602084015261424560a084018861410a565b6040840196909652606083019490945250911660809091015292915050565b6020808252825182820181905260009190848201906040850190845b818110156142a55783516001600160a01b031683529284019291840191600101614280565b50909695505050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561434a57888303603f19018552815180516001600160a01b0390811685528882015160a08a870181905291906143148388018261410a565b848b0151888c015260608086015190890152608094850151909216939096019290925250948701949250908601906001016142d8565b509098975050505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156143ad57603f1988860301845261439b858351614136565b9450928501929085019060010161437f565b5092979650505050505050565b6040815260006143ce6040830185876140e1565b9050826020830152949350505050565b60c0815260006143f260c08301898b6140e1565b87602084015286604084015285606084015284608084015282810360a084015261441c818561408c565b9a9950505050505050505050565b6020815260006118e5602083018461410a565b60208082526022908201527f44414f3a20746869732066756e6374696f6e206973206f6e6c7920666f722044604082015261414f60f01b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020815260006118e56020830184614136565b604051601f8201601f191681016001600160401b03811182821017156144f1576144f1614666565b604052919050565b60006001600160401b0382111561451257614512614666565b5060051b60200190565b6000821982111561452f5761452f61460e565b500190565b60008261455157634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156145705761457061460e565b500290565b6000828210156145875761458761460e565b500390565b60005b838110156145a757818101518382015260200161458f565b83811115612e745750506000910152565b600181811c908216806145cc57607f821691505b602082108114156145ed57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156146075761460761460e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a26469706673582212203b37782a165171a264bd34c6b12b441806897847836274ef2b1f26d2f023182b64736f6c63430008060033a2646970667358221220e3f996125e5588e5cf7c51e858af4c4b842381165687526c22467f80035b216264736f6c63430008060033000000000000000000000000ca49ecf7e7bb9bbc9d1d295384663f6ba5c0e36600000000000000000000000071eeba415a523f5c952cc2f06361d5443545ad28

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

000000000000000000000000ca49ecf7e7bb9bbc9d1d295384663f6ba5c0e36600000000000000000000000071eeba415a523f5c952cc2f06361d5443545ad28

-----Decoded View---------------
Arg [0] : _shop (address): 0xca49ecf7e7bb9bbc9d1d295384663f6ba5c0e366
Arg [1] : _xdao (address): 0x71eeba415a523f5c952cc2f06361d5443545ad28

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000ca49ecf7e7bb9bbc9d1d295384663f6ba5c0e366
Arg [1] : 00000000000000000000000071eeba415a523f5c952cc2f06361d5443545ad28


Block Transaction Difficulty Gas Used Reward
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.