Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 7832759 | 154 days ago | IN | 0 ETH | 0.00000234 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
CommunityV3
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; import './CommunityV2.sol'; using SafeERC20 for IERC20; /// @custom:oz-upgrades-from CommunityV2 contract CommunityV3 is CommunityV2 {}
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; import './Community.sol'; using SafeERC20 for IERC20; /// @custom:oz-upgrades-from Community contract CommunityV2 is Community { function claimYield2( address asset, address recipient, address con, uint256 amount ) external onlyOwner nonReentrant { (uint256 recipientPart, uint256 treasuryPart) = _distributeYield2(asset, recipient, con, amount); emit ClaimYield(recipient, asset, recipientPart, treasuryPart); } function _distributeYield2( address asset, address recipient, address con, uint256 amount ) private returns (uint256, uint256) { require(recipient != address(0), 'invalid recipient'); uint256 treasuryPart = 0; uint256 recipientPart = 0; if (asset == address(0)) { uint256 claimed = BLAST.claimAllYield(address(this), address(this)); treasuryPart = (claimed * _treasuryRateBps) / 10_000; recipientPart = claimed - treasuryPart; (bool success1, ) = payable(recipient).call{ value: recipientPart }(''); require(success1, 'recipient: failed to send ether'); if (treasuryPart > 0) { (bool success2, ) = payable(_treasury).call{ value: treasuryPart }(''); require(success2, 'treasury: failed to send ether'); } } else if (asset == address(USDBR) || asset == address(WETH)) { uint256 claimed = 0; if (asset == address(USDBR)) { // claimed = USDBR.getClaimableAmount(address(this)); USDBR.claim(con, amount); } else { // claimed = WETH.getClaimableAmount(address(this)); WETH.claim(con, amount); } treasuryPart = (claimed * _treasuryRateBps) / 10_000; recipientPart = claimed - treasuryPart; IERC20(asset).safeTransfer(recipient, recipientPart); if (treasuryPart > 0) { IERC20(asset).safeTransfer(_treasury, treasuryPart); } } else { revert('invalid asset'); } return (recipientPart, treasuryPart); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol'; import '@openzeppelin/contracts/interfaces/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import './interfaces/IBlast.sol'; import './interfaces/IERC20Rebasing.sol'; using SafeERC20 for IERC20; contract Community is Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable { event Deposit(address indexed account, address indexed asset, uint256 amount, uint256 fee); event Withdraw(address indexed account, address indexed asset, uint256 amount); event ClaimYield( address indexed recipient, address indexed asset, uint256 recipientPart, uint256 treasuryPart ); event ClaimFee( address indexed recipient, address indexed asset, uint256 recipientPart, uint256 treasuryPart ); IBlast public constant BLAST = IBlast(0x4300000000000000000000000000000000000002); // IERC20Rebasing public constant USDBR = IERC20Rebasing(0x4300000000000000000000000000000000000003); IERC20Rebasing public constant USDBR = IERC20Rebasing(0x4200000000000000000000000000000000000022); // testnet // IERC20Rebasing public constant WETH = IERC20Rebasing(0x4300000000000000000000000000000000000004); IERC20Rebasing public constant WETH = IERC20Rebasing(0x4200000000000000000000000000000000000023); // testnet address public _factory; uint256 public _feeRateBps; address public _treasury; uint256 public _treasuryRateBps; mapping(address => uint256) public _lots; // _lots[asset] mapping(address => mapping(address => uint256)) public _balances; // _balances[asset][account] mapping(address => uint256) public _fees; // _fees[asset] /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize( address factory, address owner_, uint256 feeRateBps, address treasury, uint256 treasuryRateBps, address[] memory tokens, uint256[] memory lots ) external initializer { require(tokens.length == lots.length, 'invalid tokens'); require(owner_ != address(0), 'invalid owner'); require(factory != address(0), 'invalid factory'); require(treasury != address(0), 'invalid treasury'); require(treasuryRateBps <= 5_000, 'invalid treasuryRateBps'); require(feeRateBps <= 5_000, 'invalid feeRateBps'); __Ownable_init(owner_); __Context_init(); __ReentrancyGuard_init(); _factory = factory; _feeRateBps = feeRateBps; _treasury = treasury; _treasuryRateBps = treasuryRateBps; BLAST.configureClaimableYield(); USDBR.configure(YieldMode.CLAIMABLE); WETH.configure(YieldMode.CLAIMABLE); for (uint i = 0; i < tokens.length; i++) { uint256 lot = lots[i]; require(lot > 0, 'invalid lot amount'); _lots[tokens[i]] = lot; } } function updateSettings(uint256 feeRateBps, address treasury, uint256 treasuryRateBps) external { require(_msgSender() == _factory, 'not the factory'); require(treasury != address(0), 'invalid treasury'); require(treasuryRateBps <= 5_000, 'invalid treasuryRateBps'); require(feeRateBps <= 5_000, 'invalid feeRateBps'); _feeRateBps = feeRateBps; _treasury = treasury; _treasuryRateBps = treasuryRateBps; } function setLot(address asset, uint256 lot) external onlyOwner { _lots[asset] = lot; } function yield() external view returns (uint256, uint256, uint256) { return ( BLAST.readClaimableYield(address(this)), WETH.getClaimableAmount(address(this)), USDBR.getClaimableAmount(address(this)) ); } function claimYield(address asset, address recipient) external onlyOwner nonReentrant { (uint256 recipientPart, uint256 treasuryPart) = _distributeYield(asset, recipient); emit ClaimYield(recipient, asset, recipientPart, treasuryPart); } function claimFee(address asset, address recipient) external onlyOwner nonReentrant { (uint256 recipientPart, uint256 treasuryPart) = _distributeFee(asset, recipient); emit ClaimFee(recipient, asset, recipientPart, treasuryPart); } function deposit(address asset, uint256 amount) external payable nonReentrant { uint256 lot = _lots[asset]; require(lot > 0, 'not supported asset'); require(amount > 0, 'invalid amount'); require(amount >= lot, 'invalid lot amount'); if (asset == address(0)) { require(msg.value == amount, 'conflicted amount'); } else { require(msg.value == 0, 'unexpected amount'); uint256 balanceBefore = IERC20(asset).balanceOf(_msgSender()); require(balanceBefore >= amount, 'not enough balance'); uint256 contractBalanceBefore = IERC20(asset).balanceOf(address(this)); IERC20(asset).safeTransferFrom(_msgSender(), address(this), amount); uint256 contractBalanceAfter = IERC20(asset).balanceOf(address(this)); uint256 balanceAfter = IERC20(asset).balanceOf(_msgSender()); require(contractBalanceAfter == contractBalanceBefore + amount, 'invalid contract balance after'); require(balanceAfter == balanceBefore - amount, 'invalid balance after'); } uint256 fee = (amount * _feeRateBps) / 10_000; uint256 newAmount = amount - fee; _balances[asset][_msgSender()] += newAmount; _fees[asset] += fee; emit Deposit(_msgSender(), asset, newAmount, fee); } function withdraw(address asset, uint256 amount) external nonReentrant { uint256 balance = _balances[asset][_msgSender()]; require(amount > 0, 'invalid amount'); require(balance >= amount, 'not enough balance'); _balances[asset][_msgSender()] = balance - amount; if (asset == address(0)) { (bool success, ) = payable(_msgSender()).call{ value: amount }(''); require(success, 'failed to send ether'); } else { IERC20(asset).safeTransfer(_msgSender(), amount); } emit Withdraw(_msgSender(), asset, amount); } function _distributeYield(address asset, address recipient) private returns (uint256, uint256) { require(recipient != address(0), 'invalid recipient'); uint256 treasuryPart = 0; uint256 recipientPart = 0; if (asset == address(0)) { uint256 claimed = BLAST.claimAllYield(address(this), address(this)); treasuryPart = (claimed * _treasuryRateBps) / 10_000; recipientPart = claimed - treasuryPart; (bool success1, ) = payable(recipient).call{ value: recipientPart }(''); require(success1, 'recipient: failed to send ether'); if (treasuryPart > 0) { (bool success2, ) = payable(_treasury).call{ value: treasuryPart }(''); require(success2, 'treasury: failed to send ether'); } } else if (asset == address(USDBR) || asset == address(WETH)) { uint256 claimed = 0; if (asset == address(USDBR)) { claimed = USDBR.getClaimableAmount(address(this)); USDBR.claim(address(this), claimed); } else { claimed = WETH.getClaimableAmount(address(this)); WETH.claim(address(this), claimed); } treasuryPart = (claimed * _treasuryRateBps) / 10_000; recipientPart = claimed - treasuryPart; IERC20(asset).safeTransfer(recipient, recipientPart); if (treasuryPart > 0) { IERC20(asset).safeTransfer(_treasury, treasuryPart); } } else { revert('invalid asset'); } return (recipientPart, treasuryPart); } function _distributeFee(address asset, address recipient) private returns (uint256, uint256) { require(recipient != address(0), 'invalid recipient'); uint256 amount = _fees[asset]; require(amount > 0, 'invalid amount'); _fees[asset] = 0; uint256 treasuryPart = (amount * _treasuryRateBps) / 10_000; uint256 recipientPart = amount - treasuryPart; if (asset == address(0)) { (bool success1, ) = payable(recipient).call{ value: recipientPart }(''); require(success1, 'recipient: failed to send ether'); if (treasuryPart > 0) { (bool success2, ) = payable(_treasury).call{ value: treasuryPart }(''); require(success2, 'treasury: failed to send ether'); } } else { IERC20(asset).safeTransfer(recipient, recipientPart); if (treasuryPart > 0) { IERC20(asset).safeTransfer(_treasury, treasuryPart); } } return (recipientPart, treasuryPart); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.Ownable struct OwnableStorage { address _owner; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300; function _getOwnableStorage() private pure returns (OwnableStorage storage $) { assembly { $.slot := OwnableStorageLocation } } /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ function __Ownable_init(address initialOwner) internal onlyInitializing { __Ownable_init_unchained(initialOwner); } function __Ownable_init_unchained(address initialOwner) internal onlyInitializing { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { OwnableStorage storage $ = _getOwnableStorage(); return $._owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { OwnableStorage storage $ = _getOwnableStorage(); address oldOwner = $._owner; $._owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard struct ReentrancyGuardStorage { uint256 _status; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00; function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) { assembly { $.slot := ReentrancyGuardStorageLocation } } /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); $._status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // On the first call to nonReentrant, _status will be NOT_ENTERED if ($._status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail $._status = ENTERED; } function _nonReentrantAfter() private { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) $._status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); return $._status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC20Permit} from "../extensions/IERC20Permit.sol"; import {Address} from "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev An operation with an ERC20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data); if (returndata.length != 0 && !abi.decode(returndata, (bool))) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; interface IBlast { function configureClaimableYield() external; function configureClaimableGas() external; function claimAllGas(address contractAddress, address recipient) external returns (uint256); function claimYield( address contractAddress, address recipientOfYield, uint256 amount ) external returns (uint256); function claimAllYield(address contractAddress, address recipientOfYield) external returns (uint256); function readClaimableYield(address contractAddress) external view returns (uint256); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; import './Types.sol'; interface IERC20Rebasing { function configure(YieldMode) external returns (uint256); function claim(address recipient, uint256 amount) external returns (uint256); function getClaimableAmount(address account) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @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 Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 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 in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._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 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._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() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @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 { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) 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 FailedInnerCall(); } } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; enum YieldMode { AUTOMATIC, VOID, CLAIMABLE } enum GasMode { VOID, CLAIMABLE }
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "hardhat/=lib/openzeppelin-foundry-upgrades/node_modules/hardhat/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/", "solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "viaIR": false, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"recipientPart","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"treasuryPart","type":"uint256"}],"name":"ClaimFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"recipientPart","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"treasuryPart","type":"uint256"}],"name":"ClaimYield","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"BLAST","outputs":[{"internalType":"contract IBlast","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDBR","outputs":[{"internalType":"contract IERC20Rebasing","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IERC20Rebasing","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"_balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_feeRateBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_fees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_lots","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_treasuryRateBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"recipient","type":"address"}],"name":"claimFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"recipient","type":"address"}],"name":"claimYield","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"con","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claimYield2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"internalType":"address","name":"owner_","type":"address"},{"internalType":"uint256","name":"feeRateBps","type":"uint256"},{"internalType":"address","name":"treasury","type":"address"},{"internalType":"uint256","name":"treasuryRateBps","type":"uint256"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"lots","type":"uint256[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"lot","type":"uint256"}],"name":"setLot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"feeRateBps","type":"uint256"},{"internalType":"address","name":"treasury","type":"address"},{"internalType":"uint256","name":"treasuryRateBps","type":"uint256"}],"name":"updateSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yield","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801562000010575f80fd5b506200001b62000021565b620000d5565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000725760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620000d25780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6126ef80620000e35f395ff3fe608060405260043610610131575f3560e01c806397d75776116100a8578063dea67dc11161006d578063dea67dc114610370578063e21d072314610385578063e319a3d9146103bb578063ec903068146103da578063f2fde38b146103ef578063f3fef3a31461040e575f80fd5b806397d75776146102d4578063a53da0a0146102ee578063a8ac93f51461030d578063ad5c464814610338578063c5cc6b6a14610352575f80fd5b80636cac65fb116100f95780636cac65fb146101db578063706b233a146101fa578063715018a6146102195780637f4512591461022d578063899c27411461025f5780638da5cb5b14610298575f80fd5b80630de3cd08146101355780631809fcbc146101565780632859398414610175578063304a114c146101a957806347e7ef24146101c8575b5f80fd5b348015610140575f80fd5b5061015461014f3660046122e2565b61042d565b005b348015610161575f80fd5b506101546101703660046123e0565b61090e565b348015610180575f80fd5b506101896109a4565b604080519384526020840192909252908201526060015b60405180910390f35b3480156101b4575f80fd5b506101546101c3366004612428565b610ae1565b6101546101d6366004612428565b610b04565b3480156101e6575f80fd5b506101546101f5366004612450565b611024565b348015610205575f80fd5b50610154610214366004612481565b6110b2565b348015610224575f80fd5b5061015461120d565b348015610238575f80fd5b506102476022602160991b0181565b6040516001600160a01b0390911681526020016101a0565b34801561026a575f80fd5b5061028a6102793660046124b3565b60046020525f908152604090205481565b6040519081526020016101a0565b3480156102a3575f80fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610247565b3480156102df575f80fd5b506102476002604360981b0181565b3480156102f9575f80fd5b50610154610308366004612450565b611220565b348015610318575f80fd5b5061028a6103273660046124b3565b60066020525f908152604090205481565b348015610343575f80fd5b506102476023602160991b0181565b34801561035d575f80fd5b505f54610247906001600160a01b031681565b34801561037b575f80fd5b5061028a60015481565b348015610390575f80fd5b5061028a61039f366004612450565b600560209081525f928352604080842090915290825290205481565b3480156103c6575f80fd5b50600254610247906001600160a01b031681565b3480156103e5575f80fd5b5061028a60035481565b3480156103fa575f80fd5b506101546104093660046124b3565b61128e565b348015610419575f80fd5b50610154610428366004612428565b6112cb565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff165f811580156104725750825b90505f8267ffffffffffffffff16600114801561048e5750303b155b90508115801561049c575080155b156104ba5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156104e457845460ff60401b1916600160401b1785555b855187511461052b5760405162461bcd60e51b815260206004820152600e60248201526d696e76616c696420746f6b656e7360901b60448201526064015b60405180910390fd5b6001600160a01b038b166105715760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b21037bbb732b960991b6044820152606401610522565b6001600160a01b038c166105b95760405162461bcd60e51b815260206004820152600f60248201526e696e76616c696420666163746f727960881b6044820152606401610522565b6001600160a01b0389166106025760405162461bcd60e51b815260206004820152601060248201526f696e76616c696420747265617375727960801b6044820152606401610522565b61138888111561064e5760405162461bcd60e51b8152602060048201526017602482015276696e76616c69642074726561737572795261746542707360481b6044820152606401610522565b6113888a11156106955760405162461bcd60e51b8152602060048201526012602482015271696e76616c6964206665655261746542707360701b6044820152606401610522565b61069e8b611489565b6106a661149a565b6106ae6114a2565b5f80546001600160a01b03808f166001600160a01b031992831617835560018d905560028054918d169190921617905560038990556040805163784c3b3d60e11b815290516002604360981b019263f098767a926004808201939182900301818387803b15801561071d575f80fd5b505af115801561072f573d5f803e3d5ffd5b5050604051631a33757d60e01b81526022602160991b019250631a33757d915061075e906002906004016124cc565b6020604051808303815f875af115801561077a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061079e91906124f2565b50604051631a33757d60e01b81526023602160991b0190631a33757d906107ca906002906004016124cc565b6020604051808303815f875af11580156107e6573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061080a91906124f2565b505f5b87518110156108b9575f87828151811061082957610829612509565b602002602001015190505f81116108775760405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a59081b1bdd08185b5bdd5b9d60721b6044820152606401610522565b8060045f8b858151811061088d5761088d612509565b6020908102919091018101516001600160a01b031682528101919091526040015f20555060010161080d565b50831561090057845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050505050565b6109166114b2565b61091e61150d565b5f8061092c86868686611544565b91509150856001600160a01b0316856001600160a01b03167f8bc3a9723e5a1f1c9fad43c632554367016acdc2d20ed712b4117f86e368aad5848460405161097e929190918252602082015260400190565b60405180910390a3505061099e60015f8051602061269a83398151915255565b50505050565b604051631d864f1d60e31b81523060048201525f90819081906002604360981b019063ec3278e890602401602060405180830381865afa1580156109ea573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a0e91906124f2565b60405163e12f3a6160e01b81523060048201526023602160991b019063e12f3a6190602401602060405180830381865afa158015610a4e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a7291906124f2565b60405163e12f3a6160e01b81523060048201526022602160991b019063e12f3a6190602401602060405180830381865afa158015610ab2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ad691906124f2565b925092509250909192565b610ae96114b2565b6001600160a01b039091165f90815260046020526040902055565b610b0c61150d565b6001600160a01b0382165f9081526004602052604090205480610b675760405162461bcd60e51b81526020600482015260136024820152721b9bdd081cdd5c1c1bdc9d195908185cdcd95d606a1b6044820152606401610522565b5f8211610b865760405162461bcd60e51b81526004016105229061251d565b80821015610bcb5760405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a59081b1bdd08185b5bdd5b9d60721b6044820152606401610522565b6001600160a01b038316610c2157813414610c1c5760405162461bcd60e51b815260206004820152601160248201527018dbdb999b1a58dd195908185b5bdd5b9d607a1b6044820152606401610522565b610f30565b3415610c635760405162461bcd60e51b81526020600482015260116024820152701d5b995e1c1958dd195908185b5bdd5b9d607a1b6044820152606401610522565b5f6001600160a01b0384166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610cb6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cda91906124f2565b905082811015610d215760405162461bcd60e51b81526020600482015260126024820152716e6f7420656e6f7567682062616c616e636560701b6044820152606401610522565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa158015610d65573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d8991906124f2565b9050610da06001600160a01b0386163330876118fa565b6040516370a0823160e01b81523060048201525f906001600160a01b038716906370a0823190602401602060405180830381865afa158015610de4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e0891906124f2565b90505f6001600160a01b0387166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610e5d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e8191906124f2565b9050610e8d8684612559565b8214610edb5760405162461bcd60e51b815260206004820152601e60248201527f696e76616c696420636f6e74726163742062616c616e636520616674657200006044820152606401610522565b610ee5868561256c565b8114610f2b5760405162461bcd60e51b815260206004820152601560248201527434b73b30b634b2103130b630b731b29030b33a32b960591b6044820152606401610522565b505050505b5f61271060015484610f42919061257f565b610f4c9190612596565b90505f610f59828561256c565b6001600160a01b0386165f908152600560209081526040808320338452909152812080549293508392909190610f90908490612559565b90915550506001600160a01b0385165f9081526006602052604081208054849290610fbc908490612559565b909155505060408051828152602081018490526001600160a01b0387169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a350505061102060015f8051602061269a83398151915255565b5050565b61102c6114b2565b61103461150d565b5f806110408484611961565b91509150836001600160a01b0316836001600160a01b03167fa5a56e24e8cbe4c43434b9fd1d71f3567e9897e6b194f6d0d2e0d638bc9aa05a8484604051611092929190918252602082015260400190565b60405180910390a3505061102060015f8051602061269a83398151915255565b5f546001600160a01b0316336001600160a01b0316146111065760405162461bcd60e51b815260206004820152600f60248201526e6e6f742074686520666163746f727960881b6044820152606401610522565b6001600160a01b03821661114f5760405162461bcd60e51b815260206004820152601060248201526f696e76616c696420747265617375727960801b6044820152606401610522565b61138881111561119b5760405162461bcd60e51b8152602060048201526017602482015276696e76616c69642074726561737572795261746542707360481b6044820152606401610522565b6113888311156111e25760405162461bcd60e51b8152602060048201526012602482015271696e76616c6964206665655261746542707360701b6044820152606401610522565b600192909255600280546001600160a01b0319166001600160a01b0392909216919091179055600355565b6112156114b2565b61121e5f611b3c565b565b6112286114b2565b61123061150d565b5f8061123c8484611bac565b91509150836001600160a01b0316836001600160a01b03167f8bc3a9723e5a1f1c9fad43c632554367016acdc2d20ed712b4117f86e368aad58484604051611092929190918252602082015260400190565b6112966114b2565b6001600160a01b0381166112bf57604051631e4fbdf760e01b81525f6004820152602401610522565b6112c881611b3c565b50565b6112d361150d565b6001600160a01b0382165f908152600560209081526040808320338452909152902054816113135760405162461bcd60e51b81526004016105229061251d565b818110156113585760405162461bcd60e51b81526020600482015260126024820152716e6f7420656e6f7567682062616c616e636560701b6044820152606401610522565b611362828261256c565b6001600160a01b0384165f81815260056020908152604080832033845290915290209190915561141e576040515f90339084908381818185875af1925050503d805f81146113cb576040519150601f19603f3d011682016040523d82523d5f602084013e6113d0565b606091505b50509050806114185760405162461bcd60e51b81526020600482015260146024820152733330b4b632b2103a379039b2b7321032ba3432b960611b6044820152606401610522565b50611432565b6114326001600160a01b0384163384611fcd565b6040518281526001600160a01b0384169033907f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9060200160405180910390a35061102060015f8051602061269a83398151915255565b611491612003565b6112c88161204c565b61121e612003565b6114aa612003565b61121e612054565b336114e47f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b03161461121e5760405163118cdaa760e01b8152336004820152602401610522565b5f8051602061269a83398151915280546001190161153e57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f806001600160a01b03851661156c5760405162461bcd60e51b8152600401610522906125b5565b5f806001600160a01b0388166117035760405163430021db60e11b8152306004820181905260248201525f906002604360981b019063860043b6906044016020604051808303815f875af11580156115c6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115ea91906124f2565b9050612710600354826115fd919061257f565b6116079190612596565b9250611613838261256c565b91505f886001600160a01b0316836040515f6040518083038185875af1925050503d805f811461165e576040519150601f19603f3d011682016040523d82523d5f602084013e611663565b606091505b50509050806116845760405162461bcd60e51b8152600401610522906125e0565b83156116fc576002546040515f916001600160a01b03169086908381818185875af1925050503d805f81146116d4576040519150601f19603f3d011682016040523d82523d5f602084013e6116d9565b606091505b50509050806116fa5760405162461bcd60e51b815260040161052290612617565b505b50506118db565b6001600160a01b0388166022602160991b01148061173057506001600160a01b0388166023602160991b01145b156118a3575f6021602160991b01196001600160a01b038a16016117c957604051635569f64b60e11b81526001600160a01b0388166004820152602481018790526022602160991b019063aad3ec96906044016020604051808303815f875af115801561179f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117c391906124f2565b50611840565b604051635569f64b60e11b81526001600160a01b0388166004820152602481018790526023602160991b019063aad3ec96906044016020604051808303815f875af115801561181a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061183e91906124f2565b505b61271060035482611851919061257f565b61185b9190612596565b9250611867838261256c565b915061187d6001600160a01b038a168984611fcd565b821561189d5760025461189d906001600160a01b038b8116911685611fcd565b506118db565b60405162461bcd60e51b815260206004820152600d60248201526c1a5b9d985b1a5908185cdcd95d609a1b6044820152606401610522565b97909650945050505050565b60015f8051602061269a83398151915255565b6040516001600160a01b03848116602483015283811660448301526064820183905261099e9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061205c565b5f806001600160a01b0383166119895760405162461bcd60e51b8152600401610522906125b5565b6001600160a01b0384165f90815260066020526040902054806119be5760405162461bcd60e51b81526004016105229061251d565b6001600160a01b0385165f908152600660205260408120819055600354612710906119e9908461257f565b6119f39190612596565b90505f611a00828461256c565b90506001600160a01b038716611afd575f866001600160a01b0316826040515f6040518083038185875af1925050503d805f8114611a59576040519150601f19603f3d011682016040523d82523d5f602084013e611a5e565b606091505b5050905080611a7f5760405162461bcd60e51b8152600401610522906125e0565b8215611af7576002546040515f916001600160a01b03169085908381818185875af1925050503d805f8114611acf576040519150601f19603f3d011682016040523d82523d5f602084013e611ad4565b606091505b5050905080611af55760405162461bcd60e51b815260040161052290612617565b505b50611b31565b611b116001600160a01b0388168783611fcd565b8115611b3157600254611b31906001600160a01b03898116911684611fcd565b969095509350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b5f806001600160a01b038316611bd45760405162461bcd60e51b8152600401610522906125b5565b5f806001600160a01b038616611d6b5760405163430021db60e11b8152306004820181905260248201525f906002604360981b019063860043b6906044016020604051808303815f875af1158015611c2e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c5291906124f2565b905061271060035482611c65919061257f565b611c6f9190612596565b9250611c7b838261256c565b91505f866001600160a01b0316836040515f6040518083038185875af1925050503d805f8114611cc6576040519150601f19603f3d011682016040523d82523d5f602084013e611ccb565b606091505b5050905080611cec5760405162461bcd60e51b8152600401610522906125e0565b8315611d64576002546040515f916001600160a01b03169086908381818185875af1925050503d805f8114611d3c576040519150601f19603f3d011682016040523d82523d5f602084013e611d41565b606091505b5050905080611d625760405162461bcd60e51b815260040161052290612617565b505b5050611fc3565b6001600160a01b0386166022602160991b011480611d9857506001600160a01b0386166023602160991b01145b156118a3575f6021602160991b01196001600160a01b03881601611e8f5760405163e12f3a6160e01b81523060048201526022602160991b019063e12f3a6190602401602060405180830381865afa158015611df6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e1a91906124f2565b604051635569f64b60e11b8152306004820152602481018290529091506022602160991b019063aad3ec96906044016020604051808303815f875af1158015611e65573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e8991906124f2565b50611f64565b60405163e12f3a6160e01b81523060048201526023602160991b019063e12f3a6190602401602060405180830381865afa158015611ecf573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ef391906124f2565b604051635569f64b60e11b8152306004820152602481018290529091506023602160991b019063aad3ec96906044016020604051808303815f875af1158015611f3e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f6291906124f2565b505b61271060035482611f75919061257f565b611f7f9190612596565b9250611f8b838261256c565b9150611fa16001600160a01b0388168784611fcd565b8215611fc157600254611fc1906001600160a01b03898116911685611fcd565b505b9590945092505050565b6040516001600160a01b03838116602483015260448201839052611ffe91859182169063a9059cbb9060640161192f565b505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661121e57604051631afcd79f60e31b815260040160405180910390fd5b611296612003565b6118e7612003565b5f6120706001600160a01b038416836120bd565b905080515f14158015612094575080806020019051810190612092919061264e565b155b15611ffe57604051635274afe760e01b81526001600160a01b0384166004820152602401610522565b60606120ca83835f6120d3565b90505b92915050565b6060814710156120f85760405163cd78605960e01b8152306004820152602401610522565b5f80856001600160a01b03168486604051612113919061266d565b5f6040518083038185875af1925050503d805f811461214d576040519150601f19603f3d011682016040523d82523d5f602084013e612152565b606091505b509150915061216286838361216e565b925050505b9392505050565b6060826121835761217e826121ca565b612167565b815115801561219a57506001600160a01b0384163b155b156121c357604051639996b31560e01b81526001600160a01b0385166004820152602401610522565b5080612167565b8051156121da5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114612209575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561224b5761224b61220e565b604052919050565b5f67ffffffffffffffff82111561226c5761226c61220e565b5060051b60200190565b5f82601f830112612285575f80fd5b8135602061229a61229583612253565b612222565b8083825260208201915060208460051b8701019350868411156122bb575f80fd5b602086015b848110156122d757803583529183019183016122c0565b509695505050505050565b5f805f805f805f60e0888a0312156122f8575f80fd5b612301886121f3565b96506020612310818a016121f3565b96506040890135955061232560608a016121f3565b94506080890135935060a089013567ffffffffffffffff80821115612348575f80fd5b818b0191508b601f83011261235b575f80fd5b813561236961229582612253565b81815260059190911b8301840190848101908e831115612387575f80fd5b938501935b828510156123ac5761239d856121f3565b8252938501939085019061238c565b9650505060c08b01359250808311156123c3575f80fd5b50506123d18a828b01612276565b91505092959891949750929550565b5f805f80608085870312156123f3575f80fd5b6123fc856121f3565b935061240a602086016121f3565b9250612418604086016121f3565b9396929550929360600135925050565b5f8060408385031215612439575f80fd5b612442836121f3565b946020939093013593505050565b5f8060408385031215612461575f80fd5b61246a836121f3565b9150612478602084016121f3565b90509250929050565b5f805f60608486031215612493575f80fd5b833592506124a3602085016121f3565b9150604084013590509250925092565b5f602082840312156124c3575f80fd5b6120ca826121f3565b60208101600383106124ec57634e487b7160e01b5f52602160045260245ffd5b91905290565b5f60208284031215612502575f80fd5b5051919050565b634e487b7160e01b5f52603260045260245ffd5b6020808252600e908201526d1a5b9d985b1a5908185b5bdd5b9d60921b604082015260600190565b634e487b7160e01b5f52601160045260245ffd5b808201808211156120cd576120cd612545565b818103818111156120cd576120cd612545565b80820281158282048414176120cd576120cd612545565b5f826125b057634e487b7160e01b5f52601260045260245ffd5b500490565b6020808252601190820152701a5b9d985b1a59081c9958da5c1a595b9d607a1b604082015260600190565b6020808252601f908201527f726563697069656e743a206661696c656420746f2073656e6420657468657200604082015260600190565b6020808252601e908201527f74726561737572793a206661696c656420746f2073656e642065746865720000604082015260600190565b5f6020828403121561265e575f80fd5b81518015158114612167575f80fd5b5f82515f5b8181101561268c5760208186018101518583015201612672565b505f92019182525091905056fe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220dfbb2dcc37a5cc93373126e5bf5f93e501cc12fa0ad4102b7cd083a9719ba42364736f6c63430008180033
Deployed Bytecode
0x608060405260043610610131575f3560e01c806397d75776116100a8578063dea67dc11161006d578063dea67dc114610370578063e21d072314610385578063e319a3d9146103bb578063ec903068146103da578063f2fde38b146103ef578063f3fef3a31461040e575f80fd5b806397d75776146102d4578063a53da0a0146102ee578063a8ac93f51461030d578063ad5c464814610338578063c5cc6b6a14610352575f80fd5b80636cac65fb116100f95780636cac65fb146101db578063706b233a146101fa578063715018a6146102195780637f4512591461022d578063899c27411461025f5780638da5cb5b14610298575f80fd5b80630de3cd08146101355780631809fcbc146101565780632859398414610175578063304a114c146101a957806347e7ef24146101c8575b5f80fd5b348015610140575f80fd5b5061015461014f3660046122e2565b61042d565b005b348015610161575f80fd5b506101546101703660046123e0565b61090e565b348015610180575f80fd5b506101896109a4565b604080519384526020840192909252908201526060015b60405180910390f35b3480156101b4575f80fd5b506101546101c3366004612428565b610ae1565b6101546101d6366004612428565b610b04565b3480156101e6575f80fd5b506101546101f5366004612450565b611024565b348015610205575f80fd5b50610154610214366004612481565b6110b2565b348015610224575f80fd5b5061015461120d565b348015610238575f80fd5b506102476022602160991b0181565b6040516001600160a01b0390911681526020016101a0565b34801561026a575f80fd5b5061028a6102793660046124b3565b60046020525f908152604090205481565b6040519081526020016101a0565b3480156102a3575f80fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610247565b3480156102df575f80fd5b506102476002604360981b0181565b3480156102f9575f80fd5b50610154610308366004612450565b611220565b348015610318575f80fd5b5061028a6103273660046124b3565b60066020525f908152604090205481565b348015610343575f80fd5b506102476023602160991b0181565b34801561035d575f80fd5b505f54610247906001600160a01b031681565b34801561037b575f80fd5b5061028a60015481565b348015610390575f80fd5b5061028a61039f366004612450565b600560209081525f928352604080842090915290825290205481565b3480156103c6575f80fd5b50600254610247906001600160a01b031681565b3480156103e5575f80fd5b5061028a60035481565b3480156103fa575f80fd5b506101546104093660046124b3565b61128e565b348015610419575f80fd5b50610154610428366004612428565b6112cb565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff165f811580156104725750825b90505f8267ffffffffffffffff16600114801561048e5750303b155b90508115801561049c575080155b156104ba5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156104e457845460ff60401b1916600160401b1785555b855187511461052b5760405162461bcd60e51b815260206004820152600e60248201526d696e76616c696420746f6b656e7360901b60448201526064015b60405180910390fd5b6001600160a01b038b166105715760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b21037bbb732b960991b6044820152606401610522565b6001600160a01b038c166105b95760405162461bcd60e51b815260206004820152600f60248201526e696e76616c696420666163746f727960881b6044820152606401610522565b6001600160a01b0389166106025760405162461bcd60e51b815260206004820152601060248201526f696e76616c696420747265617375727960801b6044820152606401610522565b61138888111561064e5760405162461bcd60e51b8152602060048201526017602482015276696e76616c69642074726561737572795261746542707360481b6044820152606401610522565b6113888a11156106955760405162461bcd60e51b8152602060048201526012602482015271696e76616c6964206665655261746542707360701b6044820152606401610522565b61069e8b611489565b6106a661149a565b6106ae6114a2565b5f80546001600160a01b03808f166001600160a01b031992831617835560018d905560028054918d169190921617905560038990556040805163784c3b3d60e11b815290516002604360981b019263f098767a926004808201939182900301818387803b15801561071d575f80fd5b505af115801561072f573d5f803e3d5ffd5b5050604051631a33757d60e01b81526022602160991b019250631a33757d915061075e906002906004016124cc565b6020604051808303815f875af115801561077a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061079e91906124f2565b50604051631a33757d60e01b81526023602160991b0190631a33757d906107ca906002906004016124cc565b6020604051808303815f875af11580156107e6573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061080a91906124f2565b505f5b87518110156108b9575f87828151811061082957610829612509565b602002602001015190505f81116108775760405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a59081b1bdd08185b5bdd5b9d60721b6044820152606401610522565b8060045f8b858151811061088d5761088d612509565b6020908102919091018101516001600160a01b031682528101919091526040015f20555060010161080d565b50831561090057845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050505050565b6109166114b2565b61091e61150d565b5f8061092c86868686611544565b91509150856001600160a01b0316856001600160a01b03167f8bc3a9723e5a1f1c9fad43c632554367016acdc2d20ed712b4117f86e368aad5848460405161097e929190918252602082015260400190565b60405180910390a3505061099e60015f8051602061269a83398151915255565b50505050565b604051631d864f1d60e31b81523060048201525f90819081906002604360981b019063ec3278e890602401602060405180830381865afa1580156109ea573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a0e91906124f2565b60405163e12f3a6160e01b81523060048201526023602160991b019063e12f3a6190602401602060405180830381865afa158015610a4e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a7291906124f2565b60405163e12f3a6160e01b81523060048201526022602160991b019063e12f3a6190602401602060405180830381865afa158015610ab2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ad691906124f2565b925092509250909192565b610ae96114b2565b6001600160a01b039091165f90815260046020526040902055565b610b0c61150d565b6001600160a01b0382165f9081526004602052604090205480610b675760405162461bcd60e51b81526020600482015260136024820152721b9bdd081cdd5c1c1bdc9d195908185cdcd95d606a1b6044820152606401610522565b5f8211610b865760405162461bcd60e51b81526004016105229061251d565b80821015610bcb5760405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a59081b1bdd08185b5bdd5b9d60721b6044820152606401610522565b6001600160a01b038316610c2157813414610c1c5760405162461bcd60e51b815260206004820152601160248201527018dbdb999b1a58dd195908185b5bdd5b9d607a1b6044820152606401610522565b610f30565b3415610c635760405162461bcd60e51b81526020600482015260116024820152701d5b995e1c1958dd195908185b5bdd5b9d607a1b6044820152606401610522565b5f6001600160a01b0384166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610cb6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cda91906124f2565b905082811015610d215760405162461bcd60e51b81526020600482015260126024820152716e6f7420656e6f7567682062616c616e636560701b6044820152606401610522565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa158015610d65573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d8991906124f2565b9050610da06001600160a01b0386163330876118fa565b6040516370a0823160e01b81523060048201525f906001600160a01b038716906370a0823190602401602060405180830381865afa158015610de4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e0891906124f2565b90505f6001600160a01b0387166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610e5d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e8191906124f2565b9050610e8d8684612559565b8214610edb5760405162461bcd60e51b815260206004820152601e60248201527f696e76616c696420636f6e74726163742062616c616e636520616674657200006044820152606401610522565b610ee5868561256c565b8114610f2b5760405162461bcd60e51b815260206004820152601560248201527434b73b30b634b2103130b630b731b29030b33a32b960591b6044820152606401610522565b505050505b5f61271060015484610f42919061257f565b610f4c9190612596565b90505f610f59828561256c565b6001600160a01b0386165f908152600560209081526040808320338452909152812080549293508392909190610f90908490612559565b90915550506001600160a01b0385165f9081526006602052604081208054849290610fbc908490612559565b909155505060408051828152602081018490526001600160a01b0387169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a350505061102060015f8051602061269a83398151915255565b5050565b61102c6114b2565b61103461150d565b5f806110408484611961565b91509150836001600160a01b0316836001600160a01b03167fa5a56e24e8cbe4c43434b9fd1d71f3567e9897e6b194f6d0d2e0d638bc9aa05a8484604051611092929190918252602082015260400190565b60405180910390a3505061102060015f8051602061269a83398151915255565b5f546001600160a01b0316336001600160a01b0316146111065760405162461bcd60e51b815260206004820152600f60248201526e6e6f742074686520666163746f727960881b6044820152606401610522565b6001600160a01b03821661114f5760405162461bcd60e51b815260206004820152601060248201526f696e76616c696420747265617375727960801b6044820152606401610522565b61138881111561119b5760405162461bcd60e51b8152602060048201526017602482015276696e76616c69642074726561737572795261746542707360481b6044820152606401610522565b6113888311156111e25760405162461bcd60e51b8152602060048201526012602482015271696e76616c6964206665655261746542707360701b6044820152606401610522565b600192909255600280546001600160a01b0319166001600160a01b0392909216919091179055600355565b6112156114b2565b61121e5f611b3c565b565b6112286114b2565b61123061150d565b5f8061123c8484611bac565b91509150836001600160a01b0316836001600160a01b03167f8bc3a9723e5a1f1c9fad43c632554367016acdc2d20ed712b4117f86e368aad58484604051611092929190918252602082015260400190565b6112966114b2565b6001600160a01b0381166112bf57604051631e4fbdf760e01b81525f6004820152602401610522565b6112c881611b3c565b50565b6112d361150d565b6001600160a01b0382165f908152600560209081526040808320338452909152902054816113135760405162461bcd60e51b81526004016105229061251d565b818110156113585760405162461bcd60e51b81526020600482015260126024820152716e6f7420656e6f7567682062616c616e636560701b6044820152606401610522565b611362828261256c565b6001600160a01b0384165f81815260056020908152604080832033845290915290209190915561141e576040515f90339084908381818185875af1925050503d805f81146113cb576040519150601f19603f3d011682016040523d82523d5f602084013e6113d0565b606091505b50509050806114185760405162461bcd60e51b81526020600482015260146024820152733330b4b632b2103a379039b2b7321032ba3432b960611b6044820152606401610522565b50611432565b6114326001600160a01b0384163384611fcd565b6040518281526001600160a01b0384169033907f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9060200160405180910390a35061102060015f8051602061269a83398151915255565b611491612003565b6112c88161204c565b61121e612003565b6114aa612003565b61121e612054565b336114e47f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b03161461121e5760405163118cdaa760e01b8152336004820152602401610522565b5f8051602061269a83398151915280546001190161153e57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f806001600160a01b03851661156c5760405162461bcd60e51b8152600401610522906125b5565b5f806001600160a01b0388166117035760405163430021db60e11b8152306004820181905260248201525f906002604360981b019063860043b6906044016020604051808303815f875af11580156115c6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115ea91906124f2565b9050612710600354826115fd919061257f565b6116079190612596565b9250611613838261256c565b91505f886001600160a01b0316836040515f6040518083038185875af1925050503d805f811461165e576040519150601f19603f3d011682016040523d82523d5f602084013e611663565b606091505b50509050806116845760405162461bcd60e51b8152600401610522906125e0565b83156116fc576002546040515f916001600160a01b03169086908381818185875af1925050503d805f81146116d4576040519150601f19603f3d011682016040523d82523d5f602084013e6116d9565b606091505b50509050806116fa5760405162461bcd60e51b815260040161052290612617565b505b50506118db565b6001600160a01b0388166022602160991b01148061173057506001600160a01b0388166023602160991b01145b156118a3575f6021602160991b01196001600160a01b038a16016117c957604051635569f64b60e11b81526001600160a01b0388166004820152602481018790526022602160991b019063aad3ec96906044016020604051808303815f875af115801561179f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117c391906124f2565b50611840565b604051635569f64b60e11b81526001600160a01b0388166004820152602481018790526023602160991b019063aad3ec96906044016020604051808303815f875af115801561181a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061183e91906124f2565b505b61271060035482611851919061257f565b61185b9190612596565b9250611867838261256c565b915061187d6001600160a01b038a168984611fcd565b821561189d5760025461189d906001600160a01b038b8116911685611fcd565b506118db565b60405162461bcd60e51b815260206004820152600d60248201526c1a5b9d985b1a5908185cdcd95d609a1b6044820152606401610522565b97909650945050505050565b60015f8051602061269a83398151915255565b6040516001600160a01b03848116602483015283811660448301526064820183905261099e9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061205c565b5f806001600160a01b0383166119895760405162461bcd60e51b8152600401610522906125b5565b6001600160a01b0384165f90815260066020526040902054806119be5760405162461bcd60e51b81526004016105229061251d565b6001600160a01b0385165f908152600660205260408120819055600354612710906119e9908461257f565b6119f39190612596565b90505f611a00828461256c565b90506001600160a01b038716611afd575f866001600160a01b0316826040515f6040518083038185875af1925050503d805f8114611a59576040519150601f19603f3d011682016040523d82523d5f602084013e611a5e565b606091505b5050905080611a7f5760405162461bcd60e51b8152600401610522906125e0565b8215611af7576002546040515f916001600160a01b03169085908381818185875af1925050503d805f8114611acf576040519150601f19603f3d011682016040523d82523d5f602084013e611ad4565b606091505b5050905080611af55760405162461bcd60e51b815260040161052290612617565b505b50611b31565b611b116001600160a01b0388168783611fcd565b8115611b3157600254611b31906001600160a01b03898116911684611fcd565b969095509350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b5f806001600160a01b038316611bd45760405162461bcd60e51b8152600401610522906125b5565b5f806001600160a01b038616611d6b5760405163430021db60e11b8152306004820181905260248201525f906002604360981b019063860043b6906044016020604051808303815f875af1158015611c2e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c5291906124f2565b905061271060035482611c65919061257f565b611c6f9190612596565b9250611c7b838261256c565b91505f866001600160a01b0316836040515f6040518083038185875af1925050503d805f8114611cc6576040519150601f19603f3d011682016040523d82523d5f602084013e611ccb565b606091505b5050905080611cec5760405162461bcd60e51b8152600401610522906125e0565b8315611d64576002546040515f916001600160a01b03169086908381818185875af1925050503d805f8114611d3c576040519150601f19603f3d011682016040523d82523d5f602084013e611d41565b606091505b5050905080611d625760405162461bcd60e51b815260040161052290612617565b505b5050611fc3565b6001600160a01b0386166022602160991b011480611d9857506001600160a01b0386166023602160991b01145b156118a3575f6021602160991b01196001600160a01b03881601611e8f5760405163e12f3a6160e01b81523060048201526022602160991b019063e12f3a6190602401602060405180830381865afa158015611df6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e1a91906124f2565b604051635569f64b60e11b8152306004820152602481018290529091506022602160991b019063aad3ec96906044016020604051808303815f875af1158015611e65573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e8991906124f2565b50611f64565b60405163e12f3a6160e01b81523060048201526023602160991b019063e12f3a6190602401602060405180830381865afa158015611ecf573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ef391906124f2565b604051635569f64b60e11b8152306004820152602481018290529091506023602160991b019063aad3ec96906044016020604051808303815f875af1158015611f3e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f6291906124f2565b505b61271060035482611f75919061257f565b611f7f9190612596565b9250611f8b838261256c565b9150611fa16001600160a01b0388168784611fcd565b8215611fc157600254611fc1906001600160a01b03898116911685611fcd565b505b9590945092505050565b6040516001600160a01b03838116602483015260448201839052611ffe91859182169063a9059cbb9060640161192f565b505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661121e57604051631afcd79f60e31b815260040160405180910390fd5b611296612003565b6118e7612003565b5f6120706001600160a01b038416836120bd565b905080515f14158015612094575080806020019051810190612092919061264e565b155b15611ffe57604051635274afe760e01b81526001600160a01b0384166004820152602401610522565b60606120ca83835f6120d3565b90505b92915050565b6060814710156120f85760405163cd78605960e01b8152306004820152602401610522565b5f80856001600160a01b03168486604051612113919061266d565b5f6040518083038185875af1925050503d805f811461214d576040519150601f19603f3d011682016040523d82523d5f602084013e612152565b606091505b509150915061216286838361216e565b925050505b9392505050565b6060826121835761217e826121ca565b612167565b815115801561219a57506001600160a01b0384163b155b156121c357604051639996b31560e01b81526001600160a01b0385166004820152602401610522565b5080612167565b8051156121da5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114612209575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561224b5761224b61220e565b604052919050565b5f67ffffffffffffffff82111561226c5761226c61220e565b5060051b60200190565b5f82601f830112612285575f80fd5b8135602061229a61229583612253565b612222565b8083825260208201915060208460051b8701019350868411156122bb575f80fd5b602086015b848110156122d757803583529183019183016122c0565b509695505050505050565b5f805f805f805f60e0888a0312156122f8575f80fd5b612301886121f3565b96506020612310818a016121f3565b96506040890135955061232560608a016121f3565b94506080890135935060a089013567ffffffffffffffff80821115612348575f80fd5b818b0191508b601f83011261235b575f80fd5b813561236961229582612253565b81815260059190911b8301840190848101908e831115612387575f80fd5b938501935b828510156123ac5761239d856121f3565b8252938501939085019061238c565b9650505060c08b01359250808311156123c3575f80fd5b50506123d18a828b01612276565b91505092959891949750929550565b5f805f80608085870312156123f3575f80fd5b6123fc856121f3565b935061240a602086016121f3565b9250612418604086016121f3565b9396929550929360600135925050565b5f8060408385031215612439575f80fd5b612442836121f3565b946020939093013593505050565b5f8060408385031215612461575f80fd5b61246a836121f3565b9150612478602084016121f3565b90509250929050565b5f805f60608486031215612493575f80fd5b833592506124a3602085016121f3565b9150604084013590509250925092565b5f602082840312156124c3575f80fd5b6120ca826121f3565b60208101600383106124ec57634e487b7160e01b5f52602160045260245ffd5b91905290565b5f60208284031215612502575f80fd5b5051919050565b634e487b7160e01b5f52603260045260245ffd5b6020808252600e908201526d1a5b9d985b1a5908185b5bdd5b9d60921b604082015260600190565b634e487b7160e01b5f52601160045260245ffd5b808201808211156120cd576120cd612545565b818103818111156120cd576120cd612545565b80820281158282048414176120cd576120cd612545565b5f826125b057634e487b7160e01b5f52601260045260245ffd5b500490565b6020808252601190820152701a5b9d985b1a59081c9958da5c1a595b9d607a1b604082015260600190565b6020808252601f908201527f726563697069656e743a206661696c656420746f2073656e6420657468657200604082015260600190565b6020808252601e908201527f74726561737572793a206661696c656420746f2073656e642065746865720000604082015260600190565b5f6020828403121561265e575f80fd5b81518015158114612167575f80fd5b5f82515f5b8181101561268c5760208186018101518583015201612672565b505f92019182525091905056fe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220dfbb2dcc37a5cc93373126e5bf5f93e501cc12fa0ad4102b7cd083a9719ba42364736f6c63430008180033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.