Source Code
Latest 25 from a total of 224 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Update Reward Di... | 24449977 | 33 hrs ago | IN | 0 ETH | 0.00006465 | ||||
| Pause | 24449943 | 33 hrs ago | IN | 0 ETH | 0.00009684 | ||||
| Distribute Rewar... | 24449941 | 33 hrs ago | IN | 0 ETH | 0.00014075 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449914 | 33 hrs ago | IN | 0 ETH | 0.00000156 | ||||
| Transfer | 24449908 | 33 hrs ago | IN | 0 ETH | 0.00000186 | ||||
| Transfer | 24449908 | 33 hrs ago | IN | 0 ETH | 0.00000186 | ||||
| Transfer | 24449908 | 33 hrs ago | IN | 0 ETH | 0.00000186 | ||||
| Transfer | 24449908 | 33 hrs ago | IN | 0 ETH | 0.00000186 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 23376945 | 151 days ago | 0.00431499 ETH | ||||
| Transfer | 23376466 | 151 days ago | 0.19555894 ETH | ||||
| Transfer | 23376466 | 151 days ago | 0.02486574 ETH | ||||
| Transfer | 23376455 | 151 days ago | 0.03108218 ETH | ||||
| Transfer | 23376447 | 151 days ago | 0.03108218 ETH | ||||
| Transfer | 23376447 | 151 days ago | 0.32593156 ETH | ||||
| Transfer | 23376443 | 151 days ago | 0.00644892 ETH | ||||
| Transfer | 23376443 | 151 days ago | 0.02207818 ETH | ||||
| Transfer | 23376443 | 151 days ago | 0.00577953 ETH | ||||
| Transfer | 23376166 | 151 days ago | 0.00577953 ETH | ||||
| Transfer | 23376166 | 151 days ago | 0.02207818 ETH | ||||
| Transfer | 23316766 | 159 days ago | 0.00980721 ETH | ||||
| Transfer | 23316721 | 159 days ago | 0.28755279 ETH | ||||
| Transfer | 23316721 | 159 days ago | 0.02320852 ETH | ||||
| Transfer | 23316715 | 159 days ago | 0.02901066 ETH | ||||
| Transfer | 23316705 | 159 days ago | 0.47925465 ETH | ||||
| Transfer | 23316705 | 159 days ago | 0.02314482 ETH | ||||
| Transfer | 23316699 | 159 days ago | 0.01173167 ETH | ||||
| Transfer | 23316699 | 159 days ago | 0.01084899 ETH | ||||
| Transfer | 23316699 | 159 days ago | 0.01094427 ETH | ||||
| Transfer | 23316699 | 159 days ago | 0.00682368 ETH | ||||
| Transfer | 23316679 | 159 days ago | 0.01084899 ETH | ||||
| Transfer | 23316679 | 159 days ago | 0.00682368 ETH | ||||
| Transfer | 23048485 | 197 days ago | 0.04519831 ETH | ||||
| Transfer | 23038694 | 198 days ago | 0.02356442 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
TriaRewardDistributor
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ZeroValue, InsufficientBalance, ZeroAddress, ArrayLengthMismatch, ZeroLengthArray} from "./utils/Common.sol";
/// @title TriaRewardDistributor
/// @notice Distributes rewards in ERC20 and native tokens to users
/// @custom:security-contact [email protected]
contract TriaRewardDistributor is AccessControl, ReentrancyGuard, Pausable {
using Address for address;
using SafeERC20 for IERC20;
/// @notice Role for distributing rewards
bytes32 public constant REWARD_DISTRIBUTOR_ROLE =
keccak256("REWARD_DISTRIBUTOR_ROLE");
/// @notice The address of the Ethereum
address public constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
/// @notice Maximum array length limit
uint256 public maxArrayLimit = 50;
/// @notice Supported tokens
mapping(address token => bool isSupported) public supportedTokens;
/// @notice Event emitted when the maximum array limit is updated
event MaxArrayLimitUpdated(uint256 _arrayLimit);
/// @notice Event emitted when supported tokens are updated
event SupportedTokensUpdated(address[] _tokens, bool[] _statuses);
/// @notice Event emitted when multiple reward distributors are updated
event RewardDistributorsUpdated(address[] _distributors, bool[] _statuses);
/// @notice Event emitted when rewards are distributed
event RewardsDistributed(
address _token,
uint256 _totalRecipients,
address[] _recipients,
uint256[] _amounts
);
/// @notice Error emitted when the token is not supported
error UnsupportedToken(address token);
/// @notice Error emitted when the array length is exceeded
error ArrayLengthExceeded();
/// @notice Modifier to validate array lengths are non-zero and matching
/// @param _array1Length Length of first array
/// @param _array2Length Length of second array
modifier validateArrayLengths(
uint256 _array1Length,
uint256 _array2Length
) {
if (_array1Length == 0 || _array2Length == 0) revert ZeroLengthArray();
if (_array1Length != _array2Length) revert ArrayLengthMismatch();
_;
}
/// @notice Modifier to validate the address is not zero
/// @param _address Address to validate
modifier isValidAddress(address _address) {
if (_address == address(0)) {
revert ZeroAddress();
}
_;
}
/// @notice Constructor to initialize the contract
constructor() {
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
}
/// @notice Accepts native token transfers
receive() external payable {}
/// @notice Pauses the contract to prevent distribution of rewards
function pause() external onlyRole(DEFAULT_ADMIN_ROLE) {
_pause();
}
/// @notice Unpauses the contract to allow distribution of rewards
function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) {
_unpause();
}
/// @notice Updates the maximum array limit
/// @param _newLimit New limit
function updateMaxArrayLimit(
uint256 _newLimit
) external onlyRole(DEFAULT_ADMIN_ROLE) {
if (_newLimit == 0) revert ZeroValue();
maxArrayLimit = _newLimit;
emit MaxArrayLimitUpdated(maxArrayLimit);
}
/// @notice Updates the supported tokens
/// @param _tokens An array of addresses to update
/// @param _statuses Exemption statuses for each address
function updateSupportedTokens(
address[] calldata _tokens,
bool[] calldata _statuses
)
external
onlyRole(DEFAULT_ADMIN_ROLE)
validateArrayLengths(_tokens.length, _statuses.length)
{
for (uint256 i; i < _tokens.length; ) {
if (_tokens[i] == address(0)) revert ZeroAddress();
supportedTokens[_tokens[i]] = _statuses[i];
unchecked {
++i;
}
}
emit SupportedTokensUpdated(_tokens, _statuses);
}
/// @notice Updates the supported reward distributors
/// @param _distributors An array of addresses to update
/// @param _statuses Exemption statuses for each address
function updateRewardDistributors(
address[] calldata _distributors,
bool[] calldata _statuses
)
external
onlyRole(DEFAULT_ADMIN_ROLE)
validateArrayLengths(_distributors.length, _statuses.length)
{
for (uint256 i; i < _distributors.length; ) {
address distributor = _distributors[i];
if (distributor == address(0)) revert ZeroAddress();
if (_statuses[i]) {
_grantRole(REWARD_DISTRIBUTOR_ROLE, distributor);
} else {
_revokeRole(REWARD_DISTRIBUTOR_ROLE, distributor);
}
unchecked {
++i;
}
}
emit RewardDistributorsUpdated(_distributors, _statuses);
}
/// @notice Recovers tokens stuck in the contract
/// @param _token Token to recover (address(0) for native token)
/// @param _amount Amount to recover
/// @param _recipient Address to send the recovered tokens to
function emergencyTokenRecover(
address _token,
uint256 _amount,
address _recipient
) external onlyRole(DEFAULT_ADMIN_ROLE) isValidAddress(_recipient) {
if (_amount == 0) revert ZeroValue();
if (!supportedTokens[_token]) revert UnsupportedToken(_token);
uint256 balance = getBalance(_token, address(this));
if (balance < _amount) revert InsufficientBalance();
if (_token == ETH) {
Address.sendValue(payable(_recipient), _amount);
} else {
IERC20(_token).safeTransfer(_recipient, _amount);
}
}
/// @notice Distributes rewards to recipients
/// @param _token Token to distribute
/// @param _recipients Recipients to distribute to
/// @param _amounts Amounts to distribute
function distributeRewards(
address _token,
address[] calldata _recipients,
uint256[] calldata _amounts
)
external
whenNotPaused
nonReentrant
onlyRole(REWARD_DISTRIBUTOR_ROLE)
validateArrayLengths(_recipients.length, _amounts.length)
{
if (_recipients.length > maxArrayLimit) revert ArrayLengthExceeded();
if (!supportedTokens[_token]) revert UnsupportedToken(_token);
uint256 totalDistributionAmount;
uint256 totalRecipients = _recipients.length;
for (uint256 i; i < totalRecipients; ) {
if (_recipients[i] == address(0)) revert ZeroAddress();
if (_amounts[i] == 0) revert ZeroValue();
totalDistributionAmount += _amounts[i];
unchecked {
++i;
}
}
if (totalDistributionAmount > getBalance(_token, address(this)))
revert InsufficientBalance();
if (_token == ETH) {
for (uint256 i; i < totalRecipients; ) {
Address.sendValue(payable(_recipients[i]), _amounts[i]);
unchecked {
++i;
}
}
} else {
for (uint256 i; i < totalRecipients; ) {
IERC20(_token).safeTransfer(_recipients[i], _amounts[i]);
unchecked {
++i;
}
}
}
emit RewardsDistributed(_token, totalRecipients, _recipients, _amounts);
}
/// @notice Get token balance for either ERC20 or native token
/// @param _token Token address (Address(ETH) for native token)
/// @param _account Account to get balance for
/// @return balance Current balance of the token
function getBalance(
address _token,
address _account
) public view isValidAddress(_account) returns (uint256) {
if (_token == ETH) {
return _account.balance;
} else {
return IERC20(_token).balanceOf(_account);
}
}
/// @notice Check if an address has distributor role
/// @param _rewardDistributor Address to check
/// @return bool True if address has distributor role
function isRewardDistributor(
address _rewardDistributor
) external view returns (bool) {
return hasRole(REWARD_DISTRIBUTOR_ROLE, _rewardDistributor);
}
}// SPDX-License-Identifier: MIT pragma solidity 0.8.26; // ETH price feed precision uint256 constant ETH_PRICE_FEED_PRECISION = 10 ** 8; // ETH precision uint256 constant WEI_PRECISION = 1e18; // USD precision uint256 constant USD_PRECISION = 1e6; /// @notice Thrown when updating an address with zero address error ZeroAddress(); /// @notice Thrown when updating with an array of no values error ZeroLengthArray(); /// @notice Thrown when two array lengths does not match error ArrayLengthMismatch(); /// @notice Thrown when sign is invalid error InvalidSignature(); /// @notice Thrown when the tokenId already exists error TokenIdAlreadyExists(uint256 tokenId); /// @notice Thrown when the tokenId does not exist error TokenIdDoesNotExist(uint256 tokenId); /// @notice Thrown when the NFT is tried to be transferred error NFTIsSoulbound(); /// @notice Thrown when Token is restricted in given round error TokenDisallowed(); /// @notice Thrown when the ETH sent is insufficient error InsufficientETHSent(uint256 sent); /// @notice Thrown when amount is invalid error ZeroValue(); /// @notice Thrown when the chainlink price feed is not updated error PriceNotUpdated(); /// @notice Thrown when the token balance is insufficient error InsufficientBalance(); /// @notice Thrown when sign deadline is expired error DeadlineExpired();
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (utils/Address.sol)
pragma solidity ^0.8.20;
import {Errors} from "./Errors.sol";
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
(bool success, bytes memory returndata) = recipient.call{value: amount}("");
if (!success) {
_revert(returndata);
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {Errors.FailedCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
* of an unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {Errors.FailedCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly ("memory-safe") {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.FailedCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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 {
bool private _paused;
/**
* @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);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @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 {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @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 v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)
pragma solidity ^0.8.20;
import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address account => bool) hasRole;
bytes32 adminRole;
}
mapping(bytes32 role => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with an {AccessControlUnauthorizedAccount} error including the required role.
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual returns (bool) {
return _roles[role].hasRole[account];
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
* is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
* is missing `role`.
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert AccessControlUnauthorizedAccount(account, role);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address callerConfirmation) public virtual {
if (callerConfirmation != _msgSender()) {
revert AccessControlBadConfirmation();
}
_revokeRole(role, callerConfirmation);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
if (!hasRole(role, account)) {
_roles[role].hasRole[account] = true;
emit RoleGranted(role, account, _msgSender());
return true;
} else {
return false;
}
}
/**
* @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
if (hasRole(role, account)) {
_roles[role].hasRole[account] = false;
emit RoleRevoked(role, account, _msgSender());
return true;
} else {
return false;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of common custom errors used in multiple contracts
*
* IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
* It is recommended to avoid relying on the error API for critical functionality.
*
* _Available since v5.1._
*/
library Errors {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedCall();
/**
* @dev The deployment failed.
*/
error FailedDeployment();
/**
* @dev A necessary precompile is missing.
*/
error MissingPrecompile(address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/IAccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev External interface of AccessControl declared to support ERC-165 detection.
*/
interface IAccessControl {
/**
* @dev The `account` is missing a role.
*/
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
/**
* @dev The caller of a function is not the expected one.
*
* NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
*/
error AccessControlBadConfirmation();
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).
* Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*/
function renounceRole(bytes32 role, address callerConfirmation) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";{
"optimizer": {
"enabled": true,
"runs": 1000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ArrayLengthExceeded","type":"error"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"UnsupportedToken","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroLengthArray","type":"error"},{"inputs":[],"name":"ZeroValue","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_arrayLimit","type":"uint256"}],"name":"MaxArrayLimitUpdated","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":"_distributors","type":"address[]"},{"indexed":false,"internalType":"bool[]","name":"_statuses","type":"bool[]"}],"name":"RewardDistributorsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_totalRecipients","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"_recipients","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"RewardsDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"_tokens","type":"address[]"},{"indexed":false,"internalType":"bool[]","name":"_statuses","type":"bool[]"}],"name":"SupportedTokensUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_DISTRIBUTOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address[]","name":"_recipients","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"distributeRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"emergencyTokenRecover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_account","type":"address"}],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardDistributor","type":"address"}],"name":"isRewardDistributor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxArrayLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"supportedTokens","outputs":[{"internalType":"bool","name":"isSupported","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newLimit","type":"uint256"}],"name":"updateMaxArrayLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_distributors","type":"address[]"},{"internalType":"bool[]","name":"_statuses","type":"bool[]"}],"name":"updateRewardDistributors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"bool[]","name":"_statuses","type":"bool[]"}],"name":"updateSupportedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
608060405260326003553480156013575f80fd5b50600180556002805460ff19169055602a5f33602f565b5060d5565b5f828152602081815260408083206001600160a01b038516845290915281205460ff1660cc575f838152602081815260408083206001600160a01b03861684529091529020805460ff1916600117905560853390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600160cf565b505f5b92915050565b61177a806100e25f395ff3fe608060405260043610610165575f3560e01c8063548b8a35116100c657806391d148541161007c578063d4fac45d11610057578063d4fac45d14610404578063d547741f14610423578063dd8c818e14610442575f80fd5b806391d1485414610390578063a217fddf146103d2578063cb9ab727146103e5575f80fd5b806368c4ac26116100ac57806368c4ac261461030f5780638322fff21461033d5780638456cb591461037c575f80fd5b8063548b8a35146102d95780635c975abb146102f8575f80fd5b806332e4bb0a1161011b57806336568abe1161010157806336568abe146102875780633f4ba83a146102a6578063449c4189146102ba575f80fd5b806332e4bb0a1461023f57806334b3ec3b14610272575f80fd5b806316ed85251161014b57806316ed8525146101c5578063248a9ca3146101e45780632f2ff15d14610220575f80fd5b806301ffc9a71461017057806305f1883e146101a4575f80fd5b3661016c57005b5f80fd5b34801561017b575f80fd5b5061018f61018a366004611368565b610461565b60405190151581526020015b60405180910390f35b3480156101af575f80fd5b506101c36101be3660046113ae565b6104f9565b005b3480156101d0575f80fd5b5061018f6101df3660046113e0565b61055f565b3480156101ef575f80fd5b506102126101fe3660046113ae565b5f9081526020819052604090206001015490565b60405190815260200161019b565b34801561022b575f80fd5b506101c361023a3660046113f9565b61059e565b34801561024a575f80fd5b506102127fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44981565b34801561027d575f80fd5b5061021260035481565b348015610292575f80fd5b506101c36102a13660046113f9565b6105c8565b3480156102b1575f80fd5b506101c3610619565b3480156102c5575f80fd5b506101c36102d4366004611423565b61062e565b3480156102e4575f80fd5b506101c36102f33660046114a4565b610746565b348015610303575f80fd5b5060025460ff1661018f565b34801561031a575f80fd5b5061018f6103293660046113e0565b60046020525f908152604090205460ff1681565b348015610348575f80fd5b5061036473eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b6040516001600160a01b03909116815260200161019b565b348015610387575f80fd5b506101c36108bb565b34801561039b575f80fd5b5061018f6103aa3660046113f9565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156103dd575f80fd5b506102125f81565b3480156103f0575f80fd5b506101c36103ff3660046114a4565b6108cd565b34801561040f575f80fd5b5061021261041e366004611510565b610a44565b34801561042e575f80fd5b506101c361043d3660046113f9565b610b2f565b34801561044d575f80fd5b506101c361045c366004611538565b610b53565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806104f357507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b5f61050381610e8e565b815f0361052357604051637c946ed760e01b815260040160405180910390fd5b60038290556040518281527f3cc903be55ae5f28b8a8f81a852fa714ef0570b0aca5ca300c11f4bc775504119060200160405180910390a15050565b6001600160a01b0381165f9081527f9e607de338c7d6508550727646d2998939f27517879a7dd916362b3520e39487602052604081205460ff166104f3565b5f828152602081905260409020600101546105b881610e8e565b6105c28383610e98565b50505050565b6001600160a01b038116331461060a576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106148282610f3f565b505050565b5f61062381610e8e565b61062b610fc0565b50565b5f61063881610e8e565b816001600160a01b0381166106605760405163d92e233d60e01b815260040160405180910390fd5b835f0361068057604051637c946ed760e01b815260040160405180910390fd5b6001600160a01b0385165f9081526004602052604090205460ff166106c857604051635f8b555b60e11b81526001600160a01b03861660048201526024015b60405180910390fd5b5f6106d38630610a44565b9050848110156106f657604051631e9acf1760e31b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0387160161072a576107258486611012565b61073e565b61073e6001600160a01b03871685876110b7565b505050505050565b5f61075081610e8e565b838281158061075d575080155b1561077b57604051630f59b9ff60e01b815260040160405180910390fd5b80821461079b5760405163512509d360e11b815260040160405180910390fd5b5f5b86811015610874575f8888838181106107b8576107b86115b8565b90506020020160208101906107cd91906113e0565b6001600160a01b0316036107f45760405163d92e233d60e01b815260040160405180910390fd5b858582818110610806576108066115b8565b905060200201602081019061081b91906115db565b60045f8a8a85818110610830576108306115b8565b905060200201602081019061084591906113e0565b6001600160a01b0316815260208101919091526040015f20805460ff191691151591909117905560010161079d565b507faf5a552fd03176d93829b344cbe163a954b2a4cfc9722e90185f0c5ab850312e878787876040516108aa949392919061163a565b60405180910390a150505050505050565b5f6108c581610e8e565b61062b611137565b5f6108d781610e8e565b83828115806108e4575080155b1561090257604051630f59b9ff60e01b815260040160405180910390fd5b8082146109225760405163512509d360e11b815260040160405180910390fd5b5f5b86811015610a0e575f88888381811061093f5761093f6115b8565b905060200201602081019061095491906113e0565b90506001600160a01b03811661097d5760405163d92e233d60e01b815260040160405180910390fd5b86868381811061098f5761098f6115b8565b90506020020160208101906109a491906115db565b156109d9576109d37fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44982610e98565b50610a05565b610a037fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44982610f3f565b505b50600101610924565b507f15b30e92d7d4a2de3f4cad37e507f950e3cb376b2ddc9cb48163024778a46601878787876040516108aa949392919061163a565b5f816001600160a01b038116610a6d5760405163d92e233d60e01b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03851601610aa457826001600160a01b0316319150610b28565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301528516906370a0823190602401602060405180830381865afa158015610b01573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b259190611694565b91505b5092915050565b5f82815260208190526040902060010154610b4981610e8e565b6105c28383610f3f565b610b5b611174565b610b636111b3565b7fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b449610b8d81610e8e565b8382811580610b9a575080155b15610bb857604051630f59b9ff60e01b815260040160405180910390fd5b808214610bd85760405163512509d360e11b815260040160405180910390fd5b600354861115610c14576040517fdbc5d29600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0388165f9081526004602052604090205460ff16610c5757604051635f8b555b60e11b81526001600160a01b03891660048201526024016106bf565b5f86815b81811015610d18575f8a8a83818110610c7657610c766115b8565b9050602002016020810190610c8b91906113e0565b6001600160a01b031603610cb25760405163d92e233d60e01b815260040160405180910390fd5b878782818110610cc457610cc46115b8565b905060200201355f03610cea57604051637c946ed760e01b815260040160405180910390fd5b878782818110610cfc57610cfc6115b8565b9050602002013583610d0e91906116ab565b9250600101610c5b565b50610d238a30610a44565b821115610d4357604051631e9acf1760e31b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038b1601610dc8575f5b81811015610dc257610dba8a8a83818110610d8757610d876115b8565b9050602002016020810190610d9c91906113e0565b898984818110610dae57610dae6115b8565b90506020020135611012565b600101610d6a565b50610e38565b5f5b81811015610e3657610e2e8a8a83818110610de757610de76115b8565b9050602002016020810190610dfc91906113e0565b898984818110610e0e57610e0e6115b8565b905060200201358d6001600160a01b03166110b79092919063ffffffff16565b600101610dca565b505b7f8b2bc56c62594afde5b520e83e1ca19ebd071798db21382e328014f47b31ce578a828b8b8b8b604051610e71969594939291906116ca565b60405180910390a15050505050610e8760018055565b5050505050565b61062b81336111f6565b5f828152602081815260408083206001600160a01b038516845290915281205460ff16610f38575f838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610ef03390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016104f3565b505f6104f3565b5f828152602081815260408083206001600160a01b038516845290915281205460ff1615610f38575f838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016104f3565b610fc8611265565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b80471015611055576040517fcf479181000000000000000000000000000000000000000000000000000000008152476004820152602481018290526044016106bf565b5f80836001600160a01b0316836040515f6040518083038185875af1925050503d805f811461109f576040519150601f19603f3d011682016040523d82523d5f602084013e6110a4565b606091505b5091509150816105c2576105c2816112a1565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526106149084906112e3565b61113f611174565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610ff53390565b60025460ff16156111b1576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6002600154036111ef576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b5f828152602081815260408083206001600160a01b038516845290915290205460ff16611261576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602481018390526044016106bf565b5050565b60025460ff166111b1576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051156112b15780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8060205f8451602086015f885af180611302576040513d5f823e3d81fd5b50505f513d91508115611319578060011415611326565b6001600160a01b0384163b155b156105c2576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024016106bf565b5f60208284031215611378575f80fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146113a7575f80fd5b9392505050565b5f602082840312156113be575f80fd5b5035919050565b80356001600160a01b03811681146113db575f80fd5b919050565b5f602082840312156113f0575f80fd5b6113a7826113c5565b5f806040838503121561140a575f80fd5b8235915061141a602084016113c5565b90509250929050565b5f805f60608486031215611435575f80fd5b61143e846113c5565b925060208401359150611453604085016113c5565b90509250925092565b5f8083601f84011261146c575f80fd5b50813567ffffffffffffffff811115611483575f80fd5b6020830191508360208260051b850101111561149d575f80fd5b9250929050565b5f805f80604085870312156114b7575f80fd5b843567ffffffffffffffff8111156114cd575f80fd5b6114d98782880161145c565b909550935050602085013567ffffffffffffffff8111156114f8575f80fd5b6115048782880161145c565b95989497509550505050565b5f8060408385031215611521575f80fd5b61152a836113c5565b915061141a602084016113c5565b5f805f805f6060868803121561154c575f80fd5b611555866113c5565b9450602086013567ffffffffffffffff811115611570575f80fd5b61157c8882890161145c565b909550935050604086013567ffffffffffffffff81111561159b575f80fd5b6115a78882890161145c565b969995985093965092949392505050565b634e487b7160e01b5f52603260045260245ffd5b803580151581146113db575f80fd5b5f602082840312156115eb575f80fd5b6113a7826115cc565b8183526020830192505f815f5b84811015611630576001600160a01b0361161a836113c5565b1686526020958601959190910190600101611601565b5093949350505050565b604081525f61164d6040830186886115f4565b8281036020808501919091528482528591015f5b8581101561168857611672836115cc565b1515825260209283019290910190600101611661565b50979650505050505050565b5f602082840312156116a4575f80fd5b5051919050565b808201808211156104f357634e487b7160e01b5f52601160045260245ffd5b6001600160a01b0387168152856020820152608060408201525f6116f26080830186886115f4565b82810360608401528381527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841115611729575f80fd5b8360051b80866020840137016020019897505050505050505056fea2646970667358221220b4d874a1a66e20eb54e8e81ab42d66244c8716698b5702a893835495c999eba664736f6c634300081a0033
Deployed Bytecode
0x608060405260043610610165575f3560e01c8063548b8a35116100c657806391d148541161007c578063d4fac45d11610057578063d4fac45d14610404578063d547741f14610423578063dd8c818e14610442575f80fd5b806391d1485414610390578063a217fddf146103d2578063cb9ab727146103e5575f80fd5b806368c4ac26116100ac57806368c4ac261461030f5780638322fff21461033d5780638456cb591461037c575f80fd5b8063548b8a35146102d95780635c975abb146102f8575f80fd5b806332e4bb0a1161011b57806336568abe1161010157806336568abe146102875780633f4ba83a146102a6578063449c4189146102ba575f80fd5b806332e4bb0a1461023f57806334b3ec3b14610272575f80fd5b806316ed85251161014b57806316ed8525146101c5578063248a9ca3146101e45780632f2ff15d14610220575f80fd5b806301ffc9a71461017057806305f1883e146101a4575f80fd5b3661016c57005b5f80fd5b34801561017b575f80fd5b5061018f61018a366004611368565b610461565b60405190151581526020015b60405180910390f35b3480156101af575f80fd5b506101c36101be3660046113ae565b6104f9565b005b3480156101d0575f80fd5b5061018f6101df3660046113e0565b61055f565b3480156101ef575f80fd5b506102126101fe3660046113ae565b5f9081526020819052604090206001015490565b60405190815260200161019b565b34801561022b575f80fd5b506101c361023a3660046113f9565b61059e565b34801561024a575f80fd5b506102127fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44981565b34801561027d575f80fd5b5061021260035481565b348015610292575f80fd5b506101c36102a13660046113f9565b6105c8565b3480156102b1575f80fd5b506101c3610619565b3480156102c5575f80fd5b506101c36102d4366004611423565b61062e565b3480156102e4575f80fd5b506101c36102f33660046114a4565b610746565b348015610303575f80fd5b5060025460ff1661018f565b34801561031a575f80fd5b5061018f6103293660046113e0565b60046020525f908152604090205460ff1681565b348015610348575f80fd5b5061036473eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b6040516001600160a01b03909116815260200161019b565b348015610387575f80fd5b506101c36108bb565b34801561039b575f80fd5b5061018f6103aa3660046113f9565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156103dd575f80fd5b506102125f81565b3480156103f0575f80fd5b506101c36103ff3660046114a4565b6108cd565b34801561040f575f80fd5b5061021261041e366004611510565b610a44565b34801561042e575f80fd5b506101c361043d3660046113f9565b610b2f565b34801561044d575f80fd5b506101c361045c366004611538565b610b53565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806104f357507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b5f61050381610e8e565b815f0361052357604051637c946ed760e01b815260040160405180910390fd5b60038290556040518281527f3cc903be55ae5f28b8a8f81a852fa714ef0570b0aca5ca300c11f4bc775504119060200160405180910390a15050565b6001600160a01b0381165f9081527f9e607de338c7d6508550727646d2998939f27517879a7dd916362b3520e39487602052604081205460ff166104f3565b5f828152602081905260409020600101546105b881610e8e565b6105c28383610e98565b50505050565b6001600160a01b038116331461060a576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106148282610f3f565b505050565b5f61062381610e8e565b61062b610fc0565b50565b5f61063881610e8e565b816001600160a01b0381166106605760405163d92e233d60e01b815260040160405180910390fd5b835f0361068057604051637c946ed760e01b815260040160405180910390fd5b6001600160a01b0385165f9081526004602052604090205460ff166106c857604051635f8b555b60e11b81526001600160a01b03861660048201526024015b60405180910390fd5b5f6106d38630610a44565b9050848110156106f657604051631e9acf1760e31b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0387160161072a576107258486611012565b61073e565b61073e6001600160a01b03871685876110b7565b505050505050565b5f61075081610e8e565b838281158061075d575080155b1561077b57604051630f59b9ff60e01b815260040160405180910390fd5b80821461079b5760405163512509d360e11b815260040160405180910390fd5b5f5b86811015610874575f8888838181106107b8576107b86115b8565b90506020020160208101906107cd91906113e0565b6001600160a01b0316036107f45760405163d92e233d60e01b815260040160405180910390fd5b858582818110610806576108066115b8565b905060200201602081019061081b91906115db565b60045f8a8a85818110610830576108306115b8565b905060200201602081019061084591906113e0565b6001600160a01b0316815260208101919091526040015f20805460ff191691151591909117905560010161079d565b507faf5a552fd03176d93829b344cbe163a954b2a4cfc9722e90185f0c5ab850312e878787876040516108aa949392919061163a565b60405180910390a150505050505050565b5f6108c581610e8e565b61062b611137565b5f6108d781610e8e565b83828115806108e4575080155b1561090257604051630f59b9ff60e01b815260040160405180910390fd5b8082146109225760405163512509d360e11b815260040160405180910390fd5b5f5b86811015610a0e575f88888381811061093f5761093f6115b8565b905060200201602081019061095491906113e0565b90506001600160a01b03811661097d5760405163d92e233d60e01b815260040160405180910390fd5b86868381811061098f5761098f6115b8565b90506020020160208101906109a491906115db565b156109d9576109d37fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44982610e98565b50610a05565b610a037fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44982610f3f565b505b50600101610924565b507f15b30e92d7d4a2de3f4cad37e507f950e3cb376b2ddc9cb48163024778a46601878787876040516108aa949392919061163a565b5f816001600160a01b038116610a6d5760405163d92e233d60e01b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03851601610aa457826001600160a01b0316319150610b28565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301528516906370a0823190602401602060405180830381865afa158015610b01573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b259190611694565b91505b5092915050565b5f82815260208190526040902060010154610b4981610e8e565b6105c28383610f3f565b610b5b611174565b610b636111b3565b7fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b449610b8d81610e8e565b8382811580610b9a575080155b15610bb857604051630f59b9ff60e01b815260040160405180910390fd5b808214610bd85760405163512509d360e11b815260040160405180910390fd5b600354861115610c14576040517fdbc5d29600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0388165f9081526004602052604090205460ff16610c5757604051635f8b555b60e11b81526001600160a01b03891660048201526024016106bf565b5f86815b81811015610d18575f8a8a83818110610c7657610c766115b8565b9050602002016020810190610c8b91906113e0565b6001600160a01b031603610cb25760405163d92e233d60e01b815260040160405180910390fd5b878782818110610cc457610cc46115b8565b905060200201355f03610cea57604051637c946ed760e01b815260040160405180910390fd5b878782818110610cfc57610cfc6115b8565b9050602002013583610d0e91906116ab565b9250600101610c5b565b50610d238a30610a44565b821115610d4357604051631e9acf1760e31b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038b1601610dc8575f5b81811015610dc257610dba8a8a83818110610d8757610d876115b8565b9050602002016020810190610d9c91906113e0565b898984818110610dae57610dae6115b8565b90506020020135611012565b600101610d6a565b50610e38565b5f5b81811015610e3657610e2e8a8a83818110610de757610de76115b8565b9050602002016020810190610dfc91906113e0565b898984818110610e0e57610e0e6115b8565b905060200201358d6001600160a01b03166110b79092919063ffffffff16565b600101610dca565b505b7f8b2bc56c62594afde5b520e83e1ca19ebd071798db21382e328014f47b31ce578a828b8b8b8b604051610e71969594939291906116ca565b60405180910390a15050505050610e8760018055565b5050505050565b61062b81336111f6565b5f828152602081815260408083206001600160a01b038516845290915281205460ff16610f38575f838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610ef03390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016104f3565b505f6104f3565b5f828152602081815260408083206001600160a01b038516845290915281205460ff1615610f38575f838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016104f3565b610fc8611265565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b80471015611055576040517fcf479181000000000000000000000000000000000000000000000000000000008152476004820152602481018290526044016106bf565b5f80836001600160a01b0316836040515f6040518083038185875af1925050503d805f811461109f576040519150601f19603f3d011682016040523d82523d5f602084013e6110a4565b606091505b5091509150816105c2576105c2816112a1565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526106149084906112e3565b61113f611174565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610ff53390565b60025460ff16156111b1576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6002600154036111ef576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b5f828152602081815260408083206001600160a01b038516845290915290205460ff16611261576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602481018390526044016106bf565b5050565b60025460ff166111b1576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051156112b15780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8060205f8451602086015f885af180611302576040513d5f823e3d81fd5b50505f513d91508115611319578060011415611326565b6001600160a01b0384163b155b156105c2576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024016106bf565b5f60208284031215611378575f80fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146113a7575f80fd5b9392505050565b5f602082840312156113be575f80fd5b5035919050565b80356001600160a01b03811681146113db575f80fd5b919050565b5f602082840312156113f0575f80fd5b6113a7826113c5565b5f806040838503121561140a575f80fd5b8235915061141a602084016113c5565b90509250929050565b5f805f60608486031215611435575f80fd5b61143e846113c5565b925060208401359150611453604085016113c5565b90509250925092565b5f8083601f84011261146c575f80fd5b50813567ffffffffffffffff811115611483575f80fd5b6020830191508360208260051b850101111561149d575f80fd5b9250929050565b5f805f80604085870312156114b7575f80fd5b843567ffffffffffffffff8111156114cd575f80fd5b6114d98782880161145c565b909550935050602085013567ffffffffffffffff8111156114f8575f80fd5b6115048782880161145c565b95989497509550505050565b5f8060408385031215611521575f80fd5b61152a836113c5565b915061141a602084016113c5565b5f805f805f6060868803121561154c575f80fd5b611555866113c5565b9450602086013567ffffffffffffffff811115611570575f80fd5b61157c8882890161145c565b909550935050604086013567ffffffffffffffff81111561159b575f80fd5b6115a78882890161145c565b969995985093965092949392505050565b634e487b7160e01b5f52603260045260245ffd5b803580151581146113db575f80fd5b5f602082840312156115eb575f80fd5b6113a7826115cc565b8183526020830192505f815f5b84811015611630576001600160a01b0361161a836113c5565b1686526020958601959190910190600101611601565b5093949350505050565b604081525f61164d6040830186886115f4565b8281036020808501919091528482528591015f5b8581101561168857611672836115cc565b1515825260209283019290910190600101611661565b50979650505050505050565b5f602082840312156116a4575f80fd5b5051919050565b808201808211156104f357634e487b7160e01b5f52601160045260245ffd5b6001600160a01b0387168152856020820152608060408201525f6116f26080830186886115f4565b82810360608401528381527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841115611729575f80fd5b8360051b80866020840137016020019897505050505050505056fea2646970667358221220b4d874a1a66e20eb54e8e81ab42d66244c8716698b5702a893835495c999eba664736f6c634300081a0033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$460.65
Net Worth in ETH
0.221783
Token Allocations
USDC
100.00%
ETH
0.00%
Multichain Portfolio | 34 Chains
Loading...
Loading
Loading...
Loading
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.