Contract Overview
Contract Name:
MiningNativeReward
Compiler Version
v0.6.4+commit.1dca32f3
/** *Submitted for verification at Etherscan.io on 2020-09-09 */ pragma solidity 0.6.4; 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); } library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @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, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private initializing; /** * @dev Modifier to use in the initializer function of a contract. */ modifier initializer() { require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized"); bool isTopLevelCall = !initializing; if (isTopLevelCall) { initializing = true; initialized = true; } _; if (isTopLevelCall) { initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. address self = address(this); uint256 cs; assembly { cs := extcodesize(self) } return cs == 0; } // Reserved storage space to allow for layout changes in the future. uint256[50] private ______gap; } contract MiningNativeReward is Initializable { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address payable; bool internal _notEntered; /// @notice 管理员地址 address payable public admin; /// @notice 预备管理员地址 address payable public proposedAdmin; /// @notice 奖励设置时间 uint256 public datetime; /// @notice 用户奖励信息 /// @param amount 用户可提取的奖励数量 struct Balance { uint256 amount; } /// @notice 提币管理员地址 address public coinAdmin; /// @notice 预备提币管理员地址 address public proposedCoinAdmin; /// @notice 用户地址 => 用户奖励余额信息 mapping(address => Balance) public userBalance; /// @notice 事件:设置预备管理员 /// @param admin 管理员地址 /// @param proposedAdmin 预备管理员地址 event ProposeAdmin(address admin, address proposedAdmin); /// @notice 事件:Claim Admin /// @param oldAdmin 旧管理员地址 /// @param newAdmin 新管理员地址 event ClaimAdmin(address oldAdmin, address newAdmin); /// @notice 事件:管理员取出奖励代币(指定数量) /// @param amount 数量 event WithdrawRewardWithAmount(uint256 amount); /// @notice 事件:管理员取出奖励代币(全部取出) /// @param amount 数量 event WithdrawReward(uint256 amount); /// @notice 事件:管理员取出奖励代币(指定接收地址,全部取出) /// @param addr 接收地址 /// @param amount 数量 event WithdrawRewardToAddress(address addr, uint256 amount); /// @notice 事件:管理员取出奖励代币(指定接收地址,指定数量) /// @param addr 接收地址 /// @param amount 数量 event WithdrawRewardToAddressWithAmount(address addr, uint256 amount); /// @notice 事件:用户取出奖励 /// @param addr 用户地址 /// @param amount 数量 event ClaimReward(address addr, uint256 amount); /// @notice 事件:批量设置用户奖励 /// @param accounts 用户地址数组 /// @param amounts 奖励数量数组 /// @param datetime 时间戳 event BatchSet(address[] accounts, uint256[] amounts, uint256 datetime); /// @notice 事件:单独设置用户的奖励数量(修正情况下使用) /// @param account 用户地址 /// @param amount 奖励数量 event Set(address account, uint256 amount); /// @notice 初始化函数 /// @param _admin 管理员地址 function initialize(address _admin, address _coinAdmin) public initializer { admin = address(uint160(_admin)); coinAdmin = _coinAdmin; _notEntered = true; } modifier onlyAdmin { require(msg.sender == admin, "Admin required"); _; } modifier onlyCoinAdmin { require(msg.sender == coinAdmin, "CoinAdmin required"); _; } modifier nonReentrant() { require(_notEntered, "re-entered"); _notEntered = false; _; _notEntered = true; } /// @notice 设置预备管理员地址 /// @param _proposedAdmin 预备管理员地址 function proposeAdmin(address _proposedAdmin) public onlyAdmin { require(_proposedAdmin != address(0)); proposedAdmin = address(uint160(_proposedAdmin)); emit ProposeAdmin(admin, _proposedAdmin); } /// @notice 预备管理员 claim 权限 function claimAdmin() public { require(msg.sender == proposedAdmin, "ProposedAdmin required"); address oldAdmin = admin; admin = proposedAdmin; proposedAdmin = address(0); emit ClaimAdmin(oldAdmin, admin); } /// @notice 设置预备管理员地址 /// @param _proposedCoinAdmin 预备管理员地址 function proposeCoinAdmin(address _proposedCoinAdmin) public onlyCoinAdmin { require(_proposedCoinAdmin != address(0)); proposedCoinAdmin = _proposedCoinAdmin; // emit ProposeAdmin(admin, _proposedCoinAdmin); } /// @notice 预备管理员 claim 权限 function claimCoinAdmin() public { require(msg.sender == proposedCoinAdmin, "proposedCoinAdmin required"); // address oldCoinAdmin = coinAdmin; coinAdmin = proposedCoinAdmin; proposedCoinAdmin = address(0); // emit ClaimAdmin(oldAdmin, admin); } /// @notice 管理员取出奖励代币的数量(可指定数量) /// @param amount 取出数量 function withdrawRewardWithAmount(uint256 amount) public onlyCoinAdmin { uint256 balance = checkRewardBalance(); require(balance > 0, "No reward left"); require(balance >= amount, "Invalid amount"); admin.sendValue(amount); emit WithdrawRewardWithAmount(amount); } /// @notice 管理员取出奖励代币的数量(全部取出) function withdrawReward() public onlyCoinAdmin { uint256 balance = checkRewardBalance(); require(balance > 0, "No reward left"); admin.sendValue(balance); emit WithdrawReward(balance); } /// @notice 管理员取出奖励代币的数量(全部取出,指定接收地址) /// @param addr 接收代币地址 function withdrawRewardToAddress(address payable addr) public onlyCoinAdmin { uint256 balance = checkRewardBalance(); require(balance > 0, "No reward left"); addr.sendValue(balance); emit WithdrawRewardToAddress(addr, balance); } /// @notice 管理员取出奖励代币的数量(全部取出,指定接收地址,指定数量) /// @param addr 接收代币地址 /// @param amount 取出数量 function withdrawRewardToAddressWithAmount(address payable addr, uint256 amount) public onlyCoinAdmin { uint256 balance = checkRewardBalance(); require(balance > 0, "No reward left"); require(balance >= amount, "Invalid amount"); addr.sendValue(amount); emit WithdrawRewardToAddressWithAmount(addr, amount); } /// @notice 批量设置用户的奖励数量 /// @param accounts 用户地址数组 /// @param amount 奖励数量数组 /// @param _datetime 时间戳 function batchSet( address[] calldata accounts, uint256[] calldata amount, uint256 _datetime ) external onlyAdmin { require(_datetime > datetime, "Invalid time"); uint256 userCount = accounts.length; require(userCount == amount.length, "Invalid input"); for (uint256 i = 0; i < userCount; ++i) { userBalance[accounts[i]].amount = userBalance[accounts[i]] .amount .add(amount[i]); } datetime = _datetime; emit BatchSet(accounts, amount, _datetime); } /// @notice 单独设置用户的奖励数量(修正情况下使用) /// @param account 用户地址 /// @param amount 奖励数量 function set(address account, uint256 amount) external onlyAdmin { userBalance[account].amount = amount; emit Set(account, amount); } /// @notice 用户取出自己的挖矿奖励 function claimReward() public nonReentrant { uint256 claimAmount = userBalance[msg.sender].amount; require(claimAmount > 0, "No reward"); require(checkRewardBalance() >= claimAmount, "Insufficient rewardBalance"); userBalance[msg.sender].amount = 0; msg.sender.sendValue(claimAmount); emit ClaimReward(msg.sender, claimAmount); } /// @notice 用户查看自己的可取资产 function checkBalance(address account) public view returns (uint256) { return userBalance[account].amount; } /// @notice 查看当前奖励代币余额 function checkRewardBalance() public view returns (uint256) { return address(this).balance; } receive() external payable { } }
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"accounts","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"datetime","type":"uint256"}],"name":"BatchSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"ClaimAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"address","name":"proposedAdmin","type":"address"}],"name":"ProposeAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Set","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawRewardToAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawRewardToAddressWithAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawRewardWithAmount","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"amount","type":"uint256[]"},{"internalType":"uint256","name":"_datetime","type":"uint256"}],"name":"batchSet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"checkBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkRewardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimCoinAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"coinAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"datetime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address","name":"_coinAdmin","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_proposedAdmin","type":"address"}],"name":"proposeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_proposedCoinAdmin","type":"address"}],"name":"proposeCoinAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"proposedAdmin","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proposedCoinAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBalance","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"addr","type":"address"}],"name":"withdrawRewardToAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"addr","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawRewardToAddressWithAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawRewardWithAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6080604052600436106101235760003560e01c806377f50f97116100a0578063cfb4d57511610064578063cfb4d57514610395578063d3edf60414610464578063e5a1b64314610479578063f314d51b146104ac578063f851a440146104c15761012a565b806377f50f971461032c5780638b26e2c514610341578063b88a802f14610356578063c885bc581461036b578063cd2290fb146103805761012a565b80633ea722e3116100e75780633ea722e31461024c57806340d5605a1461027f578063485cc955146102945780635f515226146102cf57806363cb4a90146103025761012a565b80630103c92b1461012f578063147bf6c41461017457806332f751ec146101a95780633599c9bc146101da5780633825d828146102135761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b506101626004803603602081101561015257600080fd5b50356001600160a01b03166104d6565b60408051918252519081900360200190f35b34801561018057600080fd5b506101a76004803603602081101561019757600080fd5b50356001600160a01b03166104e8565b005b3480156101b557600080fd5b506101be6105b9565b604080516001600160a01b039092168252519081900360200190f35b3480156101e657600080fd5b506101a7600480360360408110156101fd57600080fd5b506001600160a01b0381351690602001356105c8565b34801561021f57600080fd5b506101a76004803603604081101561023657600080fd5b506001600160a01b038135169060200135610716565b34801561025857600080fd5b506101a76004803603602081101561026f57600080fd5b50356001600160a01b03166107c4565b34801561028b57600080fd5b506101626108cb565b3480156102a057600080fd5b506101a7600480360360408110156102b757600080fd5b506001600160a01b03813581169160200135166108d1565b3480156102db57600080fd5b50610162600480360360208110156102f257600080fd5b50356001600160a01b03166109ba565b34801561030e57600080fd5b506101a76004803603602081101561032557600080fd5b50356109d5565b34801561033857600080fd5b506101a7610b13565b34801561034d57600080fd5b506101be610bec565b34801561036257600080fd5b506101a7610bfb565b34801561037757600080fd5b506101a7610d5e565b34801561038c57600080fd5b506101be610e55565b3480156103a157600080fd5b506101a7600480360360608110156103b857600080fd5b8101906020810181356401000000008111156103d357600080fd5b8201836020820111156103e557600080fd5b8035906020019184602083028401116401000000008311171561040757600080fd5b91939092909160208101903564010000000081111561042557600080fd5b82018360208201111561043757600080fd5b8035906020019184602083028401116401000000008311171561045957600080fd5b919350915035610e64565b34801561047057600080fd5b506101a761109c565b34801561048557600080fd5b506101a76004803603602081101561049c57600080fd5b50356001600160a01b0316611122565b3480156104b857600080fd5b506101626111ab565b3480156104cd57600080fd5b506101be6111b0565b60386020526000908152604090205481565b60335461010090046001600160a01b0316331461053d576040805162461bcd60e51b815260206004820152600e60248201526d10591b5a5b881c995c5d5a5c995960921b604482015290519081900360640190fd5b6001600160a01b03811661055057600080fd5b603480546001600160a01b0319166001600160a01b03838116918217909255603354604080516101009092049093168152602081019190915281517f09836bb9aad40118d4cdc3500a189a0940bab36af8f47f11252d2a85b03b6dad929181900390910190a150565b6034546001600160a01b031681565b6036546001600160a01b0316331461061c576040805162461bcd60e51b815260206004820152601260248201527110dbda5b90591b5a5b881c995c5d5a5c995960721b604482015290519081900360640190fd5b60006106266111ab565b90506000811161066e576040805162461bcd60e51b815260206004820152600e60248201526d139bc81c995dd85c99081b19599d60921b604482015290519081900360640190fd5b818110156106b4576040805162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b604482015290519081900360640190fd5b6106cd6001600160a01b0384168363ffffffff6111c416565b604080516001600160a01b03851681526020810184905281517f8bad6c3594c4fb67b5b57979b82b3649970547e6e65b9115a71821a42db2a5db929181900390910190a1505050565b60335461010090046001600160a01b0316331461076b576040805162461bcd60e51b815260206004820152600e60248201526d10591b5a5b881c995c5d5a5c995960921b604482015290519081900360640190fd5b6001600160a01b0382166000818152603860209081526040918290208490558151928352820183905280517ffd28ec3ec2555238d8ad6f9faf3e4cd10e574ce7e7ef28b73caa53f9512f65b99281900390910190a15050565b6036546001600160a01b03163314610818576040805162461bcd60e51b815260206004820152601260248201527110dbda5b90591b5a5b881c995c5d5a5c995960721b604482015290519081900360640190fd5b60006108226111ab565b90506000811161086a576040805162461bcd60e51b815260206004820152600e60248201526d139bc81c995dd85c99081b19599d60921b604482015290519081900360640190fd5b6108836001600160a01b0383168263ffffffff6111c416565b604080516001600160a01b03841681526020810183905281517ff8fa3c51901aa470ae9ec1988b11a8a46f67617dbefae9f92429371133c2753b929181900390910190a15050565b60355481565b600054610100900460ff16806108ea57506108ea6112aa565b806108f8575060005460ff16155b6109335760405162461bcd60e51b815260040180806020018281038252602e81526020018061134c602e913960400191505060405180910390fd5b600054610100900460ff1615801561095e576000805460ff1961ff0019909116610100171660011790555b60338054603680546001600160a01b0319166001600160a01b0386811691909117909155610100600160a81b0319909116610100918616919091021760ff1916600117905580156109b5576000805461ff00191690555b505050565b6001600160a01b031660009081526038602052604090205490565b6036546001600160a01b03163314610a29576040805162461bcd60e51b815260206004820152601260248201527110dbda5b90591b5a5b881c995c5d5a5c995960721b604482015290519081900360640190fd5b6000610a336111ab565b905060008111610a7b576040805162461bcd60e51b815260206004820152600e60248201526d139bc81c995dd85c99081b19599d60921b604482015290519081900360640190fd5b81811015610ac1576040805162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b604482015290519081900360640190fd5b603354610adc9061010090046001600160a01b0316836111c4565b6040805183815290517f3f1f37d6ba2cb9c48629270d074e28e4c8076c2bcf40cd81a56581ebf48a71a29181900360200190a15050565b6034546001600160a01b03163314610b6b576040805162461bcd60e51b8152602060048201526016602482015275141c9bdc1bdcd95910591b5a5b881c995c5d5a5c995960521b604482015290519081900360640190fd5b60338054603480546001600160a01b03818116610100908102610100600160a81b0319861617958690556001600160a01b031990921690925560408051938290048316808552919094049091166020830152825190927f60cae9fabd3bef6b015e14f55d6c66df6c507bbacdb16149e2bf7c440690da27928290030190a150565b6037546001600160a01b031681565b60335460ff16610c3f576040805162461bcd60e51b815260206004820152600a6024820152691c994b595b9d195c995960b21b604482015290519081900360640190fd5b6033805460ff191690553360009081526038602052604090205480610c97576040805162461bcd60e51b8152602060048201526009602482015268139bc81c995dd85c9960ba1b604482015290519081900360640190fd5b80610ca06111ab565b1015610cf3576040805162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e742072657761726442616c616e6365000000000000604482015290519081900360640190fd5b33600081815260386020526040812055610d13908263ffffffff6111c416565b604080513381526020810183905281517fba8de60c3403ec381d1d484652ea1980e3c3e56359195c92525bff4ce47ad98e929181900390910190a1506033805460ff19166001179055565b6036546001600160a01b03163314610db2576040805162461bcd60e51b815260206004820152601260248201527110dbda5b90591b5a5b881c995c5d5a5c995960721b604482015290519081900360640190fd5b6000610dbc6111ab565b905060008111610e04576040805162461bcd60e51b815260206004820152600e60248201526d139bc81c995dd85c99081b19599d60921b604482015290519081900360640190fd5b603354610e1f9061010090046001600160a01b0316826111c4565b6040805182815290517f57b16428e0995660a2371bfccc1866c98df04182d095c00b50648af066dd1ec99181900360200190a150565b6036546001600160a01b031681565b60335461010090046001600160a01b03163314610eb9576040805162461bcd60e51b815260206004820152600e60248201526d10591b5a5b881c995c5d5a5c995960921b604482015290519081900360640190fd5b6035548111610efe576040805162461bcd60e51b815260206004820152600c60248201526b496e76616c69642074696d6560a01b604482015290519081900360640190fd5b83828114610f43576040805162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b604482015290519081900360640190fd5b60005b81811015610ff157610fb6858583818110610f5d57fe5b90506020020135603860008a8a86818110610f7457fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020600001546112b090919063ffffffff16565b60386000898985818110610fc657fe5b602090810292909201356001600160a01b031683525081019190915260400160002055600101610f46565b50816035819055507f3d42dcf7dc9d942d0432de62f545e4f39cd82301f72f0a070a17b6ff2d05a68b86868686866040518080602001806020018481526020018381038352888882818152602001925060200280828437600083820152601f01601f19169091018481038352868152602090810191508790870280828437600083820152604051601f909101601f1916909201829003995090975050505050505050a1505050505050565b6037546001600160a01b031633146110fb576040805162461bcd60e51b815260206004820152601a60248201527f70726f706f736564436f696e41646d696e207265717569726564000000000000604482015290519081900360640190fd5b60378054603680546001600160a01b03199081166001600160a01b03841617909155169055565b6036546001600160a01b03163314611176576040805162461bcd60e51b815260206004820152601260248201527110dbda5b90591b5a5b881c995c5d5a5c995960721b604482015290519081900360640190fd5b6001600160a01b03811661118957600080fd5b603780546001600160a01b0319166001600160a01b0392909216919091179055565b303190565b60335461010090046001600160a01b031681565b303181111561121a576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b6040516000906001600160a01b0384169083908381818185875af1925050503d8060008114611265576040519150601f19603f3d011682016040523d82523d6000602084013e61126a565b606091505b50509050806109b55760405162461bcd60e51b815260040180806020018281038252603a815260200180611312603a913960400191505060405180910390fd5b303b1590565b60008282018381101561130a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a6564a26469706673582212208f9d3618b8ad9b8267489ee5183510f1eb81de1fe55e4aafed3e5f63b7f844f364736f6c63430006040033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for
interesting conversations.