Contract Address Details

0xa81c9070CDdE315180fcB14b783345F77E087138

Contract Name
RecordStorage
Creator
0x195582–c8d801 at 0xac6467–1d031b
Balance
0 ROSE
Tokens
Fetching tokens...
Transactions
18 Transactions
Transfers
23 Transfers
Gas Used
5,727,047
Last Balance Update
4334638
Contract name:
RecordStorage




Optimization enabled
true
Compiler version
v0.8.11+commit.d7f03943




Optimization runs
200
EVM Version
default




Verified at
2022-06-19 09:48:46.464947Z

Constructor Arguments

0000000000000000000000006cb9750a92643382e020ea9a170abb83df05f30b00000000000000000000000094fbffe5698db6f54d6ca524dbe673a7729014be00000000000000000000000021c718c22d52d0f3a789b752d4c2fd5908a8a733

Arg [0] (address) : 0x6cb9750a92643382e020ea9a170abb83df05f30b
Arg [1] (address) : 0x94fbffe5698db6f54d6ca524dbe673a7729014be
Arg [2] (address) : 0x21c718c22d52d0f3a789b752d4c2fd5908a8a733

              

Contract source code

pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
contract UserStorage is Ownable {
struct User {
address userAddr;
string avatar;
string email;
uint isOnline;
uint userFlag;
uint256 credit;
uint regTime;
TradeStats tradeStats;
MorgageStats morgageStats;
}
struct TradeStats {
uint256 tradeTotal;
uint256 restTotal;
}
struct MorgageStats {
uint256 mortgage;
uint256 freezeMortgage;
uint256 relieveMortgage;
uint256 inviteUserCount;
uint256 inviteUserReward;
uint applyRelieveTime;
uint handleRelieveTime;
}
mapping (address => User) public users;
mapping (address => uint256) public userIndex;
User[] public userList;
event addUser(address _userAddr);
event updateUser(string _avatar, string _email, uint _isOnline);
address _restCAddr;
address _orderCAddr;
address _recordCAddr;
address _appealCAddr;
modifier onlyAuthFromAddr() {
require(_restCAddr != address(0), 'Invalid address call rest');
require(_orderCAddr != address(0), 'Invalid address call order');
require(_recordCAddr != address(0), 'Invalid address call record');
require(_appealCAddr != address(0), 'Invalid address call appeal');
_;
}
function authFromContract(address _fromRest, address _fromOrder, address _fromRecord, address _fromAppeal) external onlyOwner {
_restCAddr = _fromRest;
_orderCAddr = _fromOrder;
_recordCAddr = _fromRecord;
_appealCAddr = _fromAppeal;
}
modifier onlyMemberOf() {
require(users[msg.sender].userAddr != address(0), 'has no permission');
_;
}
function _insert(address _addr) internal {
require(_addr != address(0), "UserStorage: addr null is not allowed");
require(users[_addr].userAddr == address(0), "UserStorage: current User exist");
TradeStats memory tradeStats = TradeStats({tradeTotal:0, restTotal:0});
MorgageStats memory morgageStats = MorgageStats({mortgage:0, freezeMortgage:0, relieveMortgage: 0, inviteUserCount:0, inviteUserReward:0, applyRelieveTime:0, handleRelieveTime:0});
User memory u = User({userAddr:_addr, avatar: '', email:'',
isOnline:1, userFlag:0, credit:0, regTime:block.timestamp,tradeStats:tradeStats, morgageStats:morgageStats});
users[_addr] = u;
userList.push(u);
userIndex[_addr] = userList.length -1;
emit addUser(_addr);
}
function _updateInfo(address _addr, string memory _avatar, string memory _email, uint _isOnline) internal {
require(_addr != address(0), "UserStorage: _addr null is not allowed");
require(users[_addr].userAddr != address(0), "UserStorage: current User not exist");
User memory u = users[_addr];
if(bytes(_avatar).length != 0){
u.avatar = _avatar;
}
if(bytes(_email).length != 0){
u.email = _email;
}
if(_isOnline != uint(0)){
u.isOnline = _isOnline;
}
users[_addr] = u;
userList[userIndex[_addr]] = u;
}
function _updateTradeStats(address _addr, TradeStats memory _tradeStats, uint _credit) internal {
require(_addr != address(0), "UserStorage: _addr null is not allowed");
require(users[_addr].userAddr != address(0), "UserStorage: current User not exist");
User memory u = users[_addr];
u.credit = _credit;
u.tradeStats.tradeTotal = _tradeStats.tradeTotal;
u.tradeStats.restTotal = _tradeStats.restTotal;
users[_addr] = u;
userList[userIndex[_addr]] = u;
}
function _updateMorgageStats(address _addr, MorgageStats memory _morgageStats) internal {
require(_addr != address(0), "UserStorage: _addr null is not allowed");
require(users[_addr].userAddr != address(0), "UserStorage: current User not exist");
User memory u = users[_addr];
u.morgageStats.mortgage = _morgageStats.mortgage;
u.morgageStats.freezeMortgage = _morgageStats.freezeMortgage;
u.morgageStats.relieveMortgage = _morgageStats.relieveMortgage;
u.morgageStats.inviteUserCount = _morgageStats.inviteUserCount;
u.morgageStats.inviteUserReward = _morgageStats.inviteUserReward;
u.morgageStats.applyRelieveTime = _morgageStats.applyRelieveTime;
u.morgageStats.handleRelieveTime = _morgageStats.handleRelieveTime;
users[_addr] = u;
userList[userIndex[_addr]] = u;
}
function _search(address _addr) internal view returns(User memory user) {
require(_addr != address(0), "UserStorage: _addr null is not allowed");
require(users[_addr].userAddr != address(0), "UserStorage: current User not exist");
User memory a = users[_addr];
return a;
}
function register() external {
require(!isMemberOf(), 'has registed');
_insert(msg.sender);
}
function isMemberOf() public view returns (bool) {
return (users[msg.sender].userAddr != address(0));
}
function updateInfo(string memory _avatar, string memory _email, uint _isOnline) onlyMemberOf external {
_updateInfo(msg.sender, _avatar, _email, _isOnline);
emit updateUser(_avatar, _email, _isOnline);
}
function updateTradeStats(address _addr, TradeStats memory _tradeStats, uint _credit) onlyAuthFromAddr public {
require(msg.sender == _restCAddr || msg.sender == _orderCAddr || msg.sender == _appealCAddr || msg.sender == _recordCAddr, 'UserStorage:Invalid from contract address');
_updateTradeStats(_addr, _tradeStats, _credit);
}
function updateMorgageStats(address _addr, MorgageStats memory _morgageStats) onlyAuthFromAddr public {
require(msg.sender == _recordCAddr, 'UserStorage:Invalid from contract address');
_updateMorgageStats(_addr, _morgageStats);
}
function updateUserRole(address _addr, uint _userFlag) onlyAuthFromAddr public {
require(msg.sender == _recordCAddr, 'UserStorage:Invalid from contract address');
require(_addr != address(0), "UserStorage: _addr null is not allowed");
require(users[_addr].userAddr != address(0), "UserStorage: current User not exist");
require(_userFlag<=3, 'UserStorage: Invalid userFlag 3');
User memory u = users[_addr];
u.userFlag = _userFlag;
users[_addr] = u;
userList[userIndex[_addr]] = u;
}
function searchUser(address _addr) external view returns(User memory user) {
return _search(_addr);
}
function searchUserList() external view returns(User[] memory) {
return userList;
}
}
abstract contract ReentrancyGuardRest {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
library CountersRest {
struct Counter {
uint256 _value;
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
{
if (counter._value == 0) {
counter._value = 10000;
}
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
{
counter._value = value - 1;
}
}
}
contract RestStorage is Ownable,ReentrancyGuardRest {
using CountersRest for CountersRest.Counter;
RecordInterface private _recordStorage;
UserInterface private _userStorage;
address recordAddress;
struct Rest {
address userAddr;
uint restNo;
uint restType;
string coinType;
string currencyType;
uint restCount;
uint price;
uint[] payType;
uint restStatus;
RestDetail restDetail;
}
struct RestDetail {
uint finishCount;
uint remainderCount;
uint limitAmountFrom;
uint limitAmountTo;
uint limitMinCredit;
uint limitMinMortgage;
string restRemark;
uint restTime;
uint updateTime;
uint restFee;
string restHash;
}
CountersRest.Counter private _restNoCounter;
mapping (uint => Rest) private rests;
mapping (uint => uint) private restIndex;
Rest[] private restList;
mapping(address=>mapping(uint=>uint)) restFrozenTotal;
event RestAdd(uint _restNo, uint _restType, string _coinType, string _currencyType, uint _restCount, uint _price, uint[] _payType,RestDetail _restDetail);
event RestUpdate(uint _restNo, string _coinType, string _currencyType, uint _restCount, uint _price,uint[] _payType, RestDetail _restDetail);
address _orderCAddr;
modifier onlyAuthFromAddr() {
require(_orderCAddr == msg.sender, 'Invalid contract address');
_;
}
function authFromContract(address _recordAddr, address _userAddr, address _orderAddr) external onlyOwner {
_orderCAddr = _orderAddr;
_recordStorage = RecordInterface(_recordAddr);
_userStorage = UserInterface(_userAddr);
recordAddress = _recordAddr;
_restNoCounter.increment();
}
modifier onlyRestOwner(uint _restNo) {
require(rests[_restNo].userAddr == msg.sender, "rest address not exist");
_;
}
function _checkParam(uint _restType, string memory _coinType, string memory _currencyType,
uint _restCount, uint _price, uint[] memory _payType) pure internal {
require(_restType != uint(0), "RestStorage: restType null is not allowed");
require(bytes(_coinType).length != 0, "RestStorage: coinType null is not allowed");
require(bytes(_currencyType).length != 0, "RestStorage: currencyType null is not allowed");
require(_restCount != uint(0), "RestStorage: restCount null is not allowed");
require(_price != uint(0), "RestStorage: price null is not allowed");
require(_payType.length != 0, "RestStorage: payType null is not allowed");
}
function _insert(uint _restType, string memory _coinType, string memory _currencyType,
uint _restCount, uint _price, uint[] memory _payType, RestDetail memory _restDetail) internal nonReentrant returns(uint){
_checkParam(_restType, _coinType, _currencyType, _restCount, _price, _payType);
uint _restNo = _restNoCounter.current();
require(rests[_restNo].restNo == uint(0), "rest exist");
_restDetail.finishCount = 0;
_restDetail.remainderCount = _restCount;
_restDetail.restTime = block.timestamp;
_restDetail.updateTime = 0;
if(_restDetail.limitAmountTo > SafeMath.mul(_restCount, _price) || _restDetail.limitAmountTo == 0) {
_restDetail.limitAmountTo = SafeMath.mul(_restCount, _price);
}
Rest memory r = Rest({userAddr: msg.sender, restNo: _restNo, restType:_restType,
coinType:_coinType, currencyType:_currencyType,
restCount:_restCount, price:_price,
payType:_payType, restStatus:1, restDetail: _restDetail});
rests[_restNo] = r;
restList.push(r);
restIndex[_restNo] = restList.length-1;
_restNoCounter.increment();
emit RestAdd(_restNo, _restType, _coinType, _currencyType, _restCount, _price, _payType, _restDetail);
return _restNo;
}
function _updateInfo(uint _restNo, string memory _coinType, string memory _currencyType,
uint _addCount, uint _price, uint[] memory _payType, RestDetail memory _restDetail) internal {
require(_restNo != uint(0), 'Invalid restNo');
Rest memory r = rests[_restNo];
r.restStatus = 1;
if(bytes(_coinType).length != 0){
r.coinType = _coinType;
}
if(bytes(_currencyType).length != 0){
r.currencyType = _currencyType;
}
if(_price != uint(0)){
r.price = _price;
}
if(_addCount != uint(0)){
r.restCount += _addCount;
r.restDetail.remainderCount += _addCount;
r.restDetail.limitAmountTo = SafeMath.mul(r.restDetail.remainderCount, r.price);
}
if(_payType.length != 0){
r.payType = _payType;
}
if(_restDetail.limitAmountFrom != uint(0)){
if(_restDetail.limitAmountFrom > r.restDetail.limitAmountTo) {
_restDetail.limitAmountFrom = r.restDetail.limitAmountTo;
}
r.restDetail.limitAmountFrom = _restDetail.limitAmountFrom;
}
if(_restDetail.limitMinCredit != uint(0)){
r.restDetail.limitMinCredit = _restDetail.limitMinCredit;
}
if(_restDetail.limitMinMortgage != uint(0)){
r.restDetail.limitMinMortgage = _restDetail.limitMinMortgage;
}
if(bytes(_restDetail.restRemark).length != 0){
r.restDetail.restRemark = _restDetail.restRemark;
}
if(_restDetail.restFee != uint(0)){
r.restDetail.restFee = _restDetail.restFee;
}
r.restDetail.updateTime = block.timestamp;
rests[_restNo] = r;
restList[restIndex[_restNo]] = r;
emit RestUpdate(_restNo, _coinType, _currencyType, r.restCount, _price, _payType, _restDetail);
}
function addBuyRest(uint _restType, string memory _coinType, string memory _currencyType,
uint _restCount, uint _price, uint[] memory _payType,RestDetail memory _restDetail) external {
require(_restType == 1, "must buy rest" );
UserStorage.User memory _user = _userStorage.searchUser(msg.sender);
bool _openTrade = _recordStorage.getOpenTrade();
require(_openTrade || _user.userFlag == 3, "invalid user" );
_insert(_restType, _coinType, _currencyType, _restCount, _price, _payType, _restDetail);
}
function _addSell(uint _restType, string memory _coinType, string memory _currencyType,
uint _restCount, uint _restFee, uint _price, uint[] memory _payType,RestDetail memory _restDetail) internal {
require(_restType == 2, "must sell rest" );
require(_restCount > 0, "restCount error");
UserStorage.User memory _user = _userStorage.searchUser(msg.sender);
bool _openTrade = _recordStorage.getOpenTrade();
require(_openTrade || _user.userFlag == 3, "invalid user" );
_recordStorage.addRecord(msg.sender, '', _coinType, _restCount, 2, 1, 2);
uint _needSub = SafeMath.add(_restCount, _restFee);
TokenTransfer _tokenTransfer = _recordStorage.getERC20Address(_coinType);
_tokenTransfer.transferFrom(msg.sender, recordAddress, _needSub);
uint _newRestNo = _insert(_restType, _coinType, _currencyType, _restCount, _price, _payType, _restDetail);
restFrozenTotal[msg.sender][_newRestNo] = _restCount;
}
function addSellRest(uint _restType, string memory _coinType, string memory _currencyType,
uint _restCount,uint _restFee, uint _price, uint[] memory _payType,RestDetail memory _restDetail) external {
_addSell(_restType, _coinType, _currencyType, _restCount,_restFee,_price, _payType, _restDetail);
}
function getRestFrozenTotal(address _addr, uint _restNo) public view returns(uint) {
return restFrozenTotal[_addr][_restNo];
}
function cancelBuyRest(uint _restNo) external onlyRestOwner(_restNo) {
require(rests[_restNo].restStatus == 1, "can't change this rest");
require(rests[_restNo].restType == 1, "Invalid rest type");
require(rests[_restNo].restDetail.finishCount < rests[_restNo].restCount, "this rest has finished");
Rest memory r = rests[_restNo];
r.restStatus = 4;
r.restDetail.updateTime = block.timestamp;
rests[_restNo] = r;
restList[restIndex[_restNo]] = r;
}
function _cancelSell(uint _restNo) onlyRestOwner(_restNo) internal {
require(rests[_restNo].restStatus == 1, "can't cancel this rest");
require(rests[_restNo].restType == 2, "Invalid rest type");
require(rests[_restNo].restDetail.finishCount < rests[_restNo].restCount, "this rest has finished");
require(restFrozenTotal[msg.sender][_restNo] > 0, "rest has finished");
uint _frozenTotal = _recordStorage.getFrozenTotal(msg.sender, rests[_restNo].coinType);
require(_frozenTotal >= restFrozenTotal[msg.sender][_restNo], "can't cancel this rest");
uint remainHoldCoin = restFrozenTotal[msg.sender][_restNo];
Rest memory r = rests[_restNo];
r.restStatus = 4;
if (remainHoldCoin < rests[_restNo].restCount) {
r.restStatus = 5;
}
r.restDetail.remainderCount = 0;
r.restDetail.updateTime = block.timestamp;
rests[_restNo] = r;
restList[restIndex[_restNo]] = r;
restFrozenTotal[msg.sender][_restNo] = 0;
_recordStorage.addAvailableTotal(msg.sender, rests[_restNo].coinType, remainHoldCoin);
}
function cancelSellRest(uint _restNo) external{
_cancelSell(_restNo);
}
function startOrStop(uint _restNo, uint _restStatus) external onlyRestOwner(_restNo){
require(_restStatus == 1 || _restStatus == 3, "Invalid rest status");
Rest memory r = rests[_restNo];
require(r.restStatus == 1 || r.restStatus == 3, "Invalid rest status,opt error");
r.restStatus = _restStatus;
r.restDetail.updateTime = block.timestamp;
rests[_restNo] = r;
restList[restIndex[_restNo]] = r;
}
function updateInfo(uint _restNo, string memory _coinType, string memory _currencyType,
uint _addCount, uint _restFee, uint _price,uint[] memory _payType, RestDetail memory _restDetail) external onlyRestOwner(_restNo){
require(_restNo != uint(0), 'Invalid restNo');
Rest memory _rest = rests[_restNo];
require(_rest.restNo != uint(0), 'rest not exist');
if (_rest.restType == 2) {
_recordStorage.addRecord(msg.sender, '', _coinType, _addCount, 2, 1, 2);
uint _needSub = SafeMath.add(_addCount, _restFee);
TokenTransfer _tokenTransfer = _recordStorage.getERC20Address(_coinType);
_tokenTransfer.transferFrom(msg.sender, recordAddress, _needSub);
restFrozenTotal[msg.sender][_restNo] += _addCount;
}
_updateInfo(_restNo, _coinType, _currencyType, _addCount, _price, _payType, _restDetail);
}
function updateRestFinishCount(uint _restNo, uint _finishCount) onlyAuthFromAddr external {
Rest memory _rest = rests[_restNo];
require(_rest.restDetail.remainderCount >= _finishCount, "RestStorage:finish count error");
if (_rest.restType == 2) {
restFrozenTotal[_rest.userAddr][_restNo] = SafeMath.sub(restFrozenTotal[_rest.userAddr][_restNo], _finishCount);
}
_rest.restDetail.finishCount = SafeMath.add(_rest.restDetail.finishCount, _finishCount);
_rest.restDetail.remainderCount = SafeMath.sub(_rest.restDetail.remainderCount, _finishCount);
_rest.restDetail.limitAmountTo = SafeMath.mul(_rest.price, _rest.restDetail.remainderCount);
if (_rest.restDetail.remainderCount == 0) {
_rest.restStatus = 2;
}
_rest.restDetail.updateTime = block.timestamp;
rests[_restNo] = _rest;
restList[restIndex[_restNo]] = _rest;
}
function addRestRemainCount(uint _restNo, uint _remainCount) onlyAuthFromAddr public {
Rest memory _rest = rests[_restNo];
require(_remainCount > 0 && _rest.restDetail.finishCount >= _remainCount, "count error");
if (_rest.restType == 2) {
restFrozenTotal[_rest.userAddr][_restNo] = SafeMath.add(restFrozenTotal[_rest.userAddr][_restNo], _remainCount);
}
_rest.restDetail.finishCount = SafeMath.sub(_rest.restDetail.finishCount, _remainCount);
_rest.restDetail.remainderCount = SafeMath.add(_rest.restDetail.remainderCount, _remainCount);
_rest.restDetail.limitAmountTo = SafeMath.mul(_rest.price, _rest.restDetail.remainderCount);
_rest.restDetail.limitAmountFrom = _rest.restDetail.limitAmountFrom > _rest.restDetail.limitAmountTo ? _rest.restDetail.limitAmountTo : _rest.restDetail.limitAmountFrom;
_rest.restStatus = 1;
_rest.restDetail.updateTime = block.timestamp;
rests[_restNo] = _rest;
restList[restIndex[_restNo]] = _rest;
}
function searchRest(uint _restNo) external view returns(Rest memory rest) {
require(_restNo != uint(0), "restNo null is not allowed");
Rest memory r = rests[_restNo];
return r;
}
function searchRestList() external view returns(Rest[] memory) {
return restList;
}
}
abstract contract ReentrancyGuardOrder {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
library CountersOrder {
struct Counter {
uint256 _value;
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
{
if (counter._value == 0) {
counter._value = 10000;
}
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
{
counter._value = value - 1;
}
}
}
contract OrderStorage is Ownable, ReentrancyGuardOrder {
using CountersOrder for CountersOrder.Counter;
RestStorage private _restStorage;
RecordInterface private _recordStorage;
UserInterface private _userStorage;
AppealInterface private _appealS;
address recordAddress;
struct Order {
address userAddr;
uint256 orderNo;
uint256 restNo;
uint256 coinCount;
uint256 orderAmount;
uint256 payType;
string currencyType;
uint256 orderType;
uint256 orderStatus;
OrderDetail orderDetail;
}
struct OrderDetail {
address buyerAddr;
address sellerAddr;
string coinType;
uint256 price;
uint256 tradeTime;
uint256 updateTime;
string tradeHash;
uint256 tradeFee;
}
CountersOrder.Counter private _orderNoCounter;
mapping(uint256 => Order) private orders;
mapping(uint256 => uint256) private orderIndex;
Order[] private orderList;
mapping(address => mapping(uint256 => uint256)) orderFrozenTotal;
uint256 cancelOrderTime = 30;
function setCancelOrderTime(uint256 _count) public onlyOwner {
cancelOrderTime = _count;
}
function getCancelOrderTime() public view returns (uint256) {
return cancelOrderTime;
}
uint256 canWithdrawHours = 24;
function setCanWithdrawHours(uint256 _count) public onlyOwner {
canWithdrawHours = _count;
}
function getCanWithdrawHours() public view returns (uint256) {
return canWithdrawHours;
}
event OrderAdd(
uint256 _orderNo,
uint256 _restNo,
uint256 _coinCount,
uint256 _tradeFee,
uint256 _orderAmount,
uint256 _payType,
uint256 _orderType,
address _buyerAddr,
address _sellerAddr
);
event OrderPaidMoney(uint256 _orderNo);
event OrderConfirmCollect(uint256 _orderNo);
event OrderCancel(uint256 _orderNo);
event OrderUpdateStatus(uint256 _orderNo, uint256 _orderStatus);
function authFromContract(
address _recordAddr,
address _restAddr,
address _userAddr,
address _appealAddr
) external onlyOwner {
_recordStorage = RecordInterface(_recordAddr);
_restStorage = RestStorage(_restAddr);
_userStorage = UserInterface(_userAddr);
recordAddress = _recordAddr;
_appealS = AppealInterface(_appealAddr);
_orderNoCounter.increment();
}
modifier onlyBuyer(uint256 _orderNo) {
require(_orderNo != uint256(0), "orderNo null");
require(
orders[_orderNo].orderDetail.buyerAddr == msg.sender,
"only buyer"
);
_;
}
modifier onlySeller(uint256 _orderNo) {
require(_orderNo != uint256(0), "orderNo null");
require(
orders[_orderNo].orderDetail.sellerAddr == msg.sender,
"only seller"
);
_;
}
modifier onlyBuyerOrSeller(uint256 _orderNo) {
require(_orderNo != uint256(0), "orderNo null");
require(
orders[_orderNo].orderDetail.sellerAddr == msg.sender ||
orders[_orderNo].orderDetail.buyerAddr == msg.sender,
"Only buyer or seller"
);
_;
}
function _checkParam(
uint256 _restNo,
uint256 _coinCount,
uint256 _orderAmount,
uint256 _payType
) internal pure {
require(_restNo != uint256(0), "restNo null");
require(_coinCount > 0, "coinCount null");
require(_orderAmount > 0, "orderAmount null");
require(_payType != uint256(0), "payType null");
}
function _insert(
uint256 _restNo,
uint256 _coinCount,
uint256 _tradeFee,
uint256 _orderAmount,
uint256 _payType,
uint256 _orderType,
address _buyerAddr,
address _sellerAddr
) internal nonReentrant returns (uint256 restNo) {
_checkParam(_restNo, _coinCount, _orderAmount, _payType);
RestStorage.Rest memory _rest = _restStorage.searchRest(_restNo);
require(_rest.userAddr != address(0), "rest not exist");
OrderDetail memory _orderDetail = OrderDetail({
buyerAddr: _buyerAddr,
sellerAddr: _sellerAddr,
coinType: _rest.coinType,
price: _rest.price,
tradeTime: block.timestamp,
updateTime: 0,
tradeHash: "",
tradeFee: _tradeFee
});
uint256 _orderNo = _orderNoCounter.current();
require(orders[_orderNo].orderNo == uint256(0), "order exist");
Order memory order = Order({
userAddr: msg.sender,
orderNo: _orderNo,
restNo: _restNo,
coinCount: _coinCount,
orderAmount: _orderAmount,
payType: _payType,
currencyType: _rest.currencyType,
orderType: _orderType,
orderStatus: 1,
orderDetail: _orderDetail
});
orders[_orderNo] = order;
orderList.push(order);
orderIndex[_orderNo] = orderList.length - 1;
if (_orderType == 2) {
orderFrozenTotal[msg.sender][_orderNo] = _coinCount;
} else if (_orderType == 1) {
orderFrozenTotal[_rest.userAddr][_orderNo] = _coinCount;
}
_orderNoCounter.increment();
emit OrderAdd(
_orderNo,
_restNo,
_coinCount,
_tradeFee,
_orderAmount,
_payType,
_orderType,
_buyerAddr,
_sellerAddr
);
return _orderNo;
}
function addBuyOrder(
uint256 _restNo,
uint256 _coinCount,
uint256 _orderAmount,
uint256 _payType
) external {
RestStorage.Rest memory _rest = _restStorage.searchRest(_restNo);
require(_rest.userAddr != msg.sender, "rest not exist");
require(_rest.restType == 2, "sell rest not exist");
require(_coinCount > 0 && _orderAmount > 0, "coin count error");
require(_rest.restStatus == 1, "rest status error");
UserStorage.User memory _currentUser = _userStorage.searchUser(
msg.sender
);
require(
_currentUser.userFlag != 1 && _currentUser.userFlag != 2,
"invalid user"
);
uint256 _restFrozen = _restStorage.getRestFrozenTotal(
_rest.userAddr,
_restNo
);
require(_restFrozen >= _coinCount, "coin not enough");
uint256 _amo = SafeMath.mul(_rest.price, _coinCount);
require(
_amo >= _rest.restDetail.limitAmountFrom &&
_amo <= _rest.restDetail.limitAmountTo,
"amount error"
);
require(
_currentUser.credit >= _rest.restDetail.limitMinCredit,
"credit error"
);
require(
_currentUser.morgageStats.mortgage >=
_rest.restDetail.limitMinMortgage,
"mortgage error"
);
_restStorage.updateRestFinishCount(_restNo, _coinCount);
_insert(
_restNo,
_coinCount,
0,
_orderAmount,
_payType,
1,
msg.sender,
_rest.userAddr
);
}
function addSellOrder(
uint256 _restNo,
uint256 _coinCount,
uint256 _tradeFee,
uint256 _orderAmount,
uint256 _payType
) external {
RestStorage.Rest memory _rest = _restStorage.searchRest(_restNo);
require(_rest.userAddr != msg.sender, "rest not exist");
require(_rest.restType == 1, "buy rest not exist");
require(_coinCount > 0, "coin count error");
require(_orderAmount > 0, "orderAmount error");
require(_rest.restStatus == 1, "rest status error");
uint256 _amo = SafeMath.mul(_rest.price, _coinCount);
require(
_amo >= _rest.restDetail.limitAmountFrom &&
_amo <= _rest.restDetail.limitAmountTo,
"amount error"
);
UserStorage.User memory _currentUser = _userStorage.searchUser(
msg.sender
);
require(
_currentUser.userFlag != 1 && _currentUser.userFlag != 2,
"invalid user"
);
require(
_currentUser.credit >= _rest.restDetail.limitMinCredit,
"credit error"
);
require(
_currentUser.morgageStats.mortgage >=
_rest.restDetail.limitMinMortgage,
"mortgage error"
);
uint256 _needSub = SafeMath.add(_coinCount, _tradeFee);
_restStorage.updateRestFinishCount(_restNo, _coinCount);
_insert(
_restNo,
_coinCount,
_tradeFee,
_orderAmount,
_payType,
2,
_rest.userAddr,
msg.sender
);
TokenTransfer _tokenTransfer = _recordStorage.getERC20Address(
_rest.coinType
);
_tokenTransfer.transferFrom(msg.sender, recordAddress, _needSub);
_recordStorage.addRecord(
msg.sender,
"",
_rest.coinType,
_coinCount,
2,
1,
2
);
}
function setPaidMoney(uint256 _orderNo)
external
onlyBuyer(_orderNo)
returns (bool)
{
_updateOrderStatus(_orderNo, 2);
emit OrderPaidMoney(_orderNo);
return true;
}
function confirmCollect(uint256 _orderNo) external onlySeller(_orderNo) {
require(_orderNo != uint256(0), "orderNo null");
Order memory _order = orders[_orderNo];
require(_order.orderStatus == 2, "Invalid order status");
require(
_order.orderDetail.buyerAddr != address(0),
"Invalid buyer address"
);
require(
orderFrozenTotal[msg.sender][_orderNo] >= _order.coinCount,
"coin not enough"
);
_updateOrderStatus(_orderNo, 3);
orderFrozenTotal[msg.sender][_orderNo] = 0;
uint256 _rc = _recordStorage.getTradeCredit();
UserStorage.User memory _user = _userStorage.searchUser(msg.sender);
uint256 _credit = _user.credit + _rc;
UserStorage.TradeStats memory _tradeStats = _user.tradeStats;
_tradeStats.tradeTotal += 1;
_userStorage.updateTradeStats(msg.sender, _tradeStats, _credit);
UserStorage.User memory _user2 = _userStorage.searchUser(
_order.orderDetail.buyerAddr
);
uint256 _credit2 = _user2.credit + _rc;
UserStorage.TradeStats memory _tradeStats2 = _user2.tradeStats;
_tradeStats2.tradeTotal += 1;
_userStorage.updateTradeStats(
_order.orderDetail.buyerAddr,
_tradeStats2,
_credit2
);
_recordStorage.subFrozenTotal(_orderNo, _order.orderDetail.buyerAddr);
emit OrderConfirmCollect(_orderNo);
}
function cancelOrder(uint256 _orderNo)
external
onlyBuyerOrSeller(_orderNo)
returns (bool)
{
Order memory _order = orders[_orderNo];
require(_order.orderNo != uint256(0), "current Order not exist");
require(_order.orderStatus == 1, "Can't cancel order");
if (_order.orderDetail.sellerAddr == msg.sender) {
require(
_order.orderDetail.tradeTime + cancelOrderTime * 1 minutes <
block.timestamp,
"limit"
);
}
RestStorage.Rest memory _rest = _restStorage.searchRest(_order.restNo);
if (_rest.restStatus == 4 || _rest.restStatus == 5) {
orderFrozenTotal[_order.orderDetail.sellerAddr][_orderNo] = 0;
_recordStorage.addAvailableTotal(
_order.orderDetail.sellerAddr,
_order.orderDetail.coinType,
_order.coinCount
);
} else {
if (_order.orderType == 2) {
orderFrozenTotal[_order.orderDetail.sellerAddr][_orderNo] = 0;
_recordStorage.addAvailableTotal(
_order.orderDetail.sellerAddr,
_order.orderDetail.coinType,
_order.coinCount
);
}
_restStorage.addRestRemainCount(_order.restNo, _order.coinCount);
}
_updateOrderStatus(_orderNo, 4);
emit OrderCancel(_orderNo);
return true;
}
function takeCoin(uint256 _o) external onlyBuyerOrSeller(_o) {
AppealStorage.Appeal memory _appeal = _appealS.searchAppeal(_o);
require(
block.timestamp - _appeal.detail.witnessHandleTime >
canWithdrawHours * 1 hours,
"time error"
);
address _win;
if (_appeal.user == _appeal.buyer) {
if (_appeal.status == 2) {
_win = _appeal.buyer;
} else if (_appeal.status == 3) {
_win = _appeal.seller;
}
} else {
if (_appeal.status == 2) {
_win = _appeal.seller;
} else if (_appeal.status == 3) {
_win = _appeal.buyer;
}
}
require(_win == msg.sender, "opt error");
_updateOrderStatus(_o, 5);
orderFrozenTotal[_appeal.seller][_o] = 0;
_recordStorage.subFrozenTotal(_o, msg.sender);
}
function _updateOrderStatus(uint256 _orderNo, uint256 _orderStatus)
internal
onlyBuyerOrSeller(_orderNo)
{
Order memory order = orders[_orderNo];
require(order.orderNo != uint256(0), "current Order not exist");
require(_orderStatus >= 1 && _orderStatus <= 5, "Invalid order status");
if (_orderStatus == 2 && order.orderStatus != 1) {
revert("Invalid order status 2");
}
if (_orderStatus == 3 && order.orderStatus != 2) {
revert("Invalid order status 3");
}
if (_orderStatus == 4 && order.orderStatus != 1) {
revert("Invalid order status 4");
}
if (
_orderStatus == 5 &&
order.orderStatus != 1 &&
order.orderStatus != 2
) {
revert("Invalid order status 5");
}
if (_orderStatus == 2) {
require(
order.orderDetail.buyerAddr == msg.sender,
"only buyer call"
);
}
if (_orderStatus == 3) {
require(
order.orderDetail.sellerAddr == msg.sender,
"only seller call"
);
}
order.orderStatus = _orderStatus;
order.orderDetail.updateTime = block.timestamp;
orders[_orderNo] = order;
orderList[orderIndex[_orderNo]] = order;
emit OrderUpdateStatus(_orderNo, _orderStatus);
}
function searchOrder(uint256 _orderNo)
external
view
returns (Order memory order)
{
require(_orderNo != uint256(0), "orderNo null");
require(
orders[_orderNo].orderNo != uint256(0),
"current Order not exist"
);
Order memory o = orders[_orderNo];
return o;
}
function searchOrderList() external view returns (Order[] memory) {
return orderList;
}
function searchListByRest(uint256 _restNo)
external
view
returns (Order[] memory)
{
Order[] memory resultList = new Order[](orderList.length);
for (uint256 i = 0; i < orderList.length; i++) {
Order memory _order = orderList[i];
if (_order.restNo == _restNo) {
resultList[i] = _order;
}
}
return resultList;
}
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b)
internal
pure
returns (bool, uint256)
{
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b)
internal
pure
returns (bool, uint256)
{
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b)
internal
pure
returns (bool, uint256)
{
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b)
internal
pure
returns (bool, uint256)
{
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b)
internal
pure
returns (bool, uint256)
{
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
contract AppealStorage {
OrderInterface private _oSt;
RecordInterface private _rSt;
UserInterface private _uSt;
address recAddr;
struct Appeal {
address user;
uint256 appealNo;
uint256 orderNo;
address witness;
address buyer;
address seller;
uint256 mortgage;
uint256 status;
uint256 appealTime;
uint256 witTakeTime;
uint256 obTakeTime;
AppealDetail detail;
}
struct AppealDetail {
address finalAppealAddr;
uint256 updateTime;
string witnessReason;
uint256 witnessAppealStatus;
string observerReason;
uint256 witnessHandleTime;
uint256 observerHandleTime;
address observerAddr;
uint256 witnessHandleReward;
uint256 observerHandleReward;
uint256 witnessHandleCredit;
uint256 observerHandleCredit;
uint256 witReward;
uint256 witSub;
uint256 witCreditR;
uint256 witCreditS;
}
mapping(uint256 => Appeal) public appeals;
mapping(uint256 => uint256) public appealIndex;
Appeal[] public appealList;
event addAppeal(uint256 _appealNo, uint256 _orderNo);
constructor(
address _r,
address _o,
address _u
) {
_rSt = RecordInterface(_r);
_oSt = OrderInterface(_o);
_uSt = UserInterface(_u);
recAddr = _r;
}
modifier onlyWit(uint256 _o) {
Appeal memory _al = appeals[_o];
require(_al.witness == msg.sender);
require(_al.buyer != msg.sender && _al.seller != msg.sender);
_;
}
modifier onlyOb(uint256 _o) {
Appeal memory _al = appeals[_o];
require(_al.detail.observerAddr == msg.sender);
require(_al.buyer != msg.sender && _al.seller != msg.sender);
_;
}
modifier onlyBOS(uint256 _o) {
OrderStorage.Order memory _r = _oSt.searchOrder(_o);
require(
_r.orderDetail.sellerAddr == msg.sender ||
_r.orderDetail.buyerAddr == msg.sender
);
_;
}
function _insert(uint256 _o, uint256 _count) internal {
OrderStorage.Order memory _or = _oSt.searchOrder(_o);
require(appeals[_o].appealNo == uint256(0));
AppealDetail memory _detail = AppealDetail({
finalAppealAddr: address(0),
updateTime: uint256(0),
witnessReason: "",
observerReason: "",
witnessAppealStatus: 0,
witnessHandleTime: uint256(0),
observerHandleTime: uint256(0),
observerAddr: address(0),
witnessHandleReward: 0,
observerHandleReward: 0,
witnessHandleCredit: 0,
observerHandleCredit: 0,
witReward: 0,
witSub: 0,
witCreditR: 0,
witCreditS: 0
});
uint256 _appealNo = block.timestamp;
Appeal memory _appeal = Appeal({
user: msg.sender,
appealNo: _appealNo,
orderNo: _o,
witness: address(0),
buyer: _or.orderDetail.buyerAddr,
seller: _or.orderDetail.sellerAddr,
mortgage: _count,
status: 1,
appealTime: block.timestamp,
witTakeTime: 0,
obTakeTime: 0,
detail: _detail
});
appeals[_o] = _appeal;
appealList.push(_appeal);
appealIndex[_o] = appealList.length - 1;
chanT(_or.orderDetail.sellerAddr, _or.orderDetail.buyerAddr, 1, 0);
emit addAppeal(_appealNo, _o);
}
function chanT(
address _seller,
address _buyer,
uint256 _t,
uint256 _r
) internal {
uint256 _tc = _rSt.getTradeCredit();
uint256 _rs = _rSt.getSubTCredit();
UserStorage.User memory _user = _uSt.searchUser(_seller);
UserStorage.TradeStats memory _tr = _user.tradeStats;
UserStorage.User memory _user2 = _uSt.searchUser(_buyer);
UserStorage.TradeStats memory _tr2 = _user2.tradeStats;
uint256 _c2 = _user2.credit;
uint256 _c = _user.credit;
if (_t == 1) {
_tr.tradeTotal = _tr.tradeTotal > 0 ? (_tr.tradeTotal - 1) : 0;
_tr2.tradeTotal = _tr2.tradeTotal > 0 ? (_tr2.tradeTotal - 1) : 0;
_c = (_c >= _tc) ? (_c - _tc) : 0;
_c2 = (_c2 >= _tc) ? (_c2 - _tc) : 0;
} else if (_t == 2) {
_tr.tradeTotal += 1;
_tr2.tradeTotal += 1;
if (_r == 1) {
_c += _tc;
_c2 = (_c2 >= _rs) ? (_c2 - _rs) : 0;
} else if (_r == 2) {
_c2 += _tc;
_c = (_c >= _rs) ? (_c - _rs) : 0;
}
}
_uSt.updateTradeStats(_seller, _tr, _c);
_uSt.updateTradeStats(_buyer, _tr2, _c2);
}
function applyAppeal(uint256 _o) external onlyBOS(_o) {
uint256 _fee = _rSt.getAppealFee();
_insert(_o, _fee);
TokenTransfer _tokenTransfer = _rSt.getERC20Address("wROSE");
_tokenTransfer.transferFrom(msg.sender, recAddr, _fee);
}
function takeWit(uint256 _o) external {
Appeal memory _al = appeals[_o];
require(_al.buyer != msg.sender && _al.seller != msg.sender);
require(_al.witness == address(0));
require(_al.status == 1);
bool _f = witOrOb(1);
require(_f);
_al.witness = msg.sender;
_al.witTakeTime = block.timestamp;
appeals[_o] = _al;
appealList[appealIndex[_o]] = _al;
}
function takeOb(uint256 _o) external {
Appeal memory _al = appeals[_o];
require(_al.buyer != msg.sender && _al.seller != msg.sender);
require(_al.status == 4 || _al.status == 5);
require(_al.detail.observerAddr == address(0));
bool _f = witOrOb(2);
require(_f);
_al.detail.observerAddr = msg.sender;
_al.obTakeTime = block.timestamp;
appeals[_o] = _al;
appealList[appealIndex[_o]] = _al;
}
function changeHandler(uint256 _o, uint256 _type) external onlyBOS(_o) {
Appeal memory _al = appeals[_o];
if (_type == 1) {
require(_al.status == 1);
require(_al.witness != address(0));
require(block.timestamp - _al.witTakeTime > 24 hours);
_al.witness = address(0);
_al.witTakeTime = 0;
} else if (_type == 2) {
require(_al.status == 4 || _al.status == 5);
require(_al.detail.observerAddr != address(0));
require(block.timestamp - _al.obTakeTime > 24 hours);
_al.detail.observerAddr = address(0);
_al.obTakeTime = 0;
}
appeals[_o] = _al;
appealList[appealIndex[_o]] = _al;
}
function witOrOb(uint256 _f) internal view returns (bool) {
UserStorage.User memory _u = _uSt.searchUser(msg.sender);
if (_u.userFlag == _f) {
return true;
}
return false;
}
function applyFinal(uint256 _o) external onlyBOS(_o) {
Appeal memory _al = appeals[_o];
require(_al.status == 2 || _al.status == 3);
require(block.timestamp - _al.detail.witnessHandleTime <= 24 hours);
chanT(_al.seller, _al.buyer, 1, 0);
uint256 _fee = _rSt.getAppealFeeFinal();
TokenTransfer _tokenTransfer = _rSt.getERC20Address("wROSE");
_tokenTransfer.transferFrom(msg.sender, recAddr, _fee);
if (_al.status == 2) {
_al.status = 4;
} else if (_al.status == 3) {
_al.status = 5;
}
_al.detail.finalAppealAddr = msg.sender;
_al.detail.updateTime = block.timestamp;
appeals[_o] = _al;
appealList[appealIndex[_o]] = _al;
}
function witnessOpt(
uint256 _o,
string memory _r,
uint256 _s
) external onlyWit(_o) {
require(_s == 2 || _s == 3);
Appeal memory _al = appeals[_o];
require(_al.status == 1);
uint256 _fee = _rSt.getAppealFee();
uint256 _rcedit = _rSt.getWitnessHandleCredit();
_al.status = _s;
_al.detail.witnessAppealStatus = _s;
_al.detail.witnessReason = _r;
_al.detail.witnessHandleTime = block.timestamp;
_al.detail.witnessHandleReward = _fee;
_al.detail.witnessHandleCredit = _rcedit;
_al.detail.witReward = _fee;
_al.detail.witCreditR = _rcedit;
_al.detail.updateTime = block.timestamp;
appeals[_o] = _al;
appealList[appealIndex[_o]] = _al;
if (_s == 2) {
if (_al.user == _al.buyer) {
_rSt.subAvaAppeal(_al.seller, _al.buyer, _al, _fee, 1, 0);
chanT(_al.seller, _al.buyer, 2, 2);
} else if (_al.user == _al.seller) {
_rSt.subAvaAppeal(_al.buyer, _al.seller, _al, _fee, 1, 0);
chanT(_al.seller, _al.buyer, 2, 1);
}
}
if (_s == 3) {
if (_al.user == _al.buyer) {
_rSt.subAvaAppeal(_al.buyer, _al.seller, _al, _fee, 1, 1);
chanT(_al.seller, _al.buyer, 2, 1);
} else if (_al.user == _al.seller) {
_rSt.subAvaAppeal(_al.seller, _al.buyer, _al, _fee, 1, 1);
chanT(_al.seller, _al.buyer, 2, 2);
}
}
}
function observerOpt(
uint256 _o,
string memory _r,
uint256 _s
) external onlyOb(_o) {
require(_s == 6 || _s == 7);
Appeal memory _appeal = appeals[_o];
require(_appeal.status == 4 || _appeal.status == 5);
uint256 _fee = _rSt.getAppealFeeFinal();
uint256 _rcedit = _rSt.getObserverHandleCredit();
_appeal.status = _s;
_appeal.detail.observerReason = _r;
_appeal.detail.observerHandleTime = block.timestamp;
_appeal.detail.observerHandleReward = _fee;
_appeal.detail.observerHandleCredit = _rcedit;
uint256 _subWC = _rSt.getSubWitCredit();
uint256 _subWF = _rSt.getSubWitFee();
if (_s == 6) {
if (_appeal.user == _appeal.buyer) {
_rSt.subAvaAppeal(
_appeal.seller,
_appeal.buyer,
_appeal,
_fee,
2,
0
);
chanT(_appeal.seller, _appeal.buyer, 2, 2);
_rSt.subFrozenTotal(_o, _appeal.buyer);
} else if (_appeal.user == _appeal.seller) {
_rSt.subAvaAppeal(
_appeal.buyer,
_appeal.seller,
_appeal,
_fee,
2,
0
);
chanT(_appeal.seller, _appeal.buyer, 2, 1);
_rSt.subFrozenTotal(_o, _appeal.seller);
}
if (_appeal.detail.witnessAppealStatus == 3) {
_appeal.detail.witSub = _subWF;
_appeal.detail.witCreditS = _subWC;
if (_appeal.detail.witnessHandleCredit >= _subWC) {
_appeal.detail.witnessHandleCredit = SafeMath.sub(
_appeal.detail.witnessHandleCredit,
_subWC
);
} else {
_appeal.detail.witnessHandleCredit = 0;
}
_rSt.subWitnessAvailable(_appeal.witness);
}
}
if (_s == 7) {
if (_appeal.user == _appeal.buyer) {
_rSt.subAvaAppeal(
_appeal.buyer,
_appeal.seller,
_appeal,
_fee,
2,
1
);
chanT(_appeal.seller, _appeal.buyer, 2, 1);
_rSt.subFrozenTotal(_o, _appeal.seller);
} else if (_appeal.user == _appeal.seller) {
_rSt.subAvaAppeal(
_appeal.seller,
_appeal.buyer,
_appeal,
_fee,
2,
1
);
chanT(_appeal.seller, _appeal.buyer, 2, 2);
_rSt.subFrozenTotal(_o, _appeal.buyer);
}
if (_appeal.detail.witnessAppealStatus == 2) {
_appeal.detail.witSub = _subWF;
_appeal.detail.witCreditS = _subWC;
if (_appeal.detail.witnessHandleCredit >= _subWC) {
_appeal.detail.witnessHandleCredit = SafeMath.sub(
_appeal.detail.witnessHandleCredit,
_subWC
);
} else {
_appeal.detail.witnessHandleCredit = 0;
}
_rSt.subWitnessAvailable(_appeal.witness);
}
}
_appeal.detail.updateTime = block.timestamp;
appeals[_o] = _appeal;
appealList[appealIndex[_o]] = _appeal;
}
function searchAppeal(uint256 _o)
external
view
returns (Appeal memory appeal)
{
return appeals[_o];
}
function searchAppealList() external view returns (Appeal[] memory) {
return appealList;
}
}
interface RecordInterface {
function getErcBalance(string memory _coinType, address _addr)
external
returns (uint256);
function getAvailableTotal(address _addr, string memory _coinType)
external
returns (uint256);
function getFrozenTotal(address _addr, string memory _coinType)
external
returns (uint256);
function addAvailableTotal(
address _addr,
string memory _coinType,
uint256 remainHoldCoin
) external;
function subAvaAppeal(
address _from,
address _to,
AppealStorage.Appeal memory _al,
uint256 _amt,
uint256 _type,
uint256 _self
) external;
function subWitnessAvailable(address _addr) external;
function getERC20Address(string memory _coinType)
external
returns (TokenTransfer);
function subFrozenTotal(uint256 _orderNo, address _addr) external;
function addRecord(
address _addr,
string memory _tradeHash,
string memory _coinType,
uint256 _hostCount,
uint256 _hostStatus,
uint256 _hostType,
uint256 _hostDirection
) external;
function getAppealFee() external view returns (uint256);
function getAppealFeeFinal() external view returns (uint256);
function getWitnessHandleReward() external view returns (uint256);
function getObserverHandleReward() external view returns (uint256);
function getWitnessHandleCredit() external view returns (uint256);
function getObserverHandleCredit() external view returns (uint256);
function getSubWitCredit() external view returns (uint256);
function getOpenTrade() external view returns (bool);
function getTradeCredit() external view returns (uint256);
function getSubTCredit() external view returns (uint256);
function getSubWitFee() external view returns (uint256);
}
interface RestInterface {
function searchRest(uint256 _restNo)
external
returns (RestStorage.Rest memory rest);
function getRestFrozenTotal(address _addr, uint256 _restNo)
external
returns (uint256);
function updateRestFinishCount(uint256 _restNo, uint256 _coinCount)
external
returns (uint256);
function addRestRemainCount(uint256 _restNo, uint256 _remainCount)
external
returns (uint256);
}
interface OrderInterface {
function searchOrder(uint256 _orderNo)
external
returns (OrderStorage.Order memory order);
}
interface UserInterface {
function searchUser(address _addr)
external
view
returns (UserStorage.User memory user);
function searchWitnessList(uint256 _userFlag)
external
returns (UserStorage.User[] memory userList);
function updateTradeStats(
address _addr,
UserStorage.TradeStats memory _tradeStats,
uint256 _credit
) external;
function updateMorgageStats(
address _addr,
UserStorage.MorgageStats memory _morgageStats
) external;
function updateUserRole(address _addr, uint256 _userFlag) external;
}
interface AppealInterface {
function searchAppeal(uint256 _o)
external
view
returns (AppealStorage.Appeal memory appeal);
}
abstract contract ReentrancyGuardRecord {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
library CountersRecord {
struct Counter {
uint256 _value;
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
{
if (counter._value == 0) {
counter._value = 10000;
}
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
{
counter._value = value - 1;
}
}
}
interface TokenTransfer {
function transfer(address recipient, uint256 amount) external;
function balanceOf(address account) external view returns (uint256);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external;
function allowance(address _owner, address _spender)
external
view
returns (uint256 remaining);
}
contract RecordStorage is Ownable, ReentrancyGuardRecord {
using CountersRecord for CountersRecord.Counter;
string constant P_COIN = 'wROSE';
mapping(string => address) coinTypeMaping;
uint256 merchantNeedCount = 100 * (10**18);
uint256 witnessNeedCount = 1000 * (10**18);
uint256 congressNeedCount = 10000 * (10**18);
uint256 appealFee = 100 * (10**18);
uint256 appealFeeFinal = 1000 * (10**18);
uint256 canWithdrawToTime = 28;
uint256 subWitFee = 100 * (10**18);
uint256 subWitCredit = 10;
uint256 witnessHandleReward = 100 * (10**18);
uint256 observerHandleReward = 1000 * (10**18);
uint256 witnessHandleCredit = 1;
uint256 observerHandleCredit = 1;
bool openTrade = false;
uint256 tradeCredit = 1;
uint256 subTCredit = 10;
mapping(address => uint256) witnessFlag;
mapping(address => uint256) congressFlag;
function setWitnessFlag(address _addr, uint256 _flag) external onlyOwner {
witnessFlag[_addr] = _flag;
if (_flag == 1) {
uint256 _amt = availableTotal[_addr][P_COIN];
require(_amt >= witnessNeedCount, "coin not enough");
_userStorage.updateUserRole(_addr, 1);
} else {
_userStorage.updateUserRole(_addr, 0);
}
}
function getWitnessFlag(address _addr) public view returns (uint256) {
return witnessFlag[_addr];
}
function setCongressFlag(address _addr, uint256 _flag) external onlyOwner {
congressFlag[_addr] = _flag;
if (_flag == 1) {
uint256 _amt = availableTotal[_addr][P_COIN];
require(_amt >= congressNeedCount, "coin not enough");
_userStorage.updateUserRole(_addr, 2);
} else {
_userStorage.updateUserRole(_addr, 0);
}
}
function getCongressFlag(address _addr) public view returns (uint256) {
return congressFlag[_addr];
}
function setCoinTypeMapping(
string calldata _coinType,
address _coinTypeAddr
) external onlyOwner {
coinTypeMaping[_coinType] = _coinTypeAddr;
}
function getCoinTypeMapping(string calldata _coinType)
public
view
returns (address)
{
return coinTypeMaping[_coinType];
}
function setMerchantNeedCount(uint256 _count) external onlyOwner {
merchantNeedCount = _count;
}
function getMerchantNeedCount() public view returns (uint256) {
return merchantNeedCount;
}
function setWitnessNeedCount(uint256 _count) external onlyOwner {
witnessNeedCount = _count;
}
function getWitnessNeedCount() public view returns (uint256) {
return witnessNeedCount;
}
function setCongressNeedCount(uint256 _count) external onlyOwner {
congressNeedCount = _count;
}
function getCongressNeedCount() public view returns (uint256) {
return congressNeedCount;
}
function setAppealFee(uint256 _count) external onlyOwner {
appealFee = _count;
}
function getAppealFee() public view returns (uint256) {
return appealFee;
}
function setAppealFeeFinal(uint256 _count) external onlyOwner {
appealFeeFinal = _count;
}
function getAppealFeeFinal() public view returns (uint256) {
return appealFeeFinal;
}
function setCanWithdrawToTime(uint256 _days) external onlyOwner {
canWithdrawToTime = _days;
}
function getCanWithdrawToTime() public view returns (uint256) {
return canWithdrawToTime;
}
function setSubWitFee(uint256 _c) external onlyOwner {
subWitFee = _c;
}
function getSubWitFee() public view returns (uint256) {
return subWitFee;
}
function setSubWitCredit(uint256 _c) external onlyOwner {
subWitCredit = _c;
}
function getSubWitCredit() public view returns (uint256) {
return subWitCredit;
}
function setWitnessHandleReward(uint256 _c) external onlyOwner {
witnessHandleReward = _c;
}
function getWitnessHandleReward() public view returns (uint256) {
return witnessHandleReward;
}
function setObserverHandleReward(uint256 _c) external onlyOwner {
observerHandleReward = _c;
}
function getObserverHandleReward() public view returns (uint256) {
return observerHandleReward;
}
function setWitnessHandleCredit(uint256 _c) external onlyOwner {
witnessHandleCredit = _c;
}
function getWitnessHandleCredit() public view returns (uint256) {
return witnessHandleCredit;
}
function setObserverHandleCredit(uint256 _c) external onlyOwner {
observerHandleCredit = _c;
}
function getObserverHandleCredit() public view returns (uint256) {
return observerHandleCredit;
}
function setOpenTrade(bool _c) external onlyOwner {
openTrade = _c;
}
function getOpenTrade() public view returns (bool) {
return openTrade;
}
function setTradeCredit(uint256 _c) external onlyOwner {
tradeCredit = _c;
}
function getTradeCredit() public view returns (uint256) {
return tradeCredit;
}
function setSubTCredit(uint256 _c) external onlyOwner {
subTCredit = _c;
}
function getSubTCredit() public view returns (uint256) {
return subTCredit;
}
function punishPerson(
address _from,
address _to,
uint256 _count
) external onlyOwner {
require(_from != address(0) && _to != address(0));
UserStorage.User memory _user = _userStorage.searchUser(_from);
require(_user.userFlag == 1 || _user.userFlag == 2, "can't punish");
uint256 _ava = availableTotal[_from][P_COIN];
uint256 _toavailab = availableTotal[_to][P_COIN];
if (_ava >= _count) {
availableTotal[_from][P_COIN] = SafeMath.sub(_ava, _count);
availableTotal[_to][P_COIN] = SafeMath.add(_toavailab, _count);
} else {
availableTotal[_from][P_COIN] = 0;
uint256 _draing = withdrawingTotal[_from][P_COIN];
if (SafeMath.add(_ava, _draing) >= _count) {
withdrawingTotal[_from][P_COIN] = SafeMath.sub(
_draing,
SafeMath.sub(_count, _ava)
);
availableTotal[_to][P_COIN] = SafeMath.add(_toavailab, _count);
} else {
withdrawingTotal[_from][P_COIN] = 0;
availableTotal[_to][P_COIN] = SafeMath.add(
_toavailab,
SafeMath.add(_ava, _draing)
);
}
}
chanRole(_from);
chanRole(_to);
}
UserInterface private _userStorage;
OrderInterface private _orderStorage;
struct Record {
uint256 recordNo;
address userAddr;
string tradeHash;
string coinType;
uint256 hostCount;
uint256 hostStatus;
uint256 hostType;
uint256 hostDirection;
uint256 hostTime;
uint256 updateTime;
}
CountersRecord.Counter private _recordNoCounter;
mapping(uint256 => Record) public records;
mapping(uint256 => uint256) public recordIndex;
Record[] public recordList;
mapping(address => mapping(string => uint256)) public availableTotal;
mapping(address => mapping(string => uint256)) public frozenTotal;
mapping(address => mapping(string => uint256)) public unfrozenTotal;
mapping(address => uint256) lastWithdrawTime;
mapping(address => mapping(uint256 => uint256)) lastWithdrawAmount;
mapping(address => mapping(string => uint256)) public withdrawingTotal;
mapping(address => mapping(uint256 => uint256)) orderSubFrozenList;
constructor(
address _usdtAddress,
address _usdcAddress,
address _coinAddress
) {
coinTypeMaping["USDT"] = _usdtAddress;
coinTypeMaping["USDC"] = _usdcAddress;
coinTypeMaping[P_COIN] = _coinAddress;
_recordNoCounter.increment();
}
function getERC20Address(string memory _coinType)
public
view
returns (TokenTransfer)
{
address _remoteAddr = coinTypeMaping[_coinType];
require(_remoteAddr != address(0));
TokenTransfer _tokenTransfer = TokenTransfer(_remoteAddr);
return _tokenTransfer;
}
event RecordAdd(
uint256 _recordNo,
address _addr,
string _tradeHash,
string _coinType,
uint256 _hostCount,
uint256 _hostStatus,
uint256 _hostType,
uint256 _hostDirection
);
event RecordApplyUnfrozen(address _addr, uint256 _amt);
event UnfrozenTotalTransfer(
address _addr,
string _coinType,
uint256 _lastAmount
);
event RecordUpdate(
address _addr,
uint256 _recordNo,
string _hash,
uint256 _hostStatus
);
address _userAddr;
address _restCAddr;
address _orderCAddr;
address _appealCAddr;
modifier onlyAuthFromAddr() {
require(_userAddr != address(0), "Invalid address call user");
require(_restCAddr != address(0), "Invalid address call rest");
require(_orderCAddr != address(0), "Invalid address call order");
require(_appealCAddr != address(0), "Invalid address call appeal");
_;
}
function authFromContract(
address _fromUser,
address _fromRest,
address _fromOrder,
address _fromAppeal
) external onlyOwner {
_userAddr = _fromUser;
_restCAddr = _fromRest;
_orderCAddr = _fromOrder;
_appealCAddr = _fromAppeal;
_userStorage = UserInterface(_userAddr);
_orderStorage = OrderInterface(_orderCAddr);
}
function _insert(
address _addr,
string memory _tradeHash,
string memory _coinType,
uint256 _hostCount,
uint256 _hostStatus,
uint256 _hostType,
uint256 _hostDirection
) internal nonReentrant returns (uint256 recordNo) {
require(_addr != address(0), "address null");
require(bytes(_coinType).length != 0, "coinType null");
require(_hostCount != uint256(0), "hostCount null");
require(_hostType != uint256(0), "hostType null");
require(_hostDirection != uint256(0), "hostDirection null");
uint256 _recordNo = _recordNoCounter.current();
require(records[_recordNo].recordNo == uint256(0), "order exist");
Record memory _record = Record({
recordNo: _recordNo,
userAddr: _addr,
tradeHash: _tradeHash,
coinType: _coinType,
hostCount: _hostCount,
hostStatus: _hostStatus,
hostType: _hostType,
hostDirection: _hostDirection,
hostTime: block.timestamp,
updateTime: 0
});
records[_recordNo] = _record;
recordList.push(_record);
recordIndex[_recordNo] = recordList.length - 1;
_recordNoCounter.increment();
emit RecordAdd(
_recordNo,
_addr,
_tradeHash,
_coinType,
_hostCount,
_hostStatus,
_hostType,
_hostDirection
);
return _recordNo;
}
function tokenEscrow(string memory _coinType, uint256 _amt) external {
require(_amt > 0, "invalid");
require(
availableTotal[msg.sender][_coinType] + _amt >
availableTotal[msg.sender][_coinType],
"Invalid transfer amount"
);
availableTotal[msg.sender][_coinType] = SafeMath.add(
availableTotal[msg.sender][_coinType],
_amt
);
uint256 _hostType = 1;
if (
keccak256(abi.encodePacked(_coinType)) ==
keccak256(abi.encodePacked(P_COIN))
) {
_hostType = 2;
UserStorage.User memory _user = _userStorage.searchUser(msg.sender);
_changeUserMorgageStats(
msg.sender,
availableTotal[msg.sender][_coinType]
);
if (
_user.userFlag == 0 &&
availableTotal[msg.sender][_coinType] >= merchantNeedCount
) {
_userStorage.updateUserRole(msg.sender, 3);
}
}
_insert(msg.sender, "", _coinType, _amt, 2, _hostType, 1);
TokenTransfer _tokenTransfer = getERC20Address(_coinType);
_tokenTransfer.transferFrom(msg.sender, address(this), _amt);
}
function addRecord(
address _addr,
string memory _tradeHash,
string memory _coinType,
uint256 _hostCount,
uint256 _hostStatus,
uint256 _hostType,
uint256 _hostDirection
) public onlyAuthFromAddr {
require(
msg.sender == _restCAddr || msg.sender == _orderCAddr,
"RedocrdStorage:Invalid from contract address"
);
frozenTotal[_addr][_coinType] = SafeMath.add(
frozenTotal[_addr][_coinType],
_hostCount
);
_insert(
_addr,
_tradeHash,
_coinType,
_hostCount,
_hostStatus,
_hostType,
_hostDirection
);
}
function addAvailableTotal(
address _addr,
string memory _coinType,
uint256 _amt
) public onlyAuthFromAddr {
require(
msg.sender == _restCAddr || msg.sender == _orderCAddr,
"Invalid address"
);
require(_amt > 0, "invalid");
uint256 _aBalance = getErcBalance(_coinType, address(this));
require(_aBalance >= _amt, "not enough");
require(frozenTotal[_addr][_coinType] >= _amt, "insufficient");
require(
SafeMath.sub(frozenTotal[_addr][_coinType], _amt) <=
frozenTotal[_addr][_coinType],
"Invalid amount"
);
frozenTotal[_addr][_coinType] = SafeMath.sub(
frozenTotal[_addr][_coinType],
_amt
);
TokenTransfer _tokenTransfer = getERC20Address(_coinType);
_tokenTransfer.transfer(_addr, _amt);
}
function getAvailableTotal(address _addr, string memory _coinType)
public
view
returns (uint256)
{
return availableTotal[_addr][_coinType];
}
function subFrozenTotal(uint256 _orderNo, address _addr)
public
onlyAuthFromAddr
{
require(
msg.sender == _orderCAddr || msg.sender == _appealCAddr,
"Invalid call"
);
OrderStorage.Order memory _order = _orderStorage.searchOrder(_orderNo);
require(_order.orderNo != uint256(0), "not exist");
address _seller = _order.orderDetail.sellerAddr;
string memory _coinType = _order.orderDetail.coinType;
uint256 _subAmount = orderSubFrozenList[_seller][_orderNo];
require(_subAmount == 0);
uint256 _frozen = frozenTotal[_seller][_coinType];
uint256 _orderCount = _order.coinCount;
require(_frozen >= _orderCount);
require(SafeMath.sub(_frozen, _orderCount) <= _frozen);
frozenTotal[_seller][_coinType] = SafeMath.sub(_frozen, _orderCount);
orderSubFrozenList[_seller][_orderNo] = _orderCount;
TokenTransfer _tokenTransfer = getERC20Address(_coinType);
_tokenTransfer.transfer(_addr, _orderCount);
}
function subAvaAppeal(
address _from,
address _to,
AppealStorage.Appeal memory _al,
uint256 _amt,
uint256 _t,
uint256 _self
) public onlyAuthFromAddr {
require(msg.sender == _appealCAddr, "Invalid call");
uint256 _available = getAvailableTotal(_from, P_COIN);
uint256 _need = 0;
address _opt = _t == 1 ? _al.witness : _al.detail.observerAddr;
if (_available >= _amt) {
_need = _amt;
} else {
_need = _available;
}
if (
(_t == 1 && _self == 0) ||
(_t == 2 && _al.detail.finalAppealAddr != _from)
) {
availableTotal[_from][P_COIN] = SafeMath.sub(
availableTotal[_from][P_COIN],
_need
);
availableTotal[_to][P_COIN] = SafeMath.add(
availableTotal[_to][P_COIN],
_need
);
_changeUserMorgageStats(_from, availableTotal[_from][P_COIN]);
_changeUserMorgageStats(_to, availableTotal[_to][P_COIN]);
}
availableTotal[_opt][P_COIN] = SafeMath.add(
availableTotal[_opt][P_COIN],
_amt
);
_changeUserMorgageStats(_opt, availableTotal[_opt][P_COIN]);
chanRole(_from);
chanRole(_to);
chanRole(_opt);
UserStorage.User memory _user = _userStorage.searchUser(_opt);
if (_t == 1) {
_user.credit = _user.credit + witnessHandleCredit;
} else if (_t == 2) {
_user.credit = _user.credit + observerHandleCredit;
}
UserStorage.TradeStats memory _tradeStats = _user.tradeStats;
_userStorage.updateTradeStats(_opt, _tradeStats, _user.credit);
}
function _changeUserMorgageStats(address _addr, uint256 _amt) internal {
UserStorage.User memory _user = _userStorage.searchUser(_addr);
UserStorage.MorgageStats memory _morgageStats = _user.morgageStats;
_morgageStats.mortgage = _amt;
_userStorage.updateMorgageStats(_addr, _morgageStats);
}
function subWitnessAvailable(address _addr) public onlyAuthFromAddr {
require(msg.sender == _appealCAddr, "Invalid call");
require(_addr != address(0), "address null");
uint256 _availableTotal = availableTotal[_addr][P_COIN];
uint256 _need = 0;
uint256 subFromDraing = 0;
if (_availableTotal >= subWitFee) {
_need = subWitFee;
availableTotal[_addr][P_COIN] = SafeMath.sub(
_availableTotal,
_need
);
} else {
availableTotal[_addr][P_COIN] = 0;
uint256 _draing = withdrawingTotal[_addr][P_COIN];
if (SafeMath.add(_availableTotal, _draing) >= subWitFee) {
_need = subWitFee;
subFromDraing = SafeMath.sub(subWitFee, _availableTotal);
withdrawingTotal[_addr][P_COIN] = SafeMath.sub(
_draing,
subFromDraing
);
} else {
_need = SafeMath.add(_draing, _availableTotal);
withdrawingTotal[_addr][P_COIN] = 0;
}
}
chanRole(_addr);
UserStorage.User memory _user = _userStorage.searchUser(_addr);
_user.credit = _user.credit >= subWitCredit
? (_user.credit - subWitCredit)
: 0;
UserStorage.TradeStats memory _tradeStats = _user.tradeStats;
_userStorage.updateTradeStats(_addr, _tradeStats, _user.credit);
TokenTransfer _tokenTransfer = getERC20Address(P_COIN);
_tokenTransfer.transfer(owner(), _need);
}
function getFrozenTotal(address _addr, string memory _coinType)
public
view
returns (uint256)
{
return frozenTotal[_addr][_coinType];
}
function applyUnfrozen(uint256 _amt) external returns (uint256) {
require(_amt > 0);
require(availableTotal[msg.sender][P_COIN] >= _amt, "Invalid amount");
require(
SafeMath.sub(availableTotal[msg.sender][P_COIN], _amt) <
availableTotal[msg.sender][P_COIN],
"Invalid amount 2"
);
lastWithdrawTime[msg.sender] = block.timestamp;
lastWithdrawAmount[msg.sender][lastWithdrawTime[msg.sender]] = _amt;
availableTotal[msg.sender][P_COIN] = SafeMath.sub(
availableTotal[msg.sender][P_COIN],
_amt
);
withdrawingTotal[msg.sender][P_COIN] = SafeMath.add(
withdrawingTotal[msg.sender][P_COIN],
_amt
);
chanRole(msg.sender);
_insert(msg.sender, "", P_COIN, _amt, 3, 3, 2);
emit RecordApplyUnfrozen(msg.sender, _amt);
return getAvailableTotal(msg.sender, P_COIN);
}
function chanRole(address _addr) internal {
uint256 _avail = availableTotal[_addr][P_COIN];
UserStorage.User memory _user = _userStorage.searchUser(_addr);
_changeUserMorgageStats(_addr, _avail);
if (
_user.userFlag == 2 &&
_avail < congressNeedCount &&
_avail >= merchantNeedCount
) {
_userStorage.updateUserRole(_addr, 3);
}
if (
_user.userFlag == 1 &&
_avail < witnessNeedCount &&
_avail >= merchantNeedCount
) {
_userStorage.updateUserRole(_addr, 3);
}
if (_user.userFlag == 0 && _avail >= merchantNeedCount) {
_userStorage.updateUserRole(_addr, 3);
}
if (_avail < merchantNeedCount) {
_userStorage.updateUserRole(_addr, 0);
}
}
function unApplyUnfrozen(address _addr) external onlyOwner {
uint256 _drawing = withdrawingTotal[_addr][P_COIN];
require(_drawing > 0, "sufficient");
withdrawingTotal[_addr][P_COIN] = 0;
availableTotal[_addr][P_COIN] = SafeMath.add(
availableTotal[_addr][P_COIN],
_drawing
);
chanRole(_addr);
}
function applyWithdraw(uint256 _recordNo) public {
Record memory _record = records[_recordNo];
require(_record.recordNo != uint256(0), "record not exist");
require(_record.userAddr == msg.sender, "record user not exist");
require(_record.hostStatus == 3, "status error");
require(
withdrawingTotal[msg.sender][P_COIN] >= _record.hostCount,
"sufficient"
);
require(
block.timestamp >= (_record.hostTime + canWithdrawToTime * 1 days),
"can't withdraw"
);
withdrawingTotal[msg.sender][P_COIN] = SafeMath.sub(
withdrawingTotal[msg.sender][P_COIN],
_record.hostCount
);
unfrozenTotal[msg.sender][P_COIN] = SafeMath.add(
unfrozenTotal[msg.sender][P_COIN],
_record.hostCount
);
_record.hostStatus = 4;
_record.updateTime = block.timestamp;
records[_recordNo] = _record;
recordList[recordIndex[_recordNo]] = _record;
emit RecordUpdate(msg.sender, _recordNo, _record.tradeHash, 4);
TokenTransfer _tokenTransfer = getERC20Address(P_COIN);
_tokenTransfer.transfer(msg.sender, _record.hostCount);
}
function unfrozenTotalSearch(address _addr, string memory _coinType)
public
view
returns (uint256)
{
require(_addr != address(0), "user address is null");
return unfrozenTotal[_addr][_coinType];
}
function getUnfrozenTotal(address _addr, string memory _coinType)
external
view
returns (uint256)
{
return unfrozenTotal[_addr][_coinType];
}
function getWithdrawingTotal(address _addr, string memory _coinType)
public
view
returns (uint256)
{
return withdrawingTotal[_addr][_coinType];
}
function getErcBalance(string memory _coinType, address _addr)
public
view
returns (uint256)
{
TokenTransfer _tokenTransfer = getERC20Address(_coinType);
return _tokenTransfer.balanceOf(_addr);
}
function _updateInfo(
address _addr,
uint256 _recordNo,
string memory _hash,
uint256 _hostStatus
) internal returns (bool) {
Record storage _record = records[_recordNo];
require(_record.userAddr == _addr);
require(_hostStatus == 1 || _hostStatus == 2, "invalid status");
if (_hostStatus != uint256(0)) {
_record.hostStatus = _hostStatus;
}
if (bytes(_hash).length != 0) {
_record.tradeHash = _hash;
}
_record.updateTime = block.timestamp;
emit RecordUpdate(_addr, _recordNo, _hash, _hostStatus);
return true;
}
function updateInfo(
address _addr,
uint256 _recordNo,
string memory _hash,
uint256 _hostStatus
) external returns (bool) {
return _updateInfo(_addr, _recordNo, _hash, _hostStatus);
}
function searchRecord(uint256 _recordNo)
external
view
returns (Record memory record)
{
return records[_recordNo];
}
function searchRecordList() external view returns (Record[] memory) {
return recordList;
}
}

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_usdtAddress","internalType":"address"},{"type":"address","name":"_usdcAddress","internalType":"address"},{"type":"address","name":"_coinAddress","internalType":"address"}]},{"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":"RecordAdd","inputs":[{"type":"uint256","name":"_recordNo","internalType":"uint256","indexed":false},{"type":"address","name":"_addr","internalType":"address","indexed":false},{"type":"string","name":"_tradeHash","internalType":"string","indexed":false},{"type":"string","name":"_coinType","internalType":"string","indexed":false},{"type":"uint256","name":"_hostCount","internalType":"uint256","indexed":false},{"type":"uint256","name":"_hostStatus","internalType":"uint256","indexed":false},{"type":"uint256","name":"_hostType","internalType":"uint256","indexed":false},{"type":"uint256","name":"_hostDirection","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RecordApplyUnfrozen","inputs":[{"type":"address","name":"_addr","internalType":"address","indexed":false},{"type":"uint256","name":"_amt","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RecordUpdate","inputs":[{"type":"address","name":"_addr","internalType":"address","indexed":false},{"type":"uint256","name":"_recordNo","internalType":"uint256","indexed":false},{"type":"string","name":"_hash","internalType":"string","indexed":false},{"type":"uint256","name":"_hostStatus","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UnfrozenTotalTransfer","inputs":[{"type":"address","name":"_addr","internalType":"address","indexed":false},{"type":"string","name":"_coinType","internalType":"string","indexed":false},{"type":"uint256","name":"_lastAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addAvailableTotal","inputs":[{"type":"address","name":"_addr","internalType":"address"},{"type":"string","name":"_coinType","internalType":"string"},{"type":"uint256","name":"_amt","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addRecord","inputs":[{"type":"address","name":"_addr","internalType":"address"},{"type":"string","name":"_tradeHash","internalType":"string"},{"type":"string","name":"_coinType","internalType":"string"},{"type":"uint256","name":"_hostCount","internalType":"uint256"},{"type":"uint256","name":"_hostStatus","internalType":"uint256"},{"type":"uint256","name":"_hostType","internalType":"uint256"},{"type":"uint256","name":"_hostDirection","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"applyUnfrozen","inputs":[{"type":"uint256","name":"_amt","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"applyWithdraw","inputs":[{"type":"uint256","name":"_recordNo","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"authFromContract","inputs":[{"type":"address","name":"_fromUser","internalType":"address"},{"type":"address","name":"_fromRest","internalType":"address"},{"type":"address","name":"_fromOrder","internalType":"address"},{"type":"address","name":"_fromAppeal","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"availableTotal","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"string","name":"","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"frozenTotal","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"string","name":"","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getAppealFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getAppealFeeFinal","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getAvailableTotal","inputs":[{"type":"address","name":"_addr","internalType":"address"},{"type":"string","name":"_coinType","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCanWithdrawToTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getCoinTypeMapping","inputs":[{"type":"string","name":"_coinType","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCongressFlag","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCongressNeedCount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract TokenTransfer"}],"name":"getERC20Address","inputs":[{"type":"string","name":"_coinType","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getErcBalance","inputs":[{"type":"string","name":"_coinType","internalType":"string"},{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getFrozenTotal","inputs":[{"type":"address","name":"_addr","internalType":"address"},{"type":"string","name":"_coinType","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMerchantNeedCount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getObserverHandleCredit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getObserverHandleReward","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"getOpenTrade","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getSubTCredit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getSubWitCredit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getSubWitFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTradeCredit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getUnfrozenTotal","inputs":[{"type":"address","name":"_addr","internalType":"address"},{"type":"string","name":"_coinType","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getWithdrawingTotal","inputs":[{"type":"address","name":"_addr","internalType":"address"},{"type":"string","name":"_coinType","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getWitnessFlag","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getWitnessHandleCredit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getWitnessHandleReward","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getWitnessNeedCount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"punishPerson","inputs":[{"type":"address","name":"_from","internalType":"address"},{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_count","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"recordIndex","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"recordNo","internalType":"uint256"},{"type":"address","name":"userAddr","internalType":"address"},{"type":"string","name":"tradeHash","internalType":"string"},{"type":"string","name":"coinType","internalType":"string"},{"type":"uint256","name":"hostCount","internalType":"uint256"},{"type":"uint256","name":"hostStatus","internalType":"uint256"},{"type":"uint256","name":"hostType","internalType":"uint256"},{"type":"uint256","name":"hostDirection","internalType":"uint256"},{"type":"uint256","name":"hostTime","internalType":"uint256"},{"type":"uint256","name":"updateTime","internalType":"uint256"}],"name":"recordList","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"recordNo","internalType":"uint256"},{"type":"address","name":"userAddr","internalType":"address"},{"type":"string","name":"tradeHash","internalType":"string"},{"type":"string","name":"coinType","internalType":"string"},{"type":"uint256","name":"hostCount","internalType":"uint256"},{"type":"uint256","name":"hostStatus","internalType":"uint256"},{"type":"uint256","name":"hostType","internalType":"uint256"},{"type":"uint256","name":"hostDirection","internalType":"uint256"},{"type":"uint256","name":"hostTime","internalType":"uint256"},{"type":"uint256","name":"updateTime","internalType":"uint256"}],"name":"records","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"record","internalType":"struct RecordStorage.Record","components":[{"type":"uint256","name":"recordNo","internalType":"uint256"},{"type":"address","name":"userAddr","internalType":"address"},{"type":"string","name":"tradeHash","internalType":"string"},{"type":"string","name":"coinType","internalType":"string"},{"type":"uint256","name":"hostCount","internalType":"uint256"},{"type":"uint256","name":"hostStatus","internalType":"uint256"},{"type":"uint256","name":"hostType","internalType":"uint256"},{"type":"uint256","name":"hostDirection","internalType":"uint256"},{"type":"uint256","name":"hostTime","internalType":"uint256"},{"type":"uint256","name":"updateTime","internalType":"uint256"}]}],"name":"searchRecord","inputs":[{"type":"uint256","name":"_recordNo","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct RecordStorage.Record[]","components":[{"type":"uint256","name":"recordNo","internalType":"uint256"},{"type":"address","name":"userAddr","internalType":"address"},{"type":"string","name":"tradeHash","internalType":"string"},{"type":"string","name":"coinType","internalType":"string"},{"type":"uint256","name":"hostCount","internalType":"uint256"},{"type":"uint256","name":"hostStatus","internalType":"uint256"},{"type":"uint256","name":"hostType","internalType":"uint256"},{"type":"uint256","name":"hostDirection","internalType":"uint256"},{"type":"uint256","name":"hostTime","internalType":"uint256"},{"type":"uint256","name":"updateTime","internalType":"uint256"}]}],"name":"searchRecordList","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAppealFee","inputs":[{"type":"uint256","name":"_count","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAppealFeeFinal","inputs":[{"type":"uint256","name":"_count","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCanWithdrawToTime","inputs":[{"type":"uint256","name":"_days","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCoinTypeMapping","inputs":[{"type":"string","name":"_coinType","internalType":"string"},{"type":"address","name":"_coinTypeAddr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCongressFlag","inputs":[{"type":"address","name":"_addr","internalType":"address"},{"type":"uint256","name":"_flag","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCongressNeedCount","inputs":[{"type":"uint256","name":"_count","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMerchantNeedCount","inputs":[{"type":"uint256","name":"_count","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setObserverHandleCredit","inputs":[{"type":"uint256","name":"_c","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setObserverHandleReward","inputs":[{"type":"uint256","name":"_c","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOpenTrade","inputs":[{"type":"bool","name":"_c","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSubTCredit","inputs":[{"type":"uint256","name":"_c","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSubWitCredit","inputs":[{"type":"uint256","name":"_c","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSubWitFee","inputs":[{"type":"uint256","name":"_c","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTradeCredit","inputs":[{"type":"uint256","name":"_c","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWitnessFlag","inputs":[{"type":"address","name":"_addr","internalType":"address"},{"type":"uint256","name":"_flag","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWitnessHandleCredit","inputs":[{"type":"uint256","name":"_c","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWitnessHandleReward","inputs":[{"type":"uint256","name":"_c","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWitnessNeedCount","inputs":[{"type":"uint256","name":"_count","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"subAvaAppeal","inputs":[{"type":"address","name":"_from","internalType":"address"},{"type":"address","name":"_to","internalType":"address"},{"type":"tuple","name":"_al","internalType":"struct AppealStorage.Appeal","components":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"appealNo","internalType":"uint256"},{"type":"uint256","name":"orderNo","internalType":"uint256"},{"type":"address","name":"witness","internalType":"address"},{"type":"address","name":"buyer","internalType":"address"},{"type":"address","name":"seller","internalType":"address"},{"type":"uint256","name":"mortgage","internalType":"uint256"},{"type":"uint256","name":"status","internalType":"uint256"},{"type":"uint256","name":"appealTime","internalType":"uint256"},{"type":"uint256","name":"witTakeTime","internalType":"uint256"},{"type":"uint256","name":"obTakeTime","internalType":"uint256"},{"type":"tuple","name":"detail","internalType":"struct AppealStorage.AppealDetail","components":[{"type":"address","name":"finalAppealAddr","internalType":"address"},{"type":"uint256","name":"updateTime","internalType":"uint256"},{"type":"string","name":"witnessReason","internalType":"string"},{"type":"uint256","name":"witnessAppealStatus","internalType":"uint256"},{"type":"string","name":"observerReason","internalType":"string"},{"type":"uint256","name":"witnessHandleTime","internalType":"uint256"},{"type":"uint256","name":"observerHandleTime","internalType":"uint256"},{"type":"address","name":"observerAddr","internalType":"address"},{"type":"uint256","name":"witnessHandleReward","internalType":"uint256"},{"type":"uint256","name":"observerHandleReward","internalType":"uint256"},{"type":"uint256","name":"witnessHandleCredit","internalType":"uint256"},{"type":"uint256","name":"observerHandleCredit","internalType":"uint256"},{"type":"uint256","name":"witReward","internalType":"uint256"},{"type":"uint256","name":"witSub","internalType":"uint256"},{"type":"uint256","name":"witCreditR","internalType":"uint256"},{"type":"uint256","name":"witCreditS","internalType":"uint256"}]}]},{"type":"uint256","name":"_amt","internalType":"uint256"},{"type":"uint256","name":"_t","internalType":"uint256"},{"type":"uint256","name":"_self","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"subFrozenTotal","inputs":[{"type":"uint256","name":"_orderNo","internalType":"uint256"},{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"subWitnessAvailable","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"tokenEscrow","inputs":[{"type":"string","name":"_coinType","internalType":"string"},{"type":"uint256","name":"_amt","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unApplyUnfrozen","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"unfrozenTotal","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"string","name":"","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"unfrozenTotalSearch","inputs":[{"type":"address","name":"_addr","internalType":"address"},{"type":"string","name":"_coinType","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"updateInfo","inputs":[{"type":"address","name":"_addr","internalType":"address"},{"type":"uint256","name":"_recordNo","internalType":"uint256"},{"type":"string","name":"_hash","internalType":"string"},{"type":"uint256","name":"_hostStatus","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdrawingTotal","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"string","name":"","internalType":"string"}]}]
            

Contract Creation Code

0x608060405268056bc75e2d631000006003819055683635c9adc5dea00000600481905569021e19e0c9bab240000060055560068290556007819055601c6008556009829055600a808055600b92909255600c556001600d819055600e819055600f805460ff191690556010556011553480156200007b57600080fd5b5060405162005fa138038062005fa18339810160408190526200009e9162000227565b620000a9336200018e565b6001805560408051631554d11560e21b8152600260048083018290528351928390036024908101842080546001600160a01b038a81166001600160a01b031992831617909255635553444360e01b8652928501849052855194859003909101842080549092169087161790558183018352600582526477524f534560d81b602083015291518392916200013c9162000271565b908152602001604051809103902060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550620001856016620001de60201b6200412e1760201c565b505050620002d6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8054620001eb5761271081555b6001816000016000828254620002029190620002af565b909155505050565b80516001600160a01b03811681146200022257600080fd5b919050565b6000806000606084860312156200023d57600080fd5b62000248846200020a565b925062000258602085016200020a565b915062000268604085016200020a565b90509250925092565b6000825160005b8181101562000294576020818601810151858301520162000278565b81811115620002a4576000828501525b509190910192915050565b60008219821115620002d157634e487b7160e01b600052601160045260246000fd5b500190565b615cbb80620002e66000396000f3fe608060405234801561001057600080fd5b50600436106103f15760003560e01c80636951babe11610215578063c1db216411610125578063eb004fba116100b8578063f38aea0111610087578063f38aea0114610920578063f86af85f14610933578063f99cbd1c14610946578063fa47c7fa14610959578063fb9bb65f1461096c57600080fd5b8063eb004fba146108ea578063ed786add146108f2578063ed8aca8314610905578063f2fde38b1461090d57600080fd5b8063cabeaa00116100f4578063cabeaa001461089e578063cfa8363f146108b1578063e723b280146108c4578063e84cc314146108d757600080fd5b8063c1db216414610866578063c51ecdb31461087b578063c605373e14610883578063c941455c1461089657600080fd5b80638da5cb5b116101a857806396f084b81161017757806396f084b8146107db5780639e8bbbec14610804578063a29c47ad14610817578063b91b08381461082a578063c1ab245a1461083d57600080fd5b80638da5cb5b146107915780638e0a3a89146107a257806393719f21146107b55780639634ff6a146107c857600080fd5b8063724bcbb3116101e4578063724bcbb3146107275780637318be661461072f57806376ae8abb1461074257806379110a471461077e57600080fd5b80636951babe146106ef5780636a8b6b651461070f5780636dc0ee5514610717578063715018a61461071f57600080fd5b8063349f22861161031057806353fc0585116102a35780635c7cee63116102725780635c7cee63146106ae5780635ff2efad146106b65780636537598e146106c157806366cf90df146106c957806367c92589146106dc57600080fd5b806353fc05851461068357806358e5ed9b14610696578063592d86ae1461069e5780635bb76910146106a657600080fd5b806347b71fae116102df57806347b71fae1461062a5780634e23ea971461063d5780634e2489281461065057806351727c061461066357600080fd5b8063349f2286146105b5578063364ad7a4146105c8578063436b2ab4146105db5780634542567f1461061757600080fd5b806327c34aed116103885780632ecf32bc116103575780632ecf32bc146105405780632eefdb3d1461055357806332f02e1d1461058f57806334461067146105a257600080fd5b806327c34aed146104ff5780632ad8d015146105075780632d9217691461051a5780632df59adb1461052d57600080fd5b8063139cf2ff116103c4578063139cf2ff1461048d57806319da83a8146104a05780631b725770146104c9578063276cd3a5146104dc57600080fd5b806302147ac9146103f65780630989fc371461040b5780630a45ffae1461045a5780630bc67f9b14610462575b600080fd5b610409610404366004614ba2565b61097f565b005b610447610419366004614d46565b601c602090815260009283526040909220815180830184018051928152908401929093019190912091525481565b6040519081526020015b60405180910390f35b600354610447565b610475610470366004614d95565b610b42565b6040516001600160a01b039091168152602001610451565b61044761049b366004614d46565b610b80565b6104b36104ae366004614dc9565b610bbd565b6040516104519a99989796959493929190614e3e565b6104096104d7366004614eb4565b610d38565b6104ef6104ea366004614ee4565b61104d565b6040519015158152602001610451565b600e54610447565b610409610515366004615057565b611064565b610409610528366004614dc9565b611691565b61044761053b366004614d46565b6116c0565b61040961054e366004615196565b6116e6565b610447610561366004614d46565b601b602090815260009283526040909220815180830184018051928152908401929093019190912091525481565b61040961059d3660046151b8565b611723565b6104b36105b0366004614dc9565b611ab7565b6104476105c3366004614d46565b611ae9565b6104096105d6366004615210565b611b0f565b6104476105e9366004614d46565b601f602090815260009283526040909220815180830184018051928152908401929093019190912091525481565b610409610625366004614dc9565b612032565b610447610638366004615251565b612061565b61040961064b366004615297565b6120e3565b61040961065e366004614dc9565b612298565b610447610671366004614dc9565b60186020526000908152604090205481565b610409610691366004614dc9565b6122c7565b600654610447565b600754610447565b600454610447565b601054610447565b600f5460ff166104ef565b600554610447565b6104476106d7366004614dc9565b6122f6565b6104096106ea366004614dc9565b612626565b6107026106fd366004614dc9565b612655565b60405161045191906153d3565b600b54610447565b600954610447565b610409612856565b600854610447565b61040961073d3660046153e6565b61288c565b610447610750366004614d46565b601a602090815260009283526040909220815180830184018051928152908401929093019190912091525481565b61040961078c366004614dc9565b612920565b6000546001600160a01b0316610475565b6104096107b036600461548a565b61294f565b6104096107c3366004614dc9565b6129c0565b6104096107d6366004614dc9565b6129ef565b6104476107e93660046154e0565b6001600160a01b031660009081526012602052604090205490565b610409610812366004614dc9565b612a1e565b6104096108253660046154e0565b612a4d565b610409610838366004614dc9565b612c1b565b61044761084b3660046154e0565b6001600160a01b031660009081526013602052604090205490565b61086e612c4a565b60405161045191906154fd565b600c54610447565b6104096108913660046154e0565b612e2a565b601154610447565b6104096108ac366004614ba2565b613382565b6104096108bf366004614dc9565b61349b565b6104096108d2366004614dc9565b6134ca565b6104096108e5366004614dc9565b6134f9565b600a54610447565b61047561090036600461555f565b613528565b600d54610447565b61040961091b3660046154e0565b61355d565b61044761092e366004614d46565b6135f8565b610409610941366004614dc9565b61366e565b6104096109543660046155a0565b613d3e565b610447610967366004614d46565b6140d9565b61040961097a366004614dc9565b6140ff565b6000546001600160a01b031633146109b25760405162461bcd60e51b81526004016109a9906155e4565b60405180910390fd5b6001600160a01b03821660009081526012602052604090208190556001811415610ad8576001600160a01b0382166000908152601a6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091610a1991615619565b9081526020016040518091039020549050600454811015610a6e5760405162461bcd60e51b815260206004820152600f60248201526e0c6ded2dc40dcdee840cadcdeeaced608b1b60448201526064016109a9565b60145460405163d691fba560e01b81526001600160a01b039091169063d691fba590610aa1908690600190600401615635565b600060405180830381600087803b158015610abb57600080fd5b505af1158015610acf573d6000803e3d6000fd5b50505050505050565b60145460405163d691fba560e01b81526001600160a01b039091169063d691fba590610b0b908590600090600401615635565b600060405180830381600087803b158015610b2557600080fd5b505af1158015610b39573d6000803e3d6000fd5b505050505b5050565b600080600283604051610b559190615619565b908152604051908190036020019020546001600160a01b0316905080610b7a57600080fd5b92915050565b6001600160a01b0382166000908152601c60205260408082209051610ba6908490615619565b908152602001604051809103902054905092915050565b60198181548110610bcd57600080fd5b60009182526020909120600a90910201805460018201546002830180549294506001600160a01b039091169291610c039061564e565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2f9061564e565b8015610c7c5780601f10610c5157610100808354040283529160200191610c7c565b820191906000526020600020905b815481529060010190602001808311610c5f57829003601f168201915b505050505090806003018054610c919061564e565b80601f0160208091040260200160405190810160405280929190818152602001828054610cbd9061564e565b8015610d0a5780601f10610cdf57610100808354040283529160200191610d0a565b820191906000526020600020905b815481529060010190602001808311610ced57829003601f168201915b505050505090806004015490806005015490806006015490806007015490806008015490806009015490508a565b6021546001600160a01b0316610d605760405162461bcd60e51b81526004016109a990615689565b6022546001600160a01b0316610d885760405162461bcd60e51b81526004016109a9906156c0565b6023546001600160a01b0316610db05760405162461bcd60e51b81526004016109a9906156f7565b6024546001600160a01b0316610dd85760405162461bcd60e51b81526004016109a99061572e565b6023546001600160a01b0316331480610dfb57506024546001600160a01b031633145b610e175760405162461bcd60e51b81526004016109a990615765565b6015546040516362bb335f60e11b8152600481018490526000916001600160a01b03169063c57666be906024016000604051808303816000875af1158015610e63573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e8b9190810190615894565b9050600081602001511415610ece5760405162461bcd60e51b81526020600482015260096024820152681b9bdd08195e1a5cdd60ba1b60448201526064016109a9565b6101208101516020808201516040928301516001600160a01b038216600090815283805284812088825290935292909120549091908015610f0e57600080fd5b6001600160a01b0383166000908152601b60205260408082209051610f34908590615619565b90815260405190819003602001902054606086015190915080821015610f5957600080fd5b81610f648383614157565b1115610f6f57600080fd5b610f798282614157565b6001600160a01b0386166000908152601b6020526040908190209051610fa0908790615619565b9081526040805160209281900383019020929092556001600160a01b03871660009081528180528281208b8252909152908120829055610fdf85610b42565b60405163a9059cbb60e01b81529091506001600160a01b0382169063a9059cbb90611010908b908690600401615635565b600060405180830381600087803b15801561102a57600080fd5b505af115801561103e573d6000803e3d6000fd5b50505050505050505050505050565b600061105b8585858561416a565b95945050505050565b6021546001600160a01b031661108c5760405162461bcd60e51b81526004016109a990615689565b6022546001600160a01b03166110b45760405162461bcd60e51b81526004016109a9906156c0565b6023546001600160a01b03166110dc5760405162461bcd60e51b81526004016109a9906156f7565b6024546001600160a01b03166111045760405162461bcd60e51b81526004016109a99061572e565b6024546001600160a01b0316331461112e5760405162461bcd60e51b81526004016109a990615765565b6000611157876040518060400160405280600581526020016477524f534560d81b8152506140d9565b9050600080846001146111735786610160015160e00151611179565b86606001515b905085831061118a5785915061118e565b8291505b84600114801561119c575083155b806111cd57508460021480156111cd5750886001600160a01b0316876101600151600001516001600160a01b031614155b1561140f5761123a601a60008b6001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516112259190615619565b90815260200160405180910390205483614157565b601a60008b6001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b81525060405161128a9190615619565b9081526040805160209281900383018120939093556001600160a01b038b166000908152601a83528190208382018252600584526477524f534560d81b92840192909252516112f1926112dc91615619565b9081526020016040518091039020548361425c565b601a60008a6001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516113419190615619565b9081526020016040518091039020819055506113bb89601a60008c6001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516113a79190615619565b908152602001604051809103902054614268565b61140f88601a60008b6001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516113a79190615619565b611477601a6000836001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516114629190615619565b9081526020016040518091039020548761425c565b601a6000836001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516114c79190615619565b90815260200160405180910390208190555061152d81601a6000846001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516113a79190615619565b6115368961435e565b61153f8861435e565b6115488161435e565b601454604051639bd7417f60e01b81526001600160a01b0383811660048301526000921690639bd7417f90602401600060405180830381865afa158015611593573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115bb9190810190615a53565b905085600114156115e257600d548160a001516115d89190615b59565b60a0820152611603565b856002141561160357600e548160a001516115fd9190615b59565b60a08201525b60e081015160145460a08301516040516316a1e96960e31b81526001600160a01b0386811660048301528451602483015260208501516044830152606482019290925291169063b50f4b4890608401600060405180830381600087803b15801561166c57600080fd5b505af1158015611680573d6000803e3d6000fd5b505050505050505050505050505050565b6000546001600160a01b031633146116bb5760405162461bcd60e51b81526004016109a9906155e4565b600b55565b6001600160a01b0382166000908152601f60205260408082209051610ba6908490615619565b6000546001600160a01b031633146117105760405162461bcd60e51b81526004016109a9906155e4565b600f805460ff1916911515919091179055565b6021546001600160a01b031661174b5760405162461bcd60e51b81526004016109a990615689565b6022546001600160a01b03166117735760405162461bcd60e51b81526004016109a9906156c0565b6023546001600160a01b031661179b5760405162461bcd60e51b81526004016109a9906156f7565b6024546001600160a01b03166117c35760405162461bcd60e51b81526004016109a99061572e565b6022546001600160a01b03163314806117e657506023546001600160a01b031633145b6118245760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016109a9565b6000811161185e5760405162461bcd60e51b81526020600482015260076024820152661a5b9d985b1a5960ca1b60448201526064016109a9565b600061186a8330612061565b9050818110156118a95760405162461bcd60e51b815260206004820152600a6024820152690dcdee840cadcdeeaced60b31b60448201526064016109a9565b6001600160a01b0384166000908152601b60205260409081902090518391906118d3908690615619565b908152602001604051809103902054101561191f5760405162461bcd60e51b815260206004820152600c60248201526b1a5b9cdd59999a58da595b9d60a21b60448201526064016109a9565b6001600160a01b0384166000908152601b6020526040908190209051611946908590615619565b9081526020016040518091039020546119a0601b6000876001600160a01b03166001600160a01b031681526020019081526020016000208560405161198b9190615619565b90815260200160405180910390205484614157565b11156119df5760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b60448201526064016109a9565b6001600160a01b0384166000908152601b6020526040908190209051611a0b9190611225908690615619565b6001600160a01b0385166000908152601b6020526040908190209051611a32908690615619565b908152604051908190036020019020556000611a4d84610b42565b60405163a9059cbb60e01b81529091506001600160a01b0382169063a9059cbb90611a7e9088908790600401615635565b600060405180830381600087803b158015611a9857600080fd5b505af1158015611aac573d6000803e3d6000fd5b505050505050505050565b60176020526000908152604090208054600182015460028301805492936001600160a01b0390921692610c039061564e565b6001600160a01b0382166000908152601b60205260408082209051610ba6908490615619565b6000546001600160a01b03163314611b395760405162461bcd60e51b81526004016109a9906155e4565b6001600160a01b03831615801590611b5957506001600160a01b03821615155b611b6257600080fd5b601454604051639bd7417f60e01b81526001600160a01b0385811660048301526000921690639bd7417f90602401600060405180830381865afa158015611bad573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bd59190810190615a53565b9050806080015160011480611bee575080608001516002145b611c295760405162461bcd60e51b815260206004820152600c60248201526b0c6c2dc4ee840e0eadcd2e6d60a31b60448201526064016109a9565b6001600160a01b0384166000908152601a6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091611c6c91615619565b90815260200160405180910390205490506000601a6000866001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051611ccf9190615619565b9081526020016040518091039020549050838210611dc057611cf18285614157565b601a6000886001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051611d419190615619565b90815260405190819003602001902055611d5b818561425c565b601a6000876001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051611dab9190615619565b90815260405190819003602001902055612020565b6001600160a01b0386166000908152601a6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091611e0391615619565b9081526040805160209281900383018120939093556001600160a01b0389166000908152601f83528181208483018352600585526477524f534560d81b9385019390935290519092611e5491615619565b908152602001604051809103902054905084611e70848361425c565b10611f5757611e8881611e838786614157565b614157565b601f6000896001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051611ed89190615619565b90815260405190819003602001902055611ef2828661425c565b601a6000886001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051611f429190615619565b9081526040519081900360200190205561201e565b6001600160a01b0387166000908152601f6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091611f9a91615619565b90815260405190819003602001902055611fbd82611fb8858461425c565b61425c565b601a6000886001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b81525060405161200d9190615619565b908152604051908190036020019020555b505b6120298661435e565b610b398561435e565b6000546001600160a01b0316331461205c5760405162461bcd60e51b81526004016109a9906155e4565b601055565b60008061206d84610b42565b6040516370a0823160e01b81526001600160a01b038581166004830152919250908216906370a0823190602401602060405180830381865afa1580156120b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120db9190615b71565b949350505050565b6021546001600160a01b031661210b5760405162461bcd60e51b81526004016109a990615689565b6022546001600160a01b03166121335760405162461bcd60e51b81526004016109a9906156c0565b6023546001600160a01b031661215b5760405162461bcd60e51b81526004016109a9906156f7565b6024546001600160a01b03166121835760405162461bcd60e51b81526004016109a99061572e565b6022546001600160a01b03163314806121a657506023546001600160a01b031633145b6122075760405162461bcd60e51b815260206004820152602c60248201527f5265646f63726453746f726167653a496e76616c69642066726f6d20636f6e7460448201526b72616374206164647265737360a01b60648201526084016109a9565b6001600160a01b0387166000908152601b60205260409081902090516122489190612233908890615619565b9081526020016040518091039020548561425c565b6001600160a01b0388166000908152601b602052604090819020905161226f908890615619565b9081526040519081900360200190205561228e8787878787878761460e565b5050505050505050565b6000546001600160a01b031633146122c25760405162461bcd60e51b81526004016109a9906155e4565b600c55565b6000546001600160a01b031633146122f15760405162461bcd60e51b81526004016109a9906155e4565b600955565b600080821161230457600080fd5b336000908152601a602090815260409182902082518084018452600581526477524f534560d81b92810192909252915184929161234091615619565b908152602001604051809103902054101561238e5760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b60448201526064016109a9565b336000908152601a602090815260409182902082518084018452600581526477524f534560d81b9281019290925291516123c89190615619565b90815260408051918290036020908101832054336000908152601a83528390208484018452600585526477524f534560d81b92850192909252915191926124139261198b9190615619565b106124535760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b21030b6b7bab73a101960811b60448201526064016109a9565b336000818152601d602090815260408083204290819055601e83528184209084528252808320869055928252601a81529082902082518084018452600581526477524f534560d81b9281019290925291516124b2929161122591615619565b336000908152601a602090815260409182902082518084018452600581526477524f534560d81b9281019290925291516124ec9190615619565b908152604080516020928190038301812093909355336000908152601f83528190208382018252600584526477524f534560d81b9284019290925251612535926112dc91615619565b336000908152601f602090815260409182902082518084018452600581526477524f534560d81b92810192909252915161256f9190615619565b908152604051908190036020019020556125883361435e565b6125c533604051806020016040528060008152506040518060400160405280600581526020016477524f534560d81b81525085600380600261460e565b507f072538e3c57d574904a160b874c45b7e7fd3c8ed28ab3f872a942edfd852e6d733836040516125f7929190615635565b60405180910390a1610b7a336040518060400160405280600581526020016477524f534560d81b8152506140d9565b6000546001600160a01b031633146126505760405162461bcd60e51b81526004016109a9906155e4565b600355565b6126b46040518061014001604052806000815260200160006001600160a01b0316815260200160608152602001606081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000828152601760209081526040918290208251610140810184528154815260018201546001600160a01b03169281019290925260028101805492939192918401916126ff9061564e565b80601f016020809104026020016040519081016040528092919081815260200182805461272b9061564e565b80156127785780601f1061274d57610100808354040283529160200191612778565b820191906000526020600020905b81548152906001019060200180831161275b57829003601f168201915b505050505081526020016003820180546127919061564e565b80601f01602080910402602001604051908101604052809291908181526020018280546127bd9061564e565b801561280a5780601f106127df5761010080835404028352916020019161280a565b820191906000526020600020905b8154815290600101906020018083116127ed57829003601f168201915b5050505050815260200160048201548152602001600582015481526020016006820154815260200160078201548152602001600882015481526020016009820154815250509050919050565b6000546001600160a01b031633146128805760405162461bcd60e51b81526004016109a9906155e4565b61288a6000614a94565b565b6000546001600160a01b031633146128b65760405162461bcd60e51b81526004016109a9906155e4565b602180546001600160a01b03199081166001600160a01b039687169081179092556022805482169587169590951790945560238054851693861693841790556024805485169290951691909117909355601480548316909317909255601580549091169091179055565b6000546001600160a01b0316331461294a5760405162461bcd60e51b81526004016109a9906155e4565b600655565b6000546001600160a01b031633146129795760405162461bcd60e51b81526004016109a9906155e4565b806002848460405161298c929190615b8a565b90815260405190819003602001902080546001600160a01b03929092166001600160a01b0319909216919091179055505050565b6000546001600160a01b031633146129ea5760405162461bcd60e51b81526004016109a9906155e4565b600455565b6000546001600160a01b03163314612a195760405162461bcd60e51b81526004016109a9906155e4565b600755565b6000546001600160a01b03163314612a485760405162461bcd60e51b81526004016109a9906155e4565b600555565b6000546001600160a01b03163314612a775760405162461bcd60e51b81526004016109a9906155e4565b6001600160a01b0381166000908152601f6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091612aba91615619565b908152602001604051809103902054905060008111612b085760405162461bcd60e51b815260206004820152600a6024820152691cdd59999a58da595b9d60b21b60448201526064016109a9565b6001600160a01b0382166000908152601f6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091612b4b91615619565b9081526040805160209281900383018120939093556001600160a01b0385166000908152601a83528190208382018252600584526477524f534560d81b9284019290925251612bb292612b9d91615619565b9081526020016040518091039020548261425c565b601a6000846001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051612c029190615619565b90815260405190819003602001902055610b3e8261435e565b6000546001600160a01b03163314612c455760405162461bcd60e51b81526004016109a9906155e4565b601155565b60606019805480602002602001604051908101604052809291908181526020016000905b82821015612e215760008481526020908190206040805161014081018252600a86029092018054835260018101546001600160a01b03169383019390935260028301805492939291840191612cc29061564e565b80601f0160208091040260200160405190810160405280929190818152602001828054612cee9061564e565b8015612d3b5780601f10612d1057610100808354040283529160200191612d3b565b820191906000526020600020905b815481529060010190602001808311612d1e57829003601f168201915b50505050508152602001600382018054612d549061564e565b80601f0160208091040260200160405190810160405280929190818152602001828054612d809061564e565b8015612dcd5780601f10612da257610100808354040283529160200191612dcd565b820191906000526020600020905b815481529060010190602001808311612db057829003601f168201915b50505050508152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152505081526020019060010190612c6e565b50505050905090565b6021546001600160a01b0316612e525760405162461bcd60e51b81526004016109a990615689565b6022546001600160a01b0316612e7a5760405162461bcd60e51b81526004016109a9906156c0565b6023546001600160a01b0316612ea25760405162461bcd60e51b81526004016109a9906156f7565b6024546001600160a01b0316612eca5760405162461bcd60e51b81526004016109a99061572e565b6024546001600160a01b03163314612ef45760405162461bcd60e51b81526004016109a990615765565b6001600160a01b038116612f395760405162461bcd60e51b815260206004820152600c60248201526b1859191c995cdcc81b9d5b1b60a21b60448201526064016109a9565b6001600160a01b0381166000908152601a6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091612f7c91615619565b9081526020016040518091039020549050600080600954831061300d576009549150612fa88383614157565b601a6000866001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051612ff89190615619565b908152604051908190036020019020556131b5565b6001600160a01b0384166000908152601a6020908152604080832081518083018352600581526477524f534560d81b938101939093529051909161305091615619565b9081526040805160209281900383018120939093556001600160a01b0387166000908152601f83528181208483018352600585526477524f534560d81b93850193909352905190926130a191615619565b90815260200160405180910390205490506009546130bf858361425c565b106131445760095492506130d38385614157565b91506130df8183614157565b601f6000876001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b81525060405161312f9190615619565b908152604051908190036020019020556131b3565b61314e818561425c565b92506000601f6000876001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516131a29190615619565b908152604051908190036020019020555b505b6131be8461435e565b601454604051639bd7417f60e01b81526001600160a01b0386811660048301526000921690639bd7417f90602401600060405180830381865afa158015613209573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526132319190810190615a53565b9050600a548160a00151101561324857600061325a565b600a548160a0015161325a9190615b9a565b60a0820181905260e08201516014546040516316a1e96960e31b81526001600160a01b038981166004830152835160248301526020840151604483015260648201949094529192169063b50f4b4890608401600060405180830381600087803b1580156132c657600080fd5b505af11580156132da573d6000803e3d6000fd5b5050505060006133066040518060400160405280600581526020016477524f534560d81b815250610b42565b9050806001600160a01b031663a9059cbb6133296000546001600160a01b031690565b876040518363ffffffff1660e01b8152600401613347929190615635565b600060405180830381600087803b15801561336157600080fd5b505af1158015613375573d6000803e3d6000fd5b5050505050505050505050565b6000546001600160a01b031633146133ac5760405162461bcd60e51b81526004016109a9906155e4565b6001600160a01b03821660009081526013602052604090208190556001811415610ad8576001600160a01b0382166000908152601a6020908152604080832081518083018352600581526477524f534560d81b938101939093529051909161341391615619565b90815260200160405180910390205490506005548110156134685760405162461bcd60e51b815260206004820152600f60248201526e0c6ded2dc40dcdee840cadcdeeaced608b1b60448201526064016109a9565b60145460405163d691fba560e01b81526001600160a01b039091169063d691fba590610aa1908690600290600401615635565b6000546001600160a01b031633146134c55760405162461bcd60e51b81526004016109a9906155e4565b600a55565b6000546001600160a01b031633146134f45760405162461bcd60e51b81526004016109a9906155e4565b600855565b6000546001600160a01b031633146135235760405162461bcd60e51b81526004016109a9906155e4565b600e55565b60006002838360405161353c929190615b8a565b908152604051908190036020019020546001600160a01b0316905092915050565b6000546001600160a01b031633146135875760405162461bcd60e51b81526004016109a9906155e4565b6001600160a01b0381166135ec5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109a9565b6135f581614a94565b50565b60006001600160a01b0383166136475760405162461bcd60e51b81526020600482015260146024820152731d5cd95c881859191c995cdcc81a5cc81b9d5b1b60621b60448201526064016109a9565b6001600160a01b0383166000908152601c6020526040908190209051610ba6908490615619565b60008181526017602090815260408083208151610140810183528154815260018201546001600160a01b03169381019390935260028101805491928401916136b59061564e565b80601f01602080910402602001604051908101604052809291908181526020018280546136e19061564e565b801561372e5780601f106137035761010080835404028352916020019161372e565b820191906000526020600020905b81548152906001019060200180831161371157829003601f168201915b505050505081526020016003820180546137479061564e565b80601f01602080910402602001604051908101604052809291908181526020018280546137739061564e565b80156137c05780601f10613795576101008083540402835291602001916137c0565b820191906000526020600020905b8154815290600101906020018083116137a357829003601f168201915b505050918352505060048201546020820152600582015460408201526006820154606082015260078201546080820152600882015460a082015260099091015460c090910152805190915061384a5760405162461bcd60e51b815260206004820152601060248201526f1c9958dbdc99081b9bdd08195e1a5cdd60821b60448201526064016109a9565b60208101516001600160a01b0316331461389e5760405162461bcd60e51b81526020600482015260156024820152741c9958dbdc99081d5cd95c881b9bdd08195e1a5cdd605a1b60448201526064016109a9565b8060a001516003146138e15760405162461bcd60e51b815260206004820152600c60248201526b39ba30ba3ab99032b93937b960a11b60448201526064016109a9565b6080810151336000908152601f602090815260409182902082518084018452600581526477524f534560d81b9281019290925291516139209190615619565b908152602001604051809103902054101561396a5760405162461bcd60e51b815260206004820152600a6024820152691cdd59999a58da595b9d60b21b60448201526064016109a9565b60085461397a9062015180615bb1565b81610100015161398a9190615b59565b4210156139ca5760405162461bcd60e51b815260206004820152600e60248201526d63616e277420776974686472617760901b60448201526064016109a9565b336000908152601f602090815260409182902082518084018452600581526477524f534560d81b928101929092529151613a219291613a0891615619565b9081526020016040518091039020548260800151614157565b336000908152601f602090815260409182902082518084018452600581526477524f534560d81b928101929092529151613a5b9190615619565b908152604080516020928190038301812093909355336000908152601c83528190208382018252600584526477524f534560d81b9284019290925251613abd92613aa491615619565b908152602001604051809103902054826080015161425c565b336000908152601c602090815260409182902082518084018452600581526477524f534560d81b928101929092529151613af79190615619565b908152604080516020928190038301902092909255600460a08401524261012084015260008481526017825282902083518155838201516001820180546001600160a01b0319166001600160a01b03909216919091179055918301518051849392613b69926002850192910190614ae4565b5060608201518051613b85916003840191602090910190614ae4565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820155610100820151600882015561012090910151600990910155600082815260186020526040902054601980548392908110613bea57613bea615bd0565b60009182526020918290208351600a9290920201908155828201516001820180546001600160a01b0319166001600160a01b03909216919091179055604083015180519192613c4192600285019290910190614ae4565b5060608201518051613c5d916003840191602090910190614ae4565b506080820151816004015560a0820151816005015560c0820151816006015560e08201518160070155610100820151816008015561012082015181600901559050507f184981d19cd827a29527d9fef87fd7973eb4f43f9833af36578f456bed5fa19a338383604001516004604051613cd99493929190615be6565b60405180910390a16000613d096040518060400160405280600581526020016477524f534560d81b815250610b42565b608083015160405163a9059cbb60e01b81529192506001600160a01b0383169163a9059cbb91610aa191339190600401615635565b60008111613d785760405162461bcd60e51b81526020600482015260076024820152661a5b9d985b1a5960ca1b60448201526064016109a9565b336000908152601a6020526040908190209051613d96908490615619565b90815260200160405180910390205481601a6000336001600160a01b03166001600160a01b0316815260200190815260200160002084604051613dd99190615619565b908152602001604051809103902054613df29190615b59565b11613e3f5760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964207472616e7366657220616d6f756e7400000000000000000060448201526064016109a9565b336000908152601a6020526040908190209051613e629190612b9d908590615619565b336000908152601a6020526040908190209051613e80908590615619565b908152604080519182900360209081018320939093558181018152600582526477524f534560d81b8284015251600192613ebb929101615619565b6040516020818303038152906040528051906020012083604051602001613ee29190615619565b6040516020818303038152906040528051906020012014156140475750601454604051639bd7417f60e01b81523360048201526002916000916001600160a01b0390911690639bd7417f90602401600060405180830381865afa158015613f4d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613f759190810190615a53565b336000818152601a6020526040908190209051929350613f9a926113a7908890615619565b6080810151158015613fda5750600354336000908152601a6020526040908190209051613fc8908790615619565b90815260200160405180910390205410155b156140455760145460405163d691fba560e01b81526001600160a01b039091169063d691fba590614012903390600390600401615635565b600060405180830381600087803b15801561402c57600080fd5b505af1158015614040573d6000803e3d6000fd5b505050505b505b61406733604051806020016040528060008152508585600286600161460e565b50600061407384610b42565b6040516323b872dd60e01b8152336004820152306024820152604481018590529091506001600160a01b038216906323b872dd906064015b600060405180830381600087803b1580156140c557600080fd5b505af115801561228e573d6000803e3d6000fd5b6001600160a01b0382166000908152601a60205260408082209051610ba6908490615619565b6000546001600160a01b031633146141295760405162461bcd60e51b81526004016109a9906155e4565b600d55565b805461413a5761271081555b600181600001600082825461414f9190615b59565b909155505050565b60006141638284615b9a565b9392505050565b600083815260176020526040812060018101546001600160a01b0387811691161461419457600080fd5b82600114806141a35750826002145b6141e05760405162461bcd60e51b815260206004820152600e60248201526d696e76616c69642073746174757360901b60448201526064016109a9565b82156141ee57600581018390555b83511561420c57835161420a9060028301906020870190614ae4565b505b4260098201556040517f184981d19cd827a29527d9fef87fd7973eb4f43f9833af36578f456bed5fa19a90614248908890889088908890615be6565b60405180910390a150600195945050505050565b60006141638284615b59565b601454604051639bd7417f60e01b81526001600160a01b0384811660048301526000921690639bd7417f90602401600060405180830381865afa1580156142b3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526142db9190810190615a53565b61010081015183815260145460408051630ee685c760e41b81526001600160a01b038881166004830152845160248301526020850151604483015291840151606482015260608401516084820152608084015160a482015260a084015160c482015260c084015160e4820152939450919291169063ee685c7090610104016140ab565b6001600160a01b0381166000908152601a6020908152604080832081518083018352600581526477524f534560d81b93810193909352905190916143a191615619565b90815260405190819003602001812054601454639bd7417f60e01b83526001600160a01b038581166004850152919350600092911690639bd7417f90602401600060405180830381865afa1580156143fd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526144259190810190615a53565b90506144318383614268565b80608001516002148015614446575060055482105b801561445457506003548210155b156144bf5760145460405163d691fba560e01b81526001600160a01b039091169063d691fba59061448c908690600390600401615635565b600060405180830381600087803b1580156144a657600080fd5b505af11580156144ba573d6000803e3d6000fd5b505050505b806080015160011480156144d4575060045482105b80156144e257506003548210155b1561454d5760145460405163d691fba560e01b81526001600160a01b039091169063d691fba59061451a908690600390600401615635565b600060405180830381600087803b15801561453457600080fd5b505af1158015614548573d6000803e3d6000fd5b505050505b608081015115801561456157506003548210155b156145cc5760145460405163d691fba560e01b81526001600160a01b039091169063d691fba590614599908690600390600401615635565b600060405180830381600087803b1580156145b357600080fd5b505af11580156145c7573d6000803e3d6000fd5b505050505b6003548210156146095760145460405163d691fba560e01b81526001600160a01b039091169063d691fba590610aa1908690600090600401615635565b505050565b6000600260015414156146635760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109a9565b60026001556001600160a01b0388166146ad5760405162461bcd60e51b815260206004820152600c60248201526b1859191c995cdcc81b9d5b1b60a21b60448201526064016109a9565b85516146eb5760405162461bcd60e51b815260206004820152600d60248201526c18dbda5b951e5c19481b9d5b1b609a1b60448201526064016109a9565b846147295760405162461bcd60e51b815260206004820152600e60248201526d1a1bdcdd10dbdd5b9d081b9d5b1b60921b60448201526064016109a9565b826147665760405162461bcd60e51b815260206004820152600d60248201526c1a1bdcdd151e5c19481b9d5b1b609a1b60448201526064016109a9565b816147a85760405162461bcd60e51b81526020600482015260126024820152711a1bdcdd111a5c9958dd1a5bdb881b9d5b1b60721b60448201526064016109a9565b60006147b360165490565b600081815260176020526040902054909150156148005760405162461bcd60e51b815260206004820152600b60248201526a1bdc99195c88195e1a5cdd60aa1b60448201526064016109a9565b60408051610140810182528281526001600160a01b038b811660208084019182528385018d8152606085018d9052608085018c905260a085018b905260c085018a905260e08501899052426101008601526000610120860181905287815260178352959095208451815591516001830180546001600160a01b03191691909416179092559251805192938493909261489f926002850192910190614ae4565b50606082015180516148bb916003840191602090910190614ae4565b506080820151600482015560a0820151600582015560c0820151600682015560e082015160078201556101008201516008820155610120909101516009909101556019805460018101825560009190915281517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9695600a9092029182019081556020808401517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9696840180546001600160a01b0319166001600160a01b039092169190911790556040840151805185946149b9937f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9697909101920190614ae4565b50606082015180516149d5916003840191602090910190614ae4565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820155610100820151600882015561012090910151600990910155601954614a2590600190615b9a565b600083815260186020526040902055614a3e601661412e565b7f400817122268a69f3472a92a1ec2769f27f068026b377eaeb64f6cbe0bca7a51828b8b8b8b8b8b8b604051614a7b989796959493929190615c1e565b60405180910390a1506001805598975050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054614af09061564e565b90600052602060002090601f016020900481019282614b125760008555614b58565b82601f10614b2b57805160ff1916838001178555614b58565b82800160010185558215614b58579182015b82811115614b58578251825591602001919060010190614b3d565b50614b64929150614b68565b5090565b5b80821115614b645760008155600101614b69565b6001600160a01b03811681146135f557600080fd5b8035614b9d81614b7d565b919050565b60008060408385031215614bb557600080fd5b8235614bc081614b7d565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405161020081016001600160401b0381118282101715614c0757614c07614bce565b60405290565b60405161018081016001600160401b0381118282101715614c0757614c07614bce565b60405161010081016001600160401b0381118282101715614c0757614c07614bce565b60405161014081016001600160401b0381118282101715614c0757614c07614bce565b60405161012081016001600160401b0381118282101715614c0757614c07614bce565b604051601f8201601f191681016001600160401b0381118282101715614cc157614cc1614bce565b604052919050565b60006001600160401b03821115614ce257614ce2614bce565b50601f01601f191660200190565b600082601f830112614d0157600080fd5b8135614d14614d0f82614cc9565b614c99565b818152846020838601011115614d2957600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215614d5957600080fd5b8235614d6481614b7d565b915060208301356001600160401b03811115614d7f57600080fd5b614d8b85828601614cf0565b9150509250929050565b600060208284031215614da757600080fd5b81356001600160401b03811115614dbd57600080fd5b6120db84828501614cf0565b600060208284031215614ddb57600080fd5b5035919050565b60005b83811015614dfd578181015183820152602001614de5565b83811115614e0c576000848401525b50505050565b60008151808452614e2a816020860160208601614de2565b601f01601f19169290920160200192915050565b8a81526001600160a01b038a16602082015261014060408201819052600090614e698382018c614e12565b90508281036060840152614e7d818b614e12565b6080840199909952505060a081019590955260c085019390935260e084019190915261010083015261012090910152949350505050565b60008060408385031215614ec757600080fd5b823591506020830135614ed981614b7d565b809150509250929050565b60008060008060808587031215614efa57600080fd5b8435614f0581614b7d565b93506020850135925060408501356001600160401b03811115614f2757600080fd5b614f3387828801614cf0565b949793965093946060013593505050565b60006102008284031215614f5757600080fd5b614f5f614be4565b9050614f6a82614b92565b81526020820135602082015260408201356001600160401b0380821115614f9057600080fd5b614f9c85838601614cf0565b6040840152606084013560608401526080840135915080821115614fbf57600080fd5b50614fcc84828501614cf0565b60808301525060a082013560a082015260c082013560c0820152614ff260e08301614b92565b60e0820152610100828101359082015261012080830135908201526101408083013590820152610160808301359082015261018080830135908201526101a080830135908201526101c080830135908201526101e09182013591810191909152919050565b60008060008060008060c0878903121561507057600080fd5b863561507b81614b7d565b9550602087013561508b81614b7d565b945060408701356001600160401b03808211156150a757600080fd5b90880190610180828b0312156150bc57600080fd5b6150c4614c0d565b6150cd83614b92565b815260208301356020820152604083013560408201526150ef60608401614b92565b606082015261510060808401614b92565b608082015261511160a08401614b92565b60a082015260c0838101359082015260e08084013590820152610100808401359082015261012080840135908201526101408084013590820152610160808401358381111561515f57600080fd5b61516b8d828701614f44565b828401525050809650505050606087013592506080870135915060a087013590509295509295509295565b6000602082840312156151a857600080fd5b8135801515811461416357600080fd5b6000806000606084860312156151cd57600080fd5b83356151d881614b7d565b925060208401356001600160401b038111156151f357600080fd5b6151ff86828701614cf0565b925050604084013590509250925092565b60008060006060848603121561522557600080fd5b833561523081614b7d565b9250602084013561524081614b7d565b929592945050506040919091013590565b6000806040838503121561526457600080fd5b82356001600160401b0381111561527a57600080fd5b61528685828601614cf0565b9250506020830135614ed981614b7d565b600080600080600080600060e0888a0312156152b257600080fd5b87356152bd81614b7d565b965060208801356001600160401b03808211156152d957600080fd5b6152e58b838c01614cf0565b975060408a01359150808211156152fb57600080fd5b506153088a828b01614cf0565b979a96995096976060810135975060808101359660a0820135965060c090910135945092505050565b600061014082518452602083015161535460208601826001600160a01b03169052565b50604083015181604086015261536c82860182614e12565b915050606083015184820360608601526153868282614e12565b9150506080830151608085015260a083015160a085015260c083015160c085015260e083015160e08501526101008084015181860152506101208084015181860152508091505092915050565b6020815260006141636020830184615331565b600080600080608085870312156153fc57600080fd5b843561540781614b7d565b9350602085013561541781614b7d565b9250604085013561542781614b7d565b9150606085013561543781614b7d565b939692955090935050565b60008083601f84011261545457600080fd5b5081356001600160401b0381111561546b57600080fd5b60208301915083602082850101111561548357600080fd5b9250929050565b60008060006040848603121561549f57600080fd5b83356001600160401b038111156154b557600080fd5b6154c186828701615442565b90945092505060208401356154d581614b7d565b809150509250925092565b6000602082840312156154f257600080fd5b813561416381614b7d565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561555257603f19888603018452615540858351615331565b94509285019290850190600101615524565b5092979650505050505050565b6000806020838503121561557257600080fd5b82356001600160401b0381111561558857600080fd5b61559485828601615442565b90969095509350505050565b600080604083850312156155b357600080fd5b82356001600160401b038111156155c957600080fd5b6155d585828601614cf0565b95602094909401359450505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000825161562b818460208701614de2565b9190910192915050565b6001600160a01b03929092168252602082015260400190565b600181811c9082168061566257607f821691505b6020821081141561568357634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526019908201527f496e76616c696420616464726573732063616c6c207573657200000000000000604082015260600190565b60208082526019908201527f496e76616c696420616464726573732063616c6c207265737400000000000000604082015260600190565b6020808252601a908201527f496e76616c696420616464726573732063616c6c206f72646572000000000000604082015260600190565b6020808252601b908201527f496e76616c696420616464726573732063616c6c2061707065616c0000000000604082015260600190565b6020808252600c908201526b125b9d985b1a590818d85b1b60a21b604082015260600190565b8051614b9d81614b7d565b600082601f8301126157a757600080fd5b81516157b5614d0f82614cc9565b8181528460208386010111156157ca57600080fd5b6120db826020830160208701614de2565b600061010082840312156157ee57600080fd5b6157f6614c30565b90506158018261578b565b815261580f6020830161578b565b602082015260408201516001600160401b038082111561582e57600080fd5b61583a85838601615796565b6040840152606084015160608401526080840151608084015260a084015160a084015260c084015191508082111561587157600080fd5b5061587e84828501615796565b60c08301525060e082015160e082015292915050565b6000602082840312156158a657600080fd5b81516001600160401b03808211156158bd57600080fd5b9083019061014082860312156158d257600080fd5b6158da614c53565b6158e38361578b565b81526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c08301518281111561592957600080fd5b61593587828601615796565b60c08301525060e083015160e0820152610100808401518183015250610120808401518381111561596557600080fd5b615971888287016157db565b918301919091525095945050505050565b60006040828403121561599457600080fd5b604051604081018181106001600160401b03821117156159b6576159b6614bce565b604052825181526020928301519281019290925250919050565b600060e082840312156159e257600080fd5b60405160e081018181106001600160401b0382111715615a0457615a04614bce565b8060405250809150825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c08201525092915050565b600060208284031215615a6557600080fd5b81516001600160401b0380821115615a7c57600080fd5b908301906102008286031215615a9157600080fd5b615a99614c76565b615aa28361578b565b8152602083015182811115615ab657600080fd5b615ac287828601615796565b602083015250604083015182811115615ada57600080fd5b615ae687828601615796565b604083015250606083015160608201526080830151608082015260a083015160a082015260c083015160c0820152615b218660e08501615982565b60e0820152615b348661012085016159d0565b61010082015295945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115615b6c57615b6c615b43565b500190565b600060208284031215615b8357600080fd5b5051919050565b8183823760009101908152919050565b600082821015615bac57615bac615b43565b500390565b6000816000190483118215151615615bcb57615bcb615b43565b500290565b634e487b7160e01b600052603260045260246000fd5b60018060a01b0385168152836020820152608060408201526000615c0d6080830185614e12565b905082606083015295945050505050565b8881526001600160a01b038816602082015261010060408201819052600090615c498382018a614e12565b90508281036060840152615c5d8189614e12565b9150508560808301528460a08301528360c08301528260e0830152999850505050505050505056fea2646970667358221220d16f33be3834630651df2c66199acf3a26d3caa09f9ccade9807f350262951ae64736f6c634300080b00330000000000000000000000006cb9750a92643382e020ea9a170abb83df05f30b00000000000000000000000094fbffe5698db6f54d6ca524dbe673a7729014be00000000000000000000000021c718c22d52d0f3a789b752d4c2fd5908a8a733

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106103f15760003560e01c80636951babe11610215578063c1db216411610125578063eb004fba116100b8578063f38aea0111610087578063f38aea0114610920578063f86af85f14610933578063f99cbd1c14610946578063fa47c7fa14610959578063fb9bb65f1461096c57600080fd5b8063eb004fba146108ea578063ed786add146108f2578063ed8aca8314610905578063f2fde38b1461090d57600080fd5b8063cabeaa00116100f4578063cabeaa001461089e578063cfa8363f146108b1578063e723b280146108c4578063e84cc314146108d757600080fd5b8063c1db216414610866578063c51ecdb31461087b578063c605373e14610883578063c941455c1461089657600080fd5b80638da5cb5b116101a857806396f084b81161017757806396f084b8146107db5780639e8bbbec14610804578063a29c47ad14610817578063b91b08381461082a578063c1ab245a1461083d57600080fd5b80638da5cb5b146107915780638e0a3a89146107a257806393719f21146107b55780639634ff6a146107c857600080fd5b8063724bcbb3116101e4578063724bcbb3146107275780637318be661461072f57806376ae8abb1461074257806379110a471461077e57600080fd5b80636951babe146106ef5780636a8b6b651461070f5780636dc0ee5514610717578063715018a61461071f57600080fd5b8063349f22861161031057806353fc0585116102a35780635c7cee63116102725780635c7cee63146106ae5780635ff2efad146106b65780636537598e146106c157806366cf90df146106c957806367c92589146106dc57600080fd5b806353fc05851461068357806358e5ed9b14610696578063592d86ae1461069e5780635bb76910146106a657600080fd5b806347b71fae116102df57806347b71fae1461062a5780634e23ea971461063d5780634e2489281461065057806351727c061461066357600080fd5b8063349f2286146105b5578063364ad7a4146105c8578063436b2ab4146105db5780634542567f1461061757600080fd5b806327c34aed116103885780632ecf32bc116103575780632ecf32bc146105405780632eefdb3d1461055357806332f02e1d1461058f57806334461067146105a257600080fd5b806327c34aed146104ff5780632ad8d015146105075780632d9217691461051a5780632df59adb1461052d57600080fd5b8063139cf2ff116103c4578063139cf2ff1461048d57806319da83a8146104a05780631b725770146104c9578063276cd3a5146104dc57600080fd5b806302147ac9146103f65780630989fc371461040b5780630a45ffae1461045a5780630bc67f9b14610462575b600080fd5b610409610404366004614ba2565b61097f565b005b610447610419366004614d46565b601c602090815260009283526040909220815180830184018051928152908401929093019190912091525481565b6040519081526020015b60405180910390f35b600354610447565b610475610470366004614d95565b610b42565b6040516001600160a01b039091168152602001610451565b61044761049b366004614d46565b610b80565b6104b36104ae366004614dc9565b610bbd565b6040516104519a99989796959493929190614e3e565b6104096104d7366004614eb4565b610d38565b6104ef6104ea366004614ee4565b61104d565b6040519015158152602001610451565b600e54610447565b610409610515366004615057565b611064565b610409610528366004614dc9565b611691565b61044761053b366004614d46565b6116c0565b61040961054e366004615196565b6116e6565b610447610561366004614d46565b601b602090815260009283526040909220815180830184018051928152908401929093019190912091525481565b61040961059d3660046151b8565b611723565b6104b36105b0366004614dc9565b611ab7565b6104476105c3366004614d46565b611ae9565b6104096105d6366004615210565b611b0f565b6104476105e9366004614d46565b601f602090815260009283526040909220815180830184018051928152908401929093019190912091525481565b610409610625366004614dc9565b612032565b610447610638366004615251565b612061565b61040961064b366004615297565b6120e3565b61040961065e366004614dc9565b612298565b610447610671366004614dc9565b60186020526000908152604090205481565b610409610691366004614dc9565b6122c7565b600654610447565b600754610447565b600454610447565b601054610447565b600f5460ff166104ef565b600554610447565b6104476106d7366004614dc9565b6122f6565b6104096106ea366004614dc9565b612626565b6107026106fd366004614dc9565b612655565b60405161045191906153d3565b600b54610447565b600954610447565b610409612856565b600854610447565b61040961073d3660046153e6565b61288c565b610447610750366004614d46565b601a602090815260009283526040909220815180830184018051928152908401929093019190912091525481565b61040961078c366004614dc9565b612920565b6000546001600160a01b0316610475565b6104096107b036600461548a565b61294f565b6104096107c3366004614dc9565b6129c0565b6104096107d6366004614dc9565b6129ef565b6104476107e93660046154e0565b6001600160a01b031660009081526012602052604090205490565b610409610812366004614dc9565b612a1e565b6104096108253660046154e0565b612a4d565b610409610838366004614dc9565b612c1b565b61044761084b3660046154e0565b6001600160a01b031660009081526013602052604090205490565b61086e612c4a565b60405161045191906154fd565b600c54610447565b6104096108913660046154e0565b612e2a565b601154610447565b6104096108ac366004614ba2565b613382565b6104096108bf366004614dc9565b61349b565b6104096108d2366004614dc9565b6134ca565b6104096108e5366004614dc9565b6134f9565b600a54610447565b61047561090036600461555f565b613528565b600d54610447565b61040961091b3660046154e0565b61355d565b61044761092e366004614d46565b6135f8565b610409610941366004614dc9565b61366e565b6104096109543660046155a0565b613d3e565b610447610967366004614d46565b6140d9565b61040961097a366004614dc9565b6140ff565b6000546001600160a01b031633146109b25760405162461bcd60e51b81526004016109a9906155e4565b60405180910390fd5b6001600160a01b03821660009081526012602052604090208190556001811415610ad8576001600160a01b0382166000908152601a6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091610a1991615619565b9081526020016040518091039020549050600454811015610a6e5760405162461bcd60e51b815260206004820152600f60248201526e0c6ded2dc40dcdee840cadcdeeaced608b1b60448201526064016109a9565b60145460405163d691fba560e01b81526001600160a01b039091169063d691fba590610aa1908690600190600401615635565b600060405180830381600087803b158015610abb57600080fd5b505af1158015610acf573d6000803e3d6000fd5b50505050505050565b60145460405163d691fba560e01b81526001600160a01b039091169063d691fba590610b0b908590600090600401615635565b600060405180830381600087803b158015610b2557600080fd5b505af1158015610b39573d6000803e3d6000fd5b505050505b5050565b600080600283604051610b559190615619565b908152604051908190036020019020546001600160a01b0316905080610b7a57600080fd5b92915050565b6001600160a01b0382166000908152601c60205260408082209051610ba6908490615619565b908152602001604051809103902054905092915050565b60198181548110610bcd57600080fd5b60009182526020909120600a90910201805460018201546002830180549294506001600160a01b039091169291610c039061564e565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2f9061564e565b8015610c7c5780601f10610c5157610100808354040283529160200191610c7c565b820191906000526020600020905b815481529060010190602001808311610c5f57829003601f168201915b505050505090806003018054610c919061564e565b80601f0160208091040260200160405190810160405280929190818152602001828054610cbd9061564e565b8015610d0a5780601f10610cdf57610100808354040283529160200191610d0a565b820191906000526020600020905b815481529060010190602001808311610ced57829003601f168201915b505050505090806004015490806005015490806006015490806007015490806008015490806009015490508a565b6021546001600160a01b0316610d605760405162461bcd60e51b81526004016109a990615689565b6022546001600160a01b0316610d885760405162461bcd60e51b81526004016109a9906156c0565b6023546001600160a01b0316610db05760405162461bcd60e51b81526004016109a9906156f7565b6024546001600160a01b0316610dd85760405162461bcd60e51b81526004016109a99061572e565b6023546001600160a01b0316331480610dfb57506024546001600160a01b031633145b610e175760405162461bcd60e51b81526004016109a990615765565b6015546040516362bb335f60e11b8152600481018490526000916001600160a01b03169063c57666be906024016000604051808303816000875af1158015610e63573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e8b9190810190615894565b9050600081602001511415610ece5760405162461bcd60e51b81526020600482015260096024820152681b9bdd08195e1a5cdd60ba1b60448201526064016109a9565b6101208101516020808201516040928301516001600160a01b038216600090815283805284812088825290935292909120549091908015610f0e57600080fd5b6001600160a01b0383166000908152601b60205260408082209051610f34908590615619565b90815260405190819003602001902054606086015190915080821015610f5957600080fd5b81610f648383614157565b1115610f6f57600080fd5b610f798282614157565b6001600160a01b0386166000908152601b6020526040908190209051610fa0908790615619565b9081526040805160209281900383019020929092556001600160a01b03871660009081528180528281208b8252909152908120829055610fdf85610b42565b60405163a9059cbb60e01b81529091506001600160a01b0382169063a9059cbb90611010908b908690600401615635565b600060405180830381600087803b15801561102a57600080fd5b505af115801561103e573d6000803e3d6000fd5b50505050505050505050505050565b600061105b8585858561416a565b95945050505050565b6021546001600160a01b031661108c5760405162461bcd60e51b81526004016109a990615689565b6022546001600160a01b03166110b45760405162461bcd60e51b81526004016109a9906156c0565b6023546001600160a01b03166110dc5760405162461bcd60e51b81526004016109a9906156f7565b6024546001600160a01b03166111045760405162461bcd60e51b81526004016109a99061572e565b6024546001600160a01b0316331461112e5760405162461bcd60e51b81526004016109a990615765565b6000611157876040518060400160405280600581526020016477524f534560d81b8152506140d9565b9050600080846001146111735786610160015160e00151611179565b86606001515b905085831061118a5785915061118e565b8291505b84600114801561119c575083155b806111cd57508460021480156111cd5750886001600160a01b0316876101600151600001516001600160a01b031614155b1561140f5761123a601a60008b6001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516112259190615619565b90815260200160405180910390205483614157565b601a60008b6001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b81525060405161128a9190615619565b9081526040805160209281900383018120939093556001600160a01b038b166000908152601a83528190208382018252600584526477524f534560d81b92840192909252516112f1926112dc91615619565b9081526020016040518091039020548361425c565b601a60008a6001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516113419190615619565b9081526020016040518091039020819055506113bb89601a60008c6001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516113a79190615619565b908152602001604051809103902054614268565b61140f88601a60008b6001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516113a79190615619565b611477601a6000836001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516114629190615619565b9081526020016040518091039020548761425c565b601a6000836001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516114c79190615619565b90815260200160405180910390208190555061152d81601a6000846001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516113a79190615619565b6115368961435e565b61153f8861435e565b6115488161435e565b601454604051639bd7417f60e01b81526001600160a01b0383811660048301526000921690639bd7417f90602401600060405180830381865afa158015611593573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115bb9190810190615a53565b905085600114156115e257600d548160a001516115d89190615b59565b60a0820152611603565b856002141561160357600e548160a001516115fd9190615b59565b60a08201525b60e081015160145460a08301516040516316a1e96960e31b81526001600160a01b0386811660048301528451602483015260208501516044830152606482019290925291169063b50f4b4890608401600060405180830381600087803b15801561166c57600080fd5b505af1158015611680573d6000803e3d6000fd5b505050505050505050505050505050565b6000546001600160a01b031633146116bb5760405162461bcd60e51b81526004016109a9906155e4565b600b55565b6001600160a01b0382166000908152601f60205260408082209051610ba6908490615619565b6000546001600160a01b031633146117105760405162461bcd60e51b81526004016109a9906155e4565b600f805460ff1916911515919091179055565b6021546001600160a01b031661174b5760405162461bcd60e51b81526004016109a990615689565b6022546001600160a01b03166117735760405162461bcd60e51b81526004016109a9906156c0565b6023546001600160a01b031661179b5760405162461bcd60e51b81526004016109a9906156f7565b6024546001600160a01b03166117c35760405162461bcd60e51b81526004016109a99061572e565b6022546001600160a01b03163314806117e657506023546001600160a01b031633145b6118245760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016109a9565b6000811161185e5760405162461bcd60e51b81526020600482015260076024820152661a5b9d985b1a5960ca1b60448201526064016109a9565b600061186a8330612061565b9050818110156118a95760405162461bcd60e51b815260206004820152600a6024820152690dcdee840cadcdeeaced60b31b60448201526064016109a9565b6001600160a01b0384166000908152601b60205260409081902090518391906118d3908690615619565b908152602001604051809103902054101561191f5760405162461bcd60e51b815260206004820152600c60248201526b1a5b9cdd59999a58da595b9d60a21b60448201526064016109a9565b6001600160a01b0384166000908152601b6020526040908190209051611946908590615619565b9081526020016040518091039020546119a0601b6000876001600160a01b03166001600160a01b031681526020019081526020016000208560405161198b9190615619565b90815260200160405180910390205484614157565b11156119df5760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b60448201526064016109a9565b6001600160a01b0384166000908152601b6020526040908190209051611a0b9190611225908690615619565b6001600160a01b0385166000908152601b6020526040908190209051611a32908690615619565b908152604051908190036020019020556000611a4d84610b42565b60405163a9059cbb60e01b81529091506001600160a01b0382169063a9059cbb90611a7e9088908790600401615635565b600060405180830381600087803b158015611a9857600080fd5b505af1158015611aac573d6000803e3d6000fd5b505050505050505050565b60176020526000908152604090208054600182015460028301805492936001600160a01b0390921692610c039061564e565b6001600160a01b0382166000908152601b60205260408082209051610ba6908490615619565b6000546001600160a01b03163314611b395760405162461bcd60e51b81526004016109a9906155e4565b6001600160a01b03831615801590611b5957506001600160a01b03821615155b611b6257600080fd5b601454604051639bd7417f60e01b81526001600160a01b0385811660048301526000921690639bd7417f90602401600060405180830381865afa158015611bad573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bd59190810190615a53565b9050806080015160011480611bee575080608001516002145b611c295760405162461bcd60e51b815260206004820152600c60248201526b0c6c2dc4ee840e0eadcd2e6d60a31b60448201526064016109a9565b6001600160a01b0384166000908152601a6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091611c6c91615619565b90815260200160405180910390205490506000601a6000866001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051611ccf9190615619565b9081526020016040518091039020549050838210611dc057611cf18285614157565b601a6000886001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051611d419190615619565b90815260405190819003602001902055611d5b818561425c565b601a6000876001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051611dab9190615619565b90815260405190819003602001902055612020565b6001600160a01b0386166000908152601a6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091611e0391615619565b9081526040805160209281900383018120939093556001600160a01b0389166000908152601f83528181208483018352600585526477524f534560d81b9385019390935290519092611e5491615619565b908152602001604051809103902054905084611e70848361425c565b10611f5757611e8881611e838786614157565b614157565b601f6000896001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051611ed89190615619565b90815260405190819003602001902055611ef2828661425c565b601a6000886001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051611f429190615619565b9081526040519081900360200190205561201e565b6001600160a01b0387166000908152601f6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091611f9a91615619565b90815260405190819003602001902055611fbd82611fb8858461425c565b61425c565b601a6000886001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b81525060405161200d9190615619565b908152604051908190036020019020555b505b6120298661435e565b610b398561435e565b6000546001600160a01b0316331461205c5760405162461bcd60e51b81526004016109a9906155e4565b601055565b60008061206d84610b42565b6040516370a0823160e01b81526001600160a01b038581166004830152919250908216906370a0823190602401602060405180830381865afa1580156120b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120db9190615b71565b949350505050565b6021546001600160a01b031661210b5760405162461bcd60e51b81526004016109a990615689565b6022546001600160a01b03166121335760405162461bcd60e51b81526004016109a9906156c0565b6023546001600160a01b031661215b5760405162461bcd60e51b81526004016109a9906156f7565b6024546001600160a01b03166121835760405162461bcd60e51b81526004016109a99061572e565b6022546001600160a01b03163314806121a657506023546001600160a01b031633145b6122075760405162461bcd60e51b815260206004820152602c60248201527f5265646f63726453746f726167653a496e76616c69642066726f6d20636f6e7460448201526b72616374206164647265737360a01b60648201526084016109a9565b6001600160a01b0387166000908152601b60205260409081902090516122489190612233908890615619565b9081526020016040518091039020548561425c565b6001600160a01b0388166000908152601b602052604090819020905161226f908890615619565b9081526040519081900360200190205561228e8787878787878761460e565b5050505050505050565b6000546001600160a01b031633146122c25760405162461bcd60e51b81526004016109a9906155e4565b600c55565b6000546001600160a01b031633146122f15760405162461bcd60e51b81526004016109a9906155e4565b600955565b600080821161230457600080fd5b336000908152601a602090815260409182902082518084018452600581526477524f534560d81b92810192909252915184929161234091615619565b908152602001604051809103902054101561238e5760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b60448201526064016109a9565b336000908152601a602090815260409182902082518084018452600581526477524f534560d81b9281019290925291516123c89190615619565b90815260408051918290036020908101832054336000908152601a83528390208484018452600585526477524f534560d81b92850192909252915191926124139261198b9190615619565b106124535760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b21030b6b7bab73a101960811b60448201526064016109a9565b336000818152601d602090815260408083204290819055601e83528184209084528252808320869055928252601a81529082902082518084018452600581526477524f534560d81b9281019290925291516124b2929161122591615619565b336000908152601a602090815260409182902082518084018452600581526477524f534560d81b9281019290925291516124ec9190615619565b908152604080516020928190038301812093909355336000908152601f83528190208382018252600584526477524f534560d81b9284019290925251612535926112dc91615619565b336000908152601f602090815260409182902082518084018452600581526477524f534560d81b92810192909252915161256f9190615619565b908152604051908190036020019020556125883361435e565b6125c533604051806020016040528060008152506040518060400160405280600581526020016477524f534560d81b81525085600380600261460e565b507f072538e3c57d574904a160b874c45b7e7fd3c8ed28ab3f872a942edfd852e6d733836040516125f7929190615635565b60405180910390a1610b7a336040518060400160405280600581526020016477524f534560d81b8152506140d9565b6000546001600160a01b031633146126505760405162461bcd60e51b81526004016109a9906155e4565b600355565b6126b46040518061014001604052806000815260200160006001600160a01b0316815260200160608152602001606081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000828152601760209081526040918290208251610140810184528154815260018201546001600160a01b03169281019290925260028101805492939192918401916126ff9061564e565b80601f016020809104026020016040519081016040528092919081815260200182805461272b9061564e565b80156127785780601f1061274d57610100808354040283529160200191612778565b820191906000526020600020905b81548152906001019060200180831161275b57829003601f168201915b505050505081526020016003820180546127919061564e565b80601f01602080910402602001604051908101604052809291908181526020018280546127bd9061564e565b801561280a5780601f106127df5761010080835404028352916020019161280a565b820191906000526020600020905b8154815290600101906020018083116127ed57829003601f168201915b5050505050815260200160048201548152602001600582015481526020016006820154815260200160078201548152602001600882015481526020016009820154815250509050919050565b6000546001600160a01b031633146128805760405162461bcd60e51b81526004016109a9906155e4565b61288a6000614a94565b565b6000546001600160a01b031633146128b65760405162461bcd60e51b81526004016109a9906155e4565b602180546001600160a01b03199081166001600160a01b039687169081179092556022805482169587169590951790945560238054851693861693841790556024805485169290951691909117909355601480548316909317909255601580549091169091179055565b6000546001600160a01b0316331461294a5760405162461bcd60e51b81526004016109a9906155e4565b600655565b6000546001600160a01b031633146129795760405162461bcd60e51b81526004016109a9906155e4565b806002848460405161298c929190615b8a565b90815260405190819003602001902080546001600160a01b03929092166001600160a01b0319909216919091179055505050565b6000546001600160a01b031633146129ea5760405162461bcd60e51b81526004016109a9906155e4565b600455565b6000546001600160a01b03163314612a195760405162461bcd60e51b81526004016109a9906155e4565b600755565b6000546001600160a01b03163314612a485760405162461bcd60e51b81526004016109a9906155e4565b600555565b6000546001600160a01b03163314612a775760405162461bcd60e51b81526004016109a9906155e4565b6001600160a01b0381166000908152601f6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091612aba91615619565b908152602001604051809103902054905060008111612b085760405162461bcd60e51b815260206004820152600a6024820152691cdd59999a58da595b9d60b21b60448201526064016109a9565b6001600160a01b0382166000908152601f6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091612b4b91615619565b9081526040805160209281900383018120939093556001600160a01b0385166000908152601a83528190208382018252600584526477524f534560d81b9284019290925251612bb292612b9d91615619565b9081526020016040518091039020548261425c565b601a6000846001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051612c029190615619565b90815260405190819003602001902055610b3e8261435e565b6000546001600160a01b03163314612c455760405162461bcd60e51b81526004016109a9906155e4565b601155565b60606019805480602002602001604051908101604052809291908181526020016000905b82821015612e215760008481526020908190206040805161014081018252600a86029092018054835260018101546001600160a01b03169383019390935260028301805492939291840191612cc29061564e565b80601f0160208091040260200160405190810160405280929190818152602001828054612cee9061564e565b8015612d3b5780601f10612d1057610100808354040283529160200191612d3b565b820191906000526020600020905b815481529060010190602001808311612d1e57829003601f168201915b50505050508152602001600382018054612d549061564e565b80601f0160208091040260200160405190810160405280929190818152602001828054612d809061564e565b8015612dcd5780601f10612da257610100808354040283529160200191612dcd565b820191906000526020600020905b815481529060010190602001808311612db057829003601f168201915b50505050508152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152505081526020019060010190612c6e565b50505050905090565b6021546001600160a01b0316612e525760405162461bcd60e51b81526004016109a990615689565b6022546001600160a01b0316612e7a5760405162461bcd60e51b81526004016109a9906156c0565b6023546001600160a01b0316612ea25760405162461bcd60e51b81526004016109a9906156f7565b6024546001600160a01b0316612eca5760405162461bcd60e51b81526004016109a99061572e565b6024546001600160a01b03163314612ef45760405162461bcd60e51b81526004016109a990615765565b6001600160a01b038116612f395760405162461bcd60e51b815260206004820152600c60248201526b1859191c995cdcc81b9d5b1b60a21b60448201526064016109a9565b6001600160a01b0381166000908152601a6020908152604080832081518083018352600581526477524f534560d81b9381019390935290519091612f7c91615619565b9081526020016040518091039020549050600080600954831061300d576009549150612fa88383614157565b601a6000866001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b815250604051612ff89190615619565b908152604051908190036020019020556131b5565b6001600160a01b0384166000908152601a6020908152604080832081518083018352600581526477524f534560d81b938101939093529051909161305091615619565b9081526040805160209281900383018120939093556001600160a01b0387166000908152601f83528181208483018352600585526477524f534560d81b93850193909352905190926130a191615619565b90815260200160405180910390205490506009546130bf858361425c565b106131445760095492506130d38385614157565b91506130df8183614157565b601f6000876001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b81525060405161312f9190615619565b908152604051908190036020019020556131b3565b61314e818561425c565b92506000601f6000876001600160a01b03166001600160a01b031681526020019081526020016000206040518060400160405280600581526020016477524f534560d81b8152506040516131a29190615619565b908152604051908190036020019020555b505b6131be8461435e565b601454604051639bd7417f60e01b81526001600160a01b0386811660048301526000921690639bd7417f90602401600060405180830381865afa158015613209573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526132319190810190615a53565b9050600a548160a00151101561324857600061325a565b600a548160a0015161325a9190615b9a565b60a0820181905260e08201516014546040516316a1e96960e31b81526001600160a01b038981166004830152835160248301526020840151604483015260648201949094529192169063b50f4b4890608401600060405180830381600087803b1580156132c657600080fd5b505af11580156132da573d6000803e3d6000fd5b5050505060006133066040518060400160405280600581526020016477524f534560d81b815250610b42565b9050806001600160a01b031663a9059cbb6133296000546001600160a01b031690565b876040518363ffffffff1660e01b8152600401613347929190615635565b600060405180830381600087803b15801561336157600080fd5b505af1158015613375573d6000803e3d6000fd5b5050505050505050505050565b6000546001600160a01b031633146133ac5760405162461bcd60e51b81526004016109a9906155e4565b6001600160a01b03821660009081526013602052604090208190556001811415610ad8576001600160a01b0382166000908152601a6020908152604080832081518083018352600581526477524f534560d81b938101939093529051909161341391615619565b90815260200160405180910390205490506005548110156134685760405162461bcd60e51b815260206004820152600f60248201526e0c6ded2dc40dcdee840cadcdeeaced608b1b60448201526064016109a9565b60145460405163d691fba560e01b81526001600160a01b039091169063d691fba590610aa1908690600290600401615635565b6000546001600160a01b031633146134c55760405162461bcd60e51b81526004016109a9906155e4565b600a55565b6000546001600160a01b031633146134f45760405162461bcd60e51b81526004016109a9906155e4565b600855565b6000546001600160a01b031633146135235760405162461bcd60e51b81526004016109a9906155e4565b600e55565b60006002838360405161353c929190615b8a565b908152604051908190036020019020546001600160a01b0316905092915050565b6000546001600160a01b031633146135875760405162461bcd60e51b81526004016109a9906155e4565b6001600160a01b0381166135ec5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109a9565b6135f581614a94565b50565b60006001600160a01b0383166136475760405162461bcd60e51b81526020600482015260146024820152731d5cd95c881859191c995cdcc81a5cc81b9d5b1b60621b60448201526064016109a9565b6001600160a01b0383166000908152601c6020526040908190209051610ba6908490615619565b60008181526017602090815260408083208151610140810183528154815260018201546001600160a01b03169381019390935260028101805491928401916136b59061564e565b80601f01602080910402602001604051908101604052809291908181526020018280546136e19061564e565b801561372e5780601f106137035761010080835404028352916020019161372e565b820191906000526020600020905b81548152906001019060200180831161371157829003601f168201915b505050505081526020016003820180546137479061564e565b80601f01602080910402602001604051908101604052809291908181526020018280546137739061564e565b80156137c05780601f10613795576101008083540402835291602001916137c0565b820191906000526020600020905b8154815290600101906020018083116137a357829003601f168201915b505050918352505060048201546020820152600582015460408201526006820154606082015260078201546080820152600882015460a082015260099091015460c090910152805190915061384a5760405162461bcd60e51b815260206004820152601060248201526f1c9958dbdc99081b9bdd08195e1a5cdd60821b60448201526064016109a9565b60208101516001600160a01b0316331461389e5760405162461bcd60e51b81526020600482015260156024820152741c9958dbdc99081d5cd95c881b9bdd08195e1a5cdd605a1b60448201526064016109a9565b8060a001516003146138e15760405162461bcd60e51b815260206004820152600c60248201526b39ba30ba3ab99032b93937b960a11b60448201526064016109a9565b6080810151336000908152601f602090815260409182902082518084018452600581526477524f534560d81b9281019290925291516139209190615619565b908152602001604051809103902054101561396a5760405162461bcd60e51b815260206004820152600a6024820152691cdd59999a58da595b9d60b21b60448201526064016109a9565b60085461397a9062015180615bb1565b81610100015161398a9190615b59565b4210156139ca5760405162461bcd60e51b815260206004820152600e60248201526d63616e277420776974686472617760901b60448201526064016109a9565b336000908152601f602090815260409182902082518084018452600581526477524f534560d81b928101929092529151613a219291613a0891615619565b9081526020016040518091039020548260800151614157565b336000908152601f602090815260409182902082518084018452600581526477524f534560d81b928101929092529151613a5b9190615619565b908152604080516020928190038301812093909355336000908152601c83528190208382018252600584526477524f534560d81b9284019290925251613abd92613aa491615619565b908152602001604051809103902054826080015161425c565b336000908152601c602090815260409182902082518084018452600581526477524f534560d81b928101929092529151613af79190615619565b908152604080516020928190038301902092909255600460a08401524261012084015260008481526017825282902083518155838201516001820180546001600160a01b0319166001600160a01b03909216919091179055918301518051849392613b69926002850192910190614ae4565b5060608201518051613b85916003840191602090910190614ae4565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820155610100820151600882015561012090910151600990910155600082815260186020526040902054601980548392908110613bea57613bea615bd0565b60009182526020918290208351600a9290920201908155828201516001820180546001600160a01b0319166001600160a01b03909216919091179055604083015180519192613c4192600285019290910190614ae4565b5060608201518051613c5d916003840191602090910190614ae4565b506080820151816004015560a0820151816005015560c0820151816006015560e08201518160070155610100820151816008015561012082015181600901559050507f184981d19cd827a29527d9fef87fd7973eb4f43f9833af36578f456bed5fa19a338383604001516004604051613cd99493929190615be6565b60405180910390a16000613d096040518060400160405280600581526020016477524f534560d81b815250610b42565b608083015160405163a9059cbb60e01b81529192506001600160a01b0383169163a9059cbb91610aa191339190600401615635565b60008111613d785760405162461bcd60e51b81526020600482015260076024820152661a5b9d985b1a5960ca1b60448201526064016109a9565b336000908152601a6020526040908190209051613d96908490615619565b90815260200160405180910390205481601a6000336001600160a01b03166001600160a01b0316815260200190815260200160002084604051613dd99190615619565b908152602001604051809103902054613df29190615b59565b11613e3f5760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964207472616e7366657220616d6f756e7400000000000000000060448201526064016109a9565b336000908152601a6020526040908190209051613e629190612b9d908590615619565b336000908152601a6020526040908190209051613e80908590615619565b908152604080519182900360209081018320939093558181018152600582526477524f534560d81b8284015251600192613ebb929101615619565b6040516020818303038152906040528051906020012083604051602001613ee29190615619565b6040516020818303038152906040528051906020012014156140475750601454604051639bd7417f60e01b81523360048201526002916000916001600160a01b0390911690639bd7417f90602401600060405180830381865afa158015613f4d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613f759190810190615a53565b336000818152601a6020526040908190209051929350613f9a926113a7908890615619565b6080810151158015613fda5750600354336000908152601a6020526040908190209051613fc8908790615619565b90815260200160405180910390205410155b156140455760145460405163d691fba560e01b81526001600160a01b039091169063d691fba590614012903390600390600401615635565b600060405180830381600087803b15801561402c57600080fd5b505af1158015614040573d6000803e3d6000fd5b505050505b505b61406733604051806020016040528060008152508585600286600161460e565b50600061407384610b42565b6040516323b872dd60e01b8152336004820152306024820152604481018590529091506001600160a01b038216906323b872dd906064015b600060405180830381600087803b1580156140c557600080fd5b505af115801561228e573d6000803e3d6000fd5b6001600160a01b0382166000908152601a60205260408082209051610ba6908490615619565b6000546001600160a01b031633146141295760405162461bcd60e51b81526004016109a9906155e4565b600d55565b805461413a5761271081555b600181600001600082825461414f9190615b59565b909155505050565b60006141638284615b9a565b9392505050565b600083815260176020526040812060018101546001600160a01b0387811691161461419457600080fd5b82600114806141a35750826002145b6141e05760405162461bcd60e51b815260206004820152600e60248201526d696e76616c69642073746174757360901b60448201526064016109a9565b82156141ee57600581018390555b83511561420c57835161420a9060028301906020870190614ae4565b505b4260098201556040517f184981d19cd827a29527d9fef87fd7973eb4f43f9833af36578f456bed5fa19a90614248908890889088908890615be6565b60405180910390a150600195945050505050565b60006141638284615b59565b601454604051639bd7417f60e01b81526001600160a01b0384811660048301526000921690639bd7417f90602401600060405180830381865afa1580156142b3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526142db9190810190615a53565b61010081015183815260145460408051630ee685c760e41b81526001600160a01b038881166004830152845160248301526020850151604483015291840151606482015260608401516084820152608084015160a482015260a084015160c482015260c084015160e4820152939450919291169063ee685c7090610104016140ab565b6001600160a01b0381166000908152601a6020908152604080832081518083018352600581526477524f534560d81b93810193909352905190916143a191615619565b90815260405190819003602001812054601454639bd7417f60e01b83526001600160a01b038581166004850152919350600092911690639bd7417f90602401600060405180830381865afa1580156143fd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526144259190810190615a53565b90506144318383614268565b80608001516002148015614446575060055482105b801561445457506003548210155b156144bf5760145460405163d691fba560e01b81526001600160a01b039091169063d691fba59061448c908690600390600401615635565b600060405180830381600087803b1580156144a657600080fd5b505af11580156144ba573d6000803e3d6000fd5b505050505b806080015160011480156144d4575060045482105b80156144e257506003548210155b1561454d5760145460405163d691fba560e01b81526001600160a01b039091169063d691fba59061451a908690600390600401615635565b600060405180830381600087803b15801561453457600080fd5b505af1158015614548573d6000803e3d6000fd5b505050505b608081015115801561456157506003548210155b156145cc5760145460405163d691fba560e01b81526001600160a01b039091169063d691fba590614599908690600390600401615635565b600060405180830381600087803b1580156145b357600080fd5b505af11580156145c7573d6000803e3d6000fd5b505050505b6003548210156146095760145460405163d691fba560e01b81526001600160a01b039091169063d691fba590610aa1908690600090600401615635565b505050565b6000600260015414156146635760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109a9565b60026001556001600160a01b0388166146ad5760405162461bcd60e51b815260206004820152600c60248201526b1859191c995cdcc81b9d5b1b60a21b60448201526064016109a9565b85516146eb5760405162461bcd60e51b815260206004820152600d60248201526c18dbda5b951e5c19481b9d5b1b609a1b60448201526064016109a9565b846147295760405162461bcd60e51b815260206004820152600e60248201526d1a1bdcdd10dbdd5b9d081b9d5b1b60921b60448201526064016109a9565b826147665760405162461bcd60e51b815260206004820152600d60248201526c1a1bdcdd151e5c19481b9d5b1b609a1b60448201526064016109a9565b816147a85760405162461bcd60e51b81526020600482015260126024820152711a1bdcdd111a5c9958dd1a5bdb881b9d5b1b60721b60448201526064016109a9565b60006147b360165490565b600081815260176020526040902054909150156148005760405162461bcd60e51b815260206004820152600b60248201526a1bdc99195c88195e1a5cdd60aa1b60448201526064016109a9565b60408051610140810182528281526001600160a01b038b811660208084019182528385018d8152606085018d9052608085018c905260a085018b905260c085018a905260e08501899052426101008601526000610120860181905287815260178352959095208451815591516001830180546001600160a01b03191691909416179092559251805192938493909261489f926002850192910190614ae4565b50606082015180516148bb916003840191602090910190614ae4565b506080820151600482015560a0820151600582015560c0820151600682015560e082015160078201556101008201516008820155610120909101516009909101556019805460018101825560009190915281517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9695600a9092029182019081556020808401517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9696840180546001600160a01b0319166001600160a01b039092169190911790556040840151805185946149b9937f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9697909101920190614ae4565b50606082015180516149d5916003840191602090910190614ae4565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820155610100820151600882015561012090910151600990910155601954614a2590600190615b9a565b600083815260186020526040902055614a3e601661412e565b7f400817122268a69f3472a92a1ec2769f27f068026b377eaeb64f6cbe0bca7a51828b8b8b8b8b8b8b604051614a7b989796959493929190615c1e565b60405180910390a1506001805598975050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054614af09061564e565b90600052602060002090601f016020900481019282614b125760008555614b58565b82601f10614b2b57805160ff1916838001178555614b58565b82800160010185558215614b58579182015b82811115614b58578251825591602001919060010190614b3d565b50614b64929150614b68565b5090565b5b80821115614b645760008155600101614b69565b6001600160a01b03811681146135f557600080fd5b8035614b9d81614b7d565b919050565b60008060408385031215614bb557600080fd5b8235614bc081614b7d565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405161020081016001600160401b0381118282101715614c0757614c07614bce565b60405290565b60405161018081016001600160401b0381118282101715614c0757614c07614bce565b60405161010081016001600160401b0381118282101715614c0757614c07614bce565b60405161014081016001600160401b0381118282101715614c0757614c07614bce565b60405161012081016001600160401b0381118282101715614c0757614c07614bce565b604051601f8201601f191681016001600160401b0381118282101715614cc157614cc1614bce565b604052919050565b60006001600160401b03821115614ce257614ce2614bce565b50601f01601f191660200190565b600082601f830112614d0157600080fd5b8135614d14614d0f82614cc9565b614c99565b818152846020838601011115614d2957600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215614d5957600080fd5b8235614d6481614b7d565b915060208301356001600160401b03811115614d7f57600080fd5b614d8b85828601614cf0565b9150509250929050565b600060208284031215614da757600080fd5b81356001600160401b03811115614dbd57600080fd5b6120db84828501614cf0565b600060208284031215614ddb57600080fd5b5035919050565b60005b83811015614dfd578181015183820152602001614de5565b83811115614e0c576000848401525b50505050565b60008151808452614e2a816020860160208601614de2565b601f01601f19169290920160200192915050565b8a81526001600160a01b038a16602082015261014060408201819052600090614e698382018c614e12565b90508281036060840152614e7d818b614e12565b6080840199909952505060a081019590955260c085019390935260e084019190915261010083015261012090910152949350505050565b60008060408385031215614ec757600080fd5b823591506020830135614ed981614b7d565b809150509250929050565b60008060008060808587031215614efa57600080fd5b8435614f0581614b7d565b93506020850135925060408501356001600160401b03811115614f2757600080fd5b614f3387828801614cf0565b949793965093946060013593505050565b60006102008284031215614f5757600080fd5b614f5f614be4565b9050614f6a82614b92565b81526020820135602082015260408201356001600160401b0380821115614f9057600080fd5b614f9c85838601614cf0565b6040840152606084013560608401526080840135915080821115614fbf57600080fd5b50614fcc84828501614cf0565b60808301525060a082013560a082015260c082013560c0820152614ff260e08301614b92565b60e0820152610100828101359082015261012080830135908201526101408083013590820152610160808301359082015261018080830135908201526101a080830135908201526101c080830135908201526101e09182013591810191909152919050565b60008060008060008060c0878903121561507057600080fd5b863561507b81614b7d565b9550602087013561508b81614b7d565b945060408701356001600160401b03808211156150a757600080fd5b90880190610180828b0312156150bc57600080fd5b6150c4614c0d565b6150cd83614b92565b815260208301356020820152604083013560408201526150ef60608401614b92565b606082015261510060808401614b92565b608082015261511160a08401614b92565b60a082015260c0838101359082015260e08084013590820152610100808401359082015261012080840135908201526101408084013590820152610160808401358381111561515f57600080fd5b61516b8d828701614f44565b828401525050809650505050606087013592506080870135915060a087013590509295509295509295565b6000602082840312156151a857600080fd5b8135801515811461416357600080fd5b6000806000606084860312156151cd57600080fd5b83356151d881614b7d565b925060208401356001600160401b038111156151f357600080fd5b6151ff86828701614cf0565b925050604084013590509250925092565b60008060006060848603121561522557600080fd5b833561523081614b7d565b9250602084013561524081614b7d565b929592945050506040919091013590565b6000806040838503121561526457600080fd5b82356001600160401b0381111561527a57600080fd5b61528685828601614cf0565b9250506020830135614ed981614b7d565b600080600080600080600060e0888a0312156152b257600080fd5b87356152bd81614b7d565b965060208801356001600160401b03808211156152d957600080fd5b6152e58b838c01614cf0565b975060408a01359150808211156152fb57600080fd5b506153088a828b01614cf0565b979a96995096976060810135975060808101359660a0820135965060c090910135945092505050565b600061014082518452602083015161535460208601826001600160a01b03169052565b50604083015181604086015261536c82860182614e12565b915050606083015184820360608601526153868282614e12565b9150506080830151608085015260a083015160a085015260c083015160c085015260e083015160e08501526101008084015181860152506101208084015181860152508091505092915050565b6020815260006141636020830184615331565b600080600080608085870312156153fc57600080fd5b843561540781614b7d565b9350602085013561541781614b7d565b9250604085013561542781614b7d565b9150606085013561543781614b7d565b939692955090935050565b60008083601f84011261545457600080fd5b5081356001600160401b0381111561546b57600080fd5b60208301915083602082850101111561548357600080fd5b9250929050565b60008060006040848603121561549f57600080fd5b83356001600160401b038111156154b557600080fd5b6154c186828701615442565b90945092505060208401356154d581614b7d565b809150509250925092565b6000602082840312156154f257600080fd5b813561416381614b7d565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561555257603f19888603018452615540858351615331565b94509285019290850190600101615524565b5092979650505050505050565b6000806020838503121561557257600080fd5b82356001600160401b0381111561558857600080fd5b61559485828601615442565b90969095509350505050565b600080604083850312156155b357600080fd5b82356001600160401b038111156155c957600080fd5b6155d585828601614cf0565b95602094909401359450505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000825161562b818460208701614de2565b9190910192915050565b6001600160a01b03929092168252602082015260400190565b600181811c9082168061566257607f821691505b6020821081141561568357634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526019908201527f496e76616c696420616464726573732063616c6c207573657200000000000000604082015260600190565b60208082526019908201527f496e76616c696420616464726573732063616c6c207265737400000000000000604082015260600190565b6020808252601a908201527f496e76616c696420616464726573732063616c6c206f72646572000000000000604082015260600190565b6020808252601b908201527f496e76616c696420616464726573732063616c6c2061707065616c0000000000604082015260600190565b6020808252600c908201526b125b9d985b1a590818d85b1b60a21b604082015260600190565b8051614b9d81614b7d565b600082601f8301126157a757600080fd5b81516157b5614d0f82614cc9565b8181528460208386010111156157ca57600080fd5b6120db826020830160208701614de2565b600061010082840312156157ee57600080fd5b6157f6614c30565b90506158018261578b565b815261580f6020830161578b565b602082015260408201516001600160401b038082111561582e57600080fd5b61583a85838601615796565b6040840152606084015160608401526080840151608084015260a084015160a084015260c084015191508082111561587157600080fd5b5061587e84828501615796565b60c08301525060e082015160e082015292915050565b6000602082840312156158a657600080fd5b81516001600160401b03808211156158bd57600080fd5b9083019061014082860312156158d257600080fd5b6158da614c53565b6158e38361578b565b81526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c08301518281111561592957600080fd5b61593587828601615796565b60c08301525060e083015160e0820152610100808401518183015250610120808401518381111561596557600080fd5b615971888287016157db565b918301919091525095945050505050565b60006040828403121561599457600080fd5b604051604081018181106001600160401b03821117156159b6576159b6614bce565b604052825181526020928301519281019290925250919050565b600060e082840312156159e257600080fd5b60405160e081018181106001600160401b0382111715615a0457615a04614bce565b8060405250809150825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c08201525092915050565b600060208284031215615a6557600080fd5b81516001600160401b0380821115615a7c57600080fd5b908301906102008286031215615a9157600080fd5b615a99614c76565b615aa28361578b565b8152602083015182811115615ab657600080fd5b615ac287828601615796565b602083015250604083015182811115615ada57600080fd5b615ae687828601615796565b604083015250606083015160608201526080830151608082015260a083015160a082015260c083015160c0820152615b218660e08501615982565b60e0820152615b348661012085016159d0565b61010082015295945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115615b6c57615b6c615b43565b500190565b600060208284031215615b8357600080fd5b5051919050565b8183823760009101908152919050565b600082821015615bac57615bac615b43565b500390565b6000816000190483118215151615615bcb57615bcb615b43565b500290565b634e487b7160e01b600052603260045260246000fd5b60018060a01b0385168152836020820152608060408201526000615c0d6080830185614e12565b905082606083015295945050505050565b8881526001600160a01b038816602082015261010060408201819052600090615c498382018a614e12565b90508281036060840152615c5d8189614e12565b9150508560808301528460a08301528360c08301528260e0830152999850505050505050505056fea2646970667358221220d16f33be3834630651df2c66199acf3a26d3caa09f9ccade9807f350262951ae64736f6c634300080b0033