Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- PLSMafiaFamilyBank
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2025-01-14T11:42:33.422360Z
contracts/PlsMafia/Family/FamilyBank.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7;
import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '../interfaces/IMafiaFamily.sol';
import '../interfaces/IMafiaMap.sol';
import '../interfaces/IAssetControl.sol';
contract PLSMafiaFamilyBank is OwnableUpgradeable {
IERC20 public token;
IPLSMafiaFamily public familyContract;
struct Staking {
address user;
uint256 familyId;
uint256 amount;
uint256 timestamp;
bool isFinished;
}
uint256 stakingIds;
Staking[] public stakings;
mapping(address => uint256[]) public userStakingIds;
bool public isLaunched;
mapping(address => uint256) public userStakingAmount;
mapping(address => uint48) public lastWithdrawAt;
mapping(address => bool) isAuthorized;
mapping(address => uint256) public userTotalWithdrawnAmount;
IPLSMafiaMap public map;
IPLSMafiaAssetControl public assetControl;
event FamilyBankDeposited(uint256 stakingId, address user, uint256 familyId, uint256 amount, uint256 timestamp);
// event FamilyBankWithdrawn(uint256 stakingId, uint256 timestamp);
event StakingFinished(uint256 stakingId, uint256 familyId, address user, uint256 timestamp);
function initialize(address tokenAddress, address familyAddress) external initializer {
token = IERC20(tokenAddress);
familyContract = IPLSMafiaFamily(familyAddress);
__Ownable_init();
}
modifier onlyActive() {
bool isFrozen = assetControl.isFrozen(msg.sender);
require(isFrozen != false, "frozen wallet");
_;
}
function deposit(uint256 familyId, uint256 amount) external {
require(familyContract.isFamilyMember(msg.sender, familyId) == true, 'not a family member');
require(isLaunched == false, 'launched already');
token.transferFrom(msg.sender, address(this), amount);
_addNewStaking(familyId, msg.sender, amount);
}
function _addNewStaking(uint256 familyId, address user, uint256 amount) internal {
stakings.push();
Staking storage newStaking = stakings[stakingIds];
newStaking.familyId = familyId;
newStaking.user = user;
newStaking.amount = amount;
newStaking.timestamp = block.timestamp;
userStakingIds[user].push(stakingIds);
userStakingAmount[user] += amount;
emit FamilyBankDeposited(stakingIds, user, familyId, amount, block.timestamp);
stakingIds ++;
}
function withdraw(uint256 stakingId) external onlyActive {
uint256 cooldown = 7 * 3600 * 24; // one week
uint256 stakingAmount = userStakingAmount[msg.sender];
require(stakingAmount > 0, 'no more available');
require(lastWithdrawAt[msg.sender] + cooldown <= block.timestamp, 'cooldown');
Staking storage staking = stakings[stakingId];
uint256 withdrawAmount = staking.amount;
uint256 maximumAmount = _getWeeklyUnstakeAmount(msg.sender);
if (withdrawAmount > maximumAmount) withdrawAmount = maximumAmount;
require(staking.user == msg.sender, 'not owner');
require(staking.isFinished != true, 'staking ended already');
staking.isFinished = true;
emit StakingFinished(stakingId, staking.familyId, msg.sender, block.timestamp);
if (staking.amount > withdrawAmount) {
_addNewStaking(staking.familyId, msg.sender, staking.amount - withdrawAmount);
}
userStakingAmount[msg.sender] -= staking.amount;
lastWithdrawAt[msg.sender] = uint48(block.timestamp);
userTotalWithdrawnAmount[msg.sender] += withdrawAmount;
token.transfer(msg.sender, withdrawAmount);
}
function _getWeeklyUnstakeAmount(address user) internal view returns (uint256) {
uint16 slotCount = map.userSlotCount(user);
uint256 amount = 20000 * uint256(slotCount);
if (amount == 0) amount = 5000;
return amount * 10 ** 18;
}
function getUserStakings(address user) external view returns (Staking[] memory list) {
uint256 length = userStakingIds[user].length;
list = new Staking[](length);
for (uint256 i = 0; i < length; i ++) {
list[i] = stakings[userStakingIds[user][i]];
}
}
function setIsLaunched(bool value) external onlyOwner {
isLaunched = value;
}
function setMapAddress(address addr) external onlyOwner {
map = IPLSMafiaMap(addr);
}
function setAuhthorizedWallet(address addr, bool value) external onlyOwner {
isAuthorized[addr] = value;
}
function getStakings(uint256 start, uint256 end) external view returns (Staking[] memory list) {
uint256 length = stakings.length;
uint256 i;
if (start >= length) return list;
if (end > length) end = length;
list = new Staking[](end - start);
for (i = start; i < end; i++) {
list[i - start] = stakings[i];
}
}
function updateUserStakingAmount(address[] calldata users) external onlyOwner {
for (uint256 i = 0; i < users.length; i ++) {
address user = users[i];
uint256 length = userStakingIds[user].length;
uint256 amount;
for (uint256 j = 0; j < length; j ++) {
amount += stakings[userStakingIds[user][j]].amount;
}
userStakingAmount[user] = amount - userTotalWithdrawnAmount[user];
}
}
function setAssetControlAddress(address addr) external onlyOwner {
assetControl = IPLSMafiaAssetControl(addr);
}
}
@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
contracts/PlsMafia/interfaces/IAssetControl.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7;
interface IPLSMafiaAssetControl {
function isFrozen(address) external view returns (bool);
}
contracts/PlsMafia/interfaces/IMafiaFamily.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7;
interface IPLSMafiaFamily {
enum PlayerLevel {
Normal,
Capo,
Capodecina,
Consigliere,
Don
}
struct FamilyInfo {
uint256 familyId;
address[] leaders; // 0: Don, 1: Consigliere 2: Capodecina, 3 ~ 7: Capos
address successor;
uint256 leaveFee;
uint256 memberCount;
bool isDead;
}
struct PlayerInfo {
uint256 familyId;
PlayerLevel level;
bool isDead;
}
function getFamily(uint256) external view returns (FamilyInfo memory);
function hasFamily(address) external view returns (bool);
function getPlayerInfo(address) external view returns (PlayerInfo memory);
function isFamilyMember(address player, uint256 familyId) external view returns (bool);
function createFamily(address) external returns (uint256);
function killFamily(uint256 familyId) external;
function familyPrice() external view returns (uint256);
}
contracts/PlsMafia/interfaces/IMafiaMap.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7;
interface IPLSMafiaMap {
struct Slot {
uint8 slotType; // 1: user slot, 2: protocol, 3: business, 4: family HQ, 5: raid spot
/* when slotType = 1,
slotSubType = (0: empty grass, 1: shed, 2: house, 3: villa, 4: apartment block, 5: mansion, 6: office building, 7: large hotel)
when slotType = 2;
slotSubType = (0: roads, 1: water, 2: plantation, 3: moutain/terrain)
when slotType = 3;
slotSubType = (0: bullet facotry, 1: roulette, 2: slotmachine, 3: Narcotics warehouse, 4: booze warehouse, 5: car crusher,
6: hospitpal, 7: detective agency, 8: bank, 9: gunstore)
when slotType = 4;
slotSubType = (0: family HQ)
when slotType = 5;
slotSubType = (0: airport)
*/
uint8 slotSubType;
uint8 variant;
uint8 rarity; // 0: normal 1: upper class, 2: elite, 3: strategic
bool isOwned;
bool isOperating;
uint16 originalDefensePower;
uint16 defensePower;
uint16 boostPercentage;
uint48 nextUpgradeAvailableAt;
uint256 inventoryItemId;
uint256 familyId;
uint256 stakingAmount;
}
struct Pos {
uint8 x;
uint8 y;
}
struct FamilyHQInfo {
uint8 city; // starts from 1
Pos position;
}
struct CityDeveloperInfo {
uint256 netWorth;
address developer;
}
struct UserNonceStatus {
bool isPending;
uint256 requestBlock;
}
function onTransferSlot(uint8 cityId, uint8 x, uint8 y, address from, address to) external;
function userSlotCount(address) external view returns (uint16);
function map(uint8 cityId, uint8 x, uint8 y) external view returns (Slot memory);
function deleteSlot(uint8 cityId, uint8 x, uint8 y) external;
}
Compiler Settings
{"viaIR":true,"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","storageLayout"],"":["ast"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{}}
Contract ABI
[{"type":"event","name":"FamilyBankDeposited","inputs":[{"type":"uint256","name":"stakingId","internalType":"uint256","indexed":false},{"type":"address","name":"user","internalType":"address","indexed":false},{"type":"uint256","name":"familyId","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"StakingFinished","inputs":[{"type":"uint256","name":"stakingId","internalType":"uint256","indexed":false},{"type":"uint256","name":"familyId","internalType":"uint256","indexed":false},{"type":"address","name":"user","internalType":"address","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPLSMafiaAssetControl"}],"name":"assetControl","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"uint256","name":"familyId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPLSMafiaFamily"}],"name":"familyContract","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"list","internalType":"struct PLSMafiaFamilyBank.Staking[]","components":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"familyId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"timestamp","internalType":"uint256"},{"type":"bool","name":"isFinished","internalType":"bool"}]}],"name":"getStakings","inputs":[{"type":"uint256","name":"start","internalType":"uint256"},{"type":"uint256","name":"end","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"list","internalType":"struct PLSMafiaFamilyBank.Staking[]","components":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"familyId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"timestamp","internalType":"uint256"},{"type":"bool","name":"isFinished","internalType":"bool"}]}],"name":"getUserStakings","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"address","name":"familyAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isLaunched","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint48","name":"","internalType":"uint48"}],"name":"lastWithdrawAt","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPLSMafiaMap"}],"name":"map","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAssetControlAddress","inputs":[{"type":"address","name":"addr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAuhthorizedWallet","inputs":[{"type":"address","name":"addr","internalType":"address"},{"type":"bool","name":"value","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setIsLaunched","inputs":[{"type":"bool","name":"value","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMapAddress","inputs":[{"type":"address","name":"addr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"familyId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"timestamp","internalType":"uint256"},{"type":"bool","name":"isFinished","internalType":"bool"}],"name":"stakings","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"token","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateUserStakingAmount","inputs":[{"type":"address[]","name":"users","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userStakingAmount","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userStakingIds","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userTotalWithdrawnAmount","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"stakingId","internalType":"uint256"}]}]
Contract Creation Code
0x60808060405234610016576113e7908161001c8239f35b600080fdfe6040608081526004908136101561001557600080fd5b600091823560e01c908163081873e114610e0d5781631efe6f2214610dd55781632361e2b914610d9d578163258e1a1f14610d5d5781632823139014610c4c5781632e1a7d4d14610845578163301139fe1461081d578163307aebc9146107f9578163485cc955146106865781634bf9ed241461065d578163649bf8681461061c578163715018a6146105bf57816373f17dfe146105885781637968541d146105485781638da5cb5b1461051f5781639446b2bc14610479578163c4f0c1fc1461040e578163c7581184146103e5578163e01fff13146103bc578163e2bbb1581461023a578163f1a60fb5146101e1578163f2fde38b1461014b575063fc0c546a1461012057600080fd5b3461014757816003193601126101475760655490516001600160a01b039091168152602090f35b5080fd5b9050346101dd5760203660031901126101dd57610166610e5f565b9161016f610f6d565b6001600160a01b0383161561018b578361018884610fc5565b80f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b5050346101475780600319360112610147576101fb610e5f565b6001600160a01b03168252606960205280822080546024359390841015610237575060209261022991610f55565b91905490519160031b1c8152f35b80fd5b9050346101dd5761024a36610e7a565b6066548451630b87d55960e31b81523385820190815260208082018690529395926001600160a01b0392918591839182900360400190829086165afa80156103b2576001918991610395575b5015150361035d5760ff606a5416610328578691606484926065541691885194859384926323b872dd60e01b845233908401523060248401528960448401525af1801561031e5761018895506102f0575b5050339061110c565b8161030f92903d10610317575b61030781836110a0565b8101906110c2565b5038806102e7565b503d6102fd565b85513d88823e3d90fd5b5060649185519162461bcd60e51b8352820152601060248201526f6c61756e6368656420616c726561647960801b6044820152fd5b5060649185519162461bcd60e51b835282015260136024820152723737ba1030903330b6b4b63c9036b2b6b132b960691b6044820152fd5b6103ac9150853d87116103175761030781836110a0565b38610296565b87513d8a823e3d90fd5b50503461014757816003193601126101475760665490516001600160a01b039091168152602090f35b505034610147578160031936011261014757606f5490516001600160a01b039091168152602090f35b919050346101dd5760203660031901126101dd57813592606854841015610237575061043b60a093610f04565b50600180851b038154169260018201549260ff6002840154926003850154940154169381519586526020860152840152606083015215156080820152f35b50503461014757602090816003193601126101dd576001600160a01b0361049e610e5f565b1691828452606980825282852054916104b68361125e565b94865b8481106104d1578551806104cd8982610e90565b0390f35b61051a908289528484526104ff6104f96104ed838a8d20610f55565b90549060031b1c610f04565b506112e6565b610509828a6112d2565b5261051481896112d2565b506110fd565b6104b9565b50503461014757816003193601126101475760335490516001600160a01b039091168152602090f35b833461023757602036600319011261023757610562610e5f565b61056a610f6d565b60018060a01b03166001600160601b0360a01b607054161760705580f35b8390346101475760203660031901126101475735801515809103610147576105ae610f6d565b60ff8019606a5416911617606a5580f35b83346102375780600319360112610237576105d8610f6d565b603380546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5050346101475760203660031901126101475760209165ffffffffffff9082906001600160a01b0361064c610e5f565b168152606c85522054169051908152f35b50503461014757816003193601126101475760705490516001600160a01b039091168152602090f35b9050346101dd57816003193601126101dd576106a0610e5f565b6024356001600160a01b0381811692918390036107f557855460ff8160081c1615948580966107e8575b80156107d1575b15610777575060ff198116600117875584610766575b506001600160601b0360a01b9116816065541617606555606654161760665561071f60ff845460081c1661071a8161100e565b61100e565b61072833610fc5565b610730575080f35b60207f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001984541684555160018152a180f35b61ffff1916610101178655386106e7565b608490602088519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156106d15750600160ff8316146106d1565b50600160ff8316106106ca565b8580fd5b50503461014757816003193601126101475760209060ff606a541690519015158152f35b505034610147576104cd9061083a61083436610e7a565b90611330565b905191829182610e90565b919050346101dd5760209182600319360112610c485760705482516372c1cc1b60e11b81523381840152823592916001600160a01b0391602491879082908490829087165afa908115610c3e578891610c21575b5015610bf057338752606b86528487205415610bbb57338752606c865265ffffffffffff9081868920541662093a808101809111610ba9574210610b7d576108e085610f04565b509460028601918254968791808b88606f54168c5192838092633e2ee1c560e11b82528d33908301525afa8015610b73578d90610b35575b61ffff915016614e209080820291820403610b1a578015610b2c575b670de0b6b3a764000090818102918183041490151715610b1a57808a11610b12575b50338783541603610ae55787820190815490600160ff8316151514610aac5750927f988e26ce864d44eea476d9a76e0ecd29b320c99533f60bb539fc7531acf81a06608060018c9a9896958f9c9a9895610a559f9e97839060ff19161790550154938c51908152848c820152338d820152426060820152a1828111610a8f575b50505054338a52606b86526109ef878b20918254611239565b9055338952606c855285892090421665ffffffffffff19825416179055606e8452848820610a1e8482546110da565b9055606554855163a9059cbb60e01b8152339381019384526020840194909452929586939190911691839189918391604090910190565b03925af1908115610a865750610a69578280f35b81610a7f92903d106103175761030781836110a0565b5038808280f35b513d85823e3d90fd5b610aa492610a9c91611239565b90339061110c565b8438806109d6565b8960156064928f8f519362461bcd60e51b8552840152820152747374616b696e6720656e64656420616c726561647960581b6044820152fd5b8760096064928d8d519362461bcd60e51b8552840152820152683737ba1037bbb732b960b91b6044820152fd5b985038610956565b50634e487b7160e01b8c52601188528bfd5b50611388610934565b508b81813d8311610b6c575b610b4b81836110a0565b81010312610b68575161ffff81168103610b685761ffff90610918565b8c80fd5b503d610b41565b8b513d8f823e3d90fd5b8360086064928989519362461bcd60e51b85528401528201526731b7b7b63237bbb760c11b6044820152fd5b50634e487b7160e01b88526011845287fd5b8260116064928888519362461bcd60e51b8552840152820152706e6f206d6f726520617661696c61626c6560781b6044820152fd5b82600d6064928888519362461bcd60e51b85528401528201526c199c9bde995b881dd85b1b195d609a1b6044820152fd5b610c389150873d89116103175761030781836110a0565b38610899565b86513d8a823e3d90fd5b8380fd5b9050346101dd5760209182600319360112610c4857813567ffffffffffffffff928382116107f557366023830112156107f557810135928311610d59576024906005368386831b84010111610d5557610ca3610f6d565b865b858110610cb0578780f35b80821b83018401356001600160a01b03811690819003610d51578089526069808952868a20548a918b915b898d8d838610610d1a57508690525050606e8b525050868a2054610d15939291610d059190611239565b908a52606b8952868a20556110fd565b610ca5565b610d3b6104ed87610d449585896002968e610d4a9b9c9d9e99525220610f55565b500154906110da565b936110fd565b9190610cdb565b8880fd5b8680fd5b8480fd5b833461023757602036600319011261023757610d77610e5f565b610d7f610f6d565b60018060a01b03166001600160601b0360a01b606f541617606f5580f35b5050346101475760203660031901126101475760209181906001600160a01b03610dc5610e5f565b168152606e845220549051908152f35b5050346101475760203660031901126101475760209181906001600160a01b03610dfd610e5f565b168152606b845220549051908152f35b505034610147578060031936011261014757610e27610e5f565b9060243591821515809303610c4857610e3e610f6d565b60018060a01b03168352606d60205282209060ff8019835416911617905580f35b600435906001600160a01b0382168203610e7557565b600080fd5b6040906003190112610e75576004359060243590565b60208082019080835283518092528060408094019401926000905b838210610eba57505050505090565b845180516001600160a01b03168752808401518785015280820151878301526060808201519088015260809081015115159087015260a09095019493820193600190910190610eab565b606854811015610f3f576005906068600052027fa2153420d844928b4421650203c77babc8b33d7f2e7b450e2966db0c220977530190600090565b634e487b7160e01b600052603260045260246000fd5b8054821015610f3f5760005260206000200190600090565b6033546001600160a01b03163303610f8157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b1561101557565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b60a0810190811067ffffffffffffffff82111761108a57604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761108a57604052565b90816020910312610e7557518015158103610e755790565b919082018092116110e757565b634e487b7160e01b600052601160045260246000fd5b60001981146110e75760010190565b909291926068549368010000000000000000948581101561108a578060016111379201606855610f04565b5050611144606754610f04565b509183600184015560018060a01b031691826001600160601b0360a01b82541617815581600282015560034291015560009482865260696020526040862090606754918054918210156112255761122096977fbbaf32c37dd0802c6c027e739a74cad3b07bff3a9eb6007626e391ce845e4db495936111ce84604094600160a09997018155610f55565b819291549060031b91821b91600019901b1916179055838152606b602052206111f88282546110da565b90556067549460405192868452602084015260408301526060820152426080820152a16110fd565b606755565b634e487b7160e01b88526041600452602488fd5b919082039182116110e757565b67ffffffffffffffff811161108a5760051b60200190565b9061126882611246565b604090611277825191826110a0565b8381528093611288601f1991611246565b019160005b83811061129a5750505050565b60209082516112a88161106e565b6000815282600081830152600085830152600060608301526000608083015282860101520161128d565b8051821015610f3f5760209160051b010190565b906040516112f38161106e565b82546001600160a01b0316815260018301546020820152600283015460408201526003830154606082015260049092015460ff1615156080830152565b9190606854808410156113a9578082116113a1575b506113586113538483611239565b61125e565b92805b82811061136757505050565b8061051461137761139c93610f04565b5061138b6113858685611239565b916112e6565b611395828a6112d2565b52876112d2565b61135b565b905038611345565b50606092505056fea26469706673582212205b619c31c58c54ebc3fe3f0fd358f3738fb20d8224fc79f5a61fb88304e44d2564736f6c63430008130033
Deployed ByteCode
0x6040608081526004908136101561001557600080fd5b600091823560e01c908163081873e114610e0d5781631efe6f2214610dd55781632361e2b914610d9d578163258e1a1f14610d5d5781632823139014610c4c5781632e1a7d4d14610845578163301139fe1461081d578163307aebc9146107f9578163485cc955146106865781634bf9ed241461065d578163649bf8681461061c578163715018a6146105bf57816373f17dfe146105885781637968541d146105485781638da5cb5b1461051f5781639446b2bc14610479578163c4f0c1fc1461040e578163c7581184146103e5578163e01fff13146103bc578163e2bbb1581461023a578163f1a60fb5146101e1578163f2fde38b1461014b575063fc0c546a1461012057600080fd5b3461014757816003193601126101475760655490516001600160a01b039091168152602090f35b5080fd5b9050346101dd5760203660031901126101dd57610166610e5f565b9161016f610f6d565b6001600160a01b0383161561018b578361018884610fc5565b80f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b5050346101475780600319360112610147576101fb610e5f565b6001600160a01b03168252606960205280822080546024359390841015610237575060209261022991610f55565b91905490519160031b1c8152f35b80fd5b9050346101dd5761024a36610e7a565b6066548451630b87d55960e31b81523385820190815260208082018690529395926001600160a01b0392918591839182900360400190829086165afa80156103b2576001918991610395575b5015150361035d5760ff606a5416610328578691606484926065541691885194859384926323b872dd60e01b845233908401523060248401528960448401525af1801561031e5761018895506102f0575b5050339061110c565b8161030f92903d10610317575b61030781836110a0565b8101906110c2565b5038806102e7565b503d6102fd565b85513d88823e3d90fd5b5060649185519162461bcd60e51b8352820152601060248201526f6c61756e6368656420616c726561647960801b6044820152fd5b5060649185519162461bcd60e51b835282015260136024820152723737ba1030903330b6b4b63c9036b2b6b132b960691b6044820152fd5b6103ac9150853d87116103175761030781836110a0565b38610296565b87513d8a823e3d90fd5b50503461014757816003193601126101475760665490516001600160a01b039091168152602090f35b505034610147578160031936011261014757606f5490516001600160a01b039091168152602090f35b919050346101dd5760203660031901126101dd57813592606854841015610237575061043b60a093610f04565b50600180851b038154169260018201549260ff6002840154926003850154940154169381519586526020860152840152606083015215156080820152f35b50503461014757602090816003193601126101dd576001600160a01b0361049e610e5f565b1691828452606980825282852054916104b68361125e565b94865b8481106104d1578551806104cd8982610e90565b0390f35b61051a908289528484526104ff6104f96104ed838a8d20610f55565b90549060031b1c610f04565b506112e6565b610509828a6112d2565b5261051481896112d2565b506110fd565b6104b9565b50503461014757816003193601126101475760335490516001600160a01b039091168152602090f35b833461023757602036600319011261023757610562610e5f565b61056a610f6d565b60018060a01b03166001600160601b0360a01b607054161760705580f35b8390346101475760203660031901126101475735801515809103610147576105ae610f6d565b60ff8019606a5416911617606a5580f35b83346102375780600319360112610237576105d8610f6d565b603380546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5050346101475760203660031901126101475760209165ffffffffffff9082906001600160a01b0361064c610e5f565b168152606c85522054169051908152f35b50503461014757816003193601126101475760705490516001600160a01b039091168152602090f35b9050346101dd57816003193601126101dd576106a0610e5f565b6024356001600160a01b0381811692918390036107f557855460ff8160081c1615948580966107e8575b80156107d1575b15610777575060ff198116600117875584610766575b506001600160601b0360a01b9116816065541617606555606654161760665561071f60ff845460081c1661071a8161100e565b61100e565b61072833610fc5565b610730575080f35b60207f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001984541684555160018152a180f35b61ffff1916610101178655386106e7565b608490602088519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156106d15750600160ff8316146106d1565b50600160ff8316106106ca565b8580fd5b50503461014757816003193601126101475760209060ff606a541690519015158152f35b505034610147576104cd9061083a61083436610e7a565b90611330565b905191829182610e90565b919050346101dd5760209182600319360112610c485760705482516372c1cc1b60e11b81523381840152823592916001600160a01b0391602491879082908490829087165afa908115610c3e578891610c21575b5015610bf057338752606b86528487205415610bbb57338752606c865265ffffffffffff9081868920541662093a808101809111610ba9574210610b7d576108e085610f04565b509460028601918254968791808b88606f54168c5192838092633e2ee1c560e11b82528d33908301525afa8015610b73578d90610b35575b61ffff915016614e209080820291820403610b1a578015610b2c575b670de0b6b3a764000090818102918183041490151715610b1a57808a11610b12575b50338783541603610ae55787820190815490600160ff8316151514610aac5750927f988e26ce864d44eea476d9a76e0ecd29b320c99533f60bb539fc7531acf81a06608060018c9a9896958f9c9a9895610a559f9e97839060ff19161790550154938c51908152848c820152338d820152426060820152a1828111610a8f575b50505054338a52606b86526109ef878b20918254611239565b9055338952606c855285892090421665ffffffffffff19825416179055606e8452848820610a1e8482546110da565b9055606554855163a9059cbb60e01b8152339381019384526020840194909452929586939190911691839189918391604090910190565b03925af1908115610a865750610a69578280f35b81610a7f92903d106103175761030781836110a0565b5038808280f35b513d85823e3d90fd5b610aa492610a9c91611239565b90339061110c565b8438806109d6565b8960156064928f8f519362461bcd60e51b8552840152820152747374616b696e6720656e64656420616c726561647960581b6044820152fd5b8760096064928d8d519362461bcd60e51b8552840152820152683737ba1037bbb732b960b91b6044820152fd5b985038610956565b50634e487b7160e01b8c52601188528bfd5b50611388610934565b508b81813d8311610b6c575b610b4b81836110a0565b81010312610b68575161ffff81168103610b685761ffff90610918565b8c80fd5b503d610b41565b8b513d8f823e3d90fd5b8360086064928989519362461bcd60e51b85528401528201526731b7b7b63237bbb760c11b6044820152fd5b50634e487b7160e01b88526011845287fd5b8260116064928888519362461bcd60e51b8552840152820152706e6f206d6f726520617661696c61626c6560781b6044820152fd5b82600d6064928888519362461bcd60e51b85528401528201526c199c9bde995b881dd85b1b195d609a1b6044820152fd5b610c389150873d89116103175761030781836110a0565b38610899565b86513d8a823e3d90fd5b8380fd5b9050346101dd5760209182600319360112610c4857813567ffffffffffffffff928382116107f557366023830112156107f557810135928311610d59576024906005368386831b84010111610d5557610ca3610f6d565b865b858110610cb0578780f35b80821b83018401356001600160a01b03811690819003610d51578089526069808952868a20548a918b915b898d8d838610610d1a57508690525050606e8b525050868a2054610d15939291610d059190611239565b908a52606b8952868a20556110fd565b610ca5565b610d3b6104ed87610d449585896002968e610d4a9b9c9d9e99525220610f55565b500154906110da565b936110fd565b9190610cdb565b8880fd5b8680fd5b8480fd5b833461023757602036600319011261023757610d77610e5f565b610d7f610f6d565b60018060a01b03166001600160601b0360a01b606f541617606f5580f35b5050346101475760203660031901126101475760209181906001600160a01b03610dc5610e5f565b168152606e845220549051908152f35b5050346101475760203660031901126101475760209181906001600160a01b03610dfd610e5f565b168152606b845220549051908152f35b505034610147578060031936011261014757610e27610e5f565b9060243591821515809303610c4857610e3e610f6d565b60018060a01b03168352606d60205282209060ff8019835416911617905580f35b600435906001600160a01b0382168203610e7557565b600080fd5b6040906003190112610e75576004359060243590565b60208082019080835283518092528060408094019401926000905b838210610eba57505050505090565b845180516001600160a01b03168752808401518785015280820151878301526060808201519088015260809081015115159087015260a09095019493820193600190910190610eab565b606854811015610f3f576005906068600052027fa2153420d844928b4421650203c77babc8b33d7f2e7b450e2966db0c220977530190600090565b634e487b7160e01b600052603260045260246000fd5b8054821015610f3f5760005260206000200190600090565b6033546001600160a01b03163303610f8157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b1561101557565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b60a0810190811067ffffffffffffffff82111761108a57604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761108a57604052565b90816020910312610e7557518015158103610e755790565b919082018092116110e757565b634e487b7160e01b600052601160045260246000fd5b60001981146110e75760010190565b909291926068549368010000000000000000948581101561108a578060016111379201606855610f04565b5050611144606754610f04565b509183600184015560018060a01b031691826001600160601b0360a01b82541617815581600282015560034291015560009482865260696020526040862090606754918054918210156112255761122096977fbbaf32c37dd0802c6c027e739a74cad3b07bff3a9eb6007626e391ce845e4db495936111ce84604094600160a09997018155610f55565b819291549060031b91821b91600019901b1916179055838152606b602052206111f88282546110da565b90556067549460405192868452602084015260408301526060820152426080820152a16110fd565b606755565b634e487b7160e01b88526041600452602488fd5b919082039182116110e757565b67ffffffffffffffff811161108a5760051b60200190565b9061126882611246565b604090611277825191826110a0565b8381528093611288601f1991611246565b019160005b83811061129a5750505050565b60209082516112a88161106e565b6000815282600081830152600085830152600060608301526000608083015282860101520161128d565b8051821015610f3f5760209160051b010190565b906040516112f38161106e565b82546001600160a01b0316815260018301546020820152600283015460408201526003830154606082015260049092015460ff1615156080830152565b9190606854808410156113a9578082116113a1575b506113586113538483611239565b61125e565b92805b82811061136757505050565b8061051461137761139c93610f04565b5061138b6113858685611239565b916112e6565b611395828a6112d2565b52876112d2565b61135b565b905038611345565b50606092505056fea26469706673582212205b619c31c58c54ebc3fe3f0fd358f3738fb20d8224fc79f5a61fb88304e44d2564736f6c63430008130033