My Name Tag:
Not Available
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
TokenDistributor
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 20000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// 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); } }
// 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.5.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 IVotesUpgradeable { /** * @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 the end of a past block (`blockNumber`). */ function getPastVotes(address account, uint256 blockNumber) external view returns (uint256); /** * @dev Returns the total supply of votes available at the end of a past block (`blockNumber`). * * 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 blockNumber) 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.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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 (token/ERC20/extensions/draft-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 IERC20PermitUpgradeable { /** * @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: Apache-2.0 pragma solidity 0.8.16; import {IERC20VotesUpgradeable} from "./Util.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; /// @title Token Distributor /// @notice Holds tokens for users to claim. /// @dev Unlike a merkle distributor this contract uses storage to record claims rather than a /// merkle root. This is because calldata on Arbitrum is relatively expensive when compared with /// storage, since calldata uses L1 gas. /// After construction do the following /// 1. transfer tokens to this contract /// 2. setRecipients - called as many times as required to set all the recipients /// 3. transferOwnership - the ownership of the contract should be transferred to a new owner (eg DAO) after all recipients have been set contract TokenDistributor is Ownable { /// @notice Token to be distributed IERC20VotesUpgradeable public immutable token; /// @notice Address to receive tokens that were not claimed address payable public sweepReceiver; /// @notice amount of tokens that can be claimed by address mapping(address => uint256) public claimableTokens; /// @notice Total amount of tokens claimable by recipients of this contract uint256 public totalClaimable; /// @notice Block number at which claiming starts uint256 public immutable claimPeriodStart; /// @notice Block number at which claiming ends uint256 public immutable claimPeriodEnd; /// @notice recipient can claim this amount of tokens event CanClaim(address indexed recipient, uint256 amount); /// @notice recipient has claimed this amount of tokens event HasClaimed(address indexed recipient, uint256 amount); /// @notice leftover tokens after claiming period have been swept event Swept(uint256 amount); /// @notice new address set to receive unclaimed tokens event SweepReceiverSet(address indexed newSweepReceiver); /// @notice Tokens withdrawn event Withdrawal(address indexed recipient, uint256 amount); constructor( IERC20VotesUpgradeable _token, address payable _sweepReceiver, address _owner, uint256 _claimPeriodStart, uint256 _claimPeriodEnd, address delegateTo ) Ownable() { require(address(_token) != address(0), "TokenDistributor: zero token address"); require(_sweepReceiver != address(0), "TokenDistributor: zero sweep address"); require(_owner != address(0), "TokenDistributor: zero owner address"); require(_claimPeriodStart > block.number, "TokenDistributor: start should be in the future"); require(_claimPeriodEnd > _claimPeriodStart, "TokenDistributor: start should be before end"); require(delegateTo != address(0), "TokenDistributor: zero delegate to"); _token.delegate(delegateTo); token = _token; _setSweepReciever(_sweepReceiver); claimPeriodStart = _claimPeriodStart; claimPeriodEnd = _claimPeriodEnd; _transferOwnership(_owner); } /// @notice Allows owner to update address of sweep receiver function setSweepReciever(address payable _sweepReceiver) external onlyOwner { _setSweepReciever(_sweepReceiver); } function _setSweepReciever(address payable _sweepReceiver) internal { require(_sweepReceiver != address(0), "TokenDistributor: zero sweep receiver address"); sweepReceiver = _sweepReceiver; emit SweepReceiverSet(_sweepReceiver); } /// @notice Allows owner of the contract to withdraw tokens /// @dev A safety measure in case something goes wrong with the distribution function withdraw(uint256 amount) external onlyOwner { require(token.transfer(msg.sender, amount), "TokenDistributor: fail transfer token"); emit Withdrawal(msg.sender, amount); } /// @notice Allows owner to set a list of recipients to receive tokens /// @dev This may need to be called many times to set the full list of recipients function setRecipients(address[] calldata _recipients, uint256[] calldata _claimableAmount) external onlyOwner { require( _recipients.length == _claimableAmount.length, "TokenDistributor: invalid array length" ); uint256 sum = totalClaimable; for (uint256 i = 0; i < _recipients.length; i++) { // sanity check that the address being set is consistent require(claimableTokens[_recipients[i]] == 0, "TokenDistributor: recipient already set"); claimableTokens[_recipients[i]] = _claimableAmount[i]; emit CanClaim(_recipients[i], _claimableAmount[i]); unchecked { sum += _claimableAmount[i]; } } // sanity check that the current has been sufficiently allocated require(token.balanceOf(address(this)) >= sum, "TokenDistributor: not enough balance"); totalClaimable = sum; } /// @notice Claim and delegate in a single call /// @dev Different implementations may handle validation/fail delegateBySig differently. here a OZ v4.6.0 impl is assumed /// @dev delegateBySig by OZ does not support `IERC1271`, so smart contract wallets should not use this method /// @dev delegateBySig is used so that the token contract doesn't need to contain any claiming functionality function claimAndDelegate(address delegatee, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external { claim(); // WARNING: there's a nuisance attack that can occur here on networks that allow front running // A malicious party could see the signature when it's broadcast to a public mempool and create a // new transaction to front run by calling delegateBySig on the token with the sig. The result would // be that the tx to claimAndDelegate would fail. This is only a nuisance as the user can just call the // claim function below to claim their funds, however it would be an annoying UX and they would have paid // for a failed transaction. If using this function on a network that allows front running consider // modifying it to put the delegateBySig in a try/catch and rethrow for all errors that aren't "nonce invalid" token.delegateBySig(delegatee, 0, expiry, v, r, s); // ensure that delegation did take place, this is just a sanity check that ensures the signature // matched to the sender who was claiming. It helps to detect errors in forming signatures require(token.delegates(msg.sender) == delegatee, "TokenDistributor: delegate failed"); } /// @notice Sends any unclaimed funds to the sweep reciever once the claiming period is over function sweep() external { require(block.number >= claimPeriodEnd, "TokenDistributor: not ended"); uint256 leftovers = token.balanceOf(address(this)); require(leftovers != 0, "TokenDistributor: no leftovers"); require(token.transfer(sweepReceiver, leftovers), "TokenDistributor: fail token transfer"); emit Swept(leftovers); // contract is destroyed to clean up storage selfdestruct(payable(sweepReceiver)); } /// @notice Allows a recipient to claim their tokens /// @dev Can only be called during the claim period function claim() public { require(block.number >= claimPeriodStart, "TokenDistributor: claim not started"); require(block.number < claimPeriodEnd, "TokenDistributor: claim ended"); uint256 amount = claimableTokens[msg.sender]; require(amount > 0, "TokenDistributor: nothing to claim"); claimableTokens[msg.sender] = 0; // we don't use safeTransfer since impl is assumed to be OZ require(token.transfer(msg.sender, amount), "TokenDistributor: fail token transfer"); emit HasClaimed(msg.sender, amount); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.16; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/governance/utils/IVotesUpgradeable.sol"; /// @notice increments an integer without checking for overflows /// @dev from https://github.com/ethereum/solidity/issues/11721#issuecomment-890917517 function uncheckedInc(uint256 x) pure returns (uint256) { unchecked { return x + 1; } } /// @title A token contract with governance capabilities interface IERC20VotesUpgradeable is IVotesUpgradeable, IERC20Upgradeable, IERC20PermitUpgradeable {}
{ "remappings": [ "@arbitrum/nitro-contracts/=node_modules/@arbitrum/nitro-contracts/", "@arbitrum/token-bridge-contracts/=node_modules/@arbitrum/token-bridge-contracts/", "@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/", "@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/" ], "optimizer": { "enabled": true, "runs": 20000 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
[{"inputs":[{"internalType":"contract IERC20VotesUpgradeable","name":"_token","type":"address"},{"internalType":"address payable","name":"_sweepReceiver","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_claimPeriodStart","type":"uint256"},{"internalType":"uint256","name":"_claimPeriodEnd","type":"uint256"},{"internalType":"address","name":"delegateTo","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CanClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"HasClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newSweepReceiver","type":"address"}],"name":"SweepReceiverSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"claimAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimPeriodEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimPeriodStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimableTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_recipients","type":"address[]"},{"internalType":"uint256[]","name":"_claimableAmount","type":"uint256[]"}],"name":"setRecipients","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_sweepReceiver","type":"address"}],"name":"setSweepReciever","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweepReceiver","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20VotesUpgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e06040523480156200001157600080fd5b5060405162001b8038038062001b80833981016040819052620000349162000436565b6200003f3362000315565b6001600160a01b038616620000a75760405162461bcd60e51b8152602060048201526024808201527f546f6b656e4469737472696275746f723a207a65726f20746f6b656e206164646044820152637265737360e01b60648201526084015b60405180910390fd5b6001600160a01b0385166200010b5760405162461bcd60e51b8152602060048201526024808201527f546f6b656e4469737472696275746f723a207a65726f207377656570206164646044820152637265737360e01b60648201526084016200009e565b6001600160a01b0384166200016f5760405162461bcd60e51b8152602060048201526024808201527f546f6b656e4469737472696275746f723a207a65726f206f776e6572206164646044820152637265737360e01b60648201526084016200009e565b438311620001c75760405162461bcd60e51b815260206004820152602f602482015260008051602062001b6083398151915260448201526e6520696e207468652066757475726560881b60648201526084016200009e565b8282116200021c5760405162461bcd60e51b815260206004820152602c602482015260008051602062001b6083398151915260448201526b19481899599bdc9948195b9960a21b60648201526084016200009e565b6001600160a01b0381166200027f5760405162461bcd60e51b815260206004820152602260248201527f546f6b656e4469737472696275746f723a207a65726f2064656c656761746520604482015261746f60f01b60648201526084016200009e565b6040516317066a5760e21b81526001600160a01b038281166004830152871690635c19a95c90602401600060405180830381600087803b158015620002c357600080fd5b505af1158015620002d8573d6000803e3d6000fd5b5050506001600160a01b03871660805250620002f48562000365565b60a083905260c0829052620003098462000315565b505050505050620004b3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116620003d35760405162461bcd60e51b815260206004820152602d60248201527f546f6b656e4469737472696275746f723a207a65726f2073776565702072656360448201526c6569766572206164647265737360981b60648201526084016200009e565b600180546001600160a01b0319166001600160a01b0383169081179091556040517fbea8251f76064f657f2a744bf08a1b5700486d06eb94922162892eb022d95ef690600090a250565b6001600160a01b03811681146200043357600080fd5b50565b60008060008060008060c087890312156200045057600080fd5b86516200045d816200041d565b602088015190965062000470816200041d565b604088015190955062000483816200041d565b80945050606087015192506080870151915060a0870151620004a5816200041d565b809150509295509295509295565b60805160a05160c051611637620005296000396000818161011c0152818161040e01526107fd015260008181610167015261074d015260008181610261015281816102c0015281816104c7015281816106020152818161097f01528181610b3001528181610bd20152610fc601526116376000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806378e2b59411610097578063b438abde11610066578063b438abde14610216578063f2fde38b14610229578063f6e0df9f1461023c578063fc0c546a1461025c57600080fd5b806378e2b5941461019157806384d24226146101a45780638da5cb5b146101c4578063ae373c1b1461020357600080fd5b80634838ed19116100d35780634838ed19146101515780634e71d92d1461015a57806358c13b7e14610162578063715018a61461018957600080fd5b80632e1a7d4d146100fa57806335faa4161461010f5780633da082a014610117575b600080fd5b61010d6101083660046113ac565b610283565b005b61010d61040c565b61013e7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b61013e60035481565b61010d61074b565b61013e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d610aaa565b61010d61019f3660046113e7565b610abe565b61013e6101b236600461143f565b60026020526000908152604090205481565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610148565b61010d6102113660046114af565b610ce8565b61010d61022436600461143f565b6110dc565b61010d61023736600461143f565b6110f0565b6001546101de9073ffffffffffffffffffffffffffffffffffffffff1681565b6101de7f000000000000000000000000000000000000000000000000000000000000000081565b61028b6111a4565b6040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a9059cbb906044016020604051808303816000875af115801561031e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610342919061151b565b6103d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f546f6b656e4469737472696275746f723a206661696c207472616e736665722060448201527f746f6b656e00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65906020015b60405180910390a250565b7f0000000000000000000000000000000000000000000000000000000000000000431015610496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f546f6b656e4469737472696275746f723a206e6f7420656e646564000000000060448201526064016103ca565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610523573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610547919061153d565b9050806000036105b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f546f6b656e4469737472696275746f723a206e6f206c6566746f76657273000060448201526064016103ca565b6001546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303816000875af115801561064d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610671919061151b565b6106fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f546f6b656e4469737472696275746f723a206661696c20746f6b656e2074726160448201527f6e7366657200000000000000000000000000000000000000000000000000000060648201526084016103ca565b6040518181527f7f221332ee403570bf4d61630b58189ea566ff1635269001e9df6a890f413dd89060200160405180910390a160015473ffffffffffffffffffffffffffffffffffffffff16ff5b7f00000000000000000000000000000000000000000000000000000000000000004310156107fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f546f6b656e4469737472696275746f723a20636c61696d206e6f74207374617260448201527f746564000000000000000000000000000000000000000000000000000000000060648201526084016103ca565b7f00000000000000000000000000000000000000000000000000000000000000004310610884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f546f6b656e4469737472696275746f723a20636c61696d20656e64656400000060448201526064016103ca565b3360009081526002602052604090205480610921576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f546f6b656e4469737472696275746f723a206e6f7468696e6720746f20636c6160448201527f696d00000000000000000000000000000000000000000000000000000000000060648201526084016103ca565b3360008181526002602052604080822091909155517fa9059cbb00000000000000000000000000000000000000000000000000000000815260048101919091526024810182905273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156109c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ec919061151b565b610a78576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f546f6b656e4469737472696275746f723a206661696c20746f6b656e2074726160448201527f6e7366657200000000000000000000000000000000000000000000000000000060648201526084016103ca565b60405181815233907f8629b200ebe43db58ad688b85131d53251f3f3be4c14933b4641aeebacf1c08c90602001610401565b610ab26111a4565b610abc6000611225565b565b610ac661074b565b6040517fc3cda52000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152600060248301526044820186905260ff851660648301526084820184905260a482018390527f0000000000000000000000000000000000000000000000000000000000000000169063c3cda5209060c401600060405180830381600087803b158015610b7457600080fd5b505af1158015610b88573d6000803e3d6000fd5b50506040517f587cde1e00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff88811693507f000000000000000000000000000000000000000000000000000000000000000016915063587cde1e90602401602060405180830381865afa158015610c1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3e9190611556565b73ffffffffffffffffffffffffffffffffffffffff1614610ce1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f546f6b656e4469737472696275746f723a2064656c6567617465206661696c6560448201527f640000000000000000000000000000000000000000000000000000000000000060648201526084016103ca565b5050505050565b610cf06111a4565b828114610d7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f546f6b656e4469737472696275746f723a20696e76616c69642061727261792060448201527f6c656e677468000000000000000000000000000000000000000000000000000060648201526084016103ca565b60035460005b84811015610f955760026000878784818110610da357610da3611573565b9050602002016020810190610db8919061143f565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040016000205415610e6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f546f6b656e4469737472696275746f723a20726563697069656e7420616c726560448201527f616479207365740000000000000000000000000000000000000000000000000060648201526084016103ca565b838382818110610e7e57610e7e611573565b9050602002013560026000888885818110610e9b57610e9b611573565b9050602002016020810190610eb0919061143f565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002055858582818110610ee957610ee9611573565b9050602002016020810190610efe919061143f565b73ffffffffffffffffffffffffffffffffffffffff167f87aeeb9eda09a064caef63d00f62c15063631980bfc422ad7dd30c8a79f0cbb7858584818110610f4757610f47611573565b90506020020135604051610f5d91815260200190565b60405180910390a2838382818110610f7757610f77611573565b90506020020135820191508080610f8d906115a2565b915050610d85565b506040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015281907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611022573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611046919061153d565b10156110d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546f6b656e4469737472696275746f723a206e6f7420656e6f7567682062616c60448201527f616e63650000000000000000000000000000000000000000000000000000000060648201526084016103ca565b60035550505050565b6110e46111a4565b6110ed8161129a565b50565b6110f86111a4565b73ffffffffffffffffffffffffffffffffffffffff811661119b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103ca565b6110ed81611225565b60005473ffffffffffffffffffffffffffffffffffffffff163314610abc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103ca565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff811661133d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f546f6b656e4469737472696275746f723a207a65726f2073776565702072656360448201527f656976657220616464726573730000000000000000000000000000000000000060648201526084016103ca565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517fbea8251f76064f657f2a744bf08a1b5700486d06eb94922162892eb022d95ef690600090a250565b6000602082840312156113be57600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146110ed57600080fd5b600080600080600060a086880312156113ff57600080fd5b853561140a816113c5565b945060208601359350604086013560ff8116811461142757600080fd5b94979396509394606081013594506080013592915050565b60006020828403121561145157600080fd5b813561145c816113c5565b9392505050565b60008083601f84011261147557600080fd5b50813567ffffffffffffffff81111561148d57600080fd5b6020830191508360208260051b85010111156114a857600080fd5b9250929050565b600080600080604085870312156114c557600080fd5b843567ffffffffffffffff808211156114dd57600080fd5b6114e988838901611463565b9096509450602087013591508082111561150257600080fd5b5061150f87828801611463565b95989497509550505050565b60006020828403121561152d57600080fd5b8151801515811461145c57600080fd5b60006020828403121561154f57600080fd5b5051919050565b60006020828403121561156857600080fd5b815161145c816113c5565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036115fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b506001019056fea26469706673582212200f8c309fa553f24bef509e94696c8c86f4c28ecc8d5acb1810aa60a75a5c339064736f6c63430008100033546f6b656e4469737472696275746f723a2073746172742073686f756c642062000000000000000000000000912ce59144191c1204e64559fe8253a0e49e6548000000000000000000000000bfc1feca8b09a5c5d3effe7429ebe24b9c09ef580000000000000000000000002b9acfd85440b7828db8e54694ee07b2b056b30c000000000000000000000000000000000000000000000000000000000101ba20000000000000000000000000000000000000000000000000000000000115d50000000000000000000000000000000000000000000000000000000000000a4b86
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000912ce59144191c1204e64559fe8253a0e49e6548000000000000000000000000bfc1feca8b09a5c5d3effe7429ebe24b9c09ef580000000000000000000000002b9acfd85440b7828db8e54694ee07b2b056b30c000000000000000000000000000000000000000000000000000000000101ba20000000000000000000000000000000000000000000000000000000000115d50000000000000000000000000000000000000000000000000000000000000a4b86
-----Decoded View---------------
Arg [0] : _token (address): 0x912ce59144191c1204e64559fe8253a0e49e6548
Arg [1] : _sweepReceiver (address): 0xbfc1feca8b09a5c5d3effe7429ebe24b9c09ef58
Arg [2] : _owner (address): 0x2b9acfd85440b7828db8e54694ee07b2b056b30c
Arg [3] : _claimPeriodStart (uint256): 16890400
Arg [4] : _claimPeriodEnd (uint256): 18208000
Arg [5] : delegateTo (address): 0x00000000000000000000000000000000000a4b86
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000912ce59144191c1204e64559fe8253a0e49e6548
Arg [1] : 000000000000000000000000bfc1feca8b09a5c5d3effe7429ebe24b9c09ef58
Arg [2] : 0000000000000000000000002b9acfd85440b7828db8e54694ee07b2b056b30c
Arg [3] : 000000000000000000000000000000000000000000000000000000000101ba20
Arg [4] : 000000000000000000000000000000000000000000000000000000000115d500
Arg [5] : 00000000000000000000000000000000000000000000000000000000000a4b86
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.