Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- MultiSigWallet
- Optimization enabled
- true
- Compiler version
- v0.8.18+commit.87f61d96
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-03-14T06:17:09.713430Z
contracts/MultiSigWallet.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import {OwnerManager} from "./base/OwnerManager.sol"; import {FallbackManager} from "./base/FallbackManager.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; /** * @title Safe - A multisignature wallet with support for confirmations using signed messages based on EIP-712. * @dev Most important concepts: * - Threshold: Number of required confirmations for a Safe transaction. * - Owners: List of addresses that control the Safe. They are the only ones that can add/remove owners, change the threshold and * approve transactions. Managed in `OwnerManager`. * - Nonce: Each transaction should have a different nonceto prevent replay attacks. * - Fallback: Fallback handler is a contract that can provide additional read-only functional for Safe. Managed in `FallbackManager`. * Note: This version of the implementation contract doesn't emit events for the sake of gas efficiency and therefore requires a tracing node for indexing/ * For the events-based implementation see `SafeL2.sol`. */ contract MultiSigWallet is Initializable, UUPSUpgradeable, OwnerManager, FallbackManager { uint256 public nonce; // mapping from tx nonce => owner => bool // use this to check if some transaction is confirmed by some person mapping(uint256 => mapping(address => bool)) public isConfirmed; // List of all tracked transactions mapping(uint256 => Transaction) public transactions; // Events event SafeReceived(address indexed sender, uint256 value); event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address fallbackHandler); event SubmitTransaction( address indexed owner, uint256 indexed nonce, address indexed to, uint256 value, bytes data ); event ConfirmTransaction(address indexed owner, uint256 indexed nonce); event RevokeConfirmation(address indexed owner, uint256 indexed nonce); event ExecuteTransaction(address indexed owner, uint256 indexed nonce); // Tx object struct Transaction { address to; uint256 value; bytes data; bool executed; uint8 numConfirmations; } // Helper functions modifier onlyOwner() { require(isOwner(msg.sender), "not owner"); _; } modifier txExists(uint256 _nonce) { require(_nonce < nonce, "tx does not exist"); _; } modifier notExecuted(uint256 _nonce) { require(!transactions[_nonce].executed, "tx already executed"); _; } modifier notConfirmed(uint256 _nonce) { require(!isConfirmed[_nonce][msg.sender], "tx already confirmed"); _; } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } receive() external payable { emit SafeReceived(msg.sender, msg.value); } function submitTransaction(address _to, uint256 _value, bytes memory _data) public onlyOwner { transactions[nonce] = Transaction({ to: _to, value: _value, data: _data, executed: false, numConfirmations: 0 }); emit SubmitTransaction(msg.sender, nonce, _to, _value, _data); ++nonce; } function confirmTransaction(uint256 _nonce, bool _executeTx) public payable onlyOwner txExists(_nonce) notExecuted(_nonce) notConfirmed(_nonce) { Transaction storage transaction = transactions[_nonce]; transaction.numConfirmations += 1; isConfirmed[_nonce][msg.sender] = true; emit ConfirmTransaction(msg.sender, _nonce); if (transaction.numConfirmations >= threshold && _executeTx == true) { executeTransaction(_nonce); } } function executeTransaction(uint256 _nonce) public payable onlyOwner txExists(_nonce) notExecuted(_nonce) returns (bool success) { Transaction storage transaction = transactions[_nonce]; require( transaction.numConfirmations >= threshold, "confirmation < threshold" ); transaction.executed = true; (success, ) = transaction.to.call{value: transaction.value}( transaction.data ); require(success, "tx failed"); emit ExecuteTransaction(msg.sender, _nonce); } function revokeConfirmation(uint256 _nonce) public onlyOwner txExists(_nonce) notExecuted(_nonce) { Transaction storage transaction = transactions[_nonce]; require(isConfirmed[_nonce][msg.sender], "tx not confirmed"); transaction.numConfirmations -= 1; isConfirmed[_nonce][msg.sender] = false; emit RevokeConfirmation(msg.sender, _nonce); } /****************************** * @notice Internal Function. *******************************/ /** * @notice Handles the payment for a Safe transaction. * @param gasUsed Gas used by the Safe transaction. * @param baseGas Gas costs that are independent of the transaction execution (e.g. base transaction fee, signature check, payment of the refund). * @param gasPrice Gas price that should be used for the payment calculation. * @param gasToken Token address (or 0 if ETH) that is used for the payment. * @return payment The amount of payment made in the specified token. */ function handlePayment( uint256 gasUsed, uint256 baseGas, uint256 gasPrice, address gasToken, address payable refundReceiver ) private returns (uint256 payment) { // solhint-disable-next-line avoid-tx-origin address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver; if (gasToken == address(0)) { // For native tokens, we will only adjust the gas price to not be higher than the actually used gas price payment = (gasUsed + baseGas)*(gasPrice < tx.gasprice ? gasPrice : tx.gasprice); (bool refundSuccess, ) = receiver.call{value: payment}(""); if (!refundSuccess) revertWithError("GS011"); } else { payment = (gasUsed + baseGas) * (gasPrice); if (!transferToken(gasToken, receiver, payment)) revertWithError("GS012"); } } function transferToken(address token, address receiver, uint256 amount) internal returns (bool transferred) { // 0xa9059cbb - keccack("transfer(address,uint256)") bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount); /* solhint-disable no-inline-assembly */ /// @solidity memory-safe-assembly assembly { // We write the return value to scratch space. // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20) switch returndatasize() case 0 { transferred := success } case 0x20 { transferred := iszero(or(iszero(success), iszero(mload(0)))) } default { transferred := 0 } } /* solhint-enable no-inline-assembly */ } /****************************** * @notice Public View Function. *******************************/ function getTransaction(uint256 _nonce) public view returns ( address to, uint256 value, bytes memory data, bool executed, uint8 numConfirmations ) { Transaction storage transaction = transactions[_nonce]; return ( transaction.to, transaction.value, transaction.data, transaction.executed, transaction.numConfirmations ); } /****************************** * @notice Internal Function. *******************************/ // @inheritdoc ISafe function _setup( address[] calldata _owners, uint256 _threshold, address fallbackHandler, address paymentToken, uint256 payment, address payable paymentReceiver ) internal { // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice setupOwners(_owners, _threshold); if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler); // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules // setupModules(to, data); if (payment > 0) { // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself) // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment handlePayment(payment, 0, 1, paymentToken, paymentReceiver); } emit SafeSetup(msg.sender, _owners, _threshold, fallbackHandler); } function _authorizeUpgrade(address) internal override onlyOwner {} /************************************************************** * @dev Initialize smart contract functions - only called once * @param symbol: BRT2LPSYMBOL *************************************************************/ function initialize( address[] calldata _owners, uint256 _threshold, address fallbackHandler, address paymentToken, uint256 payment, address payable paymentReceiver ) public initializer { _setup(_owners, _threshold, fallbackHandler, paymentToken, payment, paymentReceiver); __UUPSUpgradeable_init(); } }
@openzeppelin/contracts-upgradeable/interfaces/IERC1967Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol) pragma solidity ^0.8.0; /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. * * _Available since v4.8.3._ */ interface IERC1967Upgradeable { /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); }
@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/IERC1967Upgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import {Initializable} from "../utils/Initializable.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._ */ abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable { // 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; function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.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) { AddressUpgradeable.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @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 Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.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"); StorageSlotUpgradeable.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 Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.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) { AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), 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; }
@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.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 IBeaconUpgradeable { /** * @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-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import {Initializable} from "./Initializable.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 Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { /// @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 Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeTo(address newImplementation) public virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(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. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(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; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. 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: * ```solidity * 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`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
contracts/Test.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; /** * @title Safe - A multisignature wallet with support for confirmations using signed messages based on EIP-712. * @dev Most important concepts: * - Threshold: Number of required confirmations for a Safe transaction. * - Owners: List of addresses that control the Safe. They are the only ones that can add/remove owners, change the threshold and * approve transactions. Managed in `OwnerManager`. * - Nonce: Each transaction should have a different nonceto prevent replay attacks. * - Fallback: Fallback handler is a contract that can provide additional read-only functional for Safe. Managed in `FallbackManager`. * Note: This version of the implementation contract doesn't emit events for the sake of gas efficiency and therefore requires a tracing node for indexing/ * For the events-based implementation see `SafeL2.sol`. */ contract Test { uint256 public nonce; uint256 public nonce2; // mapping from tx nonce => owner => bool // use this to check if some transaction is confirmed by some person mapping(uint256 => mapping(address => bool)) public isConfirmed; // List of all tracked transactions mapping(uint256 => Transaction) public transactions; // Events event SafeReceived(address indexed sender, uint256 value); event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address fallbackHandler); event SubmitTransaction( address indexed owner, uint256 indexed nonce, address indexed to, uint256 value, bytes data ); event ConfirmTransaction(address indexed owner, uint256 indexed nonce); event RevokeConfirmation(address indexed owner, uint256 indexed nonce); event ExecuteTransaction(address indexed owner, uint256 indexed nonce); // Tx object struct Transaction { address to; uint256 value; bytes data; bool executed; uint8 numConfirmations; } modifier txExists(uint256 _nonce) { require(_nonce < nonce, "tx does not exist"); _; } modifier notExecuted(uint256 _nonce) { require(!transactions[_nonce].executed, "tx already executed"); _; } modifier notConfirmed(uint256 _nonce) { require(!isConfirmed[_nonce][msg.sender], "tx already confirmed"); _; } /****************************** * @notice Public View Function. *******************************/ function getTransaction(uint256 _nonce) public view returns ( address to, uint256 value, bytes memory data, bool executed, uint8 numConfirmations ) { Transaction storage transaction = transactions[_nonce]; return ( transaction.to, transaction.value, transaction.data, transaction.executed, transaction.numConfirmations ); } }
contracts/base/FallbackManager.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; import {SelfAuthorized} from "../common/SelfAuthorized.sol"; import {IFallbackManager} from "../interfaces/IFallbackManager.sol"; /** * @title Fallback Manager - A contract managing fallback calls made to this contract */ abstract contract FallbackManager is SelfAuthorized, IFallbackManager { // keccak256("fallback_manager.handler.address") bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5; /** * @notice Internal function to set the fallback handler. * @param handler contract to handle fallback calls. */ function internalSetFallbackHandler(address handler) internal { /* If a fallback handler is set to self, then the following attack vector is opened: Imagine we have a function like this: function withdraw() internal authorized { withdrawalAddress.call.value(address(this).balance)(""); } If the fallback method is triggered, the fallback handler appends the msg.sender address to the calldata and calls the fallback handler. A potential attacker could call a Safe with the 3 bytes signature of a withdraw function. Since 3 bytes do not create a valid signature, the call would end in a fallback handler. Since it appends the msg.sender address to the calldata, the attacker could craft an address where the first 3 bytes of the previous calldata + the first byte of the address make up a valid function signature. The subsequent call would result in unsanctioned access to Safe's internal protected methods. For some reason, solidity matches the first 4 bytes of the calldata to a function signature, regardless if more data follow these 4 bytes. */ if (handler == address(this)) revertWithError("GS400"); /* solhint-disable no-inline-assembly */ /// @solidity memory-safe-assembly assembly { sstore(FALLBACK_HANDLER_STORAGE_SLOT, handler) } /* solhint-enable no-inline-assembly */ } // @inheritdoc IFallbackManager function setFallbackHandler(address handler) public override authorized { internalSetFallbackHandler(handler); emit ChangedFallbackHandler(handler); } // @notice Forwards all calls to the fallback handler if set. Returns 0 if no handler is set. // @dev Appends the non-padded caller address to the calldata to be optionally used in the handler // The handler can make us of `HandlerContext.sol` to extract the address. // This is done because in the next call frame the `msg.sender` will be FallbackManager's address // and having the original caller address may enable additional verification scenarios. // solhint-disable-next-line payable-fallback,no-complex-fallback fallback() external { /* solhint-disable no-inline-assembly */ /// @solidity memory-safe-assembly assembly { // When compiled with the optimizer, the compiler relies on a certain assumptions on how the // memory is used, therefore we need to guarantee memory safety (keeping the free memory point 0x40 slot intact, // not going beyond the scratch space, etc) // Solidity docs: https://docs.soliditylang.org/en/latest/assembly.html#memory-safety let handler := sload(FALLBACK_HANDLER_STORAGE_SLOT) if iszero(handler) { return(0, 0) } let ptr := mload(0x40) calldatacopy(ptr, 0, calldatasize()) // The msg.sender address is shifted to the left by 12 bytes to remove the padding // Then the address without padding is stored right after the calldata mstore(add(ptr, calldatasize()), shl(96, caller())) // Add 20 bytes for the address appended add the end let success := call(gas(), handler, 0, ptr, add(calldatasize(), 20), 0, 0) returndatacopy(ptr, 0, returndatasize()) if iszero(success) { revert(ptr, returndatasize()) } return(ptr, returndatasize()) } /* solhint-enable no-inline-assembly */ } /** * @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; }
contracts/base/OwnerManager.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; import {SelfAuthorized} from "../common/SelfAuthorized.sol"; import {IOwnerManager} from "../interfaces/IOwnerManager.sol"; /** * @title OwnerManager - Manages Safe owners and a threshold to authorize transactions. * @dev Uses a linked list to store the owners because the code generate by the solidity compiler * is more efficient than using a dynamic array. */ abstract contract OwnerManager is SelfAuthorized, IOwnerManager { address internal constant SENTINEL_OWNERS = address(0x1); mapping(address => address) internal owners; uint256 internal ownerCount; uint256 internal threshold; /** * @notice Sets the initial storage of the contract. * @param _owners List of Safe owners. * @param _threshold Number of required confirmations for a Safe transaction. */ function setupOwners(address[] memory _owners, uint256 _threshold) internal { // Threshold can only be 0 at initialization. // Check ensures that setup function can only be called once. if (threshold > 0) revertWithError("GS200"); // Validate that threshold is smaller than number of added owners. if (_threshold > _owners.length) revertWithError("GS201"); // There has to be at least one Safe owner. if (_threshold == 0) revertWithError("GS202"); // Initializing Safe owners. address currentOwner = SENTINEL_OWNERS; for (uint256 i = 0; i < _owners.length; i++) { // Owner address cannot be null. address owner = _owners[i]; if (owner == address(0) || owner == SENTINEL_OWNERS || owner == address(this) || currentOwner == owner) revertWithError("GS203"); // No duplicate owners allowed. if (owners[owner] != address(0)) revertWithError("GS204"); owners[currentOwner] = owner; currentOwner = owner; } owners[currentOwner] = SENTINEL_OWNERS; ownerCount = _owners.length; threshold = _threshold; } // @inheritdoc IOwnerManager function addOwnerWithThreshold(address owner, uint256 _threshold) public override authorized { // Owner address cannot be null, the sentinel or the Safe itself. if (owner == address(0) || owner == SENTINEL_OWNERS || owner == address(this)) revertWithError("GS203"); // No duplicate owners allowed. if (owners[owner] != address(0)) revertWithError("GS204"); owners[owner] = owners[SENTINEL_OWNERS]; owners[SENTINEL_OWNERS] = owner; ownerCount++; emit AddedOwner(owner); // Change threshold if threshold was changed. if (threshold != _threshold) changeThreshold(_threshold); } // @inheritdoc IOwnerManager function removeOwner(address prevOwner, address owner, uint256 _threshold) public override authorized { // Only allow to remove an owner, if threshold can still be reached. if (ownerCount - 1 < _threshold) revertWithError("GS201"); // Validate owner address and check that it corresponds to owner index. if (owner == address(0) || owner == SENTINEL_OWNERS) revertWithError("GS203"); if (owners[prevOwner] != owner) revertWithError("GS205"); owners[prevOwner] = owners[owner]; owners[owner] = address(0); ownerCount--; emit RemovedOwner(owner); // Change threshold if threshold was changed. if (threshold != _threshold) changeThreshold(_threshold); } // @inheritdoc IOwnerManager function swapOwner(address prevOwner, address oldOwner, address newOwner) public override authorized { // Owner address cannot be null, the sentinel or the Safe itself. if (newOwner == address(0) || newOwner == SENTINEL_OWNERS || newOwner == address(this)) revertWithError("GS203"); // No duplicate owners allowed. if (owners[newOwner] != address(0)) revertWithError("GS204"); // Validate oldOwner address and check that it corresponds to owner index. if (oldOwner == address(0) || oldOwner == SENTINEL_OWNERS) revertWithError("GS203"); if (owners[prevOwner] != oldOwner) revertWithError("GS205"); owners[newOwner] = owners[oldOwner]; owners[prevOwner] = newOwner; owners[oldOwner] = address(0); emit RemovedOwner(oldOwner); emit AddedOwner(newOwner); } // @inheritdoc IOwnerManager function changeThreshold(uint256 _threshold) public override authorized { // Validate that threshold is smaller than number of owners. if (_threshold > ownerCount) revertWithError("GS201"); // There has to be at least one Safe owner. if (_threshold == 0) revertWithError("GS202"); threshold = _threshold; emit ChangedThreshold(threshold); } // @inheritdoc IOwnerManager function getThreshold() public view override returns (uint256) { return threshold; } // @inheritdoc IOwnerManager function isOwner(address owner) public view override returns (bool) { return !(owner == SENTINEL_OWNERS || owners[owner] == address(0)); } // @inheritdoc IOwnerManager function getOwners() public view override returns (address[] memory) { address[] memory array = new address[](ownerCount); // populate return array uint256 index = 0; address currentOwner = owners[SENTINEL_OWNERS]; while (currentOwner != SENTINEL_OWNERS) { array[index] = currentOwner; currentOwner = owners[currentOwner]; index++; } return array; } /** * @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; }
contracts/common/SelfAuthorized.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; import {ErrorMessage} from "../libraries/ErrorMessage.sol"; /** * @title SelfAuthorized - Authorizes current contract to perform actions to itself. */ abstract contract SelfAuthorized is ErrorMessage { function requireSelfCall() private view { if (msg.sender != address(this)) revertWithError("GS031"); } modifier authorized() { // Modifiers are copied around during compilation. This is a function call as it minimized the bytecode size requireSelfCall(); _; } }
contracts/interfaces/IFallbackManager.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; /** * @title IFallbackManager - A contract interface managing fallback calls made to this contract. * @author @safe-global/safe-protocol */ interface IFallbackManager { event ChangedFallbackHandler(address indexed handler); /** * @notice Set Fallback Handler to `handler` for the Safe. * @dev Only fallback calls without value and with data will be forwarded. * This can only be done via a Safe transaction. * Cannot be set to the Safe itself. * @param handler contract to handle fallback calls. */ function setFallbackHandler(address handler) external; }
contracts/interfaces/IOwnerManager.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; /** * @title IOwnerManager - Interface for contract which manages Safe owners and a threshold to authorize transactions. * @author @safe-global/safe-protocol */ interface IOwnerManager { event AddedOwner(address indexed owner); event RemovedOwner(address indexed owner); event ChangedThreshold(uint256 threshold); /** * @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`. * @dev This can only be done via a Safe transaction. * @param owner New owner address. * @param _threshold New threshold. */ function addOwnerWithThreshold(address owner, uint256 _threshold) external; /** * @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`. * @dev This can only be done via a Safe transaction. * @param prevOwner Owner that pointed to the owner to be removed in the linked list * @param owner Owner address to be removed. * @param _threshold New threshold. */ function removeOwner(address prevOwner, address owner, uint256 _threshold) external; /** * @notice Replaces the owner `oldOwner` in the Safe with `newOwner`. * @dev This can only be done via a Safe transaction. * @param prevOwner Owner that pointed to the owner to be replaced in the linked list * @param oldOwner Owner address to be replaced. * @param newOwner New owner address. */ function swapOwner(address prevOwner, address oldOwner, address newOwner) external; /** * @notice Changes the threshold of the Safe to `_threshold`. * @dev This can only be done via a Safe transaction. * @param _threshold New threshold. */ function changeThreshold(uint256 _threshold) external; /** * @notice Returns the number of required confirmations for a Safe transaction aka the threshold. * @return Threshold number. */ function getThreshold() external view returns (uint256); /** * @notice Returns if `owner` is an owner of the Safe. * @return Boolean if owner is an owner of the Safe. */ function isOwner(address owner) external view returns (bool); /** * @notice Returns a list of Safe owners. * @return Array of Safe owners. */ function getOwners() external view returns (address[] memory); }
contracts/libraries/ErrorMessage.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; /** * @title Error Message - Contract which uses assembly to revert with a custom error message. * @notice The aim is to save gas using assembly to revert with custom error message. */ abstract contract ErrorMessage { /** * @notice Function which uses assembly to revert with the passed error message. * @param error The error string to revert with. * @dev Currently it is expected that the `error` string is at max 5 bytes of length. Ex: "GSXXX" */ function revertWithError(bytes5 error) internal pure { /* solhint-disable no-inline-assembly */ /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x08c379a000000000000000000000000000000000000000000000000000000000) // Selector for method "Error(string)" mstore(add(ptr, 0x04), 0x20) // String offset mstore(add(ptr, 0x24), 0x05) // Revert reason length (5 bytes for bytes5) mstore(add(ptr, 0x44), error) // Revert reason revert(ptr, 0x64) // Revert data length is 4 bytes for selector + offset + error length + error. } /* solhint-enable no-inline-assembly */ } }
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{}}
Contract ABI
[{"type":"constructor","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addOwnerWithThreshold","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"_threshold","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changeThreshold","inputs":[{"type":"uint256","name":"_threshold","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"confirmTransaction","inputs":[{"type":"uint256","name":"_nonce","internalType":"uint256"},{"type":"bool","name":"_executeTx","internalType":"bool"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"bool","name":"success","internalType":"bool"}],"name":"executeTransaction","inputs":[{"type":"uint256","name":"_nonce","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getOwners","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getThreshold","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"},{"type":"bool","name":"executed","internalType":"bool"},{"type":"uint8","name":"numConfirmations","internalType":"uint8"}],"name":"getTransaction","inputs":[{"type":"uint256","name":"_nonce","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address[]","name":"_owners","internalType":"address[]"},{"type":"uint256","name":"_threshold","internalType":"uint256"},{"type":"address","name":"fallbackHandler","internalType":"address"},{"type":"address","name":"paymentToken","internalType":"address"},{"type":"uint256","name":"payment","internalType":"uint256"},{"type":"address","name":"paymentReceiver","internalType":"address payable"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isConfirmed","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nonce","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"proxiableUUID","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeOwner","inputs":[{"type":"address","name":"prevOwner","internalType":"address"},{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"_threshold","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeConfirmation","inputs":[{"type":"uint256","name":"_nonce","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFallbackHandler","inputs":[{"type":"address","name":"handler","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"submitTransaction","inputs":[{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_value","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swapOwner","inputs":[{"type":"address","name":"prevOwner","internalType":"address"},{"type":"address","name":"oldOwner","internalType":"address"},{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"},{"type":"bool","name":"executed","internalType":"bool"},{"type":"uint8","name":"numConfirmations","internalType":"uint8"}],"name":"transactions","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"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":"event","name":"AddedOwner","inputs":[{"type":"address","name":"owner","indexed":true}],"anonymous":false},{"type":"event","name":"AdminChanged","inputs":[{"type":"address","name":"previousAdmin","indexed":false},{"type":"address","name":"newAdmin","indexed":false}],"anonymous":false},{"type":"event","name":"BeaconUpgraded","inputs":[{"type":"address","name":"beacon","indexed":true}],"anonymous":false},{"type":"event","name":"ChangedFallbackHandler","inputs":[{"type":"address","name":"handler","indexed":true}],"anonymous":false},{"type":"event","name":"ChangedThreshold","inputs":[{"type":"uint256","name":"threshold","indexed":false}],"anonymous":false},{"type":"event","name":"ConfirmTransaction","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"uint256","name":"nonce","indexed":true}],"anonymous":false},{"type":"event","name":"ExecuteTransaction","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"uint256","name":"nonce","indexed":true}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","indexed":false}],"anonymous":false},{"type":"event","name":"RemovedOwner","inputs":[{"type":"address","name":"owner","indexed":true}],"anonymous":false},{"type":"event","name":"RevokeConfirmation","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"uint256","name":"nonce","indexed":true}],"anonymous":false},{"type":"event","name":"SafeReceived","inputs":[{"type":"address","name":"sender","indexed":true},{"type":"uint256","name":"value","indexed":false}],"anonymous":false},{"type":"event","name":"SafeSetup","inputs":[{"type":"address","name":"initiator","indexed":true},{"type":"address[]","name":"owners","indexed":false},{"type":"uint256","name":"threshold","indexed":false},{"type":"address","name":"fallbackHandler","indexed":false}],"anonymous":false},{"type":"event","name":"SubmitTransaction","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"uint256","name":"nonce","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"value","indexed":false},{"type":"bytes","name":"data","indexed":false}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","indexed":true}],"anonymous":false},{"type":"receive"},{"type":"fallback"}]
Contract Creation Code
0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e7565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516127886200011f6000396000818161082c0152818161086c0152818161090b0152818161094b01526109da01526127886000f3fe6080604052600436106101235760003560e01c80639ace38c2116100a0578063e318b52b11610064578063e318b52b146103ca578063e75235b8146103ea578063ee22610b146103ff578063f08a032314610412578063f8dc5dd9146104325761015f565b80639ace38c21461033f578063a0e67e2b1461035f578063affed0e014610381578063c642747414610397578063c6a725d8146103b75761015f565b80634f1ef286116100e75780634f1ef2861461028e57806352d1902d146102a1578063694e80c3146102c457806380f59a65146102e457806396666c2d1461031f5761015f565b80630d582f13146101c657806320ea8d86146101e85780632f54bf6e1461020857806333ea3dc81461023d5780633659cfe61461026e5761015f565b3661015f5760405134815233907f3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d9060200160405180910390a2005b34801561016b57600080fd5b507f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5548061019557005b60405136600082373360601b3682015260008060143601836000865af191503d6000823e816101c2573d81fd5b3d81f35b3480156101d257600080fd5b506101e66101e1366004611e7e565b610452565b005b3480156101f457600080fd5b506101e6610203366004611eaa565b61058f565b34801561021457600080fd5b50610228610223366004611ec3565b610703565b60405190151581526020015b60405180910390f35b34801561024957600080fd5b5061025d610258366004611eaa565b61073c565b604051610234959493929190611f37565b34801561027a57600080fd5b506101e6610289366004611ec3565b610822565b6101e661029c36600461201d565b610901565b3480156102ad57600080fd5b506102b66109cd565b604051908152602001610234565b3480156102d057600080fd5b506101e66102df366004611eaa565b610a80565b3480156102f057600080fd5b506102286102ff36600461206d565b60cb60209081526000928352604080842090915290825290205460ff1681565b34801561032b57600080fd5b506101e661033a36600461209d565b610af7565b34801561034b57600080fd5b5061025d61035a366004611eaa565b610c1e565b34801561036b57600080fd5b50610374610ce5565b6040516102349190612154565b34801561038d57600080fd5b506102b660ca5481565b3480156103a357600080fd5b506101e66103b23660046121a1565b610dd6565b6101e66103c53660046121fa565b610f04565b3480156103d657600080fd5b506101e66103e5366004612224565b6110af565b3480156103f657600080fd5b506067546102b6565b61022861040d366004611eaa565b611250565b34801561041e57600080fd5b506101e661042d366004611ec3565b611424565b34801561043e57600080fd5b506101e661044d36600461226f565b61146c565b61045a6115a8565b6001600160a01b038216158061047957506001600160a01b0382166001145b8061048c57506001600160a01b03821630145b156104a2576104a264475332303360d81b6115c2565b6001600160a01b0382811660009081526065602052604090205416156104d3576104d36411d4cc8c0d60da1b6115c2565b60656020527f4d5a9bd2e41301728d41c8e705190becb4e74abe869f75bdb405b63716a35f9e80546001600160a01b038481166000818152604081208054939094166001600160a01b031993841617909355600183528354909116179091556066805491610540836122c6565b90915550506040516001600160a01b038316907f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2690600090a2806067541461058b5761058b81610a80565b5050565b61059833610703565b6105bd5760405162461bcd60e51b81526004016105b4906122df565b60405180910390fd5b8060ca5481106105df5760405162461bcd60e51b81526004016105b490612302565b600082815260cc6020526040902060030154829060ff16156106135760405162461bcd60e51b81526004016105b49061232d565b600083815260cc6020908152604080832060cb83528184203385529092529091205460ff166106775760405162461bcd60e51b815260206004820152601060248201526f1d1e081b9bdd0818dbdb999a5c9b595960821b60448201526064016105b4565b60018160030160018282829054906101000a900460ff16610698919061235a565b825460ff9182166101009390930a928302919092021990911617905550600084815260cb60209081526040808320338085529252808320805460ff191690555186927ff0dca620e2e81f7841d07bcc105e1704fb01475b278a9d4c236e1c62945edd5591a350505050565b60006001600160a01b0382166001148061073557506001600160a01b0382811660009081526065602052604090205416155b1592915050565b600081815260cc6020526040812080546001820154600383015460028401805486956060958795869592946001600160a01b0390921693909260ff808216926101009092041690839061078e90612373565b80601f01602080910402602001604051908101604052809291908181526020018280546107ba90612373565b80156108075780601f106107dc57610100808354040283529160200191610807565b820191906000526020600020905b8154815290600101906020018083116107ea57829003601f168201915b50505050509250955095509550955095505091939590929450565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361086a5760405162461bcd60e51b81526004016105b4906123ad565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166108b360008051602061270c833981519152546001600160a01b031690565b6001600160a01b0316146108d95760405162461bcd60e51b81526004016105b4906123f9565b6108e2816115e7565b604080516000808252602082019092526108fe9183919061160c565b50565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036109495760405162461bcd60e51b81526004016105b4906123ad565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661099260008051602061270c833981519152546001600160a01b031690565b6001600160a01b0316146109b85760405162461bcd60e51b81526004016105b4906123f9565b6109c1826115e7565b61058b8282600161160c565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a6d5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016105b4565b5060008051602061270c83398151915290565b610a886115a8565b606654811115610aa357610aa364475332303160d81b6115c2565b80600003610abc57610abc6423a999181960d91b6115c2565b60678190556040518181527f610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c939060200160405180910390a150565b600054610100900460ff1615808015610b175750600054600160ff909116105b80610b315750303b158015610b31575060005460ff166001145b610b945760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105b4565b6000805460ff191660011790558015610bb7576000805461ff0019166101001790555b610bc688888888888888611777565b610bce611834565b8015610c14576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b60cc602052600090815260409020805460018201546002830180546001600160a01b03909316939192610c5090612373565b80601f0160208091040260200160405190810160405280929190818152602001828054610c7c90612373565b8015610cc95780601f10610c9e57610100808354040283529160200191610cc9565b820191906000526020600020905b815481529060010190602001808311610cac57829003601f168201915b5050506003909301549192505060ff8082169161010090041685565b6060600060665467ffffffffffffffff811115610d0457610d04611f7a565b604051908082528060200260200182016040528015610d2d578160200160208202803683370190505b506001600090815260656020527f4d5a9bd2e41301728d41c8e705190becb4e74abe869f75bdb405b63716a35f9e54919250906001600160a01b03165b6001600160a01b038116600114610dce5780838381518110610d8e57610d8e612445565b6001600160a01b03928316602091820292909201810191909152918116600090815260659092526040909120541681610dc6816122c6565b925050610d6a565b509092915050565b610ddf33610703565b610dfb5760405162461bcd60e51b81526004016105b4906122df565b6040805160a0810182526001600160a01b03858116825260208083018681528385018681526000606086018190526080860181905260ca54815260cc90935294909120835181546001600160a01b031916931692909217825551600182015591519091906002820190610e6e90826124a1565b5060608201516003909101805460809093015160ff166101000261ff00199215159290921661ffff199093169290921717905560ca546040516001600160a01b038516919033907fd5a05bf70715ad82a09a756320284a1b54c9ff74cd0f8cce6219e79b563fe59d90610ee49087908790612561565b60405180910390a460ca60008154610efb906122c6565b90915550505050565b610f0d33610703565b610f295760405162461bcd60e51b81526004016105b4906122df565b8160ca548110610f4b5760405162461bcd60e51b81526004016105b490612302565b600083815260cc6020526040902060030154839060ff1615610f7f5760405162461bcd60e51b81526004016105b49061232d565b600084815260cb60209081526040808320338452909152902054849060ff1615610fe25760405162461bcd60e51b81526020600482015260146024820152731d1e08185b1c9958591e4818dbdb999a5c9b595960621b60448201526064016105b4565b600085815260cc6020526040902060038101805460019190829061100f908290610100900460ff1661257a565b825460ff9182166101009390930a928302919092021990911617905550600086815260cb60209081526040808320338085529252808320805460ff191660011790555188927f5cbe105e36805f7820e291f799d5794ff948af2a5f664e580382defb6339004191a36067546003820154610100900460ff161080159061109757506001851515145b156110a7576110a586611250565b505b505050505050565b6110b76115a8565b6001600160a01b03811615806110d657506001600160a01b0381166001145b806110e957506001600160a01b03811630145b156110ff576110ff64475332303360d81b6115c2565b6001600160a01b038181166000908152606560205260409020541615611130576111306411d4cc8c0d60da1b6115c2565b6001600160a01b038216158061114f57506001600160a01b0382166001145b156111655761116564475332303360d81b6115c2565b6001600160a01b0383811660009081526065602052604090205481169083161461119a5761119a64475332303560d81b6115c2565b6001600160a01b03828116600081815260656020526040808220805486861680855283852080549288166001600160a01b03199384161790559589168452828420805482169096179095558383528054909416909355915190917ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf91a26040516001600160a01b038216907f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2690600090a2505050565b600061125b33610703565b6112775760405162461bcd60e51b81526004016105b4906122df565b8160ca5481106112995760405162461bcd60e51b81526004016105b490612302565b600083815260cc6020526040902060030154839060ff16156112cd5760405162461bcd60e51b81526004016105b49061232d565b600084815260cc602052604090206067546003820154610100900460ff1610156113395760405162461bcd60e51b815260206004820152601860248201527f636f6e6669726d6174696f6e203c207468726573686f6c64000000000000000060448201526064016105b4565b60038101805460ff191660019081179091558154908201546040516001600160a01b039092169161136e906002850190612593565b60006040518083038185875af1925050503d80600081146113ab576040519150601f19603f3d011682016040523d82523d6000602084013e6113b0565b606091505b505080945050836113ef5760405162461bcd60e51b81526020600482015260096024820152681d1e0819985a5b195960ba1b60448201526064016105b4565b604051859033907f5445f318f4f5fcfb66592e68e0cc5822aa15664039bd5f0ffde24c5a8142b1ac90600090a3505050919050565b61142c6115a8565b6114358161189f565b6040516001600160a01b038216907f5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b090600090a250565b6114746115a8565b8060016066546114849190612609565b101561149b5761149b64475332303160d81b6115c2565b6001600160a01b03821615806114ba57506001600160a01b0382166001145b156114d0576114d064475332303360d81b6115c2565b6001600160a01b038381166000908152606560205260409020548116908316146115055761150564475332303560d81b6115c2565b6001600160a01b03828116600081815260656020526040808220805488861684529183208054929095166001600160a01b031992831617909455918152825490911690915560668054916115588361261c565b90915550506040516001600160a01b038316907ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf90600090a280606754146115a3576115a381610a80565b505050565b3330146115c0576115c064475330333160d81b6115c2565b565b60405162461bcd60e51b81526020600482015260056024820152816044820152606481fd5b6115f033610703565b6108fe5760405162461bcd60e51b81526004016105b4906122df565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561163f576115a3836118e4565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611699575060408051601f3d908101601f1916820190925261169691810190612633565b60015b6116fc5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016105b4565b60008051602061270c833981519152811461176b5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016105b4565b506115a3838383611980565b6117b58787808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508992506119ab915050565b6001600160a01b038416156117cd576117cd8461189f565b81156117e4576117e282600060018685611b37565b505b336001600160a01b03167f5629c09440a0b5bcd29c72c5d739eaca6f7686d63d9639d601e0f1642baa168388888888604051611823949392919061264c565b60405180910390a250505050505050565b600054610100900460ff166115c05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016105b4565b306001600160a01b038216036118c0576118c064047533430360dc1b6115c2565b7f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d555565b6001600160a01b0381163b6119515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016105b4565b60008051602061270c83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61198983611c39565b6000825111806119965750805b156115a3576119a58383611c79565b50505050565b606754156119c4576119c464047533230360dc1b6115c2565b81518111156119de576119de64475332303160d81b6115c2565b806000036119f7576119f76423a999181960d91b6115c2565b600160005b8351811015611b04576000848281518110611a1957611a19612445565b6020026020010151905060006001600160a01b0316816001600160a01b03161480611a4d57506001600160a01b0381166001145b80611a6057506001600160a01b03811630145b80611a7c5750806001600160a01b0316836001600160a01b0316145b15611a9257611a9264475332303360d81b6115c2565b6001600160a01b038181166000908152606560205260409020541615611ac357611ac36411d4cc8c0d60da1b6115c2565b6001600160a01b03928316600090815260656020526040902080546001600160a01b0319169382169390931790925580611afc816122c6565b9150506119fc565b506001600160a01b0316600090815260656020526040902080546001600160a01b03191660011790559051606655606755565b6000806001600160a01b03831615611b4f5782611b51565b325b90506001600160a01b038416611bf8573a8510611b6e573a611b70565b845b611b7a87896126b2565b611b8491906126c5565b91506000816001600160a01b03168360405160006040518083038185875af1925050503d8060008114611bd3576040519150601f19603f3d011682016040523d82523d6000602084013e611bd8565b606091505b5050905080611bf257611bf264475330313160d81b6115c2565b50611c2f565b84611c0387896126b2565b611c0d91906126c5565b9150611c1a848284611ca7565b611c2f57611c2f6423a998189960d91b6115c2565b5095945050505050565b611c42816118e4565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060611c9e838360405180606001604052806027815260200161272c60279139611d36565b90505b92915050565b604080516001600160a01b03841660248201526044808201849052825180830390910181526064909101909152602080820180516001600160e01b031663a9059cbb60e01b1781528251600093929184919082896127105a03f13d8015611d195760208114611d215760009350611d2c565b819350611d2c565b600051158215171593505b5050509392505050565b6060600080856001600160a01b031685604051611d5391906126dc565b600060405180830381855af49150503d8060008114611d8e576040519150601f19603f3d011682016040523d82523d6000602084013e611d93565b606091505b5091509150611da486838387611dae565b9695505050505050565b60608315611e1d578251600003611e16576001600160a01b0385163b611e165760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105b4565b5081611e27565b611e278383611e2f565b949350505050565b815115611e3f5781518083602001fd5b8060405162461bcd60e51b81526004016105b491906126f8565b6001600160a01b03811681146108fe57600080fd5b8035611e7981611e59565b919050565b60008060408385031215611e9157600080fd5b8235611e9c81611e59565b946020939093013593505050565b600060208284031215611ebc57600080fd5b5035919050565b600060208284031215611ed557600080fd5b8135611ee081611e59565b9392505050565b60005b83811015611f02578181015183820152602001611eea565b50506000910152565b60008151808452611f23816020860160208601611ee7565b601f01601f19169290920160200192915050565b60018060a01b038616815284602082015260a060408201526000611f5e60a0830186611f0b565b93151560608301525060ff919091166080909101529392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112611fa157600080fd5b813567ffffffffffffffff80821115611fbc57611fbc611f7a565b604051601f8301601f19908116603f01168101908282118183101715611fe457611fe4611f7a565b81604052838152866020858801011115611ffd57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561203057600080fd5b823561203b81611e59565b9150602083013567ffffffffffffffff81111561205757600080fd5b61206385828601611f90565b9150509250929050565b6000806040838503121561208057600080fd5b82359150602083013561209281611e59565b809150509250929050565b600080600080600080600060c0888a0312156120b857600080fd5b873567ffffffffffffffff808211156120d057600080fd5b818a0191508a601f8301126120e457600080fd5b8135818111156120f357600080fd5b8b60208260051b850101111561210857600080fd5b60209283019950975050880135945061212360408901611e6e565b935061213160608901611e6e565b92506080880135915061214660a08901611e6e565b905092959891949750929550565b6020808252825182820181905260009190848201906040850190845b818110156121955783516001600160a01b031683529284019291840191600101612170565b50909695505050505050565b6000806000606084860312156121b657600080fd5b83356121c181611e59565b925060208401359150604084013567ffffffffffffffff8111156121e457600080fd5b6121f086828701611f90565b9150509250925092565b6000806040838503121561220d57600080fd5b823591506020830135801515811461209257600080fd5b60008060006060848603121561223957600080fd5b833561224481611e59565b9250602084013561225481611e59565b9150604084013561226481611e59565b809150509250925092565b60008060006060848603121561228457600080fd5b833561228f81611e59565b9250602084013561229f81611e59565b929592945050506040919091013590565b634e487b7160e01b600052601160045260246000fd5b6000600182016122d8576122d86122b0565b5060010190565b6020808252600990820152683737ba1037bbb732b960b91b604082015260600190565b6020808252601190820152701d1e08191bd95cc81b9bdd08195e1a5cdd607a1b604082015260600190565b6020808252601390820152721d1e08185b1c9958591e48195e1958dd5d1959606a1b604082015260600190565b60ff8281168282160390811115611ca157611ca16122b0565b600181811c9082168061238757607f821691505b6020821081036123a757634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b601f8211156115a357600081815260208120601f850160051c810160208610156124825750805b601f850160051c820191505b818110156110a75782815560010161248e565b815167ffffffffffffffff8111156124bb576124bb611f7a565b6124cf816124c98454612373565b8461245b565b602080601f83116001811461250457600084156124ec5750858301515b600019600386901b1c1916600185901b1785556110a7565b600085815260208120601f198616915b8281101561253357888601518255948401946001909101908401612514565b50858210156125515787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b828152604060208201526000611e276040830184611f0b565b60ff8181168382160190811115611ca157611ca16122b0565b60008083546125a181612373565b600182811680156125b957600181146125ce576125fd565b60ff19841687528215158302870194506125fd565b8760005260208060002060005b858110156125f45781548a8201529084019082016125db565b50505082870194505b50929695505050505050565b81810381811115611ca157611ca16122b0565b60008161262b5761262b6122b0565b506000190190565b60006020828403121561264557600080fd5b5051919050565b6060808252810184905260008560808301825b8781101561268f57823561267281611e59565b6001600160a01b031682526020928301929091019060010161265f565b50602084019590955250506001600160a01b039190911660409091015292915050565b80820180821115611ca157611ca16122b0565b8082028115828204841417611ca157611ca16122b0565b600082516126ee818460208701611ee7565b9190910192915050565b602081526000611c9e6020830184611f0b56fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220f8d2ca9d54faebea5d90e3cc8a7f20c54acbcd8eab3ff5064cb14bdcd62c9fc064736f6c63430008120033
Deployed ByteCode
0x6080604052600436106101235760003560e01c80639ace38c2116100a0578063e318b52b11610064578063e318b52b146103ca578063e75235b8146103ea578063ee22610b146103ff578063f08a032314610412578063f8dc5dd9146104325761015f565b80639ace38c21461033f578063a0e67e2b1461035f578063affed0e014610381578063c642747414610397578063c6a725d8146103b75761015f565b80634f1ef286116100e75780634f1ef2861461028e57806352d1902d146102a1578063694e80c3146102c457806380f59a65146102e457806396666c2d1461031f5761015f565b80630d582f13146101c657806320ea8d86146101e85780632f54bf6e1461020857806333ea3dc81461023d5780633659cfe61461026e5761015f565b3661015f5760405134815233907f3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d9060200160405180910390a2005b34801561016b57600080fd5b507f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5548061019557005b60405136600082373360601b3682015260008060143601836000865af191503d6000823e816101c2573d81fd5b3d81f35b3480156101d257600080fd5b506101e66101e1366004611e7e565b610452565b005b3480156101f457600080fd5b506101e6610203366004611eaa565b61058f565b34801561021457600080fd5b50610228610223366004611ec3565b610703565b60405190151581526020015b60405180910390f35b34801561024957600080fd5b5061025d610258366004611eaa565b61073c565b604051610234959493929190611f37565b34801561027a57600080fd5b506101e6610289366004611ec3565b610822565b6101e661029c36600461201d565b610901565b3480156102ad57600080fd5b506102b66109cd565b604051908152602001610234565b3480156102d057600080fd5b506101e66102df366004611eaa565b610a80565b3480156102f057600080fd5b506102286102ff36600461206d565b60cb60209081526000928352604080842090915290825290205460ff1681565b34801561032b57600080fd5b506101e661033a36600461209d565b610af7565b34801561034b57600080fd5b5061025d61035a366004611eaa565b610c1e565b34801561036b57600080fd5b50610374610ce5565b6040516102349190612154565b34801561038d57600080fd5b506102b660ca5481565b3480156103a357600080fd5b506101e66103b23660046121a1565b610dd6565b6101e66103c53660046121fa565b610f04565b3480156103d657600080fd5b506101e66103e5366004612224565b6110af565b3480156103f657600080fd5b506067546102b6565b61022861040d366004611eaa565b611250565b34801561041e57600080fd5b506101e661042d366004611ec3565b611424565b34801561043e57600080fd5b506101e661044d36600461226f565b61146c565b61045a6115a8565b6001600160a01b038216158061047957506001600160a01b0382166001145b8061048c57506001600160a01b03821630145b156104a2576104a264475332303360d81b6115c2565b6001600160a01b0382811660009081526065602052604090205416156104d3576104d36411d4cc8c0d60da1b6115c2565b60656020527f4d5a9bd2e41301728d41c8e705190becb4e74abe869f75bdb405b63716a35f9e80546001600160a01b038481166000818152604081208054939094166001600160a01b031993841617909355600183528354909116179091556066805491610540836122c6565b90915550506040516001600160a01b038316907f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2690600090a2806067541461058b5761058b81610a80565b5050565b61059833610703565b6105bd5760405162461bcd60e51b81526004016105b4906122df565b60405180910390fd5b8060ca5481106105df5760405162461bcd60e51b81526004016105b490612302565b600082815260cc6020526040902060030154829060ff16156106135760405162461bcd60e51b81526004016105b49061232d565b600083815260cc6020908152604080832060cb83528184203385529092529091205460ff166106775760405162461bcd60e51b815260206004820152601060248201526f1d1e081b9bdd0818dbdb999a5c9b595960821b60448201526064016105b4565b60018160030160018282829054906101000a900460ff16610698919061235a565b825460ff9182166101009390930a928302919092021990911617905550600084815260cb60209081526040808320338085529252808320805460ff191690555186927ff0dca620e2e81f7841d07bcc105e1704fb01475b278a9d4c236e1c62945edd5591a350505050565b60006001600160a01b0382166001148061073557506001600160a01b0382811660009081526065602052604090205416155b1592915050565b600081815260cc6020526040812080546001820154600383015460028401805486956060958795869592946001600160a01b0390921693909260ff808216926101009092041690839061078e90612373565b80601f01602080910402602001604051908101604052809291908181526020018280546107ba90612373565b80156108075780601f106107dc57610100808354040283529160200191610807565b820191906000526020600020905b8154815290600101906020018083116107ea57829003601f168201915b50505050509250955095509550955095505091939590929450565b6001600160a01b037f00000000000000000000000061a9b3e1828c92bbe846996285f7dd6a4418d66016300361086a5760405162461bcd60e51b81526004016105b4906123ad565b7f00000000000000000000000061a9b3e1828c92bbe846996285f7dd6a4418d6606001600160a01b03166108b360008051602061270c833981519152546001600160a01b031690565b6001600160a01b0316146108d95760405162461bcd60e51b81526004016105b4906123f9565b6108e2816115e7565b604080516000808252602082019092526108fe9183919061160c565b50565b6001600160a01b037f00000000000000000000000061a9b3e1828c92bbe846996285f7dd6a4418d6601630036109495760405162461bcd60e51b81526004016105b4906123ad565b7f00000000000000000000000061a9b3e1828c92bbe846996285f7dd6a4418d6606001600160a01b031661099260008051602061270c833981519152546001600160a01b031690565b6001600160a01b0316146109b85760405162461bcd60e51b81526004016105b4906123f9565b6109c1826115e7565b61058b8282600161160c565b6000306001600160a01b037f00000000000000000000000061a9b3e1828c92bbe846996285f7dd6a4418d6601614610a6d5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016105b4565b5060008051602061270c83398151915290565b610a886115a8565b606654811115610aa357610aa364475332303160d81b6115c2565b80600003610abc57610abc6423a999181960d91b6115c2565b60678190556040518181527f610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c939060200160405180910390a150565b600054610100900460ff1615808015610b175750600054600160ff909116105b80610b315750303b158015610b31575060005460ff166001145b610b945760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105b4565b6000805460ff191660011790558015610bb7576000805461ff0019166101001790555b610bc688888888888888611777565b610bce611834565b8015610c14576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b60cc602052600090815260409020805460018201546002830180546001600160a01b03909316939192610c5090612373565b80601f0160208091040260200160405190810160405280929190818152602001828054610c7c90612373565b8015610cc95780601f10610c9e57610100808354040283529160200191610cc9565b820191906000526020600020905b815481529060010190602001808311610cac57829003601f168201915b5050506003909301549192505060ff8082169161010090041685565b6060600060665467ffffffffffffffff811115610d0457610d04611f7a565b604051908082528060200260200182016040528015610d2d578160200160208202803683370190505b506001600090815260656020527f4d5a9bd2e41301728d41c8e705190becb4e74abe869f75bdb405b63716a35f9e54919250906001600160a01b03165b6001600160a01b038116600114610dce5780838381518110610d8e57610d8e612445565b6001600160a01b03928316602091820292909201810191909152918116600090815260659092526040909120541681610dc6816122c6565b925050610d6a565b509092915050565b610ddf33610703565b610dfb5760405162461bcd60e51b81526004016105b4906122df565b6040805160a0810182526001600160a01b03858116825260208083018681528385018681526000606086018190526080860181905260ca54815260cc90935294909120835181546001600160a01b031916931692909217825551600182015591519091906002820190610e6e90826124a1565b5060608201516003909101805460809093015160ff166101000261ff00199215159290921661ffff199093169290921717905560ca546040516001600160a01b038516919033907fd5a05bf70715ad82a09a756320284a1b54c9ff74cd0f8cce6219e79b563fe59d90610ee49087908790612561565b60405180910390a460ca60008154610efb906122c6565b90915550505050565b610f0d33610703565b610f295760405162461bcd60e51b81526004016105b4906122df565b8160ca548110610f4b5760405162461bcd60e51b81526004016105b490612302565b600083815260cc6020526040902060030154839060ff1615610f7f5760405162461bcd60e51b81526004016105b49061232d565b600084815260cb60209081526040808320338452909152902054849060ff1615610fe25760405162461bcd60e51b81526020600482015260146024820152731d1e08185b1c9958591e4818dbdb999a5c9b595960621b60448201526064016105b4565b600085815260cc6020526040902060038101805460019190829061100f908290610100900460ff1661257a565b825460ff9182166101009390930a928302919092021990911617905550600086815260cb60209081526040808320338085529252808320805460ff191660011790555188927f5cbe105e36805f7820e291f799d5794ff948af2a5f664e580382defb6339004191a36067546003820154610100900460ff161080159061109757506001851515145b156110a7576110a586611250565b505b505050505050565b6110b76115a8565b6001600160a01b03811615806110d657506001600160a01b0381166001145b806110e957506001600160a01b03811630145b156110ff576110ff64475332303360d81b6115c2565b6001600160a01b038181166000908152606560205260409020541615611130576111306411d4cc8c0d60da1b6115c2565b6001600160a01b038216158061114f57506001600160a01b0382166001145b156111655761116564475332303360d81b6115c2565b6001600160a01b0383811660009081526065602052604090205481169083161461119a5761119a64475332303560d81b6115c2565b6001600160a01b03828116600081815260656020526040808220805486861680855283852080549288166001600160a01b03199384161790559589168452828420805482169096179095558383528054909416909355915190917ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf91a26040516001600160a01b038216907f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2690600090a2505050565b600061125b33610703565b6112775760405162461bcd60e51b81526004016105b4906122df565b8160ca5481106112995760405162461bcd60e51b81526004016105b490612302565b600083815260cc6020526040902060030154839060ff16156112cd5760405162461bcd60e51b81526004016105b49061232d565b600084815260cc602052604090206067546003820154610100900460ff1610156113395760405162461bcd60e51b815260206004820152601860248201527f636f6e6669726d6174696f6e203c207468726573686f6c64000000000000000060448201526064016105b4565b60038101805460ff191660019081179091558154908201546040516001600160a01b039092169161136e906002850190612593565b60006040518083038185875af1925050503d80600081146113ab576040519150601f19603f3d011682016040523d82523d6000602084013e6113b0565b606091505b505080945050836113ef5760405162461bcd60e51b81526020600482015260096024820152681d1e0819985a5b195960ba1b60448201526064016105b4565b604051859033907f5445f318f4f5fcfb66592e68e0cc5822aa15664039bd5f0ffde24c5a8142b1ac90600090a3505050919050565b61142c6115a8565b6114358161189f565b6040516001600160a01b038216907f5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b090600090a250565b6114746115a8565b8060016066546114849190612609565b101561149b5761149b64475332303160d81b6115c2565b6001600160a01b03821615806114ba57506001600160a01b0382166001145b156114d0576114d064475332303360d81b6115c2565b6001600160a01b038381166000908152606560205260409020548116908316146115055761150564475332303560d81b6115c2565b6001600160a01b03828116600081815260656020526040808220805488861684529183208054929095166001600160a01b031992831617909455918152825490911690915560668054916115588361261c565b90915550506040516001600160a01b038316907ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf90600090a280606754146115a3576115a381610a80565b505050565b3330146115c0576115c064475330333160d81b6115c2565b565b60405162461bcd60e51b81526020600482015260056024820152816044820152606481fd5b6115f033610703565b6108fe5760405162461bcd60e51b81526004016105b4906122df565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561163f576115a3836118e4565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611699575060408051601f3d908101601f1916820190925261169691810190612633565b60015b6116fc5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016105b4565b60008051602061270c833981519152811461176b5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016105b4565b506115a3838383611980565b6117b58787808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508992506119ab915050565b6001600160a01b038416156117cd576117cd8461189f565b81156117e4576117e282600060018685611b37565b505b336001600160a01b03167f5629c09440a0b5bcd29c72c5d739eaca6f7686d63d9639d601e0f1642baa168388888888604051611823949392919061264c565b60405180910390a250505050505050565b600054610100900460ff166115c05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016105b4565b306001600160a01b038216036118c0576118c064047533430360dc1b6115c2565b7f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d555565b6001600160a01b0381163b6119515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016105b4565b60008051602061270c83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61198983611c39565b6000825111806119965750805b156115a3576119a58383611c79565b50505050565b606754156119c4576119c464047533230360dc1b6115c2565b81518111156119de576119de64475332303160d81b6115c2565b806000036119f7576119f76423a999181960d91b6115c2565b600160005b8351811015611b04576000848281518110611a1957611a19612445565b6020026020010151905060006001600160a01b0316816001600160a01b03161480611a4d57506001600160a01b0381166001145b80611a6057506001600160a01b03811630145b80611a7c5750806001600160a01b0316836001600160a01b0316145b15611a9257611a9264475332303360d81b6115c2565b6001600160a01b038181166000908152606560205260409020541615611ac357611ac36411d4cc8c0d60da1b6115c2565b6001600160a01b03928316600090815260656020526040902080546001600160a01b0319169382169390931790925580611afc816122c6565b9150506119fc565b506001600160a01b0316600090815260656020526040902080546001600160a01b03191660011790559051606655606755565b6000806001600160a01b03831615611b4f5782611b51565b325b90506001600160a01b038416611bf8573a8510611b6e573a611b70565b845b611b7a87896126b2565b611b8491906126c5565b91506000816001600160a01b03168360405160006040518083038185875af1925050503d8060008114611bd3576040519150601f19603f3d011682016040523d82523d6000602084013e611bd8565b606091505b5050905080611bf257611bf264475330313160d81b6115c2565b50611c2f565b84611c0387896126b2565b611c0d91906126c5565b9150611c1a848284611ca7565b611c2f57611c2f6423a998189960d91b6115c2565b5095945050505050565b611c42816118e4565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060611c9e838360405180606001604052806027815260200161272c60279139611d36565b90505b92915050565b604080516001600160a01b03841660248201526044808201849052825180830390910181526064909101909152602080820180516001600160e01b031663a9059cbb60e01b1781528251600093929184919082896127105a03f13d8015611d195760208114611d215760009350611d2c565b819350611d2c565b600051158215171593505b5050509392505050565b6060600080856001600160a01b031685604051611d5391906126dc565b600060405180830381855af49150503d8060008114611d8e576040519150601f19603f3d011682016040523d82523d6000602084013e611d93565b606091505b5091509150611da486838387611dae565b9695505050505050565b60608315611e1d578251600003611e16576001600160a01b0385163b611e165760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105b4565b5081611e27565b611e278383611e2f565b949350505050565b815115611e3f5781518083602001fd5b8060405162461bcd60e51b81526004016105b491906126f8565b6001600160a01b03811681146108fe57600080fd5b8035611e7981611e59565b919050565b60008060408385031215611e9157600080fd5b8235611e9c81611e59565b946020939093013593505050565b600060208284031215611ebc57600080fd5b5035919050565b600060208284031215611ed557600080fd5b8135611ee081611e59565b9392505050565b60005b83811015611f02578181015183820152602001611eea565b50506000910152565b60008151808452611f23816020860160208601611ee7565b601f01601f19169290920160200192915050565b60018060a01b038616815284602082015260a060408201526000611f5e60a0830186611f0b565b93151560608301525060ff919091166080909101529392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112611fa157600080fd5b813567ffffffffffffffff80821115611fbc57611fbc611f7a565b604051601f8301601f19908116603f01168101908282118183101715611fe457611fe4611f7a565b81604052838152866020858801011115611ffd57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561203057600080fd5b823561203b81611e59565b9150602083013567ffffffffffffffff81111561205757600080fd5b61206385828601611f90565b9150509250929050565b6000806040838503121561208057600080fd5b82359150602083013561209281611e59565b809150509250929050565b600080600080600080600060c0888a0312156120b857600080fd5b873567ffffffffffffffff808211156120d057600080fd5b818a0191508a601f8301126120e457600080fd5b8135818111156120f357600080fd5b8b60208260051b850101111561210857600080fd5b60209283019950975050880135945061212360408901611e6e565b935061213160608901611e6e565b92506080880135915061214660a08901611e6e565b905092959891949750929550565b6020808252825182820181905260009190848201906040850190845b818110156121955783516001600160a01b031683529284019291840191600101612170565b50909695505050505050565b6000806000606084860312156121b657600080fd5b83356121c181611e59565b925060208401359150604084013567ffffffffffffffff8111156121e457600080fd5b6121f086828701611f90565b9150509250925092565b6000806040838503121561220d57600080fd5b823591506020830135801515811461209257600080fd5b60008060006060848603121561223957600080fd5b833561224481611e59565b9250602084013561225481611e59565b9150604084013561226481611e59565b809150509250925092565b60008060006060848603121561228457600080fd5b833561228f81611e59565b9250602084013561229f81611e59565b929592945050506040919091013590565b634e487b7160e01b600052601160045260246000fd5b6000600182016122d8576122d86122b0565b5060010190565b6020808252600990820152683737ba1037bbb732b960b91b604082015260600190565b6020808252601190820152701d1e08191bd95cc81b9bdd08195e1a5cdd607a1b604082015260600190565b6020808252601390820152721d1e08185b1c9958591e48195e1958dd5d1959606a1b604082015260600190565b60ff8281168282160390811115611ca157611ca16122b0565b600181811c9082168061238757607f821691505b6020821081036123a757634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b601f8211156115a357600081815260208120601f850160051c810160208610156124825750805b601f850160051c820191505b818110156110a75782815560010161248e565b815167ffffffffffffffff8111156124bb576124bb611f7a565b6124cf816124c98454612373565b8461245b565b602080601f83116001811461250457600084156124ec5750858301515b600019600386901b1c1916600185901b1785556110a7565b600085815260208120601f198616915b8281101561253357888601518255948401946001909101908401612514565b50858210156125515787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b828152604060208201526000611e276040830184611f0b565b60ff8181168382160190811115611ca157611ca16122b0565b60008083546125a181612373565b600182811680156125b957600181146125ce576125fd565b60ff19841687528215158302870194506125fd565b8760005260208060002060005b858110156125f45781548a8201529084019082016125db565b50505082870194505b50929695505050505050565b81810381811115611ca157611ca16122b0565b60008161262b5761262b6122b0565b506000190190565b60006020828403121561264557600080fd5b5051919050565b6060808252810184905260008560808301825b8781101561268f57823561267281611e59565b6001600160a01b031682526020928301929091019060010161265f565b50602084019590955250506001600160a01b039190911660409091015292915050565b80820180821115611ca157611ca16122b0565b8082028115828204841417611ca157611ca16122b0565b600082516126ee818460208701611ee7565b9190910192915050565b602081526000611c9e6020830184611f0b56fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220f8d2ca9d54faebea5d90e3cc8a7f20c54acbcd8eab3ff5064cb14bdcd62c9fc064736f6c63430008120033