Address Details
contract
0xC49C221F763d199fA301c4EFCa4325353899c5e8
- Contract Name
- RebasedStakedCelo
- Creator
- 0x5bc1c4–68a788 at 0xe09536–ff7535
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- Fetching transactions...
- Transfers
- Fetching transfers...
- Gas Used
- Fetching gas used...
- Last Balance Update
- 15097805
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- RebasedStakedCelo
- Optimization enabled
- false
- Compiler version
- v0.8.11+commit.d7f03943
- EVM Version
- istanbul
- Verified at
- 2022-09-30T11:48:03.178435Z
contracts/RebasedStakedCelo.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "./common/UUPSOwnableUpgradeable.sol"; import "./Managed.sol"; import "./interfaces/IAccount.sol"; import "./interfaces/IStakedCelo.sol"; /** * @title An ERC-20 wrapper contract that receives stCELO * and represents the underlying voted LockedGold in the StakedCelo system. * @dev This contract depends on the Account and StakedCelo contracts * to calculate the amount of rstCELO held by depositors. */ contract RebasedStakedCelo is ERC20Upgradeable, UUPSOwnableUpgradeable { /** * @notice Total amount of stCELO deposited in this contract. */ uint256 public totalDeposit; /** * @notice Keyed by depositor address, the amount of stCELO deposited. */ mapping(address => uint256) public stakedCeloBalance; /** * @notice An instance of the StakedCelo contract. */ IStakedCelo internal stakedCelo; /** * @notice An instance of the Account contract. */ IAccount internal account; /** * @notice Used when a deposit is successfuly completed. * @param depositor The address of the depositor. * @param amount The amount of stCELO deposited. */ event StakedCeloDeposited(address depositor, uint256 amount); /** * @notice Used when a withdrawal is successfully completed. * @param withdrawer The address of the withdrawer. * @param amount The amount of stCELO withdrawn. */ event StakedCeloWithdrawn(address withdrawer, uint256 amount); /** * @notice Used when the deposit amount is zero. */ error ZeroAmount(); /** * @notice Used when a balance is too low. * @param amount The amount of stCELO that is insufficient. */ error InsufficientBalance(uint256 amount); /** * @notice Used when an null address is used. */ error NullAddress(); /** * @notice Used when deposit fails. * @param depositor The address of the depositor. * @param amount The amount of stCELO the depositor attempted to deposit. */ error FailedDeposit(address depositor, uint256 amount); /** * @notice Used when withdrawal fails. * @param withdrawer The address of the withdrawer. * @param amount The amount of stCELO the withdrawer attempted to withdraw. */ error FailedWithdrawal(address withdrawer, uint256 amount); /** * @notice Empty constructor for proxy implementation, `initializer` modifer ensures the * implementation gets initialized. */ // solhint-disable-next-line no-empty-blocks constructor() initializer {} /** * @notice Replaces the constructor for proxy implementation. * @param _stakedCelo The address of the StakedCelo contract. * @param _account The address of the Account contract. * @param _owner The address of the contract owner. */ function initialize( address _stakedCelo, address _account, address _owner ) external initializer { __ERC20_init("Rebased Staked CELO", "rstCELO"); _transferOwnership(_owner); stakedCelo = IStakedCelo(_stakedCelo); account = IAccount(_account); } /** * @notice Deposit stCELO in return for rstCELO. * @dev Although rstCELO is never minted to any account, the rstCELO balance * is calculated based on the account's deposited stCELO. See `balanceOf()` function below. * @param stCeloAmount The Amount of stCELO to be deposited. */ function deposit(uint256 stCeloAmount) external { if (stCeloAmount == 0) { revert ZeroAmount(); } totalDeposit += stCeloAmount; stakedCeloBalance[msg.sender] += stCeloAmount; emit StakedCeloDeposited(msg.sender, stCeloAmount); if (!stakedCelo.transferFrom(msg.sender, address(this), stCeloAmount)) { revert FailedDeposit(msg.sender, stCeloAmount); } } /** * @notice Withdraws stCELO. This function transfers back some or all of sender's * previously deposited stCELO amount. * @param stCeloAmount The amount of stCELO to withdraw. */ function withdraw(uint256 stCeloAmount) external { if (stCeloAmount > stakedCeloBalance[msg.sender]) { revert InsufficientBalance(stCeloAmount); } totalDeposit -= stCeloAmount; unchecked { stakedCeloBalance[msg.sender] -= stCeloAmount; } emit StakedCeloWithdrawn(msg.sender, stCeloAmount); if (!stakedCelo.transfer(msg.sender, stCeloAmount)) { revert FailedWithdrawal(msg.sender, stCeloAmount); } } /** * @notice Used to query the total supply of rstCELO. * @return The calculated total supply of rstCELO. */ function totalSupply() public view virtual override returns (uint256) { return toRebasedStakedCelo(totalDeposit); } /** * @notice Used to query the rstCELO balance of an address. * @param _account The address of interest. * @return The amount of rstCELO owned by the address. */ function balanceOf(address _account) public view override returns (uint256) { return toRebasedStakedCelo(stakedCeloBalance[_account]); } /** * @notice Computes the amount of stCELO that is represented by an amount of rstCELO. * @param rstCeloAmount The amount of rstCELO. * @return The amount of stCELO represented by rstCELO. */ function toStakedCelo(uint256 rstCeloAmount) public view returns (uint256) { uint256 stCeloSupply = stakedCelo.totalSupply(); uint256 celoBalance = account.getTotalCelo(); if (stCeloSupply == 0 || celoBalance == 0) { return rstCeloAmount; } return (rstCeloAmount * stCeloSupply) / celoBalance; } /** * @notice Computes the amount of rstCELO that is represented by an amount of stCELO. * @param stCeloAmount The amount of stCELO. * @return The amount of rstCELO represented by stCELO. */ function toRebasedStakedCelo(uint256 stCeloAmount) public view returns (uint256) { uint256 stCeloSupply = stakedCelo.totalSupply(); uint256 celoBalance = account.getTotalCelo(); if (stCeloSupply == 0 || celoBalance == 0) { return stCeloAmount; } return (stCeloAmount * celoBalance) / stCeloSupply; } /** * @notice Moves `amount` of rstCELO from `sender` to `recipient`. * @param from The address of the sender. * @param to The address of the receiver. * @param amount The amount of rstCELO to transfer. */ function _transfer( address from, address to, uint256 amount ) internal override { if (from == address(0)) { revert NullAddress(); } if (to == address(0)) { revert NullAddress(); } uint256 fromBalance = stakedCeloBalance[from]; uint256 equivalentStakedCeloAmount = toStakedCelo(amount); if (fromBalance < equivalentStakedCeloAmount) { revert InsufficientBalance(amount); } unchecked { stakedCeloBalance[from] = fromBalance - equivalentStakedCeloAmount; } stakedCeloBalance[to] += equivalentStakedCeloAmount; emit Transfer(from, to, amount); } }
/_openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeacon.sol"; import "../../utils/Address.sol"; import "../../utils/StorageSlot.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967Upgrade { // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallSecure( address newImplementation, bytes memory data, bool forceCall ) internal { address oldImplementation = _getImplementation(); // Initial upgrade and setup call _setImplementation(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } // Perform rollback test if not already in progress StorageSlot.BooleanSlot storage rollbackTesting = StorageSlot.getBooleanSlot(_ROLLBACK_SLOT); if (!rollbackTesting.value) { // Trigger rollback using upgradeTo from the new implementation rollbackTesting.value = true; Address.functionDelegateCall( newImplementation, abi.encodeWithSignature("upgradeTo(address)", oldImplementation) ); rollbackTesting.value = false; // Check rollback was effective require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades"); // Finally reset to the new implementation and log the upgrade _upgradeTo(newImplementation); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( Address.isContract(IBeacon(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } } }
/_openzeppelin/contracts/proxy/beacon/IBeacon.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
/_openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../ERC1967/ERC1967Upgrade.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is ERC1967Upgrade { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; }
/_openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(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) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
/_openzeppelin/contracts/utils/StorageSlot.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
/_openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../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 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); } /** * @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.5.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; 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. * * 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 initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
/_openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20Upgradeable.sol"; import "./extensions/IERC20MetadataUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, _allowances[owner][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = _allowances[owner][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Spend `amount` form the allowance of `owner` toward `spender`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @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[45] private __gap; }
/_openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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); /** * @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); }
/_openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20MetadataUpgradeable is IERC20Upgradeable { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
/_openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.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 * ==== * * [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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 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 v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../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; } /** * @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; }
/contracts/Managed.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @title Used via inheritance to grant special access control to the Manager * contract. */ abstract contract Managed is Initializable, OwnableUpgradeable { address public manager; /** * @notice Emitted when the manager is initially set or later modified. * @param manager The new managing account address. */ event ManagerSet(address indexed manager); /** * @notice Used when an `onlyManager` function is called by a non-manager. * @param caller `msg.sender` that called the function. */ error CallerNotManager(address caller); /** * @notice Used when a passed address is address(0). */ error NullAddress(); /** * @dev Initializes the contract in an upgradable context. * @param _manager The initial managing address. */ // solhint-disable-next-line func-name-mixedcase function __Managed_init(address _manager) internal onlyInitializing { _setManager(_manager); } /** * @dev Throws if called by any account other than the manager. */ modifier onlyManager() { if (manager != msg.sender) { revert CallerNotManager(msg.sender); } _; } /** * @notice Sets the manager address. * @param _manager The new manager address. */ function setManager(address _manager) external onlyOwner { _setManager(_manager); } /** * @notice Sets the manager address. * @param _manager The new manager address. */ function _setManager(address _manager) internal { if (_manager == address(0)) { revert NullAddress(); } manager = _manager; emit ManagerSet(_manager); } }
/contracts/common/UUPSOwnableUpgradeable.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; /** * @title A contract that links UUPSUUpgradeable with OwanbleUpgradeable to gate upgrades. */ abstract contract UUPSOwnableUpgradeable is UUPSUpgradeable, OwnableUpgradeable { /** * @notice Guard method for UUPS (Universal Upgradable Proxy Standard) * See: https://docs.openzeppelin.com/contracts/4.x/api/proxy#transparent-vs-uups * @dev This methods overrides the virtual one in UUPSUpgradeable and * adds the onlyOwner modifer. */ // solhint-disable-next-line no-empty-blocks function _authorizeUpgrade(address) internal override onlyOwner {} }
/contracts/interfaces/IAccount.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IAccount { function getTotalCelo() external view returns (uint256); function getCeloForGroup(address) external view returns (uint256); function scheduleVotes(address[] calldata group, uint256[] calldata votes) external payable; function scheduledVotesForGroup(address group) external returns (uint256); function scheduleWithdrawals( address beneficiary, address[] calldata group, uint256[] calldata withdrawals ) external; }
/contracts/interfaces/IStakedCelo.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IStakedCelo { function totalSupply() external view returns (uint256); function mint(address, uint256) external; function burn(address, uint256) external; function transfer(address, uint256) external returns (bool); function transferFrom( address, address, uint256 ) external returns (bool); }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"FailedDeposit","inputs":[{"type":"address","name":"depositor","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"error","name":"FailedWithdrawal","inputs":[{"type":"address","name":"withdrawer","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"error","name":"InsufficientBalance","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"error","name":"NullAddress","inputs":[]},{"type":"error","name":"ZeroAmount","inputs":[]},{"type":"event","name":"AdminChanged","inputs":[{"type":"address","name":"previousAdmin","internalType":"address","indexed":false},{"type":"address","name":"newAdmin","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"BeaconUpgraded","inputs":[{"type":"address","name":"beacon","internalType":"address","indexed":true}],"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":"StakedCeloDeposited","inputs":[{"type":"address","name":"depositor","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"StakedCeloWithdrawn","inputs":[{"type":"address","name":"withdrawer","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"_account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"uint256","name":"stCeloAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_stakedCelo","internalType":"address"},{"type":"address","name":"_account","internalType":"address"},{"type":"address","name":"_owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","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":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"stakedCeloBalance","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"toRebasedStakedCelo","inputs":[{"type":"uint256","name":"stCeloAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"toStakedCelo","inputs":[{"type":"uint256","name":"rstCeloAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalDeposit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeTo","inputs":[{"type":"address","name":"newImplementation","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"upgradeToAndCall","inputs":[{"type":"address","name":"newImplementation","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"stCeloAmount","internalType":"uint256"}]}]
Contract Creation Code
0x60a06040523073ffffffffffffffffffffffffffffffffffffffff1660809073ffffffffffffffffffffffffffffffffffffffff168152503480156200004457600080fd5b50600060019054906101000a900460ff166200006f5760008054906101000a900460ff161562000080565b6200007f6200013c60201b60201c565b5b620000c2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000b99062000204565b60405180910390fd5b60008060019054906101000a900460ff16159050801562000113576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b8015620001355760008060016101000a81548160ff0219169083151502179055505b5062000226565b600062000154306200015a60201b620016e51760201c565b15905090565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082825260208201905092915050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000620001ec602e836200017d565b9150620001f9826200018e565b604082019050919050565b600060208201905081810360008301526200021f81620001dd565b9050919050565b60805161333f62000257600039600081816108b30152818161094201528181610ae60152610b75015261333f6000f3fe6080604052600436106101405760003560e01c8063715018a6116100b6578063c0c53b8b1161006f578063c0c53b8b14610475578063c494ec1e1461049e578063db7168a9146104db578063dd62ed3e14610518578063f2fde38b14610555578063f6153ccd1461057e57610140565b8063715018a6146103655780638da5cb5b1461037c57806395d89b41146103a7578063a457c2d7146103d2578063a9059cbb1461040f578063b6b55f251461044c57610140565b8063313ce56711610108578063313ce5671461023e5780633659cfe61461026957806339509351146102925780634f1ef286146102cf578063653c98e7146102eb57806370a082311461032857610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d85780632e1a7d4d14610215575b600080fd5b34801561015157600080fd5b5061015a6105a9565b60405161016791906123fb565b60405180910390f35b34801561017c57600080fd5b50610197600480360381019061019291906124c5565b61063b565b6040516101a49190612520565b60405180910390f35b3480156101b957600080fd5b506101c261065e565b6040516101cf919061254a565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612565565b610670565b60405161020c9190612520565b60405180910390f35b34801561022157600080fd5b5061023c600480360381019061023791906125b8565b61069f565b005b34801561024a57600080fd5b506102536108a8565b6040516102609190612601565b60405180910390f35b34801561027557600080fd5b50610290600480360381019061028b919061261c565b6108b1565b005b34801561029e57600080fd5b506102b960048036038101906102b491906124c5565b610a3a565b6040516102c69190612520565b60405180910390f35b6102e960048036038101906102e4919061277e565b610ae4565b005b3480156102f757600080fd5b50610312600480360381019061030d919061261c565b610c21565b60405161031f919061254a565b60405180910390f35b34801561033457600080fd5b5061034f600480360381019061034a919061261c565b610c39565b60405161035c919061254a565b60405180910390f35b34801561037157600080fd5b5061037a610c8a565b005b34801561038857600080fd5b50610391610d12565b60405161039e91906127e9565b60405180910390f35b3480156103b357600080fd5b506103bc610d3c565b6040516103c991906123fb565b60405180910390f35b3480156103de57600080fd5b506103f960048036038101906103f491906124c5565b610dce565b6040516104069190612520565b60405180910390f35b34801561041b57600080fd5b50610436600480360381019061043191906124c5565b610eb8565b6040516104439190612520565b60405180910390f35b34801561045857600080fd5b50610473600480360381019061046e91906125b8565b610edb565b005b34801561048157600080fd5b5061049c60048036038101906104979190612804565b6110a6565b005b3480156104aa57600080fd5b506104c560048036038101906104c091906125b8565b61128c565b6040516104d2919061254a565b60405180910390f35b3480156104e757600080fd5b5061050260048036038101906104fd91906125b8565b6113f6565b60405161050f919061254a565b60405180910390f35b34801561052457600080fd5b5061053f600480360381019061053a9190612857565b611560565b60405161054c919061254a565b60405180910390f35b34801561056157600080fd5b5061057c6004803603810190610577919061261c565b6115e7565b005b34801561058a57600080fd5b506105936116df565b6040516105a0919061254a565b60405180910390f35b6060603680546105b8906128c6565b80601f01602080910402602001604051908101604052809291908181526020018280546105e4906128c6565b80156106315780601f1061060657610100808354040283529160200191610631565b820191906000526020600020905b81548152906001019060200180831161061457829003601f168201915b5050505050905090565b600080610646611708565b9050610653818585611710565b600191505092915050565b600061066b6097546113f6565b905090565b60008061067b611708565b90506106888582856118db565b610693858585611967565b60019150509392505050565b609860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111561072357806040517f9266535100000000000000000000000000000000000000000000000000000000815260040161071a919061254a565b60405180910390fd5b80609760008282546107359190612927565b9250508190555080609860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fbd16c4c02914d26f044cfa096a64853d87c047db6db9425cefae21488477c58f33826040516107ba92919061295b565b60405180910390a1609960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b815260040161081f92919061295b565b6020604051808303816000875af115801561083e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086291906129b0565b6108a55733816040517f55a6745800000000000000000000000000000000000000000000000000000000815260040161089c92919061295b565b60405180910390fd5b50565b60006012905090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415610940576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093790612a4f565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661097f611bd3565b73ffffffffffffffffffffffffffffffffffffffff16146109d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109cc90612ae1565b60405180910390fd5b6109de81611c2a565b610a3781600067ffffffffffffffff8111156109fd576109fc612653565b5b6040519080825280601f01601f191660200182016040528015610a2f5781602001600182028036833780820191505090505b506000611ca9565b50565b600080610a45611708565b9050610ad9818585603460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ad49190612b01565b611710565b600191505092915050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415610b73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6a90612a4f565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610bb2611bd3565b73ffffffffffffffffffffffffffffffffffffffff1614610c08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bff90612ae1565b60405180910390fd5b610c1182611c2a565b610c1d82826001611ca9565b5050565b60986020528060005260406000206000915090505481565b6000610c83609860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f6565b9050919050565b610c92611708565b73ffffffffffffffffffffffffffffffffffffffff16610cb0610d12565b73ffffffffffffffffffffffffffffffffffffffff1614610d06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cfd90612ba3565b60405180910390fd5b610d106000611e7a565b565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060378054610d4b906128c6565b80601f0160208091040260200160405190810160405280929190818152602001828054610d77906128c6565b8015610dc45780601f10610d9957610100808354040283529160200191610dc4565b820191906000526020600020905b815481529060010190602001808311610da757829003601f168201915b5050505050905090565b600080610dd9611708565b90506000603460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905083811015610e9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9690612c35565b60405180910390fd5b610eac8286868403611710565b60019250505092915050565b600080610ec3611708565b9050610ed0818585611967565b600191505092915050565b6000811415610f16576040517f1f2a200500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060976000828254610f289190612b01565b9250508190555080609860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f7e9190612b01565b925050819055507f8a7b48923ed32d7cb785f2c884f5a4c04e14793b439c0b96d3906c667cdf95ab3382604051610fb692919061295b565b60405180910390a1609960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b815260040161101d93929190612c55565b6020604051808303816000875af115801561103c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106091906129b0565b6110a35733816040517f8ab2d93d00000000000000000000000000000000000000000000000000000000815260040161109a92919061295b565b60405180910390fd5b50565b600060019054906101000a900460ff166110ce5760008054906101000a900460ff16156110d7565b6110d6611f40565b5b611116576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110d90612cfe565b60405180910390fd5b60008060019054906101000a900460ff161590508015611166576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6111da6040518060400160405280601381526020017f52656261736564205374616b65642043454c4f000000000000000000000000008152506040518060400160405280600781526020017f72737443454c4f00000000000000000000000000000000000000000000000000815250611f51565b6111e382611e7a565b83609960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082609a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080156112865760008060016101000a81548160ff0219169083151502179055505b50505050565b600080609960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113209190612d33565b90506000609a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b59190612d33565b905060008214806113c65750600081145b156113d55783925050506113f1565b8082856113e29190612d60565b6113ec9190612de9565b925050505b919050565b600080609960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611466573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148a9190612d33565b90506000609a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151f9190612d33565b905060008214806115305750600081145b1561153f57839250505061155b565b81818561154c9190612d60565b6115569190612de9565b925050505b919050565b6000603460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115ef611708565b73ffffffffffffffffffffffffffffffffffffffff1661160d610d12565b73ffffffffffffffffffffffffffffffffffffffff1614611663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165a90612ba3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ca90612e8c565b60405180910390fd5b6116dc81611e7a565b50565b60975481565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611780576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177790612f1e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e790612fb0565b60405180910390fd5b80603460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118ce919061254a565b60405180910390a3505050565b60006118e78484611560565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146119615781811015611953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194a9061301c565b60405180910390fd5b6119608484848403611710565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119ce576040517fe99d5ac500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a35576040517fe99d5ac500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000609860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611a848361128c565b905080821015611acb57826040517f92665351000000000000000000000000000000000000000000000000000000008152600401611ac2919061254a565b60405180910390fd5b808203609860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080609860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611b609190612b01565b925050819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611bc4919061254a565b60405180910390a35050505050565b6000611c017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b611fae565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611c32611708565b73ffffffffffffffffffffffffffffffffffffffff16611c50610d12565b73ffffffffffffffffffffffffffffffffffffffff1614611ca6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9d90612ba3565b60405180910390fd5b50565b6000611cb3611bd3565b9050611cbe84611fb8565b600083511180611ccb5750815b15611cdc57611cda8484612071565b505b6000611d0a7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b61209e565b90508060000160009054906101000a900460ff16611e735760018160000160006101000a81548160ff021916908315150217905550611dd68583604051602401611d5491906127e9565b6040516020818303038152906040527f3659cfe6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612071565b5060008160000160006101000a81548160ff021916908315150217905550611dfc611bd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906130ae565b60405180910390fd5b611e72856120a8565b5b5050505050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000611f4b306116e5565b15905090565b600060019054906101000a900460ff16611fa0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f9790613140565b60405180910390fd5b611faa82826120f7565b5050565b6000819050919050565b611fc181612178565b612000576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff7906131d2565b60405180910390fd5b8061202d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b611fae565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606061209683836040518060600160405280602781526020016132e36027913961218b565b905092915050565b6000819050919050565b6120b181611fb8565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b600060019054906101000a900460ff16612146576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213d90613140565b60405180910390fd5b816036908051906020019061215c9291906122bf565b5080603790805190602001906121739291906122bf565b505050565b600080823b905060008111915050919050565b606061219684612178565b6121d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cc90613264565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516121fd91906132cb565b600060405180830381855af49150503d8060008114612238576040519150601f19603f3d011682016040523d82523d6000602084013e61223d565b606091505b509150915061224d828286612258565b925050509392505050565b60608315612268578290506122b8565b60008351111561227b5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122af91906123fb565b60405180910390fd5b9392505050565b8280546122cb906128c6565b90600052602060002090601f0160209004810192826122ed5760008555612334565b82601f1061230657805160ff1916838001178555612334565b82800160010185558215612334579182015b82811115612333578251825591602001919060010190612318565b5b5090506123419190612345565b5090565b5b8082111561235e576000816000905550600101612346565b5090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561239c578082015181840152602081019050612381565b838111156123ab576000848401525b50505050565b6000601f19601f8301169050919050565b60006123cd82612362565b6123d7818561236d565b93506123e781856020860161237e565b6123f0816123b1565b840191505092915050565b6000602082019050818103600083015261241581846123c2565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061245c82612431565b9050919050565b61246c81612451565b811461247757600080fd5b50565b60008135905061248981612463565b92915050565b6000819050919050565b6124a28161248f565b81146124ad57600080fd5b50565b6000813590506124bf81612499565b92915050565b600080604083850312156124dc576124db612427565b5b60006124ea8582860161247a565b92505060206124fb858286016124b0565b9150509250929050565b60008115159050919050565b61251a81612505565b82525050565b60006020820190506125356000830184612511565b92915050565b6125448161248f565b82525050565b600060208201905061255f600083018461253b565b92915050565b60008060006060848603121561257e5761257d612427565b5b600061258c8682870161247a565b935050602061259d8682870161247a565b92505060406125ae868287016124b0565b9150509250925092565b6000602082840312156125ce576125cd612427565b5b60006125dc848285016124b0565b91505092915050565b600060ff82169050919050565b6125fb816125e5565b82525050565b600060208201905061261660008301846125f2565b92915050565b60006020828403121561263257612631612427565b5b60006126408482850161247a565b91505092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61268b826123b1565b810181811067ffffffffffffffff821117156126aa576126a9612653565b5b80604052505050565b60006126bd61241d565b90506126c98282612682565b919050565b600067ffffffffffffffff8211156126e9576126e8612653565b5b6126f2826123b1565b9050602081019050919050565b82818337600083830152505050565b600061272161271c846126ce565b6126b3565b90508281526020810184848401111561273d5761273c61264e565b5b6127488482856126ff565b509392505050565b600082601f83011261276557612764612649565b5b813561277584826020860161270e565b91505092915050565b6000806040838503121561279557612794612427565b5b60006127a38582860161247a565b925050602083013567ffffffffffffffff8111156127c4576127c361242c565b5b6127d085828601612750565b9150509250929050565b6127e381612451565b82525050565b60006020820190506127fe60008301846127da565b92915050565b60008060006060848603121561281d5761281c612427565b5b600061282b8682870161247a565b935050602061283c8682870161247a565b925050604061284d8682870161247a565b9150509250925092565b6000806040838503121561286e5761286d612427565b5b600061287c8582860161247a565b925050602061288d8582860161247a565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806128de57607f821691505b602082108114156128f2576128f1612897565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006129328261248f565b915061293d8361248f565b9250828210156129505761294f6128f8565b5b828203905092915050565b600060408201905061297060008301856127da565b61297d602083018461253b565b9392505050565b61298d81612505565b811461299857600080fd5b50565b6000815190506129aa81612984565b92915050565b6000602082840312156129c6576129c5612427565b5b60006129d48482850161299b565b91505092915050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b6000612a39602c8361236d565b9150612a44826129dd565b604082019050919050565b60006020820190508181036000830152612a6881612a2c565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b6000612acb602c8361236d565b9150612ad682612a6f565b604082019050919050565b60006020820190508181036000830152612afa81612abe565b9050919050565b6000612b0c8261248f565b9150612b178361248f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612b4c57612b4b6128f8565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612b8d60208361236d565b9150612b9882612b57565b602082019050919050565b60006020820190508181036000830152612bbc81612b80565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000612c1f60258361236d565b9150612c2a82612bc3565b604082019050919050565b60006020820190508181036000830152612c4e81612c12565b9050919050565b6000606082019050612c6a60008301866127da565b612c7760208301856127da565b612c84604083018461253b565b949350505050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000612ce8602e8361236d565b9150612cf382612c8c565b604082019050919050565b60006020820190508181036000830152612d1781612cdb565b9050919050565b600081519050612d2d81612499565b92915050565b600060208284031215612d4957612d48612427565b5b6000612d5784828501612d1e565b91505092915050565b6000612d6b8261248f565b9150612d768361248f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612daf57612dae6128f8565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612df48261248f565b9150612dff8361248f565b925082612e0f57612e0e612dba565b5b828204905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612e7660268361236d565b9150612e8182612e1a565b604082019050919050565b60006020820190508181036000830152612ea581612e69565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f0860248361236d565b9150612f1382612eac565b604082019050919050565b60006020820190508181036000830152612f3781612efb565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612f9a60228361236d565b9150612fa582612f3e565b604082019050919050565b60006020820190508181036000830152612fc981612f8d565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000613006601d8361236d565b915061301182612fd0565b602082019050919050565b6000602082019050818103600083015261303581612ff9565b9050919050565b7f45524331393637557067726164653a207570677261646520627265616b73206660008201527f7572746865722075706772616465730000000000000000000000000000000000602082015250565b6000613098602f8361236d565b91506130a38261303c565b604082019050919050565b600060208201905081810360008301526130c78161308b565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b600061312a602b8361236d565b9150613135826130ce565b604082019050919050565b600060208201905081810360008301526131598161311d565b9050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b60006131bc602d8361236d565b91506131c782613160565b604082019050919050565b600060208201905081810360008301526131eb816131af565b9050919050565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b600061324e60268361236d565b9150613259826131f2565b604082019050919050565b6000602082019050818103600083015261327d81613241565b9050919050565b600081519050919050565b600081905092915050565b60006132a582613284565b6132af818561328f565b93506132bf81856020860161237e565b80840191505092915050565b60006132d7828461329a565b91508190509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220f791af287ba1615ea9d6e363c87fed17adb9e6599cf0d5755e273ed7a09c0cdf64736f6c634300080b0033
Deployed ByteCode
0x6080604052600436106101405760003560e01c8063715018a6116100b6578063c0c53b8b1161006f578063c0c53b8b14610475578063c494ec1e1461049e578063db7168a9146104db578063dd62ed3e14610518578063f2fde38b14610555578063f6153ccd1461057e57610140565b8063715018a6146103655780638da5cb5b1461037c57806395d89b41146103a7578063a457c2d7146103d2578063a9059cbb1461040f578063b6b55f251461044c57610140565b8063313ce56711610108578063313ce5671461023e5780633659cfe61461026957806339509351146102925780634f1ef286146102cf578063653c98e7146102eb57806370a082311461032857610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d85780632e1a7d4d14610215575b600080fd5b34801561015157600080fd5b5061015a6105a9565b60405161016791906123fb565b60405180910390f35b34801561017c57600080fd5b50610197600480360381019061019291906124c5565b61063b565b6040516101a49190612520565b60405180910390f35b3480156101b957600080fd5b506101c261065e565b6040516101cf919061254a565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612565565b610670565b60405161020c9190612520565b60405180910390f35b34801561022157600080fd5b5061023c600480360381019061023791906125b8565b61069f565b005b34801561024a57600080fd5b506102536108a8565b6040516102609190612601565b60405180910390f35b34801561027557600080fd5b50610290600480360381019061028b919061261c565b6108b1565b005b34801561029e57600080fd5b506102b960048036038101906102b491906124c5565b610a3a565b6040516102c69190612520565b60405180910390f35b6102e960048036038101906102e4919061277e565b610ae4565b005b3480156102f757600080fd5b50610312600480360381019061030d919061261c565b610c21565b60405161031f919061254a565b60405180910390f35b34801561033457600080fd5b5061034f600480360381019061034a919061261c565b610c39565b60405161035c919061254a565b60405180910390f35b34801561037157600080fd5b5061037a610c8a565b005b34801561038857600080fd5b50610391610d12565b60405161039e91906127e9565b60405180910390f35b3480156103b357600080fd5b506103bc610d3c565b6040516103c991906123fb565b60405180910390f35b3480156103de57600080fd5b506103f960048036038101906103f491906124c5565b610dce565b6040516104069190612520565b60405180910390f35b34801561041b57600080fd5b50610436600480360381019061043191906124c5565b610eb8565b6040516104439190612520565b60405180910390f35b34801561045857600080fd5b50610473600480360381019061046e91906125b8565b610edb565b005b34801561048157600080fd5b5061049c60048036038101906104979190612804565b6110a6565b005b3480156104aa57600080fd5b506104c560048036038101906104c091906125b8565b61128c565b6040516104d2919061254a565b60405180910390f35b3480156104e757600080fd5b5061050260048036038101906104fd91906125b8565b6113f6565b60405161050f919061254a565b60405180910390f35b34801561052457600080fd5b5061053f600480360381019061053a9190612857565b611560565b60405161054c919061254a565b60405180910390f35b34801561056157600080fd5b5061057c6004803603810190610577919061261c565b6115e7565b005b34801561058a57600080fd5b506105936116df565b6040516105a0919061254a565b60405180910390f35b6060603680546105b8906128c6565b80601f01602080910402602001604051908101604052809291908181526020018280546105e4906128c6565b80156106315780601f1061060657610100808354040283529160200191610631565b820191906000526020600020905b81548152906001019060200180831161061457829003601f168201915b5050505050905090565b600080610646611708565b9050610653818585611710565b600191505092915050565b600061066b6097546113f6565b905090565b60008061067b611708565b90506106888582856118db565b610693858585611967565b60019150509392505050565b609860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111561072357806040517f9266535100000000000000000000000000000000000000000000000000000000815260040161071a919061254a565b60405180910390fd5b80609760008282546107359190612927565b9250508190555080609860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fbd16c4c02914d26f044cfa096a64853d87c047db6db9425cefae21488477c58f33826040516107ba92919061295b565b60405180910390a1609960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b815260040161081f92919061295b565b6020604051808303816000875af115801561083e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086291906129b0565b6108a55733816040517f55a6745800000000000000000000000000000000000000000000000000000000815260040161089c92919061295b565b60405180910390fd5b50565b60006012905090565b7f000000000000000000000000c49c221f763d199fa301c4efca4325353899c5e873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415610940576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093790612a4f565b60405180910390fd5b7f000000000000000000000000c49c221f763d199fa301c4efca4325353899c5e873ffffffffffffffffffffffffffffffffffffffff1661097f611bd3565b73ffffffffffffffffffffffffffffffffffffffff16146109d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109cc90612ae1565b60405180910390fd5b6109de81611c2a565b610a3781600067ffffffffffffffff8111156109fd576109fc612653565b5b6040519080825280601f01601f191660200182016040528015610a2f5781602001600182028036833780820191505090505b506000611ca9565b50565b600080610a45611708565b9050610ad9818585603460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ad49190612b01565b611710565b600191505092915050565b7f000000000000000000000000c49c221f763d199fa301c4efca4325353899c5e873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415610b73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6a90612a4f565b60405180910390fd5b7f000000000000000000000000c49c221f763d199fa301c4efca4325353899c5e873ffffffffffffffffffffffffffffffffffffffff16610bb2611bd3565b73ffffffffffffffffffffffffffffffffffffffff1614610c08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bff90612ae1565b60405180910390fd5b610c1182611c2a565b610c1d82826001611ca9565b5050565b60986020528060005260406000206000915090505481565b6000610c83609860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f6565b9050919050565b610c92611708565b73ffffffffffffffffffffffffffffffffffffffff16610cb0610d12565b73ffffffffffffffffffffffffffffffffffffffff1614610d06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cfd90612ba3565b60405180910390fd5b610d106000611e7a565b565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060378054610d4b906128c6565b80601f0160208091040260200160405190810160405280929190818152602001828054610d77906128c6565b8015610dc45780601f10610d9957610100808354040283529160200191610dc4565b820191906000526020600020905b815481529060010190602001808311610da757829003601f168201915b5050505050905090565b600080610dd9611708565b90506000603460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905083811015610e9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9690612c35565b60405180910390fd5b610eac8286868403611710565b60019250505092915050565b600080610ec3611708565b9050610ed0818585611967565b600191505092915050565b6000811415610f16576040517f1f2a200500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060976000828254610f289190612b01565b9250508190555080609860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f7e9190612b01565b925050819055507f8a7b48923ed32d7cb785f2c884f5a4c04e14793b439c0b96d3906c667cdf95ab3382604051610fb692919061295b565b60405180910390a1609960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b815260040161101d93929190612c55565b6020604051808303816000875af115801561103c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106091906129b0565b6110a35733816040517f8ab2d93d00000000000000000000000000000000000000000000000000000000815260040161109a92919061295b565b60405180910390fd5b50565b600060019054906101000a900460ff166110ce5760008054906101000a900460ff16156110d7565b6110d6611f40565b5b611116576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110d90612cfe565b60405180910390fd5b60008060019054906101000a900460ff161590508015611166576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6111da6040518060400160405280601381526020017f52656261736564205374616b65642043454c4f000000000000000000000000008152506040518060400160405280600781526020017f72737443454c4f00000000000000000000000000000000000000000000000000815250611f51565b6111e382611e7a565b83609960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082609a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080156112865760008060016101000a81548160ff0219169083151502179055505b50505050565b600080609960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113209190612d33565b90506000609a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b59190612d33565b905060008214806113c65750600081145b156113d55783925050506113f1565b8082856113e29190612d60565b6113ec9190612de9565b925050505b919050565b600080609960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611466573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148a9190612d33565b90506000609a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151f9190612d33565b905060008214806115305750600081145b1561153f57839250505061155b565b81818561154c9190612d60565b6115569190612de9565b925050505b919050565b6000603460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115ef611708565b73ffffffffffffffffffffffffffffffffffffffff1661160d610d12565b73ffffffffffffffffffffffffffffffffffffffff1614611663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165a90612ba3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ca90612e8c565b60405180910390fd5b6116dc81611e7a565b50565b60975481565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611780576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177790612f1e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e790612fb0565b60405180910390fd5b80603460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118ce919061254a565b60405180910390a3505050565b60006118e78484611560565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146119615781811015611953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194a9061301c565b60405180910390fd5b6119608484848403611710565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119ce576040517fe99d5ac500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a35576040517fe99d5ac500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000609860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611a848361128c565b905080821015611acb57826040517f92665351000000000000000000000000000000000000000000000000000000008152600401611ac2919061254a565b60405180910390fd5b808203609860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080609860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611b609190612b01565b925050819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611bc4919061254a565b60405180910390a35050505050565b6000611c017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b611fae565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611c32611708565b73ffffffffffffffffffffffffffffffffffffffff16611c50610d12565b73ffffffffffffffffffffffffffffffffffffffff1614611ca6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9d90612ba3565b60405180910390fd5b50565b6000611cb3611bd3565b9050611cbe84611fb8565b600083511180611ccb5750815b15611cdc57611cda8484612071565b505b6000611d0a7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b61209e565b90508060000160009054906101000a900460ff16611e735760018160000160006101000a81548160ff021916908315150217905550611dd68583604051602401611d5491906127e9565b6040516020818303038152906040527f3659cfe6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612071565b5060008160000160006101000a81548160ff021916908315150217905550611dfc611bd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906130ae565b60405180910390fd5b611e72856120a8565b5b5050505050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000611f4b306116e5565b15905090565b600060019054906101000a900460ff16611fa0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f9790613140565b60405180910390fd5b611faa82826120f7565b5050565b6000819050919050565b611fc181612178565b612000576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff7906131d2565b60405180910390fd5b8061202d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b611fae565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606061209683836040518060600160405280602781526020016132e36027913961218b565b905092915050565b6000819050919050565b6120b181611fb8565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b600060019054906101000a900460ff16612146576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213d90613140565b60405180910390fd5b816036908051906020019061215c9291906122bf565b5080603790805190602001906121739291906122bf565b505050565b600080823b905060008111915050919050565b606061219684612178565b6121d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cc90613264565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516121fd91906132cb565b600060405180830381855af49150503d8060008114612238576040519150601f19603f3d011682016040523d82523d6000602084013e61223d565b606091505b509150915061224d828286612258565b925050509392505050565b60608315612268578290506122b8565b60008351111561227b5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122af91906123fb565b60405180910390fd5b9392505050565b8280546122cb906128c6565b90600052602060002090601f0160209004810192826122ed5760008555612334565b82601f1061230657805160ff1916838001178555612334565b82800160010185558215612334579182015b82811115612333578251825591602001919060010190612318565b5b5090506123419190612345565b5090565b5b8082111561235e576000816000905550600101612346565b5090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561239c578082015181840152602081019050612381565b838111156123ab576000848401525b50505050565b6000601f19601f8301169050919050565b60006123cd82612362565b6123d7818561236d565b93506123e781856020860161237e565b6123f0816123b1565b840191505092915050565b6000602082019050818103600083015261241581846123c2565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061245c82612431565b9050919050565b61246c81612451565b811461247757600080fd5b50565b60008135905061248981612463565b92915050565b6000819050919050565b6124a28161248f565b81146124ad57600080fd5b50565b6000813590506124bf81612499565b92915050565b600080604083850312156124dc576124db612427565b5b60006124ea8582860161247a565b92505060206124fb858286016124b0565b9150509250929050565b60008115159050919050565b61251a81612505565b82525050565b60006020820190506125356000830184612511565b92915050565b6125448161248f565b82525050565b600060208201905061255f600083018461253b565b92915050565b60008060006060848603121561257e5761257d612427565b5b600061258c8682870161247a565b935050602061259d8682870161247a565b92505060406125ae868287016124b0565b9150509250925092565b6000602082840312156125ce576125cd612427565b5b60006125dc848285016124b0565b91505092915050565b600060ff82169050919050565b6125fb816125e5565b82525050565b600060208201905061261660008301846125f2565b92915050565b60006020828403121561263257612631612427565b5b60006126408482850161247a565b91505092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61268b826123b1565b810181811067ffffffffffffffff821117156126aa576126a9612653565b5b80604052505050565b60006126bd61241d565b90506126c98282612682565b919050565b600067ffffffffffffffff8211156126e9576126e8612653565b5b6126f2826123b1565b9050602081019050919050565b82818337600083830152505050565b600061272161271c846126ce565b6126b3565b90508281526020810184848401111561273d5761273c61264e565b5b6127488482856126ff565b509392505050565b600082601f83011261276557612764612649565b5b813561277584826020860161270e565b91505092915050565b6000806040838503121561279557612794612427565b5b60006127a38582860161247a565b925050602083013567ffffffffffffffff8111156127c4576127c361242c565b5b6127d085828601612750565b9150509250929050565b6127e381612451565b82525050565b60006020820190506127fe60008301846127da565b92915050565b60008060006060848603121561281d5761281c612427565b5b600061282b8682870161247a565b935050602061283c8682870161247a565b925050604061284d8682870161247a565b9150509250925092565b6000806040838503121561286e5761286d612427565b5b600061287c8582860161247a565b925050602061288d8582860161247a565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806128de57607f821691505b602082108114156128f2576128f1612897565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006129328261248f565b915061293d8361248f565b9250828210156129505761294f6128f8565b5b828203905092915050565b600060408201905061297060008301856127da565b61297d602083018461253b565b9392505050565b61298d81612505565b811461299857600080fd5b50565b6000815190506129aa81612984565b92915050565b6000602082840312156129c6576129c5612427565b5b60006129d48482850161299b565b91505092915050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b6000612a39602c8361236d565b9150612a44826129dd565b604082019050919050565b60006020820190508181036000830152612a6881612a2c565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b6000612acb602c8361236d565b9150612ad682612a6f565b604082019050919050565b60006020820190508181036000830152612afa81612abe565b9050919050565b6000612b0c8261248f565b9150612b178361248f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612b4c57612b4b6128f8565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612b8d60208361236d565b9150612b9882612b57565b602082019050919050565b60006020820190508181036000830152612bbc81612b80565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000612c1f60258361236d565b9150612c2a82612bc3565b604082019050919050565b60006020820190508181036000830152612c4e81612c12565b9050919050565b6000606082019050612c6a60008301866127da565b612c7760208301856127da565b612c84604083018461253b565b949350505050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000612ce8602e8361236d565b9150612cf382612c8c565b604082019050919050565b60006020820190508181036000830152612d1781612cdb565b9050919050565b600081519050612d2d81612499565b92915050565b600060208284031215612d4957612d48612427565b5b6000612d5784828501612d1e565b91505092915050565b6000612d6b8261248f565b9150612d768361248f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612daf57612dae6128f8565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612df48261248f565b9150612dff8361248f565b925082612e0f57612e0e612dba565b5b828204905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612e7660268361236d565b9150612e8182612e1a565b604082019050919050565b60006020820190508181036000830152612ea581612e69565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f0860248361236d565b9150612f1382612eac565b604082019050919050565b60006020820190508181036000830152612f3781612efb565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612f9a60228361236d565b9150612fa582612f3e565b604082019050919050565b60006020820190508181036000830152612fc981612f8d565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000613006601d8361236d565b915061301182612fd0565b602082019050919050565b6000602082019050818103600083015261303581612ff9565b9050919050565b7f45524331393637557067726164653a207570677261646520627265616b73206660008201527f7572746865722075706772616465730000000000000000000000000000000000602082015250565b6000613098602f8361236d565b91506130a38261303c565b604082019050919050565b600060208201905081810360008301526130c78161308b565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b600061312a602b8361236d565b9150613135826130ce565b604082019050919050565b600060208201905081810360008301526131598161311d565b9050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b60006131bc602d8361236d565b91506131c782613160565b604082019050919050565b600060208201905081810360008301526131eb816131af565b9050919050565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b600061324e60268361236d565b9150613259826131f2565b604082019050919050565b6000602082019050818103600083015261327d81613241565b9050919050565b600081519050919050565b600081905092915050565b60006132a582613284565b6132af818561328f565b93506132bf81856020860161237e565b80840191505092915050565b60006132d7828461329a565b91508190509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220f791af287ba1615ea9d6e363c87fed17adb9e6599cf0d5755e273ed7a09c0cdf64736f6c634300080b0033