BNB Chain

0xc7bc8217313badfad9e9108674cb5b45a719c672

Decompiled Solidity recovered from this contract's runtime bytecode. Best-effort reconstruction — confirm behaviour against on-chain state.

Decompilation outputBNB Chain · 0xc7bc8217a719c6725.3 KB7.7 s
Share
//decompiled by exvvul decompiler tool contact@exvul.com https://x.com/exvulsec
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

contract DesolexContract {
    uint256 public constant GOVERNANCE_ROLE = 51344670724517732003549907689393193919197804398902247150944709319656146718385;
    uint256 public constant ABSOLUTE_MAX_DEPTH = 128;
    uint256 public constant commRoot = 920223621847663838883502859550374689875735245416;
    uint256 public constant DEFAULT_ADMIN_ROLE = 0;
    uint256 public constant OPERATIONS_ROLE = 102876873776470630514903892487788316353599214811428103424130969231014764698747;
    uint256 public constant protocolRegistry = 1447451786632729987978363687652043719134903805331;
    uint256 public constant moduleKey = 31808897884088151665887568070698065044561782837372769290261509036040598492135;
    uint256 public constant interfaceVersion = 2;
    
    mapping(bytes32 => mapping(address => bool)) public hasRole; // STORAGE[0x0]
    mapping(bytes32 => uint256) public getRoleMemberCount; // STORAGE[0x1]
    bytes32 stor_2; // STORAGE[0x2] // DESOLEX_RAW_STORAGE: whole slot: uint16 [ArithmeticUse] vs uint256 [ArithmeticUse] (ambiguous)
    mapping(bytes32 => bytes32) mapping_3; // STORAGE[0x3] // DESOLEX_RAW_STORAGE: mapping value 0: bool [VerifiedAbi] vs uint256 [VerifiedAbi] (ambiguous)
    mapping(address => uint256) public childrenCount; // STORAGE[0x4]
    mapping(address => bool) mapping_316a51056d8b2401ab04c48d9973add294eadde229c785c6d19cde93785467ef; // STORAGE[0x316a51056d8b2401ab04c48d9973add294eadde229c785c6d19cde93785467ef]
    mapping(address => bool) mapping_3b2867e304f6d33a464e7508860fcbe0e3c5f5b0d520a00aebeeaa4fa97dacec; // STORAGE[0x3b2867e304f6d33a464e7508860fcbe0e3c5f5b0d520a00aebeeaa4fa97dacec]
    mapping(address => uint256) mapping_expr_ag;
    mapping(address => uint256) mapping_expr_aq;
    mapping(address => uint256) mapping_expr_e;
    bytes32 stor_expr_ad;
    bytes32 stor_expr_aj;
    uint256 stor_expr_ak;
    bytes32 stor_expr_al;
    uint256 stor_expr_an;
    uint256 stor_expr_ap;
    address stor_expr_ar;
    uint256 stor_expr_av;
    bytes32 stor_expr_aw;
    bytes32 stor_expr_ax;
    bytes32 stor_expr_b;
    address stor_expr_ba;
    uint256 stor_expr_bf;
    bytes32 stor_expr_bg;
    uint256 stor_expr_bi;
    bytes32 stor_expr_bk;
    uint256 stor_expr_f;
    uint256 stor_expr_g;
    uint256 stor_expr_h;
    bytes32 stor_expr_j;
    bytes32 stor_expr_k;
    bytes32 stor_expr_l;
    uint256 stor_expr_n;
    bytes32 stor_expr_o;
    uint256 stor_expr_u;
    bytes32 stor_expr_v;
    uint256 stor_expr_w;
    bytes32 stor_expr_y;
    bytes32 stor_expr_z;
    
    event RoleRevoked(bytes32 indexed, address indexed, address indexed);
    event Event_f1b89515(uint256 indexed, uint256, uint256, uint256, uint256);
    error CustomError_300d7a34();
    error InvalidAddress();
    error CustomError_d0cf2702();
    event Event_beaa8bdb(uint256 indexed, uint256 indexed, uint256);
    error CustomError_5ecabb41();
    event RoleGranted(bytes32 indexed, address indexed, address indexed);
    error LengthMismatch();
    event Event_46667611(address indexed, address indexed, uint256);
    error AccessControlBadConfirmation();
    error CustomError_003b2682();
    error ReferrerNotJoined();
    event Event_b0d88043(uint256, uint256, uint256);
    error AccessControlUnauthorizedAccount(address, bytes32);
    error SelfReferral();
    function _desolexPanic(uint256 code) private pure {
        assembly ("memory-safe") {
            mstore(0x00, shl(224, 0x4e487b71))
            mstore(0x04, code)
            revert(0x00, 0x24)
        }
    }
    fallback() external {
        // Synthetic compatibility routes preserve original selectors for unresolved names.
        if ((msg.data.length >= 4) && (msg.sig == 0x61020cca)) {
            // Route to Unknown_61020cca(uint16) after replacing only msg.sig.
            __desolexSelectorShim(uint32(0x4bf55c1e));
            return;
        }
        if ((msg.data.length >= 4) && (msg.sig == 0x9010d07c)) {
            // Route to Unknown_9010d07c(uint256,uint256) after replacing only msg.sig.
            __desolexSelectorShim(uint32(0xb656a175));
            return;
        }
        if ((msg.data.length >= 4) && (msg.sig == 0xa3246ad3)) {
            // Route to Unknown_a3246ad3(uint256) after replacing only msg.sig.
            __desolexSelectorShim(uint32(0x1cf458ec));
            return;
        }
        if ((msg.data.length >= 4) && (msg.sig == 0xeddcbf82)) {
            // Route to Unknown_eddcbf82() after replacing only msg.sig.
            __desolexSelectorShim(uint32(0x2ef2da1c));
            return;
        }
        revert();
    }
    
    
    function Unknown_eddcbf82() public view returns (uint16) {
        return uint16(stor_2);
    }
    
    function revokeRole(bytes32 role, address account) public {
        require(bytes1(hasRole[stor_expr_b][msg.sender]), AccessControlUnauthorizedAccount());
        uint256 value0 = 0;
        if (bytes1(hasRole[role][account])) {
            hasRole[role][account] = false;
            emit RoleRevoked(role, account, msg.sender);
            value0 = 0x01;
        }
        if (value0 != 0x0) {
            uint256 value4 = 0;
            if (!(0 == (!(!(mapping_expr_e[account]))))) {
                uint256 value1 = 0;
                uint256 value2 = 0;
                uint256 value3 = 0;
                if ((mapping_expr_e[account] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) != (stor_expr_f + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)) {
                    if (!(((stor_expr_f + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) < stor_expr_g))) _desolexPanic(50);
                    if (!(((mapping_expr_e[account] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) < stor_expr_h))) _desolexPanic(50);
                    stor_expr_k = (0 & stor_expr_l) | ((stor_expr_j >> 0) << 0);
                    mapping_expr_e[stor_expr_j >> 0] = mapping_expr_e[account];
                } else {
                    value1 = mapping_expr_e[account] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
                    value2 = stor_expr_f + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
                    value3 = mapping_expr_e[account];
                }
                if (!(stor_expr_f != 0x0)) _desolexPanic(49);
                if (!(((0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + stor_expr_f) < stor_expr_n))) _desolexPanic(50);
                stor_expr_o = (0) & stor_expr_o;
                stor_expr_f = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + stor_expr_f;
                mapping_expr_e[account] = 0;
                value4 = 0x01;
            }
        }
    }
    
    function referrerOf(address account) public view returns (address) {
        return address(mapping_3[account] >> 0x18);
    }
    
    function referrals(address arg0, uint256 arg1, uint256 arg2) public view returns (bytes memory) {
        uint256 var_c;
        if (!(arg1 < childrenCount[arg0])) {
            if (((var_c + 0x20) > 0xffffffffffffffff) | ((var_c + 0x20) < var_c)) _desolexPanic(65);
            var_c = var_c + 0x20;
            uint256 value0 = 0;
            uint256 value1 = var_c + 0x20;
            uint256 value2 = var_c + 0x40;
            while (true) {
                if (value0 >= var_c.length) {
                    break;
                }
                value0 = 0x01 + value0;
                value1 = value1 + 0x20;
                value2 = 0x20 + value2;
            }
        } else {
            uint256 value3 = childrenCount[arg0] - arg1;
            if (arg2 < (childrenCount[arg0] - arg1)) {
                value3 = arg2;
            }
            if (!(value3 <= 0xffffffffffffffff)) _desolexPanic(65);
            if (((var_c + (((0x20 + (value3 << 0x05)) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) > 0xffffffffffffffff) | ((var_c + (((0x20 + (value3 << 0x05)) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) < var_c)) _desolexPanic(65);
            var_c = var_c + (((0x20 + (value3 << 0x05)) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0));
            if (!(value3 <= 0xffffffffffffffff)) _desolexPanic(65);
            uint256 value4 = 0;
            while (true) {
                if (value4 >= value3) {
                    break;
                }
                if (arg1 > arg1 + value4) {
                    _desolexPanic(17);
                    break;
                }
                if (!((arg1 + value4) < childrenCount[arg0])) _desolexPanic(50);
                if (!(value4 < var_c.length)) {
                    _desolexPanic(50);
                    break;
                }
                value4 = value4 + 0x01;
            }
            uint256 value0 = 0;
            uint256 value1 = var_c + 0x20;
            uint256 value2 = var_c + 0x40;
            while (true) {
                if (value0 >= var_c.length) {
                    break;
                }
                value0 = 0x01 + value0;
                value1 = value1 + 0x20;
                value2 = 0x20 + value2;
            }
        }
        return abi.encodePacked(0x20, var_c.length);
    }
    
    function setTeamName(string memory arg0) public {
        require((arg0 + 0x23) < msg.data.length);
        require(((arg0 + arg0) + 0x24) <= msg.data.length);
        require(bytes1(mapping_3[msg.sender]), CustomError_d0cf2702());
        uint256 value0 = (0x7f) & (stor_expr_u >> 0x01);
        if (stor_expr_u & (0x01)) {
            value0 = stor_expr_u >> 0x01;
        }
        if (!((value0 < 0x20) != (stor_expr_u & 0x01))) _desolexPanic(34);
        if (!(stor_expr_u & (0x01))) {
            uint256 var_e;
            if (((var_e + (((((var_e + (value0 << 0x05)) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) > 0xffffffffffffffff) | ((var_e + (((((var_e + (value0 << 0x05)) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) < var_e)) _desolexPanic(65);
            var_e = var_e + (((((var_e + (value0 << 0x05)) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0));
            uint256 value1 = (0x7f) & (stor_expr_u >> 0x01);
            if (stor_expr_u & (0x01)) {
                value1 = stor_expr_u >> 0x01;
            }
            if (!((value1 < 0x20) != (stor_expr_u & 0x01))) _desolexPanic(34);
            if ((value1 > 0x1f) && (value1 > arg0)) {
                uint256 value2 = 0;
                if (!(arg0.length < 0x20)) {
                    value2 = (arg0.length + 0x1f) >> 0x05;
                }
                uint256 value3 = 0;
                while (true) {
                    if (!(value3 < (((value1 + 0x1f) >> 0x05) - value2))) {
                        break;
                    }
                    stor_expr_v = 0;
                    value3 = 0x01 + value3;
                }
            }
            if (!(0x01 == (arg0.length > 0x1f))) {
                uint256 value4 = msg.data[0] >> 0xe0;
                uint256 value5 = msg.data[(arg0 + 0) + 0x24];
                if (arg0 == 0) {
                    value4 = 0;
                    value5 = 0;
                }
                stor_expr_u = (~(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff >> (arg0.length << 0x03)) & value5) | (arg0.length << 0x01);
                emit Event_f1b89515(msg.sender, 0x40, (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & (0x1f + var_e.length) + (var_e + 0x40) + 0x20) - var_e, var_e.length, (arg0));
            }
            uint256 value6 = 0;
            uint256 value7 = 0;
            uint256 value8 = keccak256(abi.encode(0x01 + (keccak256(abi.encode(msg.sender, 0x03)))));
            while (true) {
                if (!(value6 < (arg0.length & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0)))) {
                    uint256 value9 = msg.data[0] >> 0xe0;
                    uint256 value10 = msg.data[0] >> 0xe0;
                    if ((arg0.length & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0)) < arg0) {
                        stor_expr_w = (~(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff >> (0xf8 & (arg0.length << 0x03)))) & (msg.data[0x24 + (arg0 + value7)]);
                    } else {
                        value9 = value7;
                        value10 = value8;
                    }
                    stor_expr_u = (arg0.length << 0x01) + 0x01;
                    emit Event_f1b89515(msg.sender, 0x40, (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & (0x1f + var_e.length) + (var_e + 0x40) + 0x20) - var_e, var_e.length, (arg0));
                }
                stor_expr_w = msg.data[0x24 + (value7 + arg0)];
                value6 = 0x20 + value6;
                value7 = 0x20 + value7;
                value8 = value8 + 0x01;
            }
        } else {
            if (0x01 == (stor_expr_u & (0x01))) {
                uint256 value12 = keccak256(abi.encode(0x01 + (keccak256(abi.encode(msg.sender, 0x03)))));
                uint256 value11 = 0;
                while (true) {
                    if (value11 >= value0) {
                        break;
                    }
                    value12 = value12 + 0x01;
                    value11 = value11 + 0x20;
                }
                if (((var_e + (((((var_e + value11) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) > 0xffffffffffffffff) | ((var_e + (((((var_e + value11) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) < var_e)) _desolexPanic(65);
                var_e = var_e + (((((var_e + value11) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0));
                uint256 value13 = (0x7f) & (stor_expr_u >> 0x01);
                if (stor_expr_u & (0x01)) {
                    value13 = stor_expr_u >> 0x01;
                }
                if (!((value13 < 0x20) != (stor_expr_u & 0x01))) _desolexPanic(34);
                if ((value13 > 0x1f) && (value13 > arg0)) {
                    uint256 value14 = 0;
                    if (!(arg0.length < 0x20)) {
                        value14 = (arg0.length + 0x1f) >> 0x05;
                    }
                    uint256 value3 = 0;
                    while (true) {
                        if (!(value3 < (((value13 + 0x1f) >> 0x05) - value2))) {
                            break;
                        }
                        stor_expr_y = 0;
                        value3 = 0x01 + value3;
                    }
                }
                if (!(0x01 == (arg0.length > 0x1f))) {
                    uint256 value15 = msg.data[0] >> 0xe0;
                    uint256 value16 = msg.data[(arg0 + 0) + 0x24];
                    if (arg0 == 0) {
                        value15 = 0;
                        value16 = 0;
                    }
                    stor_expr_u = (~(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff >> (arg0.length << 0x03)) & value16) | (arg0.length << 0x01);
                    emit Event_f1b89515(msg.sender, 0x40, (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & (0x1f + var_e.length) + (var_e + 0x40) + 0x20) - var_e, var_e.length, (arg0));
                }
                uint256 value6 = 0;
                uint256 value7 = 0;
                uint256 value8 = keccak256(abi.encode(0x01 + (keccak256(abi.encode(msg.sender, 0x03)))));
                while (true) {
                    if (!(value6 < (arg0.length & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0)))) {
                        uint256 value17 = msg.data[0] >> 0xe0;
                        uint256 value18 = msg.data[0] >> 0xe0;
                        if ((arg0.length & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0)) < arg0) {
                            stor_expr_w = (~(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff >> (0xf8 & (arg0.length << 0x03)))) & (msg.data[0x24 + (arg0 + value7)]);
                        } else {
                            value17 = value7;
                            value18 = value8;
                        }
                        stor_expr_u = (arg0.length << 0x01) + 0x01;
                        emit Event_f1b89515(msg.sender, 0x40, (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & (0x1f + var_e.length) + (var_e + 0x40) + 0x20) - var_e, var_e.length, (arg0));
                    }
                    stor_expr_w = msg.data[0x24 + (value7 + arg0)];
                    value6 = 0x20 + value6;
                    value7 = 0x20 + value7;
                    value8 = value8 + 0x01;
                }
            } else {
                if (((var_e + (((0 - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) > 0xffffffffffffffff) | ((var_e + (((0 - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) < var_e)) _desolexPanic(65);
                var_e = var_e + (((0 - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0));
                uint256 value19 = (0x7f) & (stor_expr_u >> 0x01);
                if (stor_expr_u & (0x01)) {
                    value19 = stor_expr_u >> 0x01;
                }
                if (!((value19 < 0x20) != (stor_expr_u & 0x01))) _desolexPanic(34);
                if ((value19 > 0x1f) && (value19 > arg0)) {
                    uint256 value20 = 0;
                    if (!(arg0.length < 0x20)) {
                        value20 = (arg0.length + 0x1f) >> 0x05;
                    }
                    uint256 value3 = 0;
                    while (true) {
                        if (!(value3 < (((value19 + 0x1f) >> 0x05) - value2))) {
                            break;
                        }
                        stor_expr_z = 0;
                        value3 = 0x01 + value3;
                    }
                }
                if (!(0x01 == (arg0.length > 0x1f))) {
                    uint256 value21 = msg.data[0] >> 0xe0;
                    uint256 value22 = msg.data[(arg0 + 0) + 0x24];
                    if (arg0 == 0) {
                        value21 = 0;
                        value22 = 0;
                    }
                    stor_expr_u = (~(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff >> (arg0.length << 0x03)) & value22) | (arg0.length << 0x01);
                    var_e = var_e.length;
                    emit Event_f1b89515(msg.sender, 0x40, (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & (0x1f + var_e.length) + (var_e + 0x40) + 0x20) - var_e, var_e, (arg0));
                }
                uint256 value6 = 0;
                uint256 value7 = 0;
                uint256 value8 = keccak256(abi.encode(0x01 + (keccak256(abi.encode(msg.sender, 0x03)))));
                while (true) {
                    if (!(value6 < (arg0.length & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0)))) {
                        uint256 value23 = msg.data[0] >> 0xe0;
                        uint256 value24 = msg.data[0] >> 0xe0;
                        if ((arg0.length & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0)) < arg0) {
                            stor_expr_w = (~(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff >> (0xf8 & (arg0.length << 0x03)))) & (msg.data[0x24 + (arg0 + value7)]);
                        } else {
                            value23 = value7;
                            value24 = value8;
                        }
                        stor_expr_u = (arg0.length << 0x01) + 0x01;
                        var_e = var_e.length;
                        emit Event_f1b89515(msg.sender, 0x40, (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & (0x1f + var_e.length) + (var_e + 0x40) + 0x20) - var_e, var_e, (arg0));
                    }
                    stor_expr_w = msg.data[0x24 + (value7 + arg0)];
                    value6 = 0x20 + value6;
                    value7 = 0x20 + value7;
                    value8 = value8 + 0x01;
                }
            }
        }
    }
    
    function Unknown_a3246ad3(uint256 arg0) public view returns (bytes memory) {
        uint256 value0 = 0;
        uint256 value1 = keccak256(abi.encode(keccak256(abi.encode(arg0, 0x01))));
        uint256 var_a;
        uint256 value2 = var_a + 0x20;
        while (true) {
            if (value0 >= getRoleMemberCount[arg0]) {
                break;
            }
            value0 = 0x01 + value0;
            value1 = 0x01 + value1;
            value2 = value2 + 0x20;
        }
        if (((var_a + (((value2 - var_a) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) > 0xffffffffffffffff) | ((var_a + (((value2 - var_a) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) < var_a)) _desolexPanic(65);
        uint256 value3 = 0;
        uint256 value4 = var_a + 0x20;
        uint256 value5 = var_a + 0x40;
        while (true) {
            var_a = var_a + (((value2 - var_a) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0));
            if (value3 >= var_a.length) {
                break;
            }
            value3 = 0x01 + value3;
            value4 = value4 + 0x20;
            value5 = 0x20 + value5;
        }
        return abi.encodePacked(0x20, var_a.length);
    }
    
    function Unknown_9010d07c(uint256 arg0, uint256 arg1) public view returns (address) {
        if (!(arg1 < getRoleMemberCount[arg0])) _desolexPanic(50);
        return address(stor_expr_ad >> 0);
    }
    
    function Unknown_61020cca(uint16 arg0) public {
        require(arg0 == (arg0 & 0xffff));
        require(mapping_316a51056d8b2401ab04c48d9973add294eadde229c785c6d19cde93785467ef[msg.sender], AccessControlUnauthorizedAccount());
        require(!((arg0 & 0xffff) != 0x0 && (arg0 & 0xffff) > 0x80 || (arg0 & 0xffff) == 0x0), CustomError_5ecabb41());
        stor_2 = (stor_2 & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000)) | (arg0 & (0xffff));
        emit Event_b0d88043(uint16(stor_2), uint16(arg0), block.timestamp);
    }
    
    function isJoined(address account) public view returns (bool) {
        return !(!(bytes1(mapping_3[account])));
    }
    
    function levelOf(address account) public view returns (uint16) {
        return uint16(mapping_3[account] >> 0x08);
    }
    
    function renounceRole(bytes32 role, address account) public {
        require(account == msg.sender, AccessControlBadConfirmation());
        internal_12aa(role, account);
    }
    
    function grantRole(bytes32 role, address account) public {
        require(bytes1(hasRole[stor_expr_b][msg.sender]), AccessControlUnauthorizedAccount());
        if (!(bytes1(hasRole[role][account]) != 0x0)) {
            hasRole[role][account] = true;
            emit RoleGranted(role, account, msg.sender);
        }
        if (!(0 == (!(mapping_expr_aq[account])))) {
            if (!(stor_expr_ap < 0x010000000000000000)) _desolexPanic(65);
            stor_expr_ap = stor_expr_ap + 0x01;
            if (!(stor_expr_ap < stor_expr_ap)) _desolexPanic(50);
            stor_expr_ar = (0 & stor_expr_ar) | (account << 0);
            mapping_expr_aq[account] = stor_expr_ap;
        }
    }
    
    function join(address arg0) public {
        bool flag0 = (msg.sender) == 0x01;
        if (!(msg.sender != address(0))) {
            flag0 = !(msg.sender);
        }
        require(!(!flag0 && (arg0 != address(0) && arg0 == address(0x1) || arg0 == address(0) && arg0 == address(0)) || flag0), InvalidAddress());
        require(!(bytes1(mapping_3[msg.sender])), CustomError_003b2682());
        require(arg0 != msg.sender, SelfReferral());
        require(bytes1(mapping_3[arg0]), ReferrerNotJoined());
        require(uint16((mapping_3[arg0] >> 0x08) + 0x01) <= uint16(stor_2), CustomError_300d7a34());
        uint256 var_c;
        if (((var_c + 0x80) > 0xffffffffffffffff) | ((var_c + 0x80) < var_c)) _desolexPanic(65);
        var_c = var_c + 0x80;
        if (((var_c + 0x20) > 0xffffffffffffffff) | ((var_c + 0x20) < var_c)) _desolexPanic(65);
        var_c = var_c + 0x20;
        mapping_3[msg.sender] = (0xffffffffffffffffffffffffffffffffffffffff000000 & (var_i << 0x18)) | (0xffff00 & (var_j << 0x08) | (var_c.length & (0xff) | (mapping_3[msg.sender] & (0xffffffffffffffffff0000000000000000000000000000000000000000000000))));
        if (!(var_k <= 0xffffffffffffffff)) _desolexPanic(65);
        uint256 value0 = (0x7f) & (stor_expr_av >> 0x01);
        if (stor_expr_av & (0x01)) {
            value0 = stor_expr_av >> 0x01;
        }
        if (!((value0 < 0x20) != (stor_expr_av & 0x01))) _desolexPanic(34);
        if ((value0 > 0x1f) && (value0 > var_k)) {
            uint256 value1 = 0;
            if (!(var_k < 0x20)) {
                value1 = (var_k + 0x1f) >> 0x05;
            }
            uint256 value2 = 0;
            uint256 value4 = keccak256(abi.encode(0x01 + (keccak256(abi.encode(address(msg.sender), 0x03))))) + value1;
            uint256 value3 = ((value0 + 0x1f) >> 0x05) - value1;
            while (true) {
                if (value2 >= value3) {
                    break;
                }
                stor_expr_aw = 0;
                value2 = 0x01 + value2;
                value4 = value4;
                value3 = value3;
            }
        }
        if (0x01 == (var_k > 0x1f)) {
            uint256 value5 = 0;
            uint256 value6 = 0x20;
            uint256 value7 = keccak256(abi.encode(0x01 + (keccak256(abi.encode(msg.sender, 0x03)))));
            while (true) {
                if (value5 >= (var_k & 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0)) {
                    break;
                }
                stor_expr_ax = var_l;
                value5 = value5 + 0x20;
                value6 = value6 + 0x20;
                value7 = value7 + 0x01;
            }
            uint256 value8 = 0;
            uint256 value9 = 0;
            uint256 value10 = 0;
            if (var_k & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0) < var_k) {
                stor_expr_ax = (~(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff >> ((var_k << 0x03) & (0xf8)))) & var_l;
            } else {
                value8 = var_m;
                value9 = value6;
                value10 = value7;
            }
            stor_expr_av = (var_k << 0x01) + 0x01;
        } else {
            uint256 value11 = 0;
            uint256 value12 = 0;
            uint256 value13 = var_n;
            if (!(var_k)) {
                value11 = var_m;
                value12 = 0x20;
                value13 = 0;
            }
            stor_expr_av = (~(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff >> (var_k << 0x03)) & value13) | (var_k << 0x01);
        }
        if (!((childrenCount[arg0] < 0x010000000000000000))) _desolexPanic(65);
        childrenCount[arg0] = childrenCount[arg0] + 0x01;
        if (!(childrenCount[arg0] < childrenCount[arg0])) _desolexPanic(50);
        stor_expr_ba = (msg.sender << 0) | (0xffffffffffffffffffffffff0000000000000000000000000000000000000000 & stor_expr_ba);
        emit Event_beaa8bdb(msg.sender, arg0, uint16((mapping_3[arg0] >> 0x08) + 0x01));
    }
    
    function getRoleAdmin(bytes32 role) public view returns (uint256) {
        return stor_expr_b;
    }
    
    function importRelations(address[] memory arg0, address[] memory arg1) public {
        require(((0x04 + arg0) + 0x1f) < msg.data.length);
        require(!(((arg0.length << 0x05) + (0x04 + arg0) + 0x20) > msg.data.length));
        require(((0x04 + arg1) + 0x1f) < msg.data.length);
        require(!(((arg1.length << 0x05) + (0x04 + arg1) + 0x20) > msg.data.length));
        require(mapping_3b2867e304f6d33a464e7508860fcbe0e3c5f5b0d520a00aebeeaa4fa97dacec[msg.sender], AccessControlUnauthorizedAccount());
        require(arg0 == arg1, LengthMismatch());
        uint256 value0 = 0;
        while (true) {
            if (!((value0 < arg0.length))) _desolexPanic(50);
            if (msg.data[(value0 << 0x05) + ((0x04 + arg0) + 0x20)] != (address(msg.data[(value0 << 0x05) + ((0x04 + arg0) + 0x20)]))) {
                revert();
                break;
            }
            if (!(value0 < arg1.length)) {
                _desolexPanic(50);
                break;
            }
            if ((value0 << 0x05) + (arg1 + 0x20) != (address((value0 << 0x05) + (arg1 + 0x20)))) {
                revert();
                break;
            }
            bool flag0 = (address((value0 << 0x05) + (arg1 + 0x20))) == 0x01;
            if (!(address((value0 << 0x05) + (arg1 + 0x20)))) {
                flag0 = !(address((value0 << 0x05) + (arg1 + 0x20)));
            }
            if (((!flag0) && ((((0xffffffffffffffffffffffffffffffffffffffff & CALLDATALOAD(SHL(0x5, value0) + ((0x04 + arg0) + 0x20))) != 0x0) && ((0xffffffffffffffffffffffffffffffffffffffff & CALLDATALOAD(SHL(0x5, value0) + ((0x04 + arg0) + 0x20))) == 0x1)) || (((0xffffffffffffffffffffffffffffffffffffffff & CALLDATALOAD(SHL(0x5, value0) + ((0x04 + arg0) + 0x20))) == 0x0) && ((0xffffffffffffffffffffffffffffffffffffffff & CALLDATALOAD(SHL(0x5, value0) + ((0x04 + arg0) + 0x20))) == 0x0)))) || (flag0)) {
                revert InvalidAddress();
                break;
            }
            if (bytes1(mapping_3[address((value0 << 0x05) + (arg1 + 0x20))]) != 0x0) {
                revert CustomError_003b2682();
                break;
            }
            if (address(msg.data[(value0 << 0x05) + ((0x04 + arg0) + 0x20)]) == (address((value0 << 0x05) + (arg1 + 0x20)))) {
                revert SelfReferral();
                break;
            }
            if (!(bytes1(mapping_3[address(msg.data[(value0 << 0x05) + ((0x04 + arg0) + 0x20)])]))) {
                revert ReferrerNotJoined();
                break;
            }
            if ((uint16(mapping_3[address(msg.data[(value0 << 0x05) + ((0x04 + arg0) + 0x20)])] >> 0x08) + 0x01) > 0xffff) {
                _desolexPanic(17);
                break;
            }
            if (uint16((mapping_3[address(msg.data[(value0 << 0x05) + ((0x04 + arg0) + 0x20)])] >> 0x08) + 0x01) > (uint16(stor_2))) {
                revert CustomError_300d7a34();
                break;
            }
            if (!(value0 < arg0.length)) {
                _desolexPanic(50);
                break;
            }
            if ((value0 << 0x05) + (arg0 + 0x20) != (address((value0 << 0x05) + (arg0 + 0x20)))) {
                revert();
                break;
            }
            if (!(value0 < arg1.length)) {
                _desolexPanic(50);
                break;
            }
            if ((value0 << 0x05) + (arg1 + 0x20) != (address((value0 << 0x05) + (arg1 + 0x20)))) {
                revert();
                break;
            }
            uint256 var_d;
            if (((var_d + 0x80) > 0xffffffffffffffff) | ((var_d + 0x80) < var_d)) _desolexPanic(65);
            var_d = var_d + 0x80;
            if (((var_d + 0x20) > 0xffffffffffffffff) | ((var_d + 0x20) < var_d)) _desolexPanic(65);
            var_d = var_d + 0x20;
            mapping_3[address((value0 << 0x05) + (arg1 + 0x20))] = (0xffffffffffffffffffffffffffffffffffffffff000000 & (var_j << 0x18)) | (0xffff00 & (var_k << 0x08) | (var_d.length & (0xff) | (mapping_3[address((value0 << 0x05) + (arg1 + 0x20))] & (0xffffffffffffffffff0000000000000000000000000000000000000000000000))));
            if (!(var_l <= 0xffffffffffffffff)) _desolexPanic(65);
            uint256 value1 = (0x7f) & (stor_expr_bg >> 0x01);
            if (stor_expr_bf & (0x01)) {
                value1 = stor_expr_bf >> 0x01;
            }
            if (!((value1 < 0x20) != (stor_expr_bf & 0x01))) _desolexPanic(34);
            if ((value1 > 0x1f) && (value1 > var_l)) {
                uint256 value2 = 0;
                if (!(var_l < 0x20)) {
                    value2 = (var_l + 0x1f) >> 0x05;
                }
                uint256 value3 = 0;
                uint256 value5 = keccak256(abi.encode(0x01 + (keccak256(abi.encode(address((value0 << 0x05) + (arg1 + 0x20)), 0x03))))) + value2;
                uint256 value4 = ((value1 + 0x1f) >> 0x05) - value2;
                while (true) {
                    if (value3 >= value4) {
                        break;
                    }
                    stor_expr_aw = 0;
                    value3 = 0x01 + value3;
                    value5 = value5;
                    value4 = value4;
                }
            }
            if (0x01 == (var_l > 0x1f)) {
                uint256 value6 = 0;
                uint256 value7 = 0x20;
                uint256 value8 = keccak256(abi.encode(0x01 + (keccak256(abi.encode(address((value0 << 0x05) + (arg1 + 0x20)), 0x03)))));
                while (true) {
                    if (value6 >= (var_l & 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0)) {
                        break;
                    }
                    stor_expr_ax = var_m;
                    value6 = value6 + 0x20;
                    value7 = value7 + 0x20;
                    value8 = value8 + 0x01;
                }
                uint256 value9 = 0;
                uint256 value10 = 0;
                uint256 value11 = 0;
                if (var_l & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0) < var_l) {
                    stor_expr_ax = (~(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff >> ((var_l << 0x03) & (0xf8)))) & var_m;
                } else {
                    value9 = var_n;
                    value10 = value7;
                    value11 = value8;
                }
                stor_expr_bf = (var_l << 0x01) + 0x01;
            } else {
                uint256 value12 = 0;
                uint256 value13 = 0;
                uint256 value14 = var_o;
                if (!(var_l)) {
                    value12 = var_n;
                    value13 = 0x20;
                    value14 = 0;
                }
                stor_expr_bf = (~(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff >> (var_l << 0x03)) & value14) | (var_l << 0x01);
            }
            if (!((childrenCount[address((value0 << 0x05) + (arg0 + 0x20))] < 0x010000000000000000))) _desolexPanic(65);
            childrenCount[address((value0 << 0x05) + (arg0 + 0x20))] = childrenCount[address((value0 << 0x05) + (arg0 + 0x20))] + 0x01;
            if (!(childrenCount[address((value0 << 0x05) + (arg0 + 0x20))] < childrenCount[address((value0 << 0x05) + (arg0 + 0x20))])) _desolexPanic(50);
            stor_expr_bi = (address((value0 << 0x05) + (arg1 + 0x20)) << 0) | (0xffffffffffffffffffffffff0000000000000000000000000000000000000000 & stor_expr_bi);
            if (!(value0 < arg1.length)) {
                _desolexPanic(50);
                break;
            }
            if ((value0 << 0x05) + (arg1 + 0x20) != (address((value0 << 0x05) + (arg1 + 0x20)))) {
                revert();
                break;
            }
            if (!(value0 < arg0.length)) {
                _desolexPanic(50);
                break;
            }
            if ((value0 << 0x05) + (arg0 + 0x20) != (address((value0 << 0x05) + (arg0 + 0x20)))) {
                revert();
                break;
            }
            emit Event_46667611(address((value0 << 0x05) + (arg1 + 0x20)), address((value0 << 0x05) + (arg0 + 0x20)), uint16((mapping_3[address(msg.data[(value0 << 0x05) + ((0x04 + arg0) + 0x20)])] >> 0x08) + 0x01));
            value0 = value0 + 0x01;
        }
    }
    
    function members(address account) public view returns (bool) {
        uint256 value0 = (0x7f) & (stor_expr_bk >> 0x01);
        if (stor_expr_bk & (0x01)) {
            value0 = stor_expr_bk >> 0x01;
        }
        if (!((value0 < 0x20) != (stor_expr_bk & 0x01))) _desolexPanic(34);
        uint256 var_e;
        if (!(stor_expr_bk & (0x01))) {
            if (((var_e + (((((var_e + (value0 << 0x05)) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) > 0xffffffffffffffff) | ((var_e + (((((var_e + (value0 << 0x05)) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) < var_e)) _desolexPanic(65);
            var_e = var_e + (((((var_e + (value0 << 0x05)) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0));
        } else {
            if (0x01 == (stor_expr_bk & (0x01))) {
                uint256 value2 = keccak256(abi.encode(keccak256(abi.encode(account, 0x03)) + 0x01));
                uint256 value1 = 0;
                while (true) {
                    if (value1 >= value0) {
                        break;
                    }
                    value2 = value2 + 0x01;
                    value1 = value1 + 0x20;
                }
                if (((var_e + (((((var_e + value1) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) > 0xffffffffffffffff) | ((var_e + (((((var_e + value1) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) < var_e)) _desolexPanic(65);
                var_e = var_e + (((((var_e + value1) + 0x20) - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0));
            } else {
                if (((var_e + (((0 - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) > 0xffffffffffffffff) | ((var_e + (((0 - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0))) < var_e)) _desolexPanic(65);
                var_e = var_e + (((0 - var_e) + 0x1f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0));
                var_e = address(mapping_3[account] >> 0x18);
            }
        }
        return abi.encodePacked(!(!(bytes1(mapping_3[account]))), uint16(mapping_3[account] >> 0x08), address(mapping_3[account] >> 0x18), 0x80, var_e.length);
    }
    
    function supportsInterface(bytes4 interfaceId) public pure returns (bool) {
        require(interfaceId == (interfaceId & 0xffffffff00000000000000000000000000000000000000000000000000000000));
        uint256 value1 = msg.data[0] >> 0xe0;
        bool flag1;
        if ((interfaceId & 0xffffffff00000000000000000000000000000000000000000000000000000000) != 0x5a05180f00000000000000000000000000000000000000000000000000000000) {
            uint256 value0 = msg.data[0] >> 0xe0;
            bool flag0 = 0x1ffc9a700000000000000000000000000000000000000000000000000000000 == (interfaceId & 0xffffffff00000000000000000000000000000000000000000000000000000000);
            if (interfaceId & (0xffffffff00000000000000000000000000000000000000000000000000000000) == 0x7965db0b00000000000000000000000000000000000000000000000000000000) {
                value0 = interfaceId & (0xffffffff00000000000000000000000000000000000000000000000000000000);
                flag0 = (interfaceId & 0xffffffff00000000000000000000000000000000000000000000000000000000) == 0x7965db0b00000000000000000000000000000000000000000000000000000000;
            }
            flag1 = flag0;
        } else {
            value1 = interfaceId & (0xffffffff00000000000000000000000000000000000000000000000000000000);
            flag1 = (interfaceId & 0xffffffff00000000000000000000000000000000000000000000000000000000) == 0x5a05180f00000000000000000000000000000000000000000000000000000000;
        }
        return flag1;
    }
    
    function internal_12aa(bytes32 arg0, address arg1) private {
        // Decompilation incomplete: helper effect provenance is conservative.
        uint256 value0 = 0;
        if (bytes1(hasRole[arg0][arg1])) {
            hasRole[arg0][arg1] = false;
            emit RoleRevoked(arg0, arg1, msg.sender);
            value0 = 0x01;
        }
        if (value0 != 0x0) {
            uint256 value4 = 0;
            if (!(0 == (!(!(mapping_expr_ag[arg1]))))) {
                uint256 value1 = 0;
                uint256 value2 = 0;
                uint256 value3 = 0;
                if ((mapping_expr_ag[arg1] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) != (getRoleMemberCount[arg0] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)) {
                    if (!(((getRoleMemberCount[arg0] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) < stor_expr_g))) _desolexPanic(50);
                    if (!(((mapping_expr_ag[arg1] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) < stor_expr_h))) _desolexPanic(50);
                    stor_expr_ak = (0 & stor_expr_al | (stor_expr_aj >> (0 << 0x03) << 0));
                    mapping_expr_ag[stor_expr_aj >> (0 << 0x03)] = mapping_expr_ag[arg1];
                } else {
                    value1 = mapping_expr_ag[arg1] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
                    value2 = getRoleMemberCount[arg0] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
                    value3 = mapping_expr_ag[arg1];
                }
                if (!(getRoleMemberCount[arg0])) _desolexPanic(49);
                if (!(((0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + getRoleMemberCount[arg0]) < stor_expr_n))) _desolexPanic(50);
                stor_expr_an = (~(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff << (0 << 0x03))) & stor_expr_an;
                getRoleMemberCount[arg0] = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + getRoleMemberCount[arg0];
                mapping_expr_ag[arg1] = 0;
                flag0 = true;
            }
        }
    }
    
    function __desolexSelectorShim(uint32 rewrittenSelector) private {
        assembly {
            let input := mload(0x40)
            calldatacopy(input, 0, calldatasize())
            mstore(input, or(and(mload(input), 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff), shl(224, and(rewrittenSelector, 0xffffffff))))
            let success := delegatecall(gas(), address(), input, calldatasize(), 0, 0)
            let size := returndatasize()
            returndatacopy(input, 0, size)
            switch success
            case 0 { revert(input, size) }
            default { return(input, size) }
        }
    }
    
    // Note: This selector table is synthetic and is not part of the original Solidity source.
    // It records the recovered selector-to-signature mapping without executable behavior.
    
    // 0x01ffc9a7 => supportsInterface(bytes4)
    // 0x08ae4b0c => members(address)
    // 0x12ae1a93 => importRelations(address[],address[])
    // 0x1d8ffa4d => interfaceVersion()
    // 0x248a9ca3 => getRoleAdmin(bytes32)
    // 0x28ffe6c8 => join(address)
    // 0x2f2ff15d => grantRole(bytes32,address)
    // 0x36568abe => renounceRole(bytes32,address)
    // 0x55fd7fa0 => moduleKey()
    // 0x5c138c9d => levelOf(address)
    // 0x5e6a43f5 => isJoined(address)
    // 0x61020cca => Unknown_61020cca(uint16)
    // 0x7656419f => protocolRegistry()
    // 0x78a6cc09 => OPERATIONS_ROLE()
    // 0x9010d07c => Unknown_9010d07c(uint256,uint256)
    // 0x91d14854 => hasRole(bytes32,address)
    // 0x960b2969 => childrenCount(address)
    // 0xa217fddf => DEFAULT_ADMIN_ROLE()
    // 0xa3246ad3 => Unknown_a3246ad3(uint256)
    // 0xa788371f => commRoot()
    // 0xb995ac5b => setTeamName(string)
    // 0xc01b35a1 => referrals(address,uint256,uint256)
    // 0xc793b723 => ABSOLUTE_MAX_DEPTH()
    // 0xca15c873 => getRoleMemberCount(bytes32)
    // 0xd21cacdf => referrerOf(address)
    // 0xd547741f => revokeRole(bytes32,address)
    // 0xeddcbf82 => Unknown_eddcbf82()
    // 0xf36c8f5c => GOVERNANCE_ROLE()
}
0xc7bc82…19c672 on BNB Chain — Decompiled Solidity