Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 39,394 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim Reward | 18045202 | 392 days ago | IN | 0 ETH | 0.00027258 | ||||
Emergency Withdr... | 18041302 | 393 days ago | IN | 0 ETH | 0.0007539 | ||||
Claim Reward | 18008838 | 398 days ago | IN | 0 ETH | 0.00030356 | ||||
Claim Reward | 17863735 | 418 days ago | IN | 0 ETH | 0.00081796 | ||||
Withdraw | 17849832 | 420 days ago | IN | 0 ETH | 0.00055699 | ||||
Claim Reward | 17828182 | 423 days ago | IN | 0 ETH | 0.00127726 | ||||
Claim Reward | 17763898 | 432 days ago | IN | 0 ETH | 0.00216404 | ||||
Claim Reward | 17763062 | 432 days ago | IN | 0 ETH | 0.0013139 | ||||
Claim Reward | 17685419 | 443 days ago | IN | 0 ETH | 0.00237613 | ||||
Claim Reward | 17685274 | 443 days ago | IN | 0 ETH | 0.00169831 | ||||
Claim Reward | 17684719 | 443 days ago | IN | 0 ETH | 0.00151091 | ||||
Claim Reward | 17683904 | 443 days ago | IN | 0 ETH | 0.00153306 | ||||
Claim Reward | 17682684 | 443 days ago | IN | 0 ETH | 0.00149976 | ||||
Claim Reward | 17682651 | 443 days ago | IN | 0 ETH | 0.00124719 | ||||
Claim Reward | 17682546 | 443 days ago | IN | 0 ETH | 0.0012197 | ||||
Claim Reward | 17682411 | 443 days ago | IN | 0 ETH | 0.0014657 | ||||
Claim Reward | 17682393 | 443 days ago | IN | 0 ETH | 0.00117302 | ||||
Claim Reward | 17680526 | 444 days ago | IN | 0 ETH | 0.00150592 | ||||
Claim Reward | 17680386 | 444 days ago | IN | 0 ETH | 0.00207179 | ||||
Claim Reward | 17677146 | 444 days ago | IN | 0 ETH | 0.00157863 | ||||
Claim Reward | 17674947 | 444 days ago | IN | 0 ETH | 0.00130691 | ||||
Claim Reward | 17674413 | 444 days ago | IN | 0 ETH | 0.00117784 | ||||
Claim Reward | 17673990 | 444 days ago | IN | 0 ETH | 0.00124208 | ||||
Claim Reward | 17673749 | 445 days ago | IN | 0 ETH | 0.00142379 | ||||
Claim Reward | 17670477 | 445 days ago | IN | 0 ETH | 0.0016264 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
17849832 | 420 days ago | 0.2859126 ETH |
Loading...
Loading
Contract Name:
TwitFiReward
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 150 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract TwitFiReward is Pausable { using SafeMath for uint256; using Counters for Counters.Counter; address private _owner; mapping (address => bool) private _validators; mapping(address => Counters.Counter) private _nonces; IERC20 public _erc20; struct Reward { uint256 _amount; address _holder; uint256 _deadline; bytes _signature; string _ref; } event CliamReward(uint256 amount, address account, string ref, uint256 timestamp); constructor(IERC20 _token) { _owner = msg.sender; _erc20 = _token; _validators[msg.sender] = true; } function setErc20(IERC20 _token) public onlyOwner { _erc20 = _token; } function setValidator(address _validator, bool _enable) public whenNotPaused onlyOwner { _validators[_validator] = _enable; } function isValidator(address _validator) public view returns (bool) { return _validators[_validator]; } function claimReward(bytes memory _data, uint _deadline) external whenNotPaused { require(block.timestamp <= _deadline, "Deadline exceeded"); Reward memory reward; (reward) = abi.decode(_data, (Reward)); address approver = approverSignature(reward); require(_validators[approver], 'Unauthorized Opetator!'); require(reward._holder == msg.sender, 'Unauthorized!'); require(_erc20.balanceOf(address(this)) >= reward._amount, 'INSUFFICIENT_BALANCE'); _erc20.transfer(msg.sender, reward._amount); _increaseNounce(reward._holder); emit CliamReward(reward._amount, reward._holder, reward._ref, block.timestamp); } function approverSignature(Reward memory reward) internal view virtual returns (address signer) { bytes32 structHash = keccak256(abi.encode(reward._amount, reward._holder, address(this), reward._ref, _nonces[reward._holder].current(), reward._deadline)); signer = recover(structHash, reward._signature); } function recover(bytes32 structHash, bytes memory _signature) internal view virtual returns (address signer) { bytes memory prefix = "\x19Ethereum Signed Message:\n32"; bytes32 prefixedHash = keccak256(abi.encodePacked(prefix, structHash)); signer = ECDSA.recover(prefixedHash, _signature); } function nonces(address _account) public view virtual returns (uint256) { return _nonces[_account].current(); } function setOwner(address _newOwner) public onlyOwner { _owner = _newOwner; } function _increaseNounce(address _account) private { Counters.Counter storage nonce = _nonces[_account]; nonce.increment(); } function withdraw() public onlyOwner { uint amount = address(this).balance; require(amount > 0, "Insufficient balance"); (bool success, ) = payable(_owner).call { value: amount }(""); require(success, "Failed to send Matic"); } function emergencyWithdraw() external onlyOwner { _erc20.transfer(_owner, _erc20.balanceOf(address(this))); } modifier onlyOwner { require(msg.sender == _owner, "UNAUTHORIZED"); _; } receive() payable external {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // 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 (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @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) { return a + b; } /** * @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 a - b; } /** * @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) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting 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 a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting 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) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * 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) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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 v4.4.1 (utils/Context.sol) 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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @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); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
{ "optimizer": { "enabled": true, "runs": 150 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"string","name":"ref","type":"string"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"CliamReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"_erc20","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"uint256","name":"_deadline","type":"uint256"}],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_validator","type":"address"}],"name":"isValidator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"setErc20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_validator","type":"address"},{"internalType":"bool","name":"_enable","type":"bool"}],"name":"setValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516111b33803806111b383398101604081905261002f9161008a565b600080546001600160a81b03191661010033908102919091178255600380546001600160a01b0319166001600160a01b039490941693909317909255908152600160208190526040909120805460ff191690911790556100ba565b60006020828403121561009c57600080fd5b81516001600160a01b03811681146100b357600080fd5b9392505050565b6110ea806100c96000396000f3fe6080604052600436106100955760003560e01c8063db2e21bc11610059578063db2e21bc14610165578063e7e393691461017a578063ee9b80a41461019a578063f709f538146101ba578063facd743b146101f257600080fd5b806313af4035146100a15780633ccfd60b146100c35780634623c91d146100d85780635c975abb146100f85780637ecebe001461012157600080fd5b3661009c57005b600080fd5b3480156100ad57600080fd5b506100c16100bc366004610cb4565b61022b565b005b3480156100cf57600080fd5b506100c161028b565b3480156100e457600080fd5b506100c16100f3366004610cdf565b6103a1565b34801561010457600080fd5b5060005460ff165b60405190151581526020015b60405180910390f35b34801561012d57600080fd5b5061015761013c366004610cb4565b6001600160a01b031660009081526002602052604090205490565b604051908152602001610118565b34801561017157600080fd5b506100c1610403565b34801561018657600080fd5b506100c1610195366004610db0565b610522565b3480156101a657600080fd5b506100c16101b5366004610cb4565b61081d565b3480156101c657600080fd5b506003546101da906001600160a01b031681565b6040516001600160a01b039091168152602001610118565b3480156101fe57600080fd5b5061010c61020d366004610cb4565b6001600160a01b031660009081526001602052604090205460ff1690565b60005461010090046001600160a01b031633146102635760405162461bcd60e51b815260040161025a90610e32565b60405180910390fd5b600080546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60005461010090046001600160a01b031633146102ba5760405162461bcd60e51b815260040161025a90610e32565b47806102ff5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640161025a565b600080546040516101009091046001600160a01b03169083908381818185875af1925050503d8060008114610350576040519150601f19603f3d011682016040523d82523d6000602084013e610355565b606091505b505090508061039d5760405162461bcd60e51b81526020600482015260146024820152734661696c656420746f2073656e64204d6174696360601b604482015260640161025a565b5050565b6103a961086e565b60005461010090046001600160a01b031633146103d85760405162461bcd60e51b815260040161025a90610e32565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b60005461010090046001600160a01b031633146104325760405162461bcd60e51b815260040161025a90610e32565b6003546000546040516370a0823160e01b81523060048201526001600160a01b039283169263a9059cbb926101009004169083906370a0823190602401602060405180830381865afa15801561048c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b09190610e58565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156104fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051f9190610e71565b50565b61052a61086e565b8042111561056e5760405162461bcd60e51b8152602060048201526011602482015270111958591b1a5b9948195e18d959591959607a1b604482015260640161025a565b6105a96040518060a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081525090565b828060200190518101906105bd9190610f02565b905060006105ca826108b6565b6001600160a01b03811660009081526001602052604090205490915060ff1661062e5760405162461bcd60e51b8152602060048201526016602482015275556e617574686f72697a6564204f70657461746f722160501b604482015260640161025a565b60208201516001600160a01b0316331461067a5760405162461bcd60e51b815260206004820152600d60248201526c556e617574686f72697a65642160981b604482015260640161025a565b81516003546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156106c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e89190610e58565b101561072d5760405162461bcd60e51b8152602060048201526014602482015273494e53554646494349454e545f42414c414e434560601b604482015260640161025a565b600354825160405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610781573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a59190610e71565b506107ce82602001516001600160a01b0316600090815260026020526040902080546001019055565b7fd29dc2bf0836cc9aa288f9ae3977cf67110c9e5dc4680cd3a42bb9629d67dbde8260000151836020015184608001514260405161080f9493929190610ffa565b60405180910390a150505050565b60005461010090046001600160a01b0316331461084c5760405162461bcd60e51b815260040161025a90610e32565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60005460ff16156108b45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161025a565b565b805160208083015160808401516001600160a01b038216600090815260028452604080822054818801519151929687966108fa969195919430949293929101611035565b604051602081830303815290604052805190602001209050610920818460600151610927565b9392505050565b6000806040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a33320000000081525090506000818560405160200161097792919061107c565b60405160208183030381529060405280519060200120905061099981856109a2565b95945050505050565b60008060006109b185856109c6565b915091506109be81610a0b565b509392505050565b60008082516041036109fc5760208301516040840151606085015160001a6109f087828585610bbc565b94509450505050610a04565b506000905060025b9250929050565b6000816004811115610a1f57610a1f61109e565b03610a275750565b6001816004811115610a3b57610a3b61109e565b03610a835760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161025a565b6002816004811115610a9757610a9761109e565b03610ae45760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161025a565b6003816004811115610af857610af861109e565b03610b505760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161025a565b6004816004811115610b6457610b6461109e565b0361051f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161025a565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03831115610be95750600090506003610c96565b8460ff16601b14158015610c0157508460ff16601c14155b15610c125750600090506004610c96565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610c66573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610c8f57600060019250925050610c96565b9150600090505b94509492505050565b6001600160a01b038116811461051f57600080fd5b600060208284031215610cc657600080fd5b813561092081610c9f565b801515811461051f57600080fd5b60008060408385031215610cf257600080fd5b8235610cfd81610c9f565b91506020830135610d0d81610cd1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff81118282101715610d5157610d51610d18565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610d8057610d80610d18565b604052919050565b600067ffffffffffffffff821115610da257610da2610d18565b50601f01601f191660200190565b60008060408385031215610dc357600080fd5b823567ffffffffffffffff811115610dda57600080fd5b8301601f81018513610deb57600080fd5b8035610dfe610df982610d88565b610d57565b818152866020838501011115610e1357600080fd5b8160208401602083013760006020928201830152969401359450505050565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b600060208284031215610e6a57600080fd5b5051919050565b600060208284031215610e8357600080fd5b815161092081610cd1565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b6000610ec0610df984610d88565b9050828152838383011115610ed457600080fd5b610920836020830184610e8e565b600082601f830112610ef357600080fd5b61092083835160208501610eb2565b600060208284031215610f1457600080fd5b815167ffffffffffffffff80821115610f2c57600080fd5b9083019060a08286031215610f4057600080fd5b610f48610d2e565b825181526020830151610f5a81610c9f565b602082015260408381015190820152606083015182811115610f7b57600080fd5b8301601f81018713610f8c57600080fd5b610f9b87825160208401610eb2565b606083015250608083015182811115610fb357600080fd5b610fbf87828601610ee2565b60808301525095945050505050565b60008151808452610fe6816020860160208601610e8e565b601f01601f19169290920160200192915050565b8481526001600160a01b038416602082015260806040820181905260009061102490830185610fce565b905082606083015295945050505050565b8681526001600160a01b0386811660208301528516604082015260c06060820181905260009061106790830186610fce565b60808301949094525060a00152949350505050565b6000835161108e818460208801610e8e565b9190910191825250602001919050565b634e487b7160e01b600052602160045260246000fdfea264697066735822122080a51bcbd81e18f8ee3b58d532d60de7c43ee20387a120b32432e36f306b7a7164736f6c634300081100330000000000000000000000003a9cf14a7ade7544645ca49a88f7a20623ba0442
Deployed Bytecode
0x6080604052600436106100955760003560e01c8063db2e21bc11610059578063db2e21bc14610165578063e7e393691461017a578063ee9b80a41461019a578063f709f538146101ba578063facd743b146101f257600080fd5b806313af4035146100a15780633ccfd60b146100c35780634623c91d146100d85780635c975abb146100f85780637ecebe001461012157600080fd5b3661009c57005b600080fd5b3480156100ad57600080fd5b506100c16100bc366004610cb4565b61022b565b005b3480156100cf57600080fd5b506100c161028b565b3480156100e457600080fd5b506100c16100f3366004610cdf565b6103a1565b34801561010457600080fd5b5060005460ff165b60405190151581526020015b60405180910390f35b34801561012d57600080fd5b5061015761013c366004610cb4565b6001600160a01b031660009081526002602052604090205490565b604051908152602001610118565b34801561017157600080fd5b506100c1610403565b34801561018657600080fd5b506100c1610195366004610db0565b610522565b3480156101a657600080fd5b506100c16101b5366004610cb4565b61081d565b3480156101c657600080fd5b506003546101da906001600160a01b031681565b6040516001600160a01b039091168152602001610118565b3480156101fe57600080fd5b5061010c61020d366004610cb4565b6001600160a01b031660009081526001602052604090205460ff1690565b60005461010090046001600160a01b031633146102635760405162461bcd60e51b815260040161025a90610e32565b60405180910390fd5b600080546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60005461010090046001600160a01b031633146102ba5760405162461bcd60e51b815260040161025a90610e32565b47806102ff5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640161025a565b600080546040516101009091046001600160a01b03169083908381818185875af1925050503d8060008114610350576040519150601f19603f3d011682016040523d82523d6000602084013e610355565b606091505b505090508061039d5760405162461bcd60e51b81526020600482015260146024820152734661696c656420746f2073656e64204d6174696360601b604482015260640161025a565b5050565b6103a961086e565b60005461010090046001600160a01b031633146103d85760405162461bcd60e51b815260040161025a90610e32565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b60005461010090046001600160a01b031633146104325760405162461bcd60e51b815260040161025a90610e32565b6003546000546040516370a0823160e01b81523060048201526001600160a01b039283169263a9059cbb926101009004169083906370a0823190602401602060405180830381865afa15801561048c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b09190610e58565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156104fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051f9190610e71565b50565b61052a61086e565b8042111561056e5760405162461bcd60e51b8152602060048201526011602482015270111958591b1a5b9948195e18d959591959607a1b604482015260640161025a565b6105a96040518060a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081525090565b828060200190518101906105bd9190610f02565b905060006105ca826108b6565b6001600160a01b03811660009081526001602052604090205490915060ff1661062e5760405162461bcd60e51b8152602060048201526016602482015275556e617574686f72697a6564204f70657461746f722160501b604482015260640161025a565b60208201516001600160a01b0316331461067a5760405162461bcd60e51b815260206004820152600d60248201526c556e617574686f72697a65642160981b604482015260640161025a565b81516003546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156106c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e89190610e58565b101561072d5760405162461bcd60e51b8152602060048201526014602482015273494e53554646494349454e545f42414c414e434560601b604482015260640161025a565b600354825160405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610781573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a59190610e71565b506107ce82602001516001600160a01b0316600090815260026020526040902080546001019055565b7fd29dc2bf0836cc9aa288f9ae3977cf67110c9e5dc4680cd3a42bb9629d67dbde8260000151836020015184608001514260405161080f9493929190610ffa565b60405180910390a150505050565b60005461010090046001600160a01b0316331461084c5760405162461bcd60e51b815260040161025a90610e32565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60005460ff16156108b45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161025a565b565b805160208083015160808401516001600160a01b038216600090815260028452604080822054818801519151929687966108fa969195919430949293929101611035565b604051602081830303815290604052805190602001209050610920818460600151610927565b9392505050565b6000806040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a33320000000081525090506000818560405160200161097792919061107c565b60405160208183030381529060405280519060200120905061099981856109a2565b95945050505050565b60008060006109b185856109c6565b915091506109be81610a0b565b509392505050565b60008082516041036109fc5760208301516040840151606085015160001a6109f087828585610bbc565b94509450505050610a04565b506000905060025b9250929050565b6000816004811115610a1f57610a1f61109e565b03610a275750565b6001816004811115610a3b57610a3b61109e565b03610a835760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161025a565b6002816004811115610a9757610a9761109e565b03610ae45760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161025a565b6003816004811115610af857610af861109e565b03610b505760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161025a565b6004816004811115610b6457610b6461109e565b0361051f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161025a565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03831115610be95750600090506003610c96565b8460ff16601b14158015610c0157508460ff16601c14155b15610c125750600090506004610c96565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610c66573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610c8f57600060019250925050610c96565b9150600090505b94509492505050565b6001600160a01b038116811461051f57600080fd5b600060208284031215610cc657600080fd5b813561092081610c9f565b801515811461051f57600080fd5b60008060408385031215610cf257600080fd5b8235610cfd81610c9f565b91506020830135610d0d81610cd1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff81118282101715610d5157610d51610d18565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610d8057610d80610d18565b604052919050565b600067ffffffffffffffff821115610da257610da2610d18565b50601f01601f191660200190565b60008060408385031215610dc357600080fd5b823567ffffffffffffffff811115610dda57600080fd5b8301601f81018513610deb57600080fd5b8035610dfe610df982610d88565b610d57565b818152866020838501011115610e1357600080fd5b8160208401602083013760006020928201830152969401359450505050565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b600060208284031215610e6a57600080fd5b5051919050565b600060208284031215610e8357600080fd5b815161092081610cd1565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b6000610ec0610df984610d88565b9050828152838383011115610ed457600080fd5b610920836020830184610e8e565b600082601f830112610ef357600080fd5b61092083835160208501610eb2565b600060208284031215610f1457600080fd5b815167ffffffffffffffff80821115610f2c57600080fd5b9083019060a08286031215610f4057600080fd5b610f48610d2e565b825181526020830151610f5a81610c9f565b602082015260408381015190820152606083015182811115610f7b57600080fd5b8301601f81018713610f8c57600080fd5b610f9b87825160208401610eb2565b606083015250608083015182811115610fb357600080fd5b610fbf87828601610ee2565b60808301525095945050505050565b60008151808452610fe6816020860160208601610e8e565b601f01601f19169290920160200192915050565b8481526001600160a01b038416602082015260806040820181905260009061102490830185610fce565b905082606083015295945050505050565b8681526001600160a01b0386811660208301528516604082015260c06060820181905260009061106790830186610fce565b60808301949094525060a00152949350505050565b6000835161108e818460208801610e8e565b9190910191825250602001919050565b634e487b7160e01b600052602160045260246000fdfea264697066735822122080a51bcbd81e18f8ee3b58d532d60de7c43ee20387a120b32432e36f306b7a7164736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003a9cf14a7ade7544645ca49a88f7a20623ba0442
-----Decoded View---------------
Arg [0] : _token (address): 0x3A9CF14A7aDE7544645cA49A88F7a20623bA0442
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000003a9cf14a7ade7544645ca49a88f7a20623ba0442
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ 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.