false
false
0

Contract Address Details

0x728973D3Dd87CC2De387AF507e84011333E22A2d

Contract Name
TwoBearsCommission
Creator
0x65c812–d1a97c at 0x310f8f–9f8b47
Balance
0 CLO
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
16275953
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
TwoBearsCommission




Optimization enabled
false
Compiler version
v0.8.16+commit.07a7930e




EVM Version
default




Verified at
2024-09-26T15:35:13.573442Z

Contract source code

// All rights reserved.
// SPDX-License-Identifier: No License (None)

pragma solidity ^0.8.16;

interface IERC20 {
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address to, uint256 value) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 value) external returns (bool);
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}


contract TwoBearsCommission {

    struct RecipientData { 
        uint256 index; // индекс в списке получателей
        uint256 percent; // установленный процент получателя
    }

    struct RecipientPercent { // структура для вывода получателя и его установленного процента
        address recipient; // адрес получателя
        uint256 percent; // установленный процент получателя
    }

    struct ContractBalance { // структура для вывода баланса контракта по токену
        address token; // адрес токена
        bytes8 symb; // 8 байт - аббревиатура токена
        uint8 decimal; // 1 байт - количество десятичных знаков
        uint256 balance; // баланс
    }    

    uint256 lastIndex; // Всегда указывает на последнего получателя
    address public owner = 0xeBE894814554c8382EA6a24CcDdf1527407A24f6; // Владелец

    mapping(uint256 => address) private recipients; // индекс -> адрес получателя
    mapping(address => RecipientData) private recipientData; // адрес получателя -> (индекс, процент)

    event Withdrawal(address indexed token, address indexed recipient, uint value);

    modifier onlyOwner() {
        require(msg.sender == owner, "Only owner can call this");
        _;
    }


    // Обработаем функции получение нативной монеты и любых токенов ERC223

    receive() external payable {} // принимаем нативную монету

    function tokenReceived(address _from, uint _value, bytes memory _data) public returns (bytes4) { // принимаем токены ERC223
        return this.tokenReceived.selector; // возвращаем селектор этой функции
    }

    // Функции владельца

    function addRecipient(address _recipient, uint256 _percent) external onlyOwner // Добавить нового получателя и установить процент выплаты
    {
        uint256 _freePercent = freeInterest(); // получаем нераспределенные проценты
        require((_percent > 0) && (_percent <= _freePercent)); // проверяем что новому получателю может быть назначен процент выплат
        require(recipientData[_recipient].percent == 0); // проверяем что новый получатель еще не существует
        ++lastIndex;
        recipients[lastIndex] = _recipient; // Привязываем получателя к индексу
        recipientData[_recipient].index = lastIndex; // Привязываем индекс к получателю
        recipientData[_recipient].percent = _percent; // Назначаем процент выплат адресу
    }

    function changePercentRecipient(address _recipient, uint256 _newPercent) external onlyOwner // Назначить новый процент получателю
    {
        uint256 _freePercent = freeInterest(); // получаем нераспределенные проценты
        require(recipientData[_recipient].percent > 0); // проверяем что получатель существует
        _freePercent += recipientData[_recipient].percent;
        require((_newPercent > 0) && (_newPercent <= _freePercent)); // проверяем что получателю может быть назначен новый процент выплат
        recipientData[_recipient].percent = _newPercent; // Назначаем новый процент выплат адресу
    }

    function delRecipient(address _recipient) external onlyOwner // Удалить получателя
    {
        require(recipientData[_recipient].percent > 0); // проверяем что получатель существует
        uint256 _index = recipientData[_recipient].index; // индекс удаляемого получателя
        delete recipientData[_recipient];  // удаляем структуру данных получателя
        if(_index != lastIndex){ // если удаляемый получатель не последний в списке
            recipients[_index] = recipients[lastIndex];
            recipientData[recipients[_index]].index = _index;            
        }
        delete recipients[lastIndex]; // удаляем адрес привязаный к последнему индексу
        --lastIndex;
    }

    function withdraw(address[] calldata _tokens) external // выплаты токенов согласно назначеным процентам
    {
        address _token; // текущий токен
        uint256 _balance; // текущий баланс токена
        address _recipient; // текущий адрес получателя
        uint256 _percent; // установленный процент текущего получателя
        uint256 _pay; // текущая сумма которую должен выплатить контракт
        for(uint256 t = 0; t < _tokens.length; t++){ // перебираем весь массив токенов
            _token = _tokens[t]; // последовательно получаем адреса токенов из массива
            _balance = IERC20(_token).balanceOf(address(this));
            if(_balance > 0) --_balance; // всегда оставляем на балансе контракта 1 wei по любому токену
            if(_balance == 0) continue;
            // есть что выплачивать
            for(uint256 i = 1; i <= lastIndex; i++){
                _recipient = recipients[i]; // получаем адрес текущего получателя
                _percent = recipientData[_recipient].percent; // получаем процент получателя
                _pay = _percent * _balance / (100 * 1e18); // рассчитываем сумму выплаты для текущего получателя
                if(_pay > 0){ // если есть что выплачивать
                    IERC20(_token).transfer(_recipient, _pay);
                    emit Withdrawal(_token, _recipient, _pay);
                }
            }
        }
    }

    function withdrawNative() external // выплата нативной монеты согласно назначеным процентам
    {
        uint256 _balance = address(this).balance; // получаем баланс нативной монеты
        require(_balance > 0); // баланс в нативной монете должен быть > 0
        address _recipient; // текущий адрес получателя
        uint256 _percent; // установленный процент текущего получателя
        uint256 _pay; // текущая сумма которую должен выплатить контракт
        for(uint256 i = 1; i <= lastIndex; i++){
            _recipient = recipients[i]; // получаем адрес текущего получателя
            _percent = recipientData[_recipient].percent; // получаем процент получателя
            _pay = _percent * _balance / (100 * 1e18); // рассчитываем сумму выплаты для текущего получателя
            if(_pay > 0){ // если есть что выплачивать
                payable(_recipient).transfer(_pay);
                emit Withdrawal(address(0x00), _recipient, _pay);
            }
        }
    }

    // Функции получения данных из контракта

    function freeInterest() public view returns (uint256) // вернуть нераспределенный процент
    {
        uint256 _result = 100 * 1e18; // 100%
        for(uint256 i = 1; i <= lastIndex; i++){
            _result -= recipientData[recipients[i]].percent;
        }
        return _result;
    }

    function getListRecipients() public view returns (RecipientPercent[] memory) // вернуть список всех получателей с установленным процентом
    {
        RecipientPercent[] memory _result = new RecipientPercent[](lastIndex);
        for(uint256 i = 0; i < lastIndex; i++){
            _result[i].recipient = recipients[i+1];
            _result[i].percent = recipientData[_result[i].recipient].percent;
        }
        return (_result); // возвращаем массив получателей с установленным процентом
    }

    function getContractBalanceByTokens(address[] calldata _tokens) public view returns (ContractBalance[] memory) // вывода баланса контракта по заданным токенам
    {
        ContractBalance[] memory _result = new ContractBalance[](_tokens.length + 1);
        _result[0] = ContractBalance(address(0x00), "Native", 18, address(this).balance); // Информация нативной монеты сети

        for(uint256 i = 0; i < _tokens.length; i++){ // перебираем весь массив токенов
            bytes8 _newSymb;
            string memory str = IERC20(_tokens[i]).symbol();
            assembly {
                _newSymb := mload(add(str, 32))
            }    
            _result[i+1] = ContractBalance(_tokens[i], _newSymb, IERC20(_tokens[i]).decimals(), IERC20(_tokens[i]).balanceOf(address(this)));
        }
        return (_result); // возвращаем балансы по заданным токенам
    }
}
        
        

Contract ABI

[{"type":"event","name":"Withdrawal","inputs":[{"type":"address","name":"token","internalType":"address","indexed":true},{"type":"address","name":"recipient","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addRecipient","inputs":[{"type":"address","name":"_recipient","internalType":"address"},{"type":"uint256","name":"_percent","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changePercentRecipient","inputs":[{"type":"address","name":"_recipient","internalType":"address"},{"type":"uint256","name":"_newPercent","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"delRecipient","inputs":[{"type":"address","name":"_recipient","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"freeInterest","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct TwoBearsCommission.ContractBalance[]","components":[{"type":"address","name":"token","internalType":"address"},{"type":"bytes8","name":"symb","internalType":"bytes8"},{"type":"uint8","name":"decimal","internalType":"uint8"},{"type":"uint256","name":"balance","internalType":"uint256"}]}],"name":"getContractBalanceByTokens","inputs":[{"type":"address[]","name":"_tokens","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct TwoBearsCommission.RecipientPercent[]","components":[{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"percent","internalType":"uint256"}]}],"name":"getListRecipients","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"tokenReceived","inputs":[{"type":"address","name":"_from","internalType":"address"},{"type":"uint256","name":"_value","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"address[]","name":"_tokens","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawNative","inputs":[]},{"type":"receive","stateMutability":"payable"}]
              

Contract Creation Code

Verify & Publish
0x608060405273ebe894814554c8382ea6a24ccddf1527407a24f6600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561006557600080fd5b50611f6f806100756000396000f3fe6080604052600436106100955760003560e01c8063a9a1f41211610059578063a9a1f41214610176578063bd5dec98146101b3578063cea660c6146101dc578063e05e315814610205578063f79822431461022e5761009c565b806312fb0c88146100a15780632b2781a6146100cc57806350431ce4146100f75780638943ec021461010e5780638da5cb5b1461014b5761009c565b3661009c57005b600080fd5b3480156100ad57600080fd5b506100b6610257565b6040516100c391906113eb565b60405180910390f35b3480156100d857600080fd5b506100e1610314565b6040516100ee9190611534565b60405180910390f35b34801561010357600080fd5b5061010c6104ac565b005b34801561011a57600080fd5b5061013560048036038101906101309190611708565b610640565b60405161014291906117b2565b60405180910390f35b34801561015757600080fd5b50610160610653565b60405161016d91906117dc565b60405180910390f35b34801561018257600080fd5b5061019d60048036038101906101989190611857565b610679565b6040516101aa91906119ff565b60405180910390f35b3480156101bf57600080fd5b506101da60048036038101906101d59190611857565b610a28565b005b3480156101e857600080fd5b5061020360048036038101906101fe9190611a21565b610cd3565b005b34801561021157600080fd5b5061022c60048036038101906102279190611a4e565b610fa5565b005b34801561023a57600080fd5b5061025560048036038101906102509190611a4e565b611145565b005b60008068056bc75e2d6310000090506000600190505b600054811161030c57600360006002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154826102f79190611abd565b9150808061030490611af1565b91505061026d565b508091505090565b60606000805467ffffffffffffffff811115610333576103326115dd565b5b60405190808252806020026020018201604052801561036c57816020015b610359611346565b8152602001906001900390816103515790505b50905060005b6000548110156104a4576002600060018361038d9190611b39565b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168282815181106103cf576103ce611b6d565b5b60200260200101516000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506003600083838151811061042457610423611b6d565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015482828151811061048157610480611b6d565b5b60200260200101516020018181525050808061049c90611af1565b915050610372565b508091505090565b6000479050600081116104be57600080fd5b600080600080600190505b6000548111610639576002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154925068056bc75e2d6310000085846105639190611b9c565b61056d9190611c25565b91506000821115610626578373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156105be573d6000803e3d6000fd5b508373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b63988460405161061d91906113eb565b60405180910390a35b808061063190611af1565b9150506104c9565b5050505050565b6000638943ec0260e01b90509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600060018484905061068d9190611b39565b67ffffffffffffffff8111156106a6576106a56115dd565b5b6040519080825280602002602001820160405280156106df57816020015b6106cc611376565b8152602001906001900390816106c45790505b5090506040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020017f4e6174697665000000000000000000000000000000000000000000000000000077ffffffffffffffffffffffffffffffffffffffffffffffff19168152602001601260ff168152602001478152508160008151811061076d5761076c611b6d565b5b602002602001018190525060005b84849050811015610a1d5760008086868481811061079c5761079b611b6d565b5b90506020020160208101906107b19190611a21565b73ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156107fb573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906108249190611d21565b905060208101519150604051806080016040528088888681811061084b5761084a611b6d565b5b90506020020160208101906108609190611a21565b73ffffffffffffffffffffffffffffffffffffffff1681526020018377ffffffffffffffffffffffffffffffffffffffffffffffff191681526020018888868181106108af576108ae611b6d565b5b90506020020160208101906108c49190611a21565b73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611d96565b60ff16815260200188888681811061094d5761094c611b6d565b5b90506020020160208101906109629190611a21565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161099a91906117dc565b602060405180830381865afa1580156109b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109db9190611dd8565b815250846001856109ec9190611b39565b815181106109fd576109fc611b6d565b5b602002602001018190525050508080610a1590611af1565b91505061077b565b508091505092915050565b600080600080600080600090505b87879050811015610cc957878782818110610a5457610a53611b6d565b5b9050602002016020810190610a699190611a21565b95508573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610aa491906117dc565b602060405180830381865afa158015610ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae59190611dd8565b94506000851115610afd5784610afa90611e05565b94505b6000850315610cb6576000600190505b6000548111610cb4576002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169450600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154935068056bc75e2d631000008685610ba79190611b9c565b610bb19190611c25565b92506000831115610ca1578673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86856040518363ffffffff1660e01b8152600401610bf7929190611e2e565b6020604051808303816000875af1158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a9190611e8f565b508473ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b639885604051610c9891906113eb565b60405180910390a35b8080610cac90611af1565b915050610b0d565b505b8080610cc190611af1565b915050610a36565b5050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5a90611f19565b60405180910390fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015411610db257600080fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160009055600182016000905550506000548114610f5557600260008054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006002600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600260008054815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000808154610f9a90611e05565b919050819055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102c90611f19565b60405180910390fd5b600061103f610257565b90506000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541161109057600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154816110de9190611b39565b90506000821180156110f05750808211155b6110f957600080fd5b81600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111cc90611f19565b60405180910390fd5b60006111df610257565b90506000821180156111f15750808211155b6111fa57600080fd5b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541461124957600080fd5b600080815461125790611af1565b9190508190555082600260008054815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600054600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550505050565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600077ffffffffffffffffffffffffffffffffffffffffffffffff19168152602001600060ff168152602001600081525090565b6000819050919050565b6113e5816113d2565b82525050565b600060208201905061140060008301846113dc565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061145d82611432565b9050919050565b61146d81611452565b82525050565b61147c816113d2565b82525050565b6040820160008201516114986000850182611464565b5060208201516114ab6020850182611473565b50505050565b60006114bd8383611482565b60408301905092915050565b6000602082019050919050565b60006114e182611406565b6114eb8185611411565b93506114f683611422565b8060005b8381101561152757815161150e88826114b1565b9750611519836114c9565b9250506001810190506114fa565b5085935050505092915050565b6000602082019050818103600083015261154e81846114d6565b905092915050565b6000604051905090565b600080fd5b600080fd5b61157381611452565b811461157e57600080fd5b50565b6000813590506115908161156a565b92915050565b61159f816113d2565b81146115aa57600080fd5b50565b6000813590506115bc81611596565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611615826115cc565b810181811067ffffffffffffffff82111715611634576116336115dd565b5b80604052505050565b6000611647611556565b9050611653828261160c565b919050565b600067ffffffffffffffff821115611673576116726115dd565b5b61167c826115cc565b9050602081019050919050565b82818337600083830152505050565b60006116ab6116a684611658565b61163d565b9050828152602081018484840111156116c7576116c66115c7565b5b6116d2848285611689565b509392505050565b600082601f8301126116ef576116ee6115c2565b5b81356116ff848260208601611698565b91505092915050565b60008060006060848603121561172157611720611560565b5b600061172f86828701611581565b9350506020611740868287016115ad565b925050604084013567ffffffffffffffff81111561176157611760611565565b5b61176d868287016116da565b9150509250925092565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6117ac81611777565b82525050565b60006020820190506117c760008301846117a3565b92915050565b6117d681611452565b82525050565b60006020820190506117f160008301846117cd565b92915050565b600080fd5b600080fd5b60008083601f840112611817576118166115c2565b5b8235905067ffffffffffffffff811115611834576118336117f7565b5b6020830191508360208202830111156118505761184f6117fc565b5b9250929050565b6000806020838503121561186e5761186d611560565b5b600083013567ffffffffffffffff81111561188c5761188b611565565b5b61189885828601611801565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60007fffffffffffffffff00000000000000000000000000000000000000000000000082169050919050565b611905816118d0565b82525050565b600060ff82169050919050565b6119218161190b565b82525050565b60808201600082015161193d6000850182611464565b50602082015161195060208501826118fc565b5060408201516119636040850182611918565b5060608201516119766060850182611473565b50505050565b60006119888383611927565b60808301905092915050565b6000602082019050919050565b60006119ac826118a4565b6119b681856118af565b93506119c1836118c0565b8060005b838110156119f25781516119d9888261197c565b97506119e483611994565b9250506001810190506119c5565b5085935050505092915050565b60006020820190508181036000830152611a1981846119a1565b905092915050565b600060208284031215611a3757611a36611560565b5b6000611a4584828501611581565b91505092915050565b60008060408385031215611a6557611a64611560565b5b6000611a7385828601611581565b9250506020611a84858286016115ad565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611ac8826113d2565b9150611ad3836113d2565b9250828203905081811115611aeb57611aea611a8e565b5b92915050565b6000611afc826113d2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611b2e57611b2d611a8e565b5b600182019050919050565b6000611b44826113d2565b9150611b4f836113d2565b9250828201905080821115611b6757611b66611a8e565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611ba7826113d2565b9150611bb2836113d2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611beb57611bea611a8e565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611c30826113d2565b9150611c3b836113d2565b925082611c4b57611c4a611bf6565b5b828204905092915050565b600067ffffffffffffffff821115611c7157611c706115dd565b5b611c7a826115cc565b9050602081019050919050565b60005b83811015611ca5578082015181840152602081019050611c8a565b60008484015250505050565b6000611cc4611cbf84611c56565b61163d565b905082815260208101848484011115611ce057611cdf6115c7565b5b611ceb848285611c87565b509392505050565b600082601f830112611d0857611d076115c2565b5b8151611d18848260208601611cb1565b91505092915050565b600060208284031215611d3757611d36611560565b5b600082015167ffffffffffffffff811115611d5557611d54611565565b5b611d6184828501611cf3565b91505092915050565b611d738161190b565b8114611d7e57600080fd5b50565b600081519050611d9081611d6a565b92915050565b600060208284031215611dac57611dab611560565b5b6000611dba84828501611d81565b91505092915050565b600081519050611dd281611596565b92915050565b600060208284031215611dee57611ded611560565b5b6000611dfc84828501611dc3565b91505092915050565b6000611e10826113d2565b915060008203611e2357611e22611a8e565b5b600182039050919050565b6000604082019050611e4360008301856117cd565b611e5060208301846113dc565b9392505050565b60008115159050919050565b611e6c81611e57565b8114611e7757600080fd5b50565b600081519050611e8981611e63565b92915050565b600060208284031215611ea557611ea4611560565b5b6000611eb384828501611e7a565b91505092915050565b600082825260208201905092915050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869730000000000000000600082015250565b6000611f03601883611ebc565b9150611f0e82611ecd565b602082019050919050565b60006020820190508181036000830152611f3281611ef6565b905091905056fea26469706673582212207825e336e6f554e0f1c6411ad18b5f89281f52822b4c94454ee818cbbf2ed0a864736f6c63430008100033

Deployed ByteCode

0x6080604052600436106100955760003560e01c8063a9a1f41211610059578063a9a1f41214610176578063bd5dec98146101b3578063cea660c6146101dc578063e05e315814610205578063f79822431461022e5761009c565b806312fb0c88146100a15780632b2781a6146100cc57806350431ce4146100f75780638943ec021461010e5780638da5cb5b1461014b5761009c565b3661009c57005b600080fd5b3480156100ad57600080fd5b506100b6610257565b6040516100c391906113eb565b60405180910390f35b3480156100d857600080fd5b506100e1610314565b6040516100ee9190611534565b60405180910390f35b34801561010357600080fd5b5061010c6104ac565b005b34801561011a57600080fd5b5061013560048036038101906101309190611708565b610640565b60405161014291906117b2565b60405180910390f35b34801561015757600080fd5b50610160610653565b60405161016d91906117dc565b60405180910390f35b34801561018257600080fd5b5061019d60048036038101906101989190611857565b610679565b6040516101aa91906119ff565b60405180910390f35b3480156101bf57600080fd5b506101da60048036038101906101d59190611857565b610a28565b005b3480156101e857600080fd5b5061020360048036038101906101fe9190611a21565b610cd3565b005b34801561021157600080fd5b5061022c60048036038101906102279190611a4e565b610fa5565b005b34801561023a57600080fd5b5061025560048036038101906102509190611a4e565b611145565b005b60008068056bc75e2d6310000090506000600190505b600054811161030c57600360006002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154826102f79190611abd565b9150808061030490611af1565b91505061026d565b508091505090565b60606000805467ffffffffffffffff811115610333576103326115dd565b5b60405190808252806020026020018201604052801561036c57816020015b610359611346565b8152602001906001900390816103515790505b50905060005b6000548110156104a4576002600060018361038d9190611b39565b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168282815181106103cf576103ce611b6d565b5b60200260200101516000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506003600083838151811061042457610423611b6d565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015482828151811061048157610480611b6d565b5b60200260200101516020018181525050808061049c90611af1565b915050610372565b508091505090565b6000479050600081116104be57600080fd5b600080600080600190505b6000548111610639576002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154925068056bc75e2d6310000085846105639190611b9c565b61056d9190611c25565b91506000821115610626578373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156105be573d6000803e3d6000fd5b508373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b63988460405161061d91906113eb565b60405180910390a35b808061063190611af1565b9150506104c9565b5050505050565b6000638943ec0260e01b90509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600060018484905061068d9190611b39565b67ffffffffffffffff8111156106a6576106a56115dd565b5b6040519080825280602002602001820160405280156106df57816020015b6106cc611376565b8152602001906001900390816106c45790505b5090506040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020017f4e6174697665000000000000000000000000000000000000000000000000000077ffffffffffffffffffffffffffffffffffffffffffffffff19168152602001601260ff168152602001478152508160008151811061076d5761076c611b6d565b5b602002602001018190525060005b84849050811015610a1d5760008086868481811061079c5761079b611b6d565b5b90506020020160208101906107b19190611a21565b73ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156107fb573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906108249190611d21565b905060208101519150604051806080016040528088888681811061084b5761084a611b6d565b5b90506020020160208101906108609190611a21565b73ffffffffffffffffffffffffffffffffffffffff1681526020018377ffffffffffffffffffffffffffffffffffffffffffffffff191681526020018888868181106108af576108ae611b6d565b5b90506020020160208101906108c49190611a21565b73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611d96565b60ff16815260200188888681811061094d5761094c611b6d565b5b90506020020160208101906109629190611a21565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161099a91906117dc565b602060405180830381865afa1580156109b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109db9190611dd8565b815250846001856109ec9190611b39565b815181106109fd576109fc611b6d565b5b602002602001018190525050508080610a1590611af1565b91505061077b565b508091505092915050565b600080600080600080600090505b87879050811015610cc957878782818110610a5457610a53611b6d565b5b9050602002016020810190610a699190611a21565b95508573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610aa491906117dc565b602060405180830381865afa158015610ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae59190611dd8565b94506000851115610afd5784610afa90611e05565b94505b6000850315610cb6576000600190505b6000548111610cb4576002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169450600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154935068056bc75e2d631000008685610ba79190611b9c565b610bb19190611c25565b92506000831115610ca1578673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86856040518363ffffffff1660e01b8152600401610bf7929190611e2e565b6020604051808303816000875af1158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a9190611e8f565b508473ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b639885604051610c9891906113eb565b60405180910390a35b8080610cac90611af1565b915050610b0d565b505b8080610cc190611af1565b915050610a36565b5050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5a90611f19565b60405180910390fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015411610db257600080fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160009055600182016000905550506000548114610f5557600260008054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006002600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600260008054815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000808154610f9a90611e05565b919050819055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102c90611f19565b60405180910390fd5b600061103f610257565b90506000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541161109057600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154816110de9190611b39565b90506000821180156110f05750808211155b6110f957600080fd5b81600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111cc90611f19565b60405180910390fd5b60006111df610257565b90506000821180156111f15750808211155b6111fa57600080fd5b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541461124957600080fd5b600080815461125790611af1565b9190508190555082600260008054815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600054600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550505050565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600077ffffffffffffffffffffffffffffffffffffffffffffffff19168152602001600060ff168152602001600081525090565b6000819050919050565b6113e5816113d2565b82525050565b600060208201905061140060008301846113dc565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061145d82611432565b9050919050565b61146d81611452565b82525050565b61147c816113d2565b82525050565b6040820160008201516114986000850182611464565b5060208201516114ab6020850182611473565b50505050565b60006114bd8383611482565b60408301905092915050565b6000602082019050919050565b60006114e182611406565b6114eb8185611411565b93506114f683611422565b8060005b8381101561152757815161150e88826114b1565b9750611519836114c9565b9250506001810190506114fa565b5085935050505092915050565b6000602082019050818103600083015261154e81846114d6565b905092915050565b6000604051905090565b600080fd5b600080fd5b61157381611452565b811461157e57600080fd5b50565b6000813590506115908161156a565b92915050565b61159f816113d2565b81146115aa57600080fd5b50565b6000813590506115bc81611596565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611615826115cc565b810181811067ffffffffffffffff82111715611634576116336115dd565b5b80604052505050565b6000611647611556565b9050611653828261160c565b919050565b600067ffffffffffffffff821115611673576116726115dd565b5b61167c826115cc565b9050602081019050919050565b82818337600083830152505050565b60006116ab6116a684611658565b61163d565b9050828152602081018484840111156116c7576116c66115c7565b5b6116d2848285611689565b509392505050565b600082601f8301126116ef576116ee6115c2565b5b81356116ff848260208601611698565b91505092915050565b60008060006060848603121561172157611720611560565b5b600061172f86828701611581565b9350506020611740868287016115ad565b925050604084013567ffffffffffffffff81111561176157611760611565565b5b61176d868287016116da565b9150509250925092565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6117ac81611777565b82525050565b60006020820190506117c760008301846117a3565b92915050565b6117d681611452565b82525050565b60006020820190506117f160008301846117cd565b92915050565b600080fd5b600080fd5b60008083601f840112611817576118166115c2565b5b8235905067ffffffffffffffff811115611834576118336117f7565b5b6020830191508360208202830111156118505761184f6117fc565b5b9250929050565b6000806020838503121561186e5761186d611560565b5b600083013567ffffffffffffffff81111561188c5761188b611565565b5b61189885828601611801565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60007fffffffffffffffff00000000000000000000000000000000000000000000000082169050919050565b611905816118d0565b82525050565b600060ff82169050919050565b6119218161190b565b82525050565b60808201600082015161193d6000850182611464565b50602082015161195060208501826118fc565b5060408201516119636040850182611918565b5060608201516119766060850182611473565b50505050565b60006119888383611927565b60808301905092915050565b6000602082019050919050565b60006119ac826118a4565b6119b681856118af565b93506119c1836118c0565b8060005b838110156119f25781516119d9888261197c565b97506119e483611994565b9250506001810190506119c5565b5085935050505092915050565b60006020820190508181036000830152611a1981846119a1565b905092915050565b600060208284031215611a3757611a36611560565b5b6000611a4584828501611581565b91505092915050565b60008060408385031215611a6557611a64611560565b5b6000611a7385828601611581565b9250506020611a84858286016115ad565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611ac8826113d2565b9150611ad3836113d2565b9250828203905081811115611aeb57611aea611a8e565b5b92915050565b6000611afc826113d2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611b2e57611b2d611a8e565b5b600182019050919050565b6000611b44826113d2565b9150611b4f836113d2565b9250828201905080821115611b6757611b66611a8e565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611ba7826113d2565b9150611bb2836113d2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611beb57611bea611a8e565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611c30826113d2565b9150611c3b836113d2565b925082611c4b57611c4a611bf6565b5b828204905092915050565b600067ffffffffffffffff821115611c7157611c706115dd565b5b611c7a826115cc565b9050602081019050919050565b60005b83811015611ca5578082015181840152602081019050611c8a565b60008484015250505050565b6000611cc4611cbf84611c56565b61163d565b905082815260208101848484011115611ce057611cdf6115c7565b5b611ceb848285611c87565b509392505050565b600082601f830112611d0857611d076115c2565b5b8151611d18848260208601611cb1565b91505092915050565b600060208284031215611d3757611d36611560565b5b600082015167ffffffffffffffff811115611d5557611d54611565565b5b611d6184828501611cf3565b91505092915050565b611d738161190b565b8114611d7e57600080fd5b50565b600081519050611d9081611d6a565b92915050565b600060208284031215611dac57611dab611560565b5b6000611dba84828501611d81565b91505092915050565b600081519050611dd281611596565b92915050565b600060208284031215611dee57611ded611560565b5b6000611dfc84828501611dc3565b91505092915050565b6000611e10826113d2565b915060008203611e2357611e22611a8e565b5b600182039050919050565b6000604082019050611e4360008301856117cd565b611e5060208301846113dc565b9392505050565b60008115159050919050565b611e6c81611e57565b8114611e7757600080fd5b50565b600081519050611e8981611e63565b92915050565b600060208284031215611ea557611ea4611560565b5b6000611eb384828501611e7a565b91505092915050565b600082825260208201905092915050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869730000000000000000600082015250565b6000611f03601883611ebc565b9150611f0e82611ecd565b602082019050919050565b60006020820190508181036000830152611f3281611ef6565b905091905056fea26469706673582212207825e336e6f554e0f1c6411ad18b5f89281f52822b4c94454ee818cbbf2ed0a864736f6c63430008100033