Contract Address Details
0x4A78a6a8f8b3773F7A78befD106F280403EEa807
- Contract Name
- TreasuryDAO
- Creator
- 0xf9e78cā318f5b at 0xff0006ā03403b
- Balance
- 0 Doge
- Tokens
-
Fetching tokens...
- Transactions
- 14 Transactions
- Transfers
- 625 Transfers
- Gas Used
- 436,918
- Last Balance Update
- 27561558
Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
- Contract name:
- TreasuryDAO
- Optimization enabled
- false
- Compiler version
- v0.8.9+commit.e5eed63a
- EVM Version
- default
- Verified at
- 2022-09-28T01:02:42.230971Z
Constructor Arguments
000000000000000000000000765277eebeca2e31912c9946eae1021199b39c6100000000000000000000000000000000000000000000000000000000633af8f0
Arg [0] (address) : 0x765277eebeca2e31912c9946eae1021199b39c61
Arg [1] (uint256) : 1664809200
Contract source code
// SPDX-License-Identifier: MIT // Sources flattened with hardhat v2.11.1 https://hardhat.org // File contracts/libs/IWETH.sol pragma solidity >=0.5.0; interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; } // File @openzeppelin/contracts/utils/Context.sol@v4.2.0 pragma solidity ^0.8.0; /* * @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 Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // File @openzeppelin/contracts/utils/Strings.sol@v4.2.0 pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } } // File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.2.0 pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } // File @openzeppelin/contracts/utils/introspection/ERC165.sol@v4.2.0 pragma solidity ^0.8.0; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } // File @openzeppelin/contracts/access/AccessControl.sol@v4.2.0 pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { function hasRole(bytes32 role, address account) external view returns (bool); function getRoleAdmin(bytes32 role) external view returns (bytes32); function grantRole(bytes32 role, address account) external; function revokeRole(bytes32 role, address account) external; function renounceRole(bytes32 role, address account) external; } /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, getRoleAdmin(role), adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } } // File @openzeppelin/contracts/security/ReentrancyGuard.sol@v4.2.0 pragma solidity ^0.8.0; /** * @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 ReentrancyGuard { // 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; uint256 private _status; constructor() { _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 make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.2.0 pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // File @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol@v4.2.0 pragma solidity ^0.8.0; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } // File @openzeppelin/contracts/token/ERC20/ERC20.sol@v4.2.0 pragma solidity ^0.8.0; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } // File @uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol@v1.0.1 pragma solidity >=0.5.0; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } // File @uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol@v1.0.1 pragma solidity >=0.5.0; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } // File @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol@v1.1.0-beta.0 pragma solidity >=0.6.2; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } // File @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol@v1.1.0-beta.0 pragma solidity >=0.6.2; interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } // File contracts/TreasuryDAO.sol /* ,-""""-. ,' _ `. / )_) \ : : \ / \ / `. ,' `. ,' `.,' /\`. ,-._ `-' BanksyDao.finance */ // Kurama protocol License Identifier: 62b9ff30-1008-4e02-893d-971dd776fe08 pragma solidity ^0.8.9; /* * Errors table: * E1: transfer failed! * E2: failed approve */ contract TreasuryDAO is ReentrancyGuard, AccessControl { bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR"); address public immutable usdAddress; // default to two weeks uint256 public distributionTimeFrame = 3600 * 24 * 14; uint256 public lastUsdDistroTime; uint256 public pendingUsd; // receive() external payable {} event UsdTransferredToUser(address recipient, uint256 amount); event BanksyTransferredToUser(address recipient, uint256 amount); event SetDistributionTimeFrame(uint256 distributionTimeFrame); constructor(address _usdAddress, uint256 startTime) { usdAddress = _usdAddress; lastUsdDistroTime = startTime; _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(OPERATOR_ROLE, _msgSender()); } /// External functions /// ///@dev sell all of a current type of token for usd. and distribute on a drip. function getUsdRelease(uint256 totalUsdLockup) external onlyRole(OPERATOR_ROLE) returns (uint256) { uint256 usdBalance = IERC20(usdAddress).balanceOf(address(this)); if (pendingUsd + totalUsdLockup > usdBalance) return 0; uint256 usdAvailable = usdBalance - pendingUsd - totalUsdLockup; // only provide a drip if there has been some blocks passed since the last drip uint256 timeSinceLastDistro = block.timestamp > lastUsdDistroTime ? block.timestamp - lastUsdDistroTime : 0; // We distribute the usd assuming the old usd balance wanted to be distributed over distributionTimeFrame blocks. uint256 usdRelease = (timeSinceLastDistro * usdAvailable) / distributionTimeFrame; usdRelease = usdRelease > usdAvailable ? usdAvailable : usdRelease; lastUsdDistroTime = block.timestamp; pendingUsd = pendingUsd + usdRelease; return usdRelease; } function transferUsdToOwner(address ownerAddress, uint256 amount) external onlyRole(OPERATOR_ROLE) { uint256 usdBalance = IERC20(usdAddress).balanceOf(address(this)); if (usdBalance < amount) amount = usdBalance; require(IERC20(usdAddress).transfer(ownerAddress, amount), "E1"); /// avoid negative result if (amount > pendingUsd) amount = pendingUsd; pendingUsd = pendingUsd - amount; emit UsdTransferredToUser(ownerAddress, amount); } function setDistributionTimeFrame(uint256 newUsdDistributionTimeFrame) external onlyRole(DEFAULT_ADMIN_ROLE) { distributionTimeFrame = newUsdDistributionTimeFrame; emit SetDistributionTimeFrame(distributionTimeFrame); } function emergencyWithDrawToken(address token) external onlyRole(DEFAULT_ADMIN_ROLE) { uint256 balanceToken = IERC20(token).balanceOf(address(this)); if (balanceToken > 0) IERC20(token).transfer(msg.sender, balanceToken); } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_usdAddress","internalType":"address"},{"type":"uint256","name":"startTime","internalType":"uint256"}]},{"type":"event","name":"BanksyTransferredToUser","inputs":[{"type":"address","name":"recipient","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SetDistributionTimeFrame","inputs":[{"type":"uint256","name":"distributionTimeFrame","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UsdTransferredToUser","inputs":[{"type":"address","name":"recipient","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"OPERATOR_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"distributionTimeFrame","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithDrawToken","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getUsdRelease","inputs":[{"type":"uint256","name":"totalUsdLockup","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastUsdDistroTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingUsd","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDistributionTimeFrame","inputs":[{"type":"uint256","name":"newUsdDistributionTimeFrame","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferUsdToOwner","inputs":[{"type":"address","name":"ownerAddress","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"usdAddress","inputs":[]}]
Contract Creation Code
0x60a0604052621275006002553480156200001857600080fd5b5060405162001c8e38038062001c8e83398181016040528101906200003e91906200030d565b60016000819055508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff168152505080600381905550620000a56000801b62000099620000ee60201b60201c565b620000f660201b60201c565b620000e67f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c620000da620000ee60201b60201c565b620000f660201b60201c565b505062000354565b600033905090565b6200010882826200010c60201b60201c565b5050565b6200011e8282620001fd60201b60201c565b620001f957600180600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506200019e620000ee60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b60006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200029a826200026d565b9050919050565b620002ac816200028d565b8114620002b857600080fd5b50565b600081519050620002cc81620002a1565b92915050565b6000819050919050565b620002e781620002d2565b8114620002f357600080fd5b50565b6000815190506200030781620002dc565b92915050565b6000806040838503121562000327576200032662000268565b5b60006200033785828601620002bb565b92505060206200034a85828601620002f6565b9150509250929050565b60805161190962000385600039600081816106490152818161081501528181610874015261092b01526119096000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80637085e2e511610097578063a217fddf11610066578063a217fddf146102ad578063cd84d2f8146102cb578063d547741f146102e7578063f5b541a61461030357610100565b80637085e2e514610211578063818ac0611461022f57806391d148541461025f5780639e1a86131461028f57610100565b806330ff6453116100d357806330ff64531461019f57806336568abe146101bb5780634a7e2aaa146101d75780635272b07e146101f357610100565b806301ffc9a714610105578063248a9ca3146101355780632f2ff15d146101655780632fed155e14610181575b600080fd5b61011f600480360381019061011a919061102f565b610321565b60405161012c9190611077565b60405180910390f35b61014f600480360381019061014a91906110c8565b61039b565b60405161015c9190611104565b60405180910390f35b61017f600480360381019061017a919061117d565b6103bb565b005b6101896103e4565b60405161019691906111d6565b60405180910390f35b6101b960048036038101906101b491906111f1565b6103ea565b005b6101d560048036038101906101d0919061117d565b610529565b005b6101f160048036038101906101ec919061124a565b6105ac565b005b6101fb610605565b60405161020891906111d6565b60405180910390f35b61021961060b565b60405161022691906111d6565b60405180910390f35b6102496004803603810190610244919061124a565b610611565b60405161025691906111d6565b60405180910390f35b6102796004803603810190610274919061117d565b6107a8565b6040516102869190611077565b60405180910390f35b610297610813565b6040516102a49190611286565b60405180910390f35b6102b5610837565b6040516102c29190611104565b60405180910390f35b6102e560048036038101906102e091906112a1565b61083e565b005b61030160048036038101906102fc919061117d565b610a78565b005b61030b610aa1565b6040516103189190611104565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610394575061039382610ac5565b5b9050919050565b600060016000838152602001908152602001600020600101549050919050565b6103c48261039b565b6103d5816103d0610b2f565b610b37565b6103df8383610bd4565b505050565b60025481565b6000801b6103ff816103fa610b2f565b610b37565b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161043a9190611286565b60206040518083038186803b15801561045257600080fd5b505afa158015610466573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048a91906112f6565b90506000811115610524578273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b81526004016104d0929190611323565b602060405180830381600087803b1580156104ea57600080fd5b505af11580156104fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105229190611378565b505b505050565b610531610b2f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461059e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059590611428565b60405180910390fd5b6105a88282610cb4565b5050565b6000801b6105c1816105bc610b2f565b610b37565b816002819055507f2e83559708a673d29523e9ccd1c666b7b69ec3701539c83639526b9b0cb3060e6002546040516105f991906111d6565b60405180910390a15050565b60045481565b60035481565b60007f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c61064581610640610b2f565b610b37565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016106a09190611286565b60206040518083038186803b1580156106b857600080fd5b505afa1580156106cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f091906112f6565b905080846004546107019190611477565b11156107115760009250506107a2565b6000846004548361072291906114cd565b61072c91906114cd565b90506000600354421161074057600061074f565b6003544261074e91906114cd565b5b9050600060025483836107629190611501565b61076c919061158a565b905082811161077b578061077d565b825b905042600381905550806004546107949190611477565b600481905550809550505050505b50919050565b60006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000801b81565b7f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c6108708161086b610b2f565b610b37565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016108cb9190611286565b60206040518083038186803b1580156108e357600080fd5b505afa1580156108f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091b91906112f6565b905082811015610929578092505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b8152600401610984929190611323565b602060405180830381600087803b15801561099e57600080fd5b505af11580156109b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d69190611378565b610a15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0c90611607565b60405180910390fd5b600454831115610a255760045492505b82600454610a3391906114cd565b6004819055507fb804ba76667e69a14a085c5f27273fa4ddd777f59a68b46a7fa2888a636716688484604051610a6a929190611323565b60405180910390a150505050565b610a818261039b565b610a9281610a8d610b2f565b610b37565b610a9c8383610cb4565b505050565b7f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c81565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b610b4182826107a8565b610bd057610b668173ffffffffffffffffffffffffffffffffffffffff166014610d96565b610b748360001c6020610d96565b604051602001610b85929190611739565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc791906117bd565b60405180910390fd5b5050565b610bde82826107a8565b610cb057600180600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610c55610b2f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b610cbe82826107a8565b15610d925760006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d37610b2f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b606060006002836002610da99190611501565b610db39190611477565b67ffffffffffffffff811115610dcc57610dcb6117df565b5b6040519080825280601f01601f191660200182016040528015610dfe5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610e3657610e3561180e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110610e9a57610e9961180e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002610eda9190611501565b610ee49190611477565b90505b6001811115610f84577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110610f2657610f2561180e565b5b1a60f81b828281518110610f3d57610f3c61180e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080610f7d9061183d565b9050610ee7565b5060008414610fc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fbf906118b3565b60405180910390fd5b8091505092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61100c81610fd7565b811461101757600080fd5b50565b60008135905061102981611003565b92915050565b60006020828403121561104557611044610fd2565b5b60006110538482850161101a565b91505092915050565b60008115159050919050565b6110718161105c565b82525050565b600060208201905061108c6000830184611068565b92915050565b6000819050919050565b6110a581611092565b81146110b057600080fd5b50565b6000813590506110c28161109c565b92915050565b6000602082840312156110de576110dd610fd2565b5b60006110ec848285016110b3565b91505092915050565b6110fe81611092565b82525050565b600060208201905061111960008301846110f5565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061114a8261111f565b9050919050565b61115a8161113f565b811461116557600080fd5b50565b60008135905061117781611151565b92915050565b6000806040838503121561119457611193610fd2565b5b60006111a2858286016110b3565b92505060206111b385828601611168565b9150509250929050565b6000819050919050565b6111d0816111bd565b82525050565b60006020820190506111eb60008301846111c7565b92915050565b60006020828403121561120757611206610fd2565b5b600061121584828501611168565b91505092915050565b611227816111bd565b811461123257600080fd5b50565b6000813590506112448161121e565b92915050565b6000602082840312156112605761125f610fd2565b5b600061126e84828501611235565b91505092915050565b6112808161113f565b82525050565b600060208201905061129b6000830184611277565b92915050565b600080604083850312156112b8576112b7610fd2565b5b60006112c685828601611168565b92505060206112d785828601611235565b9150509250929050565b6000815190506112f08161121e565b92915050565b60006020828403121561130c5761130b610fd2565b5b600061131a848285016112e1565b91505092915050565b60006040820190506113386000830185611277565b61134560208301846111c7565b9392505050565b6113558161105c565b811461136057600080fd5b50565b6000815190506113728161134c565b92915050565b60006020828403121561138e5761138d610fd2565b5b600061139c84828501611363565b91505092915050565b600082825260208201905092915050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000611412602f836113a5565b915061141d826113b6565b604082019050919050565b6000602082019050818103600083015261144181611405565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611482826111bd565b915061148d836111bd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156114c2576114c1611448565b5b828201905092915050565b60006114d8826111bd565b91506114e3836111bd565b9250828210156114f6576114f5611448565b5b828203905092915050565b600061150c826111bd565b9150611517836111bd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156115505761154f611448565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611595826111bd565b91506115a0836111bd565b9250826115b0576115af61155b565b5b828204905092915050565b7f4531000000000000000000000000000000000000000000000000000000000000600082015250565b60006115f16002836113a5565b91506115fc826115bb565b602082019050919050565b60006020820190508181036000830152611620816115e4565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000611668601783611627565b915061167382611632565b601782019050919050565b600081519050919050565b60005b838110156116a757808201518184015260208101905061168c565b838111156116b6576000848401525b50505050565b60006116c78261167e565b6116d18185611627565b93506116e1818560208601611689565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000611723601183611627565b915061172e826116ed565b601182019050919050565b60006117448261165b565b915061175082856116bc565b915061175b82611716565b915061176782846116bc565b91508190509392505050565b6000601f19601f8301169050919050565b600061178f8261167e565b61179981856113a5565b93506117a9818560208601611689565b6117b281611773565b840191505092915050565b600060208201905081810360008301526117d78184611784565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611848826111bd565b9150600082141561185c5761185b611448565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b600061189d6020836113a5565b91506118a882611867565b602082019050919050565b600060208201905081810360008301526118cc81611890565b905091905056fea2646970667358221220ed42866aba568b38afadba2b46b14e1b8fe0bac4de669e65733e2b307078633a64736f6c63430008090033000000000000000000000000765277eebeca2e31912c9946eae1021199b39c6100000000000000000000000000000000000000000000000000000000633af8f0
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80637085e2e511610097578063a217fddf11610066578063a217fddf146102ad578063cd84d2f8146102cb578063d547741f146102e7578063f5b541a61461030357610100565b80637085e2e514610211578063818ac0611461022f57806391d148541461025f5780639e1a86131461028f57610100565b806330ff6453116100d357806330ff64531461019f57806336568abe146101bb5780634a7e2aaa146101d75780635272b07e146101f357610100565b806301ffc9a714610105578063248a9ca3146101355780632f2ff15d146101655780632fed155e14610181575b600080fd5b61011f600480360381019061011a919061102f565b610321565b60405161012c9190611077565b60405180910390f35b61014f600480360381019061014a91906110c8565b61039b565b60405161015c9190611104565b60405180910390f35b61017f600480360381019061017a919061117d565b6103bb565b005b6101896103e4565b60405161019691906111d6565b60405180910390f35b6101b960048036038101906101b491906111f1565b6103ea565b005b6101d560048036038101906101d0919061117d565b610529565b005b6101f160048036038101906101ec919061124a565b6105ac565b005b6101fb610605565b60405161020891906111d6565b60405180910390f35b61021961060b565b60405161022691906111d6565b60405180910390f35b6102496004803603810190610244919061124a565b610611565b60405161025691906111d6565b60405180910390f35b6102796004803603810190610274919061117d565b6107a8565b6040516102869190611077565b60405180910390f35b610297610813565b6040516102a49190611286565b60405180910390f35b6102b5610837565b6040516102c29190611104565b60405180910390f35b6102e560048036038101906102e091906112a1565b61083e565b005b61030160048036038101906102fc919061117d565b610a78565b005b61030b610aa1565b6040516103189190611104565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610394575061039382610ac5565b5b9050919050565b600060016000838152602001908152602001600020600101549050919050565b6103c48261039b565b6103d5816103d0610b2f565b610b37565b6103df8383610bd4565b505050565b60025481565b6000801b6103ff816103fa610b2f565b610b37565b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161043a9190611286565b60206040518083038186803b15801561045257600080fd5b505afa158015610466573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048a91906112f6565b90506000811115610524578273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b81526004016104d0929190611323565b602060405180830381600087803b1580156104ea57600080fd5b505af11580156104fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105229190611378565b505b505050565b610531610b2f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461059e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059590611428565b60405180910390fd5b6105a88282610cb4565b5050565b6000801b6105c1816105bc610b2f565b610b37565b816002819055507f2e83559708a673d29523e9ccd1c666b7b69ec3701539c83639526b9b0cb3060e6002546040516105f991906111d6565b60405180910390a15050565b60045481565b60035481565b60007f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c61064581610640610b2f565b610b37565b60007f000000000000000000000000765277eebeca2e31912c9946eae1021199b39c6173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016106a09190611286565b60206040518083038186803b1580156106b857600080fd5b505afa1580156106cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f091906112f6565b905080846004546107019190611477565b11156107115760009250506107a2565b6000846004548361072291906114cd565b61072c91906114cd565b90506000600354421161074057600061074f565b6003544261074e91906114cd565b5b9050600060025483836107629190611501565b61076c919061158a565b905082811161077b578061077d565b825b905042600381905550806004546107949190611477565b600481905550809550505050505b50919050565b60006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b7f000000000000000000000000765277eebeca2e31912c9946eae1021199b39c6181565b6000801b81565b7f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c6108708161086b610b2f565b610b37565b60007f000000000000000000000000765277eebeca2e31912c9946eae1021199b39c6173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016108cb9190611286565b60206040518083038186803b1580156108e357600080fd5b505afa1580156108f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091b91906112f6565b905082811015610929578092505b7f000000000000000000000000765277eebeca2e31912c9946eae1021199b39c6173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b8152600401610984929190611323565b602060405180830381600087803b15801561099e57600080fd5b505af11580156109b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d69190611378565b610a15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0c90611607565b60405180910390fd5b600454831115610a255760045492505b82600454610a3391906114cd565b6004819055507fb804ba76667e69a14a085c5f27273fa4ddd777f59a68b46a7fa2888a636716688484604051610a6a929190611323565b60405180910390a150505050565b610a818261039b565b610a9281610a8d610b2f565b610b37565b610a9c8383610cb4565b505050565b7f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c81565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b610b4182826107a8565b610bd057610b668173ffffffffffffffffffffffffffffffffffffffff166014610d96565b610b748360001c6020610d96565b604051602001610b85929190611739565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc791906117bd565b60405180910390fd5b5050565b610bde82826107a8565b610cb057600180600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610c55610b2f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b610cbe82826107a8565b15610d925760006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d37610b2f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b606060006002836002610da99190611501565b610db39190611477565b67ffffffffffffffff811115610dcc57610dcb6117df565b5b6040519080825280601f01601f191660200182016040528015610dfe5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610e3657610e3561180e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110610e9a57610e9961180e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002610eda9190611501565b610ee49190611477565b90505b6001811115610f84577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110610f2657610f2561180e565b5b1a60f81b828281518110610f3d57610f3c61180e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080610f7d9061183d565b9050610ee7565b5060008414610fc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fbf906118b3565b60405180910390fd5b8091505092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61100c81610fd7565b811461101757600080fd5b50565b60008135905061102981611003565b92915050565b60006020828403121561104557611044610fd2565b5b60006110538482850161101a565b91505092915050565b60008115159050919050565b6110718161105c565b82525050565b600060208201905061108c6000830184611068565b92915050565b6000819050919050565b6110a581611092565b81146110b057600080fd5b50565b6000813590506110c28161109c565b92915050565b6000602082840312156110de576110dd610fd2565b5b60006110ec848285016110b3565b91505092915050565b6110fe81611092565b82525050565b600060208201905061111960008301846110f5565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061114a8261111f565b9050919050565b61115a8161113f565b811461116557600080fd5b50565b60008135905061117781611151565b92915050565b6000806040838503121561119457611193610fd2565b5b60006111a2858286016110b3565b92505060206111b385828601611168565b9150509250929050565b6000819050919050565b6111d0816111bd565b82525050565b60006020820190506111eb60008301846111c7565b92915050565b60006020828403121561120757611206610fd2565b5b600061121584828501611168565b91505092915050565b611227816111bd565b811461123257600080fd5b50565b6000813590506112448161121e565b92915050565b6000602082840312156112605761125f610fd2565b5b600061126e84828501611235565b91505092915050565b6112808161113f565b82525050565b600060208201905061129b6000830184611277565b92915050565b600080604083850312156112b8576112b7610fd2565b5b60006112c685828601611168565b92505060206112d785828601611235565b9150509250929050565b6000815190506112f08161121e565b92915050565b60006020828403121561130c5761130b610fd2565b5b600061131a848285016112e1565b91505092915050565b60006040820190506113386000830185611277565b61134560208301846111c7565b9392505050565b6113558161105c565b811461136057600080fd5b50565b6000815190506113728161134c565b92915050565b60006020828403121561138e5761138d610fd2565b5b600061139c84828501611363565b91505092915050565b600082825260208201905092915050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000611412602f836113a5565b915061141d826113b6565b604082019050919050565b6000602082019050818103600083015261144181611405565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611482826111bd565b915061148d836111bd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156114c2576114c1611448565b5b828201905092915050565b60006114d8826111bd565b91506114e3836111bd565b9250828210156114f6576114f5611448565b5b828203905092915050565b600061150c826111bd565b9150611517836111bd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156115505761154f611448565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611595826111bd565b91506115a0836111bd565b9250826115b0576115af61155b565b5b828204905092915050565b7f4531000000000000000000000000000000000000000000000000000000000000600082015250565b60006115f16002836113a5565b91506115fc826115bb565b602082019050919050565b60006020820190508181036000830152611620816115e4565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000611668601783611627565b915061167382611632565b601782019050919050565b600081519050919050565b60005b838110156116a757808201518184015260208101905061168c565b838111156116b6576000848401525b50505050565b60006116c78261167e565b6116d18185611627565b93506116e1818560208601611689565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000611723601183611627565b915061172e826116ed565b601182019050919050565b60006117448261165b565b915061175082856116bc565b915061175b82611716565b915061176782846116bc565b91508190509392505050565b6000601f19601f8301169050919050565b600061178f8261167e565b61179981856113a5565b93506117a9818560208601611689565b6117b281611773565b840191505092915050565b600060208201905081810360008301526117d78184611784565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611848826111bd565b9150600082141561185c5761185b611448565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b600061189d6020836113a5565b91506118a882611867565b602082019050919050565b600060208201905081810360008301526118cc81611890565b905091905056fea2646970667358221220ed42866aba568b38afadba2b46b14e1b8fe0bac4de669e65733e2b307078633a64736f6c63430008090033