More Info
Private Name Tags
ContractCreator
Latest 12 from a total of 12 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim Rewards | 19203976 | 282 days ago | IN | 0 ETH | 0.00268437 | ||||
Claim Rewards | 18808130 | 338 days ago | IN | 0 ETH | 0.00376917 | ||||
Claim Rewards | 18750117 | 346 days ago | IN | 0 ETH | 0.00562641 | ||||
Claim Rewards | 18385894 | 397 days ago | IN | 0 ETH | 0.00104597 | ||||
Claim Rewards | 18294407 | 410 days ago | IN | 0 ETH | 0.00084075 | ||||
Claim Rewards | 18294276 | 410 days ago | IN | 0 ETH | 0.00077042 | ||||
Claim Rewards | 18294275 | 410 days ago | IN | 0 ETH | 0.00078895 | ||||
Claim Rewards | 18294274 | 410 days ago | IN | 0 ETH | 0.00086971 | ||||
Claim Rewards | 18032834 | 446 days ago | IN | 0 ETH | 0.00137092 | ||||
Claim Rewards | 18032823 | 446 days ago | IN | 0 ETH | 0.001542 | ||||
Claim Rewards | 18028714 | 447 days ago | IN | 0 ETH | 0.00309938 | ||||
0x60806040 | 17633769 | 502 days ago | IN | 0 ETH | 0.03923249 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Rewards
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; import "@openzeppelin/contracts/governance/utils/IVotes.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; contract Rewards { using SafeERC20 for IERC20; // Allowed to withdraw leftover tokens after 3 months. address public dao; // The inedible token. IVotes private inedible; // token => timePoint => amount. TimePoint required because one token may do multiple airdrops. mapping(address => mapping(uint256 => uint256)) public launches; // user => token => timePoint => claimed mapping(address => mapping(address => mapping(uint256 => bool))) public claimed; event NewRewards(address token, uint256 amount, uint256 timePoint); event ClaimedReward( address indexed user, address token, uint256 timePoint, uint256 amount ); // Just used for setting DAO to manage funds within here. constructor(address _dao, address _inedible) { dao = _dao; inedible = IVotes(_inedible); } /** * @dev Called by a Uni V2 pair when launching a token to pay fees. * @param _token The address of the token being launched. * @param _amount The amount of tokens being paid as fees. **/ function payFee(address _token, uint256 _amount) external { // fix for backrun in a same block require(launches[_token][block.number] == 0, "Already set"); IERC20(_token).safeTransferFrom(msg.sender, address(this), _amount); launches[_token][block.number] = _amount; emit NewRewards(_token, _amount, block.number); } /** * @dev User calls here to claim rewards from a token launch. Sends a user their share of rewards. * @param _user Address of the user to claim rewards for. * @param _tokens An array of tokens to claim rewards from. * @param _timePoints An array of timepoints the rewards were launched at. **/ function claimRewards( address _user, address[] memory _tokens, uint[] memory _timePoints ) external { for (uint256 i = 0; i < _tokens.length; i++) { require( !claimed[_user][_tokens[i]][_timePoints[i]], "Reward already claimed." ); // Vesting for airdrops is 30 days and 216000 in blocks. require( _timePoints[i] + 216000 < block.number, "Too early to claim rewards." ); claimed[_user][_tokens[i]][_timePoints[i]] = true; uint256 amount = launches[_tokens[i]][_timePoints[i]]; (uint256 balance, uint256 supply) = inedibleCheck( _user, _timePoints[i] ); uint256 owed = (amount * balance) / supply; if (owed != 0) { IERC20(_tokens[i]).safeTransfer(_user, owed); emit ClaimedReward(_user, _tokens[i], _timePoints[i], owed); } } } /** * @dev Used by the frontend to check on rewards for the user. May need multiple calls. * @param _user The address to check rewards for. * @param _tokens An array of tokens to check user rewards for. **/ function viewRewards( address _user, address[] memory _tokens, uint256[] memory _timePoints ) external view returns (uint256[] memory owed) { owed = new uint256[](_tokens.length); for (uint256 i = 0; i < _tokens.length; i++) { uint256 amount = launches[_tokens[i]][_timePoints[i]]; (uint256 balance, uint256 supply) = inedibleCheck( _user, _timePoints[i] ); uint256 tokensOwed = (amount * balance) / supply; owed[i] = tokensOwed; } } /** * @dev Check user balance and total supply at a block. Subtracts address(0) and burn address from total supply. * @param _user Address of the user to check the balance of. * @param _timePoint The block number we're checking balance for. **/ function inedibleCheck( address _user, uint256 _timePoint ) public view returns (uint256 _balance, uint256 _totalSupply) { _balance = inedible.getPastVotes(_user, _timePoint); _totalSupply = 888_888_888_888_888 ether; } /** * @dev Allow the DAO to withdraw tokens if it's been over 90 days since launch. * Tokens may be stuck if they're given to an LP, or not worth the gas to withdraw for small holders, * so we need a way to make sure they're not lost without quite letting the DAO take whatever. * @param _token The token to withdraw from the rewards contract. * @param _to The address to send tokens to. **/ function daoWithdraw( address _token, uint _blockNumber, address _to ) external { require(msg.sender == dao, "Only DAO may call this function."); require( launches[_token][_blockNumber] > 0, "Incorrect launch details." ); // 648000 is hardcoded to result in ~90 days in blocks. Don't want the DAO to be able to withdraw immediately. require( block.number >= _blockNumber + 648000, "Too early to withdraw fees" ); // dao should not be able to withdraw same airdrop twice if there's a 2nd airdrop launches[_token][_blockNumber] = 0; IERC20 token = IERC20(_token); token.transfer(_to, token.balanceOf(address(this))); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (governance/utils/IVotes.sol) pragma solidity ^0.8.0; /** * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts. * * _Available since v4.5._ */ interface IVotes { /** * @dev Emitted when an account changes their delegate. */ event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /** * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of votes. */ event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); /** * @dev Returns the current amount of votes that `account` has. */ function getVotes(address account) external view returns (uint256); /** * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is * configured to use block numbers, this will return the value at the end of the corresponding block. */ function getPastVotes(address account, uint256 timepoint) external view returns (uint256); /** * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is * configured to use block numbers, this will return the value at the end of the corresponding block. * * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. * Votes that have not been delegated are still part of total supply, even though they would not participate in a * vote. */ function getPastTotalSupply(uint256 timepoint) external view returns (uint256); /** * @dev Returns the delegate that `account` has chosen. */ function delegates(address account) external view returns (address); /** * @dev Delegates votes from the sender to `delegatee`. */ function delegate(address delegatee) external; /** * @dev Delegates votes from signer to `delegatee`. */ function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.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' 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)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to * 0 before setting it to a non-zero value. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @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"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library 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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_dao","type":"address"},{"internalType":"address","name":"_inedible","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"timePoint","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimedReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timePoint","type":"uint256"}],"name":"NewRewards","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_timePoints","type":"uint256[]"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dao","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_blockNumber","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"daoWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_timePoint","type":"uint256"}],"name":"inedibleCheck","outputs":[{"internalType":"uint256","name":"_balance","type":"uint256"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"launches","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"payFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_timePoints","type":"uint256[]"}],"name":"viewRewards","outputs":[{"internalType":"uint256[]","name":"owed","type":"uint256[]"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516111dc3803806111dc83398101604081905261002f9161007c565b600080546001600160a01b039384166001600160a01b031991821617909155600180549290931691161790556100af565b80516001600160a01b038116811461007757600080fd5b919050565b6000806040838503121561008f57600080fd5b61009883610060565b91506100a660208401610060565b90509250929050565b61111e806100be6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063b04b2fd71161005b578063b04b2fd71461011e578063bb85e1741461013e578063f0b5e1df14610166578063f40084b71461017957600080fd5b8063163d4bfb1461008d5780634162169f146100a25780634c93a299146100d257806372746eaf1461010b575b600080fd5b6100a061009b366004610e0d565b6101bd565b005b6000546100b5906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100fd6100e0366004610edf565b600260209081526000928352604080842090915290825290205481565b6040519081526020016100c9565b6100a0610119366004610edf565b610547565b61013161012c366004610e0d565b610623565b6040516100c99190610f09565b61015161014c366004610edf565b610759565b604080519283526020830191909152016100c9565b6100a0610174366004610f4d565b6107ea565b6101ad610187366004610f89565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b60405190151581526020016100c9565b60005b8251811015610541576001600160a01b038416600090815260036020526040812084519091908590849081106101f8576101f8610fc5565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600083838151811061023457610234610fc5565b60209081029190910181015182528101919091526040016000205460ff16156102a45760405162461bcd60e51b815260206004820152601760248201527f52657761726420616c726561647920636c61696d65642e00000000000000000060448201526064015b60405180910390fd5b438282815181106102b7576102b7610fc5565b602002602001015162034bc06102cd9190610ff1565b1061031a5760405162461bcd60e51b815260206004820152601b60248201527f546f6f206561726c7920746f20636c61696d20726577617264732e0000000000604482015260640161029b565b6001600160a01b038416600090815260036020526040812084516001929086908590811061034a5761034a610fc5565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600084848151811061038657610386610fc5565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600260008584815181106103cb576103cb610fc5565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600084848151811061040757610407610fc5565b602002602001015181526020019081526020016000205490506000806104468786868151811061043957610439610fc5565b6020026020010151610759565b9092509050600081610458848661100a565b6104629190611021565b9050801561052a576104a1888289888151811061048157610481610fc5565b60200260200101516001600160a01b0316610a169092919063ffffffff16565b876001600160a01b03167fd3208fd5300db64b97bc442f47ade72b7ebcd9272aaecdcc04c777bb762861b98887815181106104de576104de610fc5565b60200260200101518888815181106104f8576104f8610fc5565b602090810291909101810151604080516001600160a01b03909416845291830152810184905260600160405180910390a25b50505050808061053990611043565b9150506101c0565b50505050565b6001600160a01b0382166000908152600260209081526040808320438452909152902054156105a65760405162461bcd60e51b815260206004820152600b60248201526a105b1c9958591e481cd95d60aa1b604482015260640161029b565b6105bb6001600160a01b038316333084610a7e565b6001600160a01b0382166000818152600260209081526040808320438085529083529281902085905580519384529083018490528201527f9e725a59e293b3a40cf2ae1148796b9ab47f79644276301835a4ee7bf4d807349060600160405180910390a15050565b6060825167ffffffffffffffff81111561063f5761063f610d37565b604051908082528060200260200182016040528015610668578160200160208202803683370190505b50905060005b83518110156107515760006002600086848151811061068f5761068f610fc5565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008584815181106106cb576106cb610fc5565b602002602001015181526020019081526020016000205490506000806106fd8887868151811061043957610439610fc5565b909250905060008161070f848661100a565b6107199190611021565b90508086868151811061072e5761072e610fc5565b60200260200101818152505050505050808061074990611043565b91505061066e565b509392505050565b600154604051630748d63560e31b81526001600160a01b038481166004830152602482018490526000928392911690633a46b1a890604401602060405180830381865afa1580156107ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d2919061105c565b946d2bd35ae79a49ed3975a215e00000945092505050565b6000546001600160a01b031633146108445760405162461bcd60e51b815260206004820181905260248201527f4f6e6c792044414f206d61792063616c6c20746869732066756e6374696f6e2e604482015260640161029b565b6001600160a01b03831660009081526002602090815260408083208584529091529020546108b45760405162461bcd60e51b815260206004820152601960248201527f496e636f7272656374206c61756e63682064657461696c732e00000000000000604482015260640161029b565b6108c1826209e340610ff1565b4310156109105760405162461bcd60e51b815260206004820152601a60248201527f546f6f206561726c7920746f2077697468647261772066656573000000000000604482015260640161029b565b6001600160a01b038316600081815260026020908152604080832086845290915280822091909155516370a0823160e01b815230600482015284919063a9059cbb90849083906370a0823190602401602060405180830381865afa15801561097c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a0919061105c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156109eb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0f9190611075565b5050505050565b6040516001600160a01b038316602482015260448101829052610a7990849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610ab6565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526105419085906323b872dd60e01b90608401610a42565b6000610b0b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610b8b9092919063ffffffff16565b9050805160001480610b2c575080806020019051810190610b2c9190611075565b610a795760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161029b565b6060610b9a8484600085610ba2565b949350505050565b606082471015610c035760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161029b565b600080866001600160a01b03168587604051610c1f91906110c2565b60006040518083038185875af1925050503d8060008114610c5c576040519150601f19603f3d011682016040523d82523d6000602084013e610c61565b606091505b5091509150610c7287838387610c7d565b979650505050505050565b60608315610cec578251600003610ce5576001600160a01b0385163b610ce55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161029b565b5081610b9a565b610b9a8383815115610d015781518083602001fd5b8060405162461bcd60e51b815260040161029b91906110de565b80356001600160a01b0381168114610d3257600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610d7657610d76610d37565b604052919050565b600067ffffffffffffffff821115610d9857610d98610d37565b5060051b60200190565b600082601f830112610db357600080fd5b81356020610dc8610dc383610d7e565b610d4d565b82815260059290921b84018101918181019086841115610de757600080fd5b8286015b84811015610e025780358352918301918301610deb565b509695505050505050565b600080600060608486031215610e2257600080fd5b610e2b84610d1b565b925060208085013567ffffffffffffffff80821115610e4957600080fd5b818701915087601f830112610e5d57600080fd5b8135610e6b610dc382610d7e565b81815260059190911b8301840190848101908a831115610e8a57600080fd5b938501935b82851015610eaf57610ea085610d1b565b82529385019390850190610e8f565b965050506040870135925080831115610ec757600080fd5b5050610ed586828701610da2565b9150509250925092565b60008060408385031215610ef257600080fd5b610efb83610d1b565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b81811015610f4157835183529284019291840191600101610f25565b50909695505050505050565b600080600060608486031215610f6257600080fd5b610f6b84610d1b565b925060208401359150610f8060408501610d1b565b90509250925092565b600080600060608486031215610f9e57600080fd5b610fa784610d1b565b9250610fb560208501610d1b565b9150604084013590509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561100457611004610fdb565b92915050565b808202811582820484141761100457611004610fdb565b60008261103e57634e487b7160e01b600052601260045260246000fd5b500490565b60006001820161105557611055610fdb565b5060010190565b60006020828403121561106e57600080fd5b5051919050565b60006020828403121561108757600080fd5b8151801515811461109757600080fd5b9392505050565b60005b838110156110b95781810151838201526020016110a1565b50506000910152565b600082516110d481846020870161109e565b9190910192915050565b60208152600082518060208401526110fd81604085016020870161109e565b601f01601f1916919091016040019291505056fea164736f6c6343000811000a00000000000000000000000025d9ded9cd633f3a8564900e610cd3efbe047ab90000000000000000000000003486b751a36f731a1bebff779374bad635864919
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063b04b2fd71161005b578063b04b2fd71461011e578063bb85e1741461013e578063f0b5e1df14610166578063f40084b71461017957600080fd5b8063163d4bfb1461008d5780634162169f146100a25780634c93a299146100d257806372746eaf1461010b575b600080fd5b6100a061009b366004610e0d565b6101bd565b005b6000546100b5906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100fd6100e0366004610edf565b600260209081526000928352604080842090915290825290205481565b6040519081526020016100c9565b6100a0610119366004610edf565b610547565b61013161012c366004610e0d565b610623565b6040516100c99190610f09565b61015161014c366004610edf565b610759565b604080519283526020830191909152016100c9565b6100a0610174366004610f4d565b6107ea565b6101ad610187366004610f89565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b60405190151581526020016100c9565b60005b8251811015610541576001600160a01b038416600090815260036020526040812084519091908590849081106101f8576101f8610fc5565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600083838151811061023457610234610fc5565b60209081029190910181015182528101919091526040016000205460ff16156102a45760405162461bcd60e51b815260206004820152601760248201527f52657761726420616c726561647920636c61696d65642e00000000000000000060448201526064015b60405180910390fd5b438282815181106102b7576102b7610fc5565b602002602001015162034bc06102cd9190610ff1565b1061031a5760405162461bcd60e51b815260206004820152601b60248201527f546f6f206561726c7920746f20636c61696d20726577617264732e0000000000604482015260640161029b565b6001600160a01b038416600090815260036020526040812084516001929086908590811061034a5761034a610fc5565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600084848151811061038657610386610fc5565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600260008584815181106103cb576103cb610fc5565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600084848151811061040757610407610fc5565b602002602001015181526020019081526020016000205490506000806104468786868151811061043957610439610fc5565b6020026020010151610759565b9092509050600081610458848661100a565b6104629190611021565b9050801561052a576104a1888289888151811061048157610481610fc5565b60200260200101516001600160a01b0316610a169092919063ffffffff16565b876001600160a01b03167fd3208fd5300db64b97bc442f47ade72b7ebcd9272aaecdcc04c777bb762861b98887815181106104de576104de610fc5565b60200260200101518888815181106104f8576104f8610fc5565b602090810291909101810151604080516001600160a01b03909416845291830152810184905260600160405180910390a25b50505050808061053990611043565b9150506101c0565b50505050565b6001600160a01b0382166000908152600260209081526040808320438452909152902054156105a65760405162461bcd60e51b815260206004820152600b60248201526a105b1c9958591e481cd95d60aa1b604482015260640161029b565b6105bb6001600160a01b038316333084610a7e565b6001600160a01b0382166000818152600260209081526040808320438085529083529281902085905580519384529083018490528201527f9e725a59e293b3a40cf2ae1148796b9ab47f79644276301835a4ee7bf4d807349060600160405180910390a15050565b6060825167ffffffffffffffff81111561063f5761063f610d37565b604051908082528060200260200182016040528015610668578160200160208202803683370190505b50905060005b83518110156107515760006002600086848151811061068f5761068f610fc5565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008584815181106106cb576106cb610fc5565b602002602001015181526020019081526020016000205490506000806106fd8887868151811061043957610439610fc5565b909250905060008161070f848661100a565b6107199190611021565b90508086868151811061072e5761072e610fc5565b60200260200101818152505050505050808061074990611043565b91505061066e565b509392505050565b600154604051630748d63560e31b81526001600160a01b038481166004830152602482018490526000928392911690633a46b1a890604401602060405180830381865afa1580156107ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d2919061105c565b946d2bd35ae79a49ed3975a215e00000945092505050565b6000546001600160a01b031633146108445760405162461bcd60e51b815260206004820181905260248201527f4f6e6c792044414f206d61792063616c6c20746869732066756e6374696f6e2e604482015260640161029b565b6001600160a01b03831660009081526002602090815260408083208584529091529020546108b45760405162461bcd60e51b815260206004820152601960248201527f496e636f7272656374206c61756e63682064657461696c732e00000000000000604482015260640161029b565b6108c1826209e340610ff1565b4310156109105760405162461bcd60e51b815260206004820152601a60248201527f546f6f206561726c7920746f2077697468647261772066656573000000000000604482015260640161029b565b6001600160a01b038316600081815260026020908152604080832086845290915280822091909155516370a0823160e01b815230600482015284919063a9059cbb90849083906370a0823190602401602060405180830381865afa15801561097c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a0919061105c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156109eb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0f9190611075565b5050505050565b6040516001600160a01b038316602482015260448101829052610a7990849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610ab6565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526105419085906323b872dd60e01b90608401610a42565b6000610b0b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610b8b9092919063ffffffff16565b9050805160001480610b2c575080806020019051810190610b2c9190611075565b610a795760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161029b565b6060610b9a8484600085610ba2565b949350505050565b606082471015610c035760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161029b565b600080866001600160a01b03168587604051610c1f91906110c2565b60006040518083038185875af1925050503d8060008114610c5c576040519150601f19603f3d011682016040523d82523d6000602084013e610c61565b606091505b5091509150610c7287838387610c7d565b979650505050505050565b60608315610cec578251600003610ce5576001600160a01b0385163b610ce55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161029b565b5081610b9a565b610b9a8383815115610d015781518083602001fd5b8060405162461bcd60e51b815260040161029b91906110de565b80356001600160a01b0381168114610d3257600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610d7657610d76610d37565b604052919050565b600067ffffffffffffffff821115610d9857610d98610d37565b5060051b60200190565b600082601f830112610db357600080fd5b81356020610dc8610dc383610d7e565b610d4d565b82815260059290921b84018101918181019086841115610de757600080fd5b8286015b84811015610e025780358352918301918301610deb565b509695505050505050565b600080600060608486031215610e2257600080fd5b610e2b84610d1b565b925060208085013567ffffffffffffffff80821115610e4957600080fd5b818701915087601f830112610e5d57600080fd5b8135610e6b610dc382610d7e565b81815260059190911b8301840190848101908a831115610e8a57600080fd5b938501935b82851015610eaf57610ea085610d1b565b82529385019390850190610e8f565b965050506040870135925080831115610ec757600080fd5b5050610ed586828701610da2565b9150509250925092565b60008060408385031215610ef257600080fd5b610efb83610d1b565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b81811015610f4157835183529284019291840191600101610f25565b50909695505050505050565b600080600060608486031215610f6257600080fd5b610f6b84610d1b565b925060208401359150610f8060408501610d1b565b90509250925092565b600080600060608486031215610f9e57600080fd5b610fa784610d1b565b9250610fb560208501610d1b565b9150604084013590509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561100457611004610fdb565b92915050565b808202811582820484141761100457611004610fdb565b60008261103e57634e487b7160e01b600052601260045260246000fd5b500490565b60006001820161105557611055610fdb565b5060010190565b60006020828403121561106e57600080fd5b5051919050565b60006020828403121561108757600080fd5b8151801515811461109757600080fd5b9392505050565b60005b838110156110b95781810151838201526020016110a1565b50506000910152565b600082516110d481846020870161109e565b9190910192915050565b60208152600082518060208401526110fd81604085016020870161109e565b601f01601f1916919091016040019291505056fea164736f6c6343000811000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000025d9ded9cd633f3a8564900e610cd3efbe047ab90000000000000000000000003486b751a36f731a1bebff779374bad635864919
-----Decoded View---------------
Arg [0] : _dao (address): 0x25d9deD9cD633f3A8564900e610Cd3EFbE047ab9
Arg [1] : _inedible (address): 0x3486b751a36F731A1bEbFf779374baD635864919
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000025d9ded9cd633f3a8564900e610cd3efbe047ab9
Arg [1] : 0000000000000000000000003486b751a36f731a1bebff779374bad635864919
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.