Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- CoreTeamDAO
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-09-26T15:25:20.943547Z
Contract source code
// SPDX-License-Identifier: No License (None) pragma solidity 0.8.19; /** * @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 { address internal _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. *//* constructor () { _owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } */ /** * @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() == msg.sender, "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface ISoyPair { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); } interface IERC20 { function balanceOf(address owner) external view returns (uint); function transfer(address to, uint value) external; } contract CoreTeamDAO is Ownable { ISoyPair constant public CLO_BUSDT = ISoyPair(0xB852AD87329986EaC6e991954fe329231D1E4De1); // reserve0 - BUSDT, reserve1 - WCLO uint256 constant public salaryPeriod = 30 days; // salary period in seconds uint256 constant public quarterlyPeriod = 91 days; // period in seconds for quarterly payment uint256 constant public yearlyPeriod = 365 days; // period in seconds for yearly payment struct Employee { uint256 startTimestamp; // timestamp from which start periods uint256 lastClaimed; // timestamp when CLO was claimed last time uint256 salary; // salary in BUSDT (without decimals) uint256 quarterlyPercent; // percent of salary paid quarterly uint256 yearlyPercent; // percent of salary paid yearly uint256 quarterlyPending; // Amount of CLO that is pending for quarterly payout uint256 yearlyPending; // Amount of CLO that is pending for yearly payout uint256 unpaid; // Amount of CLO that was not paid due to insufficient contract balance bool isStopped; // stop payouts } mapping (address => Employee) public employees; address[] public employeesList; // list of employees bool public isPaused; event SetSalary(address employee, uint256 salary, uint256 quarterlyPercent, uint256 yearlyPercent, uint256 startTimestamp); event Claim(uint256 amount, uint256 pendingAmount); event RemoveEmployee(address employee); event Rescue(address token, uint256 amount); function initialize(address _newOwner) external { require(_owner == address(0)); _owner = _newOwner; emit OwnershipTransferred(address(0), _newOwner); } receive() external payable {} // Set salary in BUSDT without decimals. if "startTimestamp" == 0, then startTimestamp will not be updated function setSalary(address employee, uint256 salary, uint256 quarterlyPercent, uint256 yearlyPercent, uint256 startTimestamp) external onlyOwner { require(quarterlyPercent + yearlyPercent < 100, "Sum of percents must be less 100"); if (!isPaused && !employees[employee].isStopped) _claim(employee); // claim unlocked salary and bonus to employee address if(employees[employee].lastClaimed == 0) { // new employee employeesList.push(employee); } if (startTimestamp > 0) { employees[employee].startTimestamp = startTimestamp; employees[employee].lastClaimed = startTimestamp; } employees[employee].salary = salary; employees[employee].quarterlyPercent = quarterlyPercent; employees[employee].yearlyPercent = yearlyPercent; emit SetSalary(employee, salary, quarterlyPercent, yearlyPercent, startTimestamp); } // pause/unpause contract function setPause(bool pause) external onlyOwner { isPaused = pause; } // stop employee payment function setStop(address employee, bool stopped) external onlyOwner { employees[employee].isStopped = stopped; } // Remove employee function removeEmployee(address employee) external onlyOwner { require(employees[employee].isStopped, "Employee is not stopped"); uint256 len = employeesList.length - 1; address last = employeesList[len]; if(last == employee) employeesList.pop(); // if employee is the last in the list, then remove it else { for(uint i = 0; i < len; i++) { if(employeesList[i] == employee) { employeesList[i] = last; employeesList.pop(); break; } } } delete employees[employee]; emit RemoveEmployee(employee); } // claim unlocked salary and bonus to employee address function claim() external { require(tx.origin == msg.sender, "Call from contract disallowed"); // protection from flash-loan price manipulation require(!isPaused, "Payout paused"); require(!employees[msg.sender].isStopped, "Payment is stopped by owner"); _claim(msg.sender); } function _claim(address employee) internal { (uint256 unlockedAmount, uint256 quarterlyPending, uint256 yearlyPending) = getUnlockedAmount(employee); if (unlockedAmount != 0) { uint256 balance = address(this).balance; if (unlockedAmount > balance) { employees[employee].unpaid = unlockedAmount - balance; unlockedAmount = balance; } else { employees[employee].unpaid = 0; } employees[employee].lastClaimed = block.timestamp; employees[employee].quarterlyPending = quarterlyPending; employees[employee].yearlyPending = yearlyPending; safeTransferCLO(employee, unlockedAmount); emit Claim(unlockedAmount, employees[employee].unpaid); } } // return unlocked amount of CLO function getUnlockedAmount(address employee) public view returns(uint256 unlockedAmount, uint256 quarterlyPending, uint256 yearlyPending) { Employee memory e = employees[employee]; uint256 salaryCLO; // calculate CLO amount for salary based on CLO_BUSDT pool { (uint112 reserveBUSDT, uint112 reserveCLO,) = CLO_BUSDT.getReserves(); salaryCLO = e.salary * 1e18 * reserveCLO / reserveBUSDT; // convert salary from BUSDT to CLO and add 18 decimals } uint256 paidPeriods = (e.lastClaimed - e.startTimestamp) / salaryPeriod; uint256 passedPeriods = (block.timestamp - e.startTimestamp) / salaryPeriod; uint256 unpaidPeriods = passedPeriods - paidPeriods; unlockedAmount = salaryCLO * unpaidPeriods * (100 - e.quarterlyPercent - e.yearlyPercent) / 100; // unlocked salary e.quarterlyPending += (salaryCLO * unpaidPeriods * e.quarterlyPercent / 100); // add part of salary to quarterlyPending e.yearlyPending += (salaryCLO * unpaidPeriods * e.yearlyPercent / 100); // add part of salary to yearlyPending // calculate amount for quarterly part uint256 periodEnd = e.startTimestamp + (((block.timestamp - e.startTimestamp) / quarterlyPeriod ) * quarterlyPeriod); // timestamp when last quarterly period ended if (periodEnd > e.lastClaimed && periodEnd <= block.timestamp ) { // quarterly period ends unpaidPeriods = passedPeriods - ((periodEnd - e.startTimestamp) / salaryPeriod); // number of months excluded from quarterly payment quarterlyPending = (salaryCLO * unpaidPeriods * e.quarterlyPercent / 100); unlockedAmount += e.quarterlyPending - quarterlyPending; } else { quarterlyPending = e.quarterlyPending; } // calculate amount for yearly part periodEnd = e.startTimestamp + (((block.timestamp - e.startTimestamp) / yearlyPeriod ) * yearlyPeriod); // timestamp when last yearly period ended if (periodEnd > e.lastClaimed && periodEnd <= block.timestamp ) { // yearly period ends unpaidPeriods = passedPeriods - ((periodEnd - e.startTimestamp) / salaryPeriod); // number of months excluded from yearly payment yearlyPending = (salaryCLO * unpaidPeriods * e.yearlyPercent / 100); unlockedAmount += e.yearlyPending - yearlyPending; } else { yearlyPending = e.yearlyPending; } unlockedAmount += e.unpaid; // if contract has debt } // return allocated amount of CLO function getAllocatedAmount() external view returns(int256 allocatedToClaim, int256 totalAllocated) { uint256 len = employeesList.length; allocatedToClaim = int256(address(this).balance); uint256 totalUnlocked; uint256 totalPending; for (uint i = 0; i < len; i++) { if (!employees[employeesList[i]].isStopped) { // don't count employees with stopped payouts (uint256 unlocked, uint256 quarterlyPending, uint256 yearlyPending) = getUnlockedAmount(employeesList[i]); totalUnlocked += unlocked; totalPending = totalPending + quarterlyPending + yearlyPending; } } allocatedToClaim = allocatedToClaim - int256(totalUnlocked); totalAllocated = allocatedToClaim - int256(totalPending); } function getEmployeesList() external view returns(address[] memory) { return employeesList; } function rescueTokens(address _token) onlyOwner external { uint256 amount; if (_token == address(0)) { amount = address(this).balance; safeTransferCLO(msg.sender, amount); } else { amount = IERC20(_token).balanceOf(address(this)); safeTransfer(_token, msg.sender, amount); } emit Rescue(_token, amount); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferCLO(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: CLO_TRANSFER_FAILED'); } }
Contract ABI
[{"type":"event","name":"Claim","inputs":[{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"pendingAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RemoveEmployee","inputs":[{"type":"address","name":"employee","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Rescue","inputs":[{"type":"address","name":"token","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"SetSalary","inputs":[{"type":"address","name":"employee","internalType":"address","indexed":false},{"type":"uint256","name":"salary","internalType":"uint256","indexed":false},{"type":"uint256","name":"quarterlyPercent","internalType":"uint256","indexed":false},{"type":"uint256","name":"yearlyPercent","internalType":"uint256","indexed":false},{"type":"uint256","name":"startTimestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ISoyPair"}],"name":"CLO_BUSDT","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claim","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"startTimestamp","internalType":"uint256"},{"type":"uint256","name":"lastClaimed","internalType":"uint256"},{"type":"uint256","name":"salary","internalType":"uint256"},{"type":"uint256","name":"quarterlyPercent","internalType":"uint256"},{"type":"uint256","name":"yearlyPercent","internalType":"uint256"},{"type":"uint256","name":"quarterlyPending","internalType":"uint256"},{"type":"uint256","name":"yearlyPending","internalType":"uint256"},{"type":"uint256","name":"unpaid","internalType":"uint256"},{"type":"bool","name":"isStopped","internalType":"bool"}],"name":"employees","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"employeesList","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"int256","name":"allocatedToClaim","internalType":"int256"},{"type":"int256","name":"totalAllocated","internalType":"int256"}],"name":"getAllocatedAmount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getEmployeesList","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"unlockedAmount","internalType":"uint256"},{"type":"uint256","name":"quarterlyPending","internalType":"uint256"},{"type":"uint256","name":"yearlyPending","internalType":"uint256"}],"name":"getUnlockedAmount","inputs":[{"type":"address","name":"employee","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isPaused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"quarterlyPeriod","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeEmployee","inputs":[{"type":"address","name":"employee","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"rescueTokens","inputs":[{"type":"address","name":"_token","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"salaryPeriod","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPause","inputs":[{"type":"bool","name":"pause","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSalary","inputs":[{"type":"address","name":"employee","internalType":"address"},{"type":"uint256","name":"salary","internalType":"uint256"},{"type":"uint256","name":"quarterlyPercent","internalType":"uint256"},{"type":"uint256","name":"yearlyPercent","internalType":"uint256"},{"type":"uint256","name":"startTimestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setStop","inputs":[{"type":"address","name":"employee","internalType":"address"},{"type":"bool","name":"stopped","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"yearlyPeriod","inputs":[]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x608060405234801561001057600080fd5b5061195e806100206000396000f3fe6080604052600436106101225760003560e01c8063b1670d5c116100a0578063d108177a11610064578063d108177a146103cf578063f2fde38b146103ef578063f79bc6351461040f578063fb6195af14610426578063fe3f3f021461045057600080fd5b8063b1670d5c14610295578063b187bd26146102b7578063bedb86fb146102e1578063c4d66de814610301578063d06789471461032157600080fd5b80634e71d92d116100e75780634e71d92d14610216578063715018a61461022b5780638da5cb5b146102405780638e5ac8001461025e578063957138a41461027557600080fd5b8062ae3bf81461012e5780631fc9d53c146101505780632c310a121461017b578063420d4a02146101b3578063427de6c1146101ee57600080fd5b3661012957005b600080fd5b34801561013a57600080fd5b5061014e610149366004611611565b610470565b005b34801561015c57600080fd5b506101686301e1338081565b6040519081526020015b60405180910390f35b34801561018757600080fd5b5061019b610196366004611633565b61058e565b6040516001600160a01b039091168152602001610172565b3480156101bf57600080fd5b506101d36101ce366004611611565b6105b8565b60408051938452602084019290925290820152606001610172565b3480156101fa57600080fd5b5061019b73b852ad87329986eac6e991954fe329231d1e4de181565b34801561022257600080fd5b5061014e6109bb565b34801561023757600080fd5b5061014e610abb565b34801561024c57600080fd5b506000546001600160a01b031661019b565b34801561026a57600080fd5b506101686277f88081565b34801561028157600080fd5b5061014e61029036600461165d565b610b3e565b3480156102a157600080fd5b506102aa610ba5565b6040516101729190611694565b3480156102c357600080fd5b506003546102d19060ff1681565b6040519015158152602001610172565b3480156102ed57600080fd5b5061014e6102fc3660046116e1565b610c07565b34801561030d57600080fd5b5061014e61031c366004611611565b610c53565b34801561032d57600080fd5b5061038961033c366004611611565b600160208190526000918252604090912080549181015460028201546003830154600484015460058501546006860154600787015460089097015495969495939492939192909160ff1689565b60408051998a5260208a0198909852968801959095526060870193909352608086019190915260a085015260c084015260e0830152151561010082015261012001610172565b3480156103db57600080fd5b5061014e6103ea366004611611565b610cb4565b3480156103fb57600080fd5b5061014e61040a366004611611565b610f3b565b34801561041b57600080fd5b5061016862278d0081565b34801561043257600080fd5b5061043b611034565b60408051928352602083019190915201610172565b34801561045c57600080fd5b5061014e61046b3660046116fe565b611123565b336104836000546001600160a01b031690565b6001600160a01b0316146104b25760405162461bcd60e51b81526004016104a990611740565b60405180910390fd5b60006001600160a01b0382166104d35750476104ce338261130b565b610548565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053b9190611775565b90506105488233836113d9565b604080516001600160a01b0384168152602081018390527f542fa6bfee3b4746210fbdd1d83f9e49b65adde3639f8d8f165dd18347938af2910160405180910390a15050565b6002818154811061059e57600080fd5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b038116600090815260016020818152604080842081516101208101835281548152938101549284019290925260028201548382015260038201546060808501919091526004808401546080860152600584015460a0860152600684015460c0860152600784015460e086015260089093015460ff1615156101008501528151630240bc6b60e21b8152915185948594909385938493849373b852ad87329986eac6e991954fe329231d1e4de193630902f1ac9381830193909290918290030181865afa158015610693573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b791906117a5565b5091509150816001600160701b0316816001600160701b03168560400151670de0b6b3a76400006106e8919061180b565b6106f2919061180b565b6106fc9190611828565b92505050600062278d008360000151846020015161071a919061184a565b6107249190611828565b9050600062278d0084600001514261073c919061184a565b6107469190611828565b90506000610754838361184a565b9050606485608001518660600151606461076e919061184a565b610778919061184a565b610782838761180b565b61078c919061180b565b6107969190611828565b97506064856060015182866107ab919061180b565b6107b5919061180b565b6107bf9190611828565b8560a0018181516107d0919061185d565b90525060808501516064906107e5838761180b565b6107ef919061180b565b6107f99190611828565b8560c00181815161080a919061185d565b90525084516000906277f880908190610823904261184a565b61082d9190611828565b610837919061180b565b8651610843919061185d565b90508560200151811180156108585750428111155b156108ce57855162278d009061086e908361184a565b6108789190611828565b610882908461184a565b9150606486606001518387610897919061180b565b6108a1919061180b565b6108ab9190611828565b9750878660a001516108bd919061184a565b6108c7908a61185d565b98506108d6565b8560a0015197505b85516301e133809081906108ea904261184a565b6108f49190611828565b6108fe919061180b565b865161090a919061185d565b905085602001518111801561091f5750428111155b1561099557855162278d0090610935908361184a565b61093f9190611828565b610949908461184a565b915060648660800151838761095e919061180b565b610968919061180b565b6109729190611828565b9650868660c00151610984919061184a565b61098e908a61185d565b985061099d565b8560c0015196505b60e08601516109ac908a61185d565b98505050505050509193909250565b323314610a0a5760405162461bcd60e51b815260206004820152601d60248201527f43616c6c2066726f6d20636f6e747261637420646973616c6c6f77656400000060448201526064016104a9565b60035460ff1615610a4d5760405162461bcd60e51b815260206004820152600d60248201526c14185e5bdd5d081c185d5cd959609a1b60448201526064016104a9565b3360009081526001602052604090206008015460ff1615610ab05760405162461bcd60e51b815260206004820152601b60248201527f5061796d656e742069732073746f70706564206279206f776e6572000000000060448201526064016104a9565b610ab9336114f4565b565b33610ace6000546001600160a01b031690565b6001600160a01b031614610af45760405162461bcd60e51b81526004016104a990611740565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b33610b516000546001600160a01b031690565b6001600160a01b031614610b775760405162461bcd60e51b81526004016104a990611740565b6001600160a01b03919091166000908152600160205260409020600801805460ff1916911515919091179055565b60606002805480602002602001604051908101604052809291908181526020018280548015610bfd57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610bdf575b5050505050905090565b33610c1a6000546001600160a01b031690565b6001600160a01b031614610c405760405162461bcd60e51b81526004016104a990611740565b6003805460ff1916911515919091179055565b6000546001600160a01b031615610c6957600080fd5b600080546001600160a01b0319166001600160a01b03831690811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350565b33610cc76000546001600160a01b031690565b6001600160a01b031614610ced5760405162461bcd60e51b81526004016104a990611740565b6001600160a01b03811660009081526001602052604090206008015460ff16610d585760405162461bcd60e51b815260206004820152601760248201527f456d706c6f796565206973206e6f742073746f7070656400000000000000000060448201526064016104a9565b600254600090610d6a9060019061184a565b9050600060028281548110610d8157610d81611870565b6000918252602090912001546001600160a01b03908116915083168103610dda576002805480610db357610db3611886565b600082815260209020810160001990810180546001600160a01b0319169055019055610eaa565b60005b82811015610ea857836001600160a01b031660028281548110610e0257610e02611870565b6000918252602090912001546001600160a01b031603610e96578160028281548110610e3057610e30611870565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506002805480610e6f57610e6f611886565b600082815260209020810160001990810180546001600160a01b0319169055019055610ea8565b80610ea08161189c565b915050610ddd565b505b6001600160a01b0383166000818152600160208181526040808420848155928301849055600283018490556003830184905560048301849055600583018490556006830184905560078301939093556008909101805460ff1916905590519182527f52d6abdca596d1c4a93f3df131dcf3a55ecaaa92ab3a0be58a15b98aab12d49b910160405180910390a1505050565b33610f4e6000546001600160a01b031690565b6001600160a01b031614610f745760405162461bcd60e51b81526004016104a990611740565b6001600160a01b038116610fd95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104a9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60025447906000908180805b8381101561110357600160006002838154811061105f5761105f611870565b60009182526020808320909101546001600160a01b0316835282019290925260400190206008015460ff166110f15760008060006110c3600285815481106110a9576110a9611870565b6000918252602090912001546001600160a01b03166105b8565b919450925090506110d4838761185d565b9550806110e1838761185d565b6110eb919061185d565b94505050505b806110fb8161189c565b915050611040565b5061110e82866118b5565b945061111a81866118b5565b93505050509091565b336111366000546001600160a01b031690565b6001600160a01b03161461115c5760405162461bcd60e51b81526004016104a990611740565b6064611168838561185d565b106111b55760405162461bcd60e51b815260206004820181905260248201527f53756d206f662070657263656e7473206d757374206265206c6573732031303060448201526064016104a9565b60035460ff161580156111e457506001600160a01b03851660009081526001602052604090206008015460ff16155b156111f2576111f2856114f4565b6001600160a01b038516600090815260016020819052604082200154900361126057600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b0387161790555b8015611289576001600160a01b0385166000908152600160208190526040909120828155018190555b6001600160a01b038516600081815260016020908152604091829020600281018890556003810187905560040185905581519283528201869052810184905260608101839052608081018290527fca5d5e0f1ad92f22bec637b03c50ccb972e35e8577fbd2e5b1f9ae1f0b1822bc9060a0015b60405180910390a15050505050565b604080516000808252602082019092526001600160a01b03841690839060405161133591906118dc565b60006040518083038185875af1925050503d8060008114611372576040519150601f19603f3d011682016040523d82523d6000602084013e611377565b606091505b50509050806113d45760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a20434c4f5f5452414e534645525f46414960448201526213115160ea1b60648201526084016104a9565b505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009283929087169161143591906118dc565b6000604051808303816000865af19150503d8060008114611472576040519150601f19603f3d011682016040523d82523d6000602084013e611477565b606091505b50915091508180156114a15750805115806114a15750808060200190518101906114a1919061190b565b6114ed5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c45440060448201526064016104a9565b5050505050565b6000806000611502846105b8565b925092509250826000146115ef57478084111561154757611523818561184a565b6001600160a01b038616600090815260016020526040902060070155925082611564565b6001600160a01b0385166000908152600160205260408120600701555b6001600160a01b038516600090815260016020819052604090912042918101919091556005810184905560060182905561159e858561130b565b6001600160a01b038516600090815260016020908152604091829020600701548251878152918201527f022e3d29644ead4083349ca84d24bcac368b2461819b70f5921fea15de4dec4d91016112fc565b50505050565b80356001600160a01b038116811461160c57600080fd5b919050565b60006020828403121561162357600080fd5b61162c826115f5565b9392505050565b60006020828403121561164557600080fd5b5035919050565b801515811461165a57600080fd5b50565b6000806040838503121561167057600080fd5b611679836115f5565b915060208301356116898161164c565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156116d55783516001600160a01b0316835292840192918401916001016116b0565b50909695505050505050565b6000602082840312156116f357600080fd5b813561162c8161164c565b600080600080600060a0868803121561171657600080fd5b61171f866115f5565b97602087013597506040870135966060810135965060800135945092505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561178757600080fd5b5051919050565b80516001600160701b038116811461160c57600080fd5b6000806000606084860312156117ba57600080fd5b6117c38461178e565b92506117d16020850161178e565b9150604084015163ffffffff811681146117ea57600080fd5b809150509250925092565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417611822576118226117f5565b92915050565b60008261184557634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115611822576118226117f5565b80820180821115611822576118226117f5565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000600182016118ae576118ae6117f5565b5060010190565b81810360008312801583831316838312821617156118d5576118d56117f5565b5092915050565b6000825160005b818110156118fd57602081860181015185830152016118e3565b506000920191825250919050565b60006020828403121561191d57600080fd5b815161162c8161164c56fea2646970667358221220291c9a0c8c41eba32947bda7dd6c6e0672a7f1237c358ffdd3f61fa11dadafbd64736f6c63430008130033
Deployed ByteCode
0x6080604052600436106101225760003560e01c8063b1670d5c116100a0578063d108177a11610064578063d108177a146103cf578063f2fde38b146103ef578063f79bc6351461040f578063fb6195af14610426578063fe3f3f021461045057600080fd5b8063b1670d5c14610295578063b187bd26146102b7578063bedb86fb146102e1578063c4d66de814610301578063d06789471461032157600080fd5b80634e71d92d116100e75780634e71d92d14610216578063715018a61461022b5780638da5cb5b146102405780638e5ac8001461025e578063957138a41461027557600080fd5b8062ae3bf81461012e5780631fc9d53c146101505780632c310a121461017b578063420d4a02146101b3578063427de6c1146101ee57600080fd5b3661012957005b600080fd5b34801561013a57600080fd5b5061014e610149366004611611565b610470565b005b34801561015c57600080fd5b506101686301e1338081565b6040519081526020015b60405180910390f35b34801561018757600080fd5b5061019b610196366004611633565b61058e565b6040516001600160a01b039091168152602001610172565b3480156101bf57600080fd5b506101d36101ce366004611611565b6105b8565b60408051938452602084019290925290820152606001610172565b3480156101fa57600080fd5b5061019b73b852ad87329986eac6e991954fe329231d1e4de181565b34801561022257600080fd5b5061014e6109bb565b34801561023757600080fd5b5061014e610abb565b34801561024c57600080fd5b506000546001600160a01b031661019b565b34801561026a57600080fd5b506101686277f88081565b34801561028157600080fd5b5061014e61029036600461165d565b610b3e565b3480156102a157600080fd5b506102aa610ba5565b6040516101729190611694565b3480156102c357600080fd5b506003546102d19060ff1681565b6040519015158152602001610172565b3480156102ed57600080fd5b5061014e6102fc3660046116e1565b610c07565b34801561030d57600080fd5b5061014e61031c366004611611565b610c53565b34801561032d57600080fd5b5061038961033c366004611611565b600160208190526000918252604090912080549181015460028201546003830154600484015460058501546006860154600787015460089097015495969495939492939192909160ff1689565b60408051998a5260208a0198909852968801959095526060870193909352608086019190915260a085015260c084015260e0830152151561010082015261012001610172565b3480156103db57600080fd5b5061014e6103ea366004611611565b610cb4565b3480156103fb57600080fd5b5061014e61040a366004611611565b610f3b565b34801561041b57600080fd5b5061016862278d0081565b34801561043257600080fd5b5061043b611034565b60408051928352602083019190915201610172565b34801561045c57600080fd5b5061014e61046b3660046116fe565b611123565b336104836000546001600160a01b031690565b6001600160a01b0316146104b25760405162461bcd60e51b81526004016104a990611740565b60405180910390fd5b60006001600160a01b0382166104d35750476104ce338261130b565b610548565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053b9190611775565b90506105488233836113d9565b604080516001600160a01b0384168152602081018390527f542fa6bfee3b4746210fbdd1d83f9e49b65adde3639f8d8f165dd18347938af2910160405180910390a15050565b6002818154811061059e57600080fd5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b038116600090815260016020818152604080842081516101208101835281548152938101549284019290925260028201548382015260038201546060808501919091526004808401546080860152600584015460a0860152600684015460c0860152600784015460e086015260089093015460ff1615156101008501528151630240bc6b60e21b8152915185948594909385938493849373b852ad87329986eac6e991954fe329231d1e4de193630902f1ac9381830193909290918290030181865afa158015610693573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b791906117a5565b5091509150816001600160701b0316816001600160701b03168560400151670de0b6b3a76400006106e8919061180b565b6106f2919061180b565b6106fc9190611828565b92505050600062278d008360000151846020015161071a919061184a565b6107249190611828565b9050600062278d0084600001514261073c919061184a565b6107469190611828565b90506000610754838361184a565b9050606485608001518660600151606461076e919061184a565b610778919061184a565b610782838761180b565b61078c919061180b565b6107969190611828565b97506064856060015182866107ab919061180b565b6107b5919061180b565b6107bf9190611828565b8560a0018181516107d0919061185d565b90525060808501516064906107e5838761180b565b6107ef919061180b565b6107f99190611828565b8560c00181815161080a919061185d565b90525084516000906277f880908190610823904261184a565b61082d9190611828565b610837919061180b565b8651610843919061185d565b90508560200151811180156108585750428111155b156108ce57855162278d009061086e908361184a565b6108789190611828565b610882908461184a565b9150606486606001518387610897919061180b565b6108a1919061180b565b6108ab9190611828565b9750878660a001516108bd919061184a565b6108c7908a61185d565b98506108d6565b8560a0015197505b85516301e133809081906108ea904261184a565b6108f49190611828565b6108fe919061180b565b865161090a919061185d565b905085602001518111801561091f5750428111155b1561099557855162278d0090610935908361184a565b61093f9190611828565b610949908461184a565b915060648660800151838761095e919061180b565b610968919061180b565b6109729190611828565b9650868660c00151610984919061184a565b61098e908a61185d565b985061099d565b8560c0015196505b60e08601516109ac908a61185d565b98505050505050509193909250565b323314610a0a5760405162461bcd60e51b815260206004820152601d60248201527f43616c6c2066726f6d20636f6e747261637420646973616c6c6f77656400000060448201526064016104a9565b60035460ff1615610a4d5760405162461bcd60e51b815260206004820152600d60248201526c14185e5bdd5d081c185d5cd959609a1b60448201526064016104a9565b3360009081526001602052604090206008015460ff1615610ab05760405162461bcd60e51b815260206004820152601b60248201527f5061796d656e742069732073746f70706564206279206f776e6572000000000060448201526064016104a9565b610ab9336114f4565b565b33610ace6000546001600160a01b031690565b6001600160a01b031614610af45760405162461bcd60e51b81526004016104a990611740565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b33610b516000546001600160a01b031690565b6001600160a01b031614610b775760405162461bcd60e51b81526004016104a990611740565b6001600160a01b03919091166000908152600160205260409020600801805460ff1916911515919091179055565b60606002805480602002602001604051908101604052809291908181526020018280548015610bfd57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610bdf575b5050505050905090565b33610c1a6000546001600160a01b031690565b6001600160a01b031614610c405760405162461bcd60e51b81526004016104a990611740565b6003805460ff1916911515919091179055565b6000546001600160a01b031615610c6957600080fd5b600080546001600160a01b0319166001600160a01b03831690811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350565b33610cc76000546001600160a01b031690565b6001600160a01b031614610ced5760405162461bcd60e51b81526004016104a990611740565b6001600160a01b03811660009081526001602052604090206008015460ff16610d585760405162461bcd60e51b815260206004820152601760248201527f456d706c6f796565206973206e6f742073746f7070656400000000000000000060448201526064016104a9565b600254600090610d6a9060019061184a565b9050600060028281548110610d8157610d81611870565b6000918252602090912001546001600160a01b03908116915083168103610dda576002805480610db357610db3611886565b600082815260209020810160001990810180546001600160a01b0319169055019055610eaa565b60005b82811015610ea857836001600160a01b031660028281548110610e0257610e02611870565b6000918252602090912001546001600160a01b031603610e96578160028281548110610e3057610e30611870565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506002805480610e6f57610e6f611886565b600082815260209020810160001990810180546001600160a01b0319169055019055610ea8565b80610ea08161189c565b915050610ddd565b505b6001600160a01b0383166000818152600160208181526040808420848155928301849055600283018490556003830184905560048301849055600583018490556006830184905560078301939093556008909101805460ff1916905590519182527f52d6abdca596d1c4a93f3df131dcf3a55ecaaa92ab3a0be58a15b98aab12d49b910160405180910390a1505050565b33610f4e6000546001600160a01b031690565b6001600160a01b031614610f745760405162461bcd60e51b81526004016104a990611740565b6001600160a01b038116610fd95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104a9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60025447906000908180805b8381101561110357600160006002838154811061105f5761105f611870565b60009182526020808320909101546001600160a01b0316835282019290925260400190206008015460ff166110f15760008060006110c3600285815481106110a9576110a9611870565b6000918252602090912001546001600160a01b03166105b8565b919450925090506110d4838761185d565b9550806110e1838761185d565b6110eb919061185d565b94505050505b806110fb8161189c565b915050611040565b5061110e82866118b5565b945061111a81866118b5565b93505050509091565b336111366000546001600160a01b031690565b6001600160a01b03161461115c5760405162461bcd60e51b81526004016104a990611740565b6064611168838561185d565b106111b55760405162461bcd60e51b815260206004820181905260248201527f53756d206f662070657263656e7473206d757374206265206c6573732031303060448201526064016104a9565b60035460ff161580156111e457506001600160a01b03851660009081526001602052604090206008015460ff16155b156111f2576111f2856114f4565b6001600160a01b038516600090815260016020819052604082200154900361126057600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b0387161790555b8015611289576001600160a01b0385166000908152600160208190526040909120828155018190555b6001600160a01b038516600081815260016020908152604091829020600281018890556003810187905560040185905581519283528201869052810184905260608101839052608081018290527fca5d5e0f1ad92f22bec637b03c50ccb972e35e8577fbd2e5b1f9ae1f0b1822bc9060a0015b60405180910390a15050505050565b604080516000808252602082019092526001600160a01b03841690839060405161133591906118dc565b60006040518083038185875af1925050503d8060008114611372576040519150601f19603f3d011682016040523d82523d6000602084013e611377565b606091505b50509050806113d45760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a20434c4f5f5452414e534645525f46414960448201526213115160ea1b60648201526084016104a9565b505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009283929087169161143591906118dc565b6000604051808303816000865af19150503d8060008114611472576040519150601f19603f3d011682016040523d82523d6000602084013e611477565b606091505b50915091508180156114a15750805115806114a15750808060200190518101906114a1919061190b565b6114ed5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c45440060448201526064016104a9565b5050505050565b6000806000611502846105b8565b925092509250826000146115ef57478084111561154757611523818561184a565b6001600160a01b038616600090815260016020526040902060070155925082611564565b6001600160a01b0385166000908152600160205260408120600701555b6001600160a01b038516600090815260016020819052604090912042918101919091556005810184905560060182905561159e858561130b565b6001600160a01b038516600090815260016020908152604091829020600701548251878152918201527f022e3d29644ead4083349ca84d24bcac368b2461819b70f5921fea15de4dec4d91016112fc565b50505050565b80356001600160a01b038116811461160c57600080fd5b919050565b60006020828403121561162357600080fd5b61162c826115f5565b9392505050565b60006020828403121561164557600080fd5b5035919050565b801515811461165a57600080fd5b50565b6000806040838503121561167057600080fd5b611679836115f5565b915060208301356116898161164c565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156116d55783516001600160a01b0316835292840192918401916001016116b0565b50909695505050505050565b6000602082840312156116f357600080fd5b813561162c8161164c565b600080600080600060a0868803121561171657600080fd5b61171f866115f5565b97602087013597506040870135966060810135965060800135945092505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561178757600080fd5b5051919050565b80516001600160701b038116811461160c57600080fd5b6000806000606084860312156117ba57600080fd5b6117c38461178e565b92506117d16020850161178e565b9150604084015163ffffffff811681146117ea57600080fd5b809150509250925092565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417611822576118226117f5565b92915050565b60008261184557634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115611822576118226117f5565b80820180821115611822576118226117f5565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000600182016118ae576118ae6117f5565b5060010190565b81810360008312801583831316838312821617156118d5576118d56117f5565b5092915050565b6000825160005b818110156118fd57602081860181015185830152016118e3565b506000920191825250919050565b60006020828403121561191d57600080fd5b815161162c8161164c56fea2646970667358221220291c9a0c8c41eba32947bda7dd6c6e0672a7f1237c358ffdd3f61fa11dadafbd64736f6c63430008130033