Overview
S Balance
S Value
$0.10 (@ $0.42/S)More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Transfer Ownersh... | 12847151 | 41 hrs ago | IN | 0 S | 0.00157712 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Charity
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import {IGelatoChecker} from "./interfaces/IGelatoChecker.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {ICharity} from "./interfaces/ICharity.sol"; import {ICharityDao} from "./interfaces/ICharityDao.sol"; contract Charity is Ownable, ReentrancyGuard, IGelatoChecker, ICharity, ICharityDao { using SafeERC20 for IERC20; /** state variables */ bool public canWithdrawFunds = true; Category public charityCategory; address public automationBot = address(0); uint256 public hardHatChainId = 31337; /** constants */ address public constant ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); /** * mappings */ mapping(address => bool) public whitelistedTokens; mapping(address => bool) public organizationExists; /** * arrays */ address[] public tokenList; address[] public organizations; enum Category { Education, Health, Environment, Animals, HumanRights, Poverty, Other } modifier onlyAutomationBot() { if (msg.sender != automationBot && msg.sender != owner()) { revert Charity__MustBeAutomatedOrOwner(msg.sender); } _; } /** events */ event DonationWithdrawn(address indexed organization, address indexed token, uint256 amount); event TokenWhitelisted(address token); event TokenRemoved(address token); event OrganizationAdded(address indexed organization); event OrganizationRemoved(address indexed organization); constructor(Category _category, address _automationBot) Ownable(msg.sender) { charityCategory = _category; automationBot = _automationBot; if (automationBot == address(0)) { revert Charity__GovernorCanNotBeZeroAddress(); } } /** * @dev Set the automation bot address. * @param _automation address of the automation bot */ function setAutomationBot(address _automation) external onlyAutomationBot { automationBot = _automation; } /** * @dev Check if the contract can withdraw funds. */ function canWithdraw() external view returns (bool) { return canWithdrawFunds; } /** * @dev Set the status of the contract to withdraw funds. * @param status The status to set. */ function setCanWithdraw(bool status) external onlyAutomationBot { canWithdrawFunds = status; } /** * @dev Adds a token to the whitelist. * @param token The address of the token to add. */ function addWhitelistedToken(address token) external onlyOwner { if (whitelistedTokens[token]) { revert Charity__TokenAlreadyWhitelisted(); } whitelistedTokens[token] = true; tokenList.push(token); emit TokenWhitelisted(token); } /** * @dev Removes a token from the whitelist. * @param token The address of the token to remove. */ function removeWhitelistedToken(address token) external onlyOwner { if (!whitelistedTokens[token]) { revert Charity__TokenNotWhitelisted(); } whitelistedTokens[token] = false; for (uint256 i = 0; i < tokenList.length; i++) { if (tokenList[i] == token) { tokenList[i] = tokenList[tokenList.length - 1]; tokenList.pop(); break; } } emit TokenRemoved(token); } /** * @dev Returns the list of whitelisted ERC-20 tokens. */ function getWhitelistedTokens() public view returns (address[] memory) { return tokenList; } /** * @dev Adds an organization to the list of organizations. * @param organization The address of the organization to add. */ function addOrganization(address organization) external onlyOwner { if (organizationExists[organization]) { revert Charity__OrganizationAlreadyExists(); } organizationExists[organization] = true; organizations.push(organization); emit OrganizationAdded(organization); } /** * @dev Removes an organization from the list of organizations. * @param organization The address of the organization to remove. */ function removeOrganization(address organization) external onlyOwner { if (!organizationExists[organization]) { revert Charity__OrganizationNotFound(); } organizationExists[organization] = false; uint256 length = organizations.length; for (uint256 i = 0; i < length; i++) { if (organizations[i] == organization) { organizations[i] = organizations[length - 1]; organizations.pop(); break; } } emit OrganizationRemoved(organization); } /** * @dev Returns the list of organizations. */ function getOrganizations() public view returns (address[] memory) { return organizations; } /** * Automates funds distribution to the organization. * @return canExec - whether the contract can execute the withdrawal * @return execPayload - the payload to execute the withdrawal */ function checker() external view returns (bool canExec, bytes memory execPayload) { uint256 orgCount = organizations.length; if (orgCount == 0) { return (false, abi.encode("No Organizations Available ")); } if (!canWithdrawFunds) { return (false, abi.encode("Withdrawals Disabled")); } uint256 ethBalance = address(this).balance; address[] memory tokens = tokenList; if (ethBalance > 0) { return ( true, abi.encodeCall( ICharity.withdrawToOrganization, (ETH_ADDRESS, ethBalance, organizations) ) ); } for (uint256 i = 0; i < tokens.length; i++) { uint256 tokenBalance = IERC20(tokens[i]).balanceOf(address(this)); if (tokenBalance > 0) { return ( true, abi.encodeCall( ICharity.withdrawToOrganization, (tokens[i], tokenBalance, organizations) ) ); } } return (false, abi.encode("No Funds Available")); } /** * @dev Check the balance of the contract. * @param token The address of the token to check the balance of. * @return The balance of the contract. */ function balanceOf(address token) external view returns (uint256) { return token == ETH_ADDRESS ? address(this).balance : IERC20(token).balanceOf(address(this)); } /** * @dev Withdraw the donation from the contract. * @param token The address of the token to withdraw. * @param amount The amount to withdraw. * @param orgs The list of organizations to withdraw to. */ function withdrawToOrganization( address token, uint256 amount, address[] memory orgs ) external onlyAutomationBot nonReentrant { if (!canWithdrawFunds) { revert Charity__WithdrawalDisabled(); } uint256 orgCount = orgs.length; if (orgCount == 0) { revert Charity__OrganizationNotFound(); } uint256 share = amount / orgCount; for (uint256 i = 0; i < orgCount; i++) { if (block.chainid != hardHatChainId) { if (!organizationExists[orgs[i]]) { revert Charity__OrganizationNotFound(); } } if (token == ETH_ADDRESS) { (bool success, ) = orgs[i].call{value: share}(""); if (!success) { revert Charity__SendingFailed(); } } else { if (!whitelistedTokens[token]) { revert Charity__TokenNotWhitelisted(); } IERC20(token).safeTransfer(orgs[i], share); } emit DonationWithdrawn(orgs[i], token, share); } } /** * @dev Fallback function to receive ETH donations. */ receive() external payable {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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 { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _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 (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.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";
// 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.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.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/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.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: UNLICENSED pragma solidity >=0.8.0; interface ICharity { function withdrawToOrganization( address token, uint256 amount, address[] memory organization ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; interface ICharityDao { /** errors */ error Charity__InsufficientBalance(); error Charity__SendingFailed(); error Charity__WithdrawalDisabled(); error Charity__TokenAlreadyWhitelisted(); error Charity__TokenNotWhitelisted(); error Charity__MustBeAutomatedOrOwner(address caller); error Charity__OrganizationAlreadyExists(); error Charity__OrganizationNotFound(); error Charity__OnlyGovernor(); error Charity__GovernorCanNotBeZeroAddress(); /** functions */ function addWhitelistedToken(address token) external; function removeWhitelistedToken(address token) external; function addOrganization(address organization) external; function removeOrganization(address organization) external; }
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.0; interface IGelatoChecker { function checker() external view returns (bool canExec, bytes memory execPayload); }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"enum Charity.Category","name":"_category","type":"uint8"},{"internalType":"address","name":"_automationBot","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Charity__GovernorCanNotBeZeroAddress","type":"error"},{"inputs":[],"name":"Charity__InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"Charity__MustBeAutomatedOrOwner","type":"error"},{"inputs":[],"name":"Charity__OnlyGovernor","type":"error"},{"inputs":[],"name":"Charity__OrganizationAlreadyExists","type":"error"},{"inputs":[],"name":"Charity__OrganizationNotFound","type":"error"},{"inputs":[],"name":"Charity__SendingFailed","type":"error"},{"inputs":[],"name":"Charity__TokenAlreadyWhitelisted","type":"error"},{"inputs":[],"name":"Charity__TokenNotWhitelisted","type":"error"},{"inputs":[],"name":"Charity__WithdrawalDisabled","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"organization","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DonationWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"organization","type":"address"}],"name":"OrganizationAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"organization","type":"address"}],"name":"OrganizationRemoved","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":false,"internalType":"address","name":"token","type":"address"}],"name":"TokenRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"TokenWhitelisted","type":"event"},{"inputs":[],"name":"ETH_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"organization","type":"address"}],"name":"addOrganization","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"addWhitelistedToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"automationBot","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canWithdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canWithdrawFunds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"charityCategory","outputs":[{"internalType":"enum Charity.Category","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checker","outputs":[{"internalType":"bool","name":"canExec","type":"bool"},{"internalType":"bytes","name":"execPayload","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOrganizations","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistedTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hardHatChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"organizationExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"organizations","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"organization","type":"address"}],"name":"removeOrganization","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeWhitelistedToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_automation","type":"address"}],"name":"setAutomationBot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setCanWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address[]","name":"orgs","type":"address[]"}],"name":"withdrawToOrganization","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040526002805461ff01600160b01b0319166001179055617a6960035534801561002a57600080fd5b5060405161186738038061186783398101604081905261004991610144565b338061006f57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b610078816100f4565b50600180556002805483919061ff00191661010083600681111561009e5761009e61018e565b02179055506002805462010000600160b01b031916620100006001600160a01b0384811682029290921792839055909104166100ed5760405163bbd507a760e01b815260040160405180910390fd5b50506101a4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806040838503121561015757600080fd5b82516007811061016657600080fd5b60208401519092506001600160a01b038116811461018357600080fd5b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b6116b4806101b36000396000f3fe60806040526004361061014f5760003560e01c8063b51459fe116100b6578063e26f79001161006f578063e26f7900146103ee578063e792dd8a14610403578063e7abd5ea14610423578063f0f4118914610453578063f2fde38b14610469578063f349736b1461048957600080fd5b8063b51459fe14610311578063b559d62314610335578063cf5303cf14610355578063d68287df14610378578063daf9c21014610398578063db362817146103c857600080fd5b806370a082311161010857806370a0823114610232578063715018a6146102605780638da5cb5b146102755780639754a3a8146102a75780639ead7222146102c9578063a734f06e146102e957600080fd5b80630c54c3921461015b5780631c88705d1461017d57806326038e4d1461019d578063326e5540146101d2578063363cb34d146101f25780636ff2c6101461021257600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017b610176366004611363565b6104a3565b005b34801561018957600080fd5b5061017b610198366004611363565b61051e565b3480156101a957600080fd5b506002546101bc90610100900460ff1681565b6040516101c99190611385565b60405180910390f35b3480156101de57600080fd5b5061017b6101ed3660046113ad565b6106bc565b3480156101fe57600080fd5b5061017b61020d366004611363565b61071b565b34801561021e57600080fd5b5061017b61022d366004611363565b6107f3565b34801561023e57600080fd5b5061025261024d366004611363565b610988565b6040519081526020016101c9565b34801561026c57600080fd5b5061017b610a23565b34801561028157600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101c9565b3480156102b357600080fd5b506102bc610a37565b6040516101c991906113cf565b3480156102d557600080fd5b5061028f6102e436600461141b565b610a99565b3480156102f557600080fd5b5061028f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561031d57600080fd5b5060025460ff165b60405190151581526020016101c9565b34801561034157600080fd5b5061017b61035036600461144a565b610ac3565b34801561036157600080fd5b5061036a610d81565b6040516101c9929190611536565b34801561038457600080fd5b5061017b610393366004611363565b611060565b3480156103a457600080fd5b506103256103b3366004611363565b60046020526000908152604090205460ff1681565b3480156103d457600080fd5b5060025461028f906201000090046001600160a01b031681565b3480156103fa57600080fd5b506102bc61112e565b34801561040f57600080fd5b5061028f61041e36600461141b565b61118e565b34801561042f57600080fd5b5061032561043e366004611363565b60056020526000908152604090205460ff1681565b34801561045f57600080fd5b5061025260035481565b34801561047557600080fd5b5061017b610484366004611363565b61119e565b34801561049557600080fd5b506002546103259060ff1681565b6002546201000090046001600160a01b031633148015906104cf57506000546001600160a01b03163314155b156104f45760405163051222cd60e31b81523360048201526024015b60405180910390fd5b600280546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b6105266111dc565b6001600160a01b03811660009081526004602052604090205460ff1661055f57604051635074a10760e01b815260040160405180910390fd5b6001600160a01b0381166000908152600460205260408120805460ff191690555b60065481101561067b57816001600160a01b0316600682815481106105a7576105a761158d565b6000918252602090912001546001600160a01b03160361067357600680546105d1906001906115a3565b815481106105e1576105e161158d565b600091825260209091200154600680546001600160a01b03909216918390811061060d5761060d61158d565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600680548061064c5761064c6115c4565b600082815260209020810160001990810180546001600160a01b031916905501905561067b565b600101610580565b506040516001600160a01b03821681527f4c910b69fe65a61f7531b9c5042b2329ca7179c77290aa7e2eb3afa3c8511fd3906020015b60405180910390a150565b6002546201000090046001600160a01b031633148015906106e857506000546001600160a01b03163314155b156107085760405163051222cd60e31b81523360048201526024016104eb565b6002805460ff1916911515919091179055565b6107236111dc565b6001600160a01b03811660009081526004602052604090205460ff161561075d576040516314c0223760e21b815260040160405180910390fd5b6001600160a01b0381166000818152600460209081526040808320805460ff191660019081179091556006805491820181559093527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f90920180546001600160a01b0319168417905590519182527f6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d26291016106b1565b6107fb6111dc565b6001600160a01b03811660009081526005602052604090205460ff16610834576040516337b51e4d60e01b815260040160405180910390fd5b6001600160a01b0381166000908152600560205260408120805460ff19169055600754905b8181101561094f57826001600160a01b03166007828154811061087e5761087e61158d565b6000918252602090912001546001600160a01b0316036109475760076108a56001846115a3565b815481106108b5576108b561158d565b600091825260209091200154600780546001600160a01b0390921691839081106108e1576108e161158d565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506007805480610920576109206115c4565b600082815260209020810160001990810180546001600160a01b031916905501905561094f565b600101610859565b506040516001600160a01b038316907fed5ec13b592dc90954aa49a121766af1b7ad6efcd03593524623dc93c35c6fa090600090a25050565b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610a1b576040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa1580156109f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1691906115da565b610a1d565b475b92915050565b610a2b6111dc565b610a356000611209565b565b60606007805480602002602001604051908101604052809291908181526020018280548015610a8f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a71575b5050505050905090565b60068181548110610aa957600080fd5b6000918252602090912001546001600160a01b0316905081565b6002546201000090046001600160a01b03163314801590610aef57506000546001600160a01b03163314155b15610b0f5760405163051222cd60e31b81523360048201526024016104eb565b610b17611259565b60025460ff16610b3a57604051634a6e592d60e11b815260040160405180910390fd5b80516000819003610b5e576040516337b51e4d60e01b815260040160405180910390fd5b6000610b6a82856115f3565b905060005b82811015610d70576003544614610bda5760056000858381518110610b9657610b9661158d565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16610bda576040516337b51e4d60e01b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03871601610c92576000848281518110610c1357610c1361158d565b60200260200101516001600160a01b03168360405160006040518083038185875af1925050503d8060008114610c65576040519150601f19603f3d011682016040523d82523d6000602084013e610c6a565b606091505b5050905080610c8c5760405163652b4abf60e01b815260040160405180910390fd5b50610d02565b6001600160a01b03861660009081526004602052604090205460ff16610ccb57604051635074a10760e01b815260040160405180910390fd5b610d02848281518110610ce057610ce061158d565b602002602001015183886001600160a01b03166112839092919063ffffffff16565b856001600160a01b0316848281518110610d1e57610d1e61158d565b60200260200101516001600160a01b03167fe3e1bb45702d421c77dbd83c3b9336df12afc7514af1960cadb24210b5fb316284604051610d6091815260200190565b60405180910390a3600101610b6f565b505050610d7c60018055565b505050565b600754600090606090808303610dec576000604051602001610dd4906020808252601b908201527f4e6f204f7267616e697a6174696f6e7320417661696c61626c65200000000000604082015260600190565b60405160208183030381529060405292509250509091565b60025460ff16610e30576000604051602001610dd49060208082526014908201527315da5d1a191c985dd85b1cc8111a5cd8589b195960621b604082015260600190565b600047905060006006805480602002602001604051908101604052809291908181526020018280548015610e8d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e6f575b505050505090506000821115610eff57600173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee836007604051602401610ec993929190611615565b60408051601f198184030181529190526020810180516001600160e01b031663b559d62360e01b17905290969095509350505050565b60005b815181101561100d576000828281518110610f1f57610f1f61158d565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610f6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9391906115da565b90508015611004576001838381518110610faf57610faf61158d565b6020026020010151826007604051602401610fcc93929190611615565b60408051601f198184030181529190526020810180516001600160e01b031663b559d62360e01b179052909890975095505050505050565b50600101610f02565b506000604051602001611046906020808252601290820152714e6f2046756e647320417661696c61626c6560701b604082015260600190565b604051602081830303815290604052945094505050509091565b6110686111dc565b6001600160a01b03811660009081526005602052604090205460ff16156110a2576040516301e9ba8360e01b815260040160405180910390fd5b6001600160a01b038116600081815260056020526040808220805460ff1916600190811790915560078054918201815583527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b03191684179055517ff84dfefd1424c476705a9a5ce3238cf6b203e946990646666c5bec8bc8043b2a9190a250565b60606006805480602002602001604051908101604052809291908181526020018280548015610a8f576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610a71575050505050905090565b60078181548110610aa957600080fd5b6111a66111dc565b6001600160a01b0381166111d057604051631e4fbdf760e01b8152600060048201526024016104eb565b6111d981611209565b50565b6000546001600160a01b03163314610a355760405163118cdaa760e01b81523360048201526024016104eb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60026001540361127c57604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b604080516001600160a01b03841660248201526044808201849052825180830390910181526064909101909152602080820180516001600160e01b031663a9059cbb60e01b1781528251610d7c938793909260009283929183919082885af1806112f3576040513d6000823e3d81fd5b50506000513d9150811561130b578060011415611318565b6001600160a01b0384163b155b1561134157604051635274afe760e01b81526001600160a01b03851660048201526024016104eb565b50505050565b80356001600160a01b038116811461135e57600080fd5b919050565b60006020828403121561137557600080fd5b61137e82611347565b9392505050565b60208101600783106113a757634e487b7160e01b600052602160045260246000fd5b91905290565b6000602082840312156113bf57600080fd5b8135801515811461137e57600080fd5b602080825282518282018190526000918401906040840190835b818110156114105783516001600160a01b03168352602093840193909201916001016113e9565b509095945050505050565b60006020828403121561142d57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561145f57600080fd5b61146884611347565b925060208401359150604084013567ffffffffffffffff81111561148b57600080fd5b8401601f8101861361149c57600080fd5b803567ffffffffffffffff8111156114b6576114b6611434565b8060051b604051601f19603f830116810181811067ffffffffffffffff821117156114e3576114e3611434565b60405291825260208184018101929081018984111561150157600080fd5b6020850194505b838510156115275761151985611347565b815260209485019401611508565b50809450505050509250925092565b8215158152604060208201526000825180604084015260005b8181101561156c576020818601810151606086840101520161154f565b506000606082850101526060601f19601f8301168401019150509392505050565b634e487b7160e01b600052603260045260246000fd5b81810381811115610a1d57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000602082840312156115ec57600080fd5b5051919050565b60008261161057634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b0384168152602080820184905260606040830181905283549083018190526000848152918220906080840190835b818110156116715783546001600160a01b031683526001938401936020909301920161164a565b509097965050505050505056fea264697066735822122079b146043a09cd1f3088a4e37eaccc79bdf898977b878897cce438756a522c5964736f6c634300081c0033000000000000000000000000000000000000000000000000000000000000000000000000000000000000000038dafb5a3f0abe1f4e3f45162b480142aae29d38
Deployed Bytecode
0x60806040526004361061014f5760003560e01c8063b51459fe116100b6578063e26f79001161006f578063e26f7900146103ee578063e792dd8a14610403578063e7abd5ea14610423578063f0f4118914610453578063f2fde38b14610469578063f349736b1461048957600080fd5b8063b51459fe14610311578063b559d62314610335578063cf5303cf14610355578063d68287df14610378578063daf9c21014610398578063db362817146103c857600080fd5b806370a082311161010857806370a0823114610232578063715018a6146102605780638da5cb5b146102755780639754a3a8146102a75780639ead7222146102c9578063a734f06e146102e957600080fd5b80630c54c3921461015b5780631c88705d1461017d57806326038e4d1461019d578063326e5540146101d2578063363cb34d146101f25780636ff2c6101461021257600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017b610176366004611363565b6104a3565b005b34801561018957600080fd5b5061017b610198366004611363565b61051e565b3480156101a957600080fd5b506002546101bc90610100900460ff1681565b6040516101c99190611385565b60405180910390f35b3480156101de57600080fd5b5061017b6101ed3660046113ad565b6106bc565b3480156101fe57600080fd5b5061017b61020d366004611363565b61071b565b34801561021e57600080fd5b5061017b61022d366004611363565b6107f3565b34801561023e57600080fd5b5061025261024d366004611363565b610988565b6040519081526020016101c9565b34801561026c57600080fd5b5061017b610a23565b34801561028157600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101c9565b3480156102b357600080fd5b506102bc610a37565b6040516101c991906113cf565b3480156102d557600080fd5b5061028f6102e436600461141b565b610a99565b3480156102f557600080fd5b5061028f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561031d57600080fd5b5060025460ff165b60405190151581526020016101c9565b34801561034157600080fd5b5061017b61035036600461144a565b610ac3565b34801561036157600080fd5b5061036a610d81565b6040516101c9929190611536565b34801561038457600080fd5b5061017b610393366004611363565b611060565b3480156103a457600080fd5b506103256103b3366004611363565b60046020526000908152604090205460ff1681565b3480156103d457600080fd5b5060025461028f906201000090046001600160a01b031681565b3480156103fa57600080fd5b506102bc61112e565b34801561040f57600080fd5b5061028f61041e36600461141b565b61118e565b34801561042f57600080fd5b5061032561043e366004611363565b60056020526000908152604090205460ff1681565b34801561045f57600080fd5b5061025260035481565b34801561047557600080fd5b5061017b610484366004611363565b61119e565b34801561049557600080fd5b506002546103259060ff1681565b6002546201000090046001600160a01b031633148015906104cf57506000546001600160a01b03163314155b156104f45760405163051222cd60e31b81523360048201526024015b60405180910390fd5b600280546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b6105266111dc565b6001600160a01b03811660009081526004602052604090205460ff1661055f57604051635074a10760e01b815260040160405180910390fd5b6001600160a01b0381166000908152600460205260408120805460ff191690555b60065481101561067b57816001600160a01b0316600682815481106105a7576105a761158d565b6000918252602090912001546001600160a01b03160361067357600680546105d1906001906115a3565b815481106105e1576105e161158d565b600091825260209091200154600680546001600160a01b03909216918390811061060d5761060d61158d565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600680548061064c5761064c6115c4565b600082815260209020810160001990810180546001600160a01b031916905501905561067b565b600101610580565b506040516001600160a01b03821681527f4c910b69fe65a61f7531b9c5042b2329ca7179c77290aa7e2eb3afa3c8511fd3906020015b60405180910390a150565b6002546201000090046001600160a01b031633148015906106e857506000546001600160a01b03163314155b156107085760405163051222cd60e31b81523360048201526024016104eb565b6002805460ff1916911515919091179055565b6107236111dc565b6001600160a01b03811660009081526004602052604090205460ff161561075d576040516314c0223760e21b815260040160405180910390fd5b6001600160a01b0381166000818152600460209081526040808320805460ff191660019081179091556006805491820181559093527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f90920180546001600160a01b0319168417905590519182527f6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d26291016106b1565b6107fb6111dc565b6001600160a01b03811660009081526005602052604090205460ff16610834576040516337b51e4d60e01b815260040160405180910390fd5b6001600160a01b0381166000908152600560205260408120805460ff19169055600754905b8181101561094f57826001600160a01b03166007828154811061087e5761087e61158d565b6000918252602090912001546001600160a01b0316036109475760076108a56001846115a3565b815481106108b5576108b561158d565b600091825260209091200154600780546001600160a01b0390921691839081106108e1576108e161158d565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506007805480610920576109206115c4565b600082815260209020810160001990810180546001600160a01b031916905501905561094f565b600101610859565b506040516001600160a01b038316907fed5ec13b592dc90954aa49a121766af1b7ad6efcd03593524623dc93c35c6fa090600090a25050565b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610a1b576040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa1580156109f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1691906115da565b610a1d565b475b92915050565b610a2b6111dc565b610a356000611209565b565b60606007805480602002602001604051908101604052809291908181526020018280548015610a8f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a71575b5050505050905090565b60068181548110610aa957600080fd5b6000918252602090912001546001600160a01b0316905081565b6002546201000090046001600160a01b03163314801590610aef57506000546001600160a01b03163314155b15610b0f5760405163051222cd60e31b81523360048201526024016104eb565b610b17611259565b60025460ff16610b3a57604051634a6e592d60e11b815260040160405180910390fd5b80516000819003610b5e576040516337b51e4d60e01b815260040160405180910390fd5b6000610b6a82856115f3565b905060005b82811015610d70576003544614610bda5760056000858381518110610b9657610b9661158d565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16610bda576040516337b51e4d60e01b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03871601610c92576000848281518110610c1357610c1361158d565b60200260200101516001600160a01b03168360405160006040518083038185875af1925050503d8060008114610c65576040519150601f19603f3d011682016040523d82523d6000602084013e610c6a565b606091505b5050905080610c8c5760405163652b4abf60e01b815260040160405180910390fd5b50610d02565b6001600160a01b03861660009081526004602052604090205460ff16610ccb57604051635074a10760e01b815260040160405180910390fd5b610d02848281518110610ce057610ce061158d565b602002602001015183886001600160a01b03166112839092919063ffffffff16565b856001600160a01b0316848281518110610d1e57610d1e61158d565b60200260200101516001600160a01b03167fe3e1bb45702d421c77dbd83c3b9336df12afc7514af1960cadb24210b5fb316284604051610d6091815260200190565b60405180910390a3600101610b6f565b505050610d7c60018055565b505050565b600754600090606090808303610dec576000604051602001610dd4906020808252601b908201527f4e6f204f7267616e697a6174696f6e7320417661696c61626c65200000000000604082015260600190565b60405160208183030381529060405292509250509091565b60025460ff16610e30576000604051602001610dd49060208082526014908201527315da5d1a191c985dd85b1cc8111a5cd8589b195960621b604082015260600190565b600047905060006006805480602002602001604051908101604052809291908181526020018280548015610e8d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e6f575b505050505090506000821115610eff57600173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee836007604051602401610ec993929190611615565b60408051601f198184030181529190526020810180516001600160e01b031663b559d62360e01b17905290969095509350505050565b60005b815181101561100d576000828281518110610f1f57610f1f61158d565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610f6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9391906115da565b90508015611004576001838381518110610faf57610faf61158d565b6020026020010151826007604051602401610fcc93929190611615565b60408051601f198184030181529190526020810180516001600160e01b031663b559d62360e01b179052909890975095505050505050565b50600101610f02565b506000604051602001611046906020808252601290820152714e6f2046756e647320417661696c61626c6560701b604082015260600190565b604051602081830303815290604052945094505050509091565b6110686111dc565b6001600160a01b03811660009081526005602052604090205460ff16156110a2576040516301e9ba8360e01b815260040160405180910390fd5b6001600160a01b038116600081815260056020526040808220805460ff1916600190811790915560078054918201815583527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b03191684179055517ff84dfefd1424c476705a9a5ce3238cf6b203e946990646666c5bec8bc8043b2a9190a250565b60606006805480602002602001604051908101604052809291908181526020018280548015610a8f576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610a71575050505050905090565b60078181548110610aa957600080fd5b6111a66111dc565b6001600160a01b0381166111d057604051631e4fbdf760e01b8152600060048201526024016104eb565b6111d981611209565b50565b6000546001600160a01b03163314610a355760405163118cdaa760e01b81523360048201526024016104eb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60026001540361127c57604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b604080516001600160a01b03841660248201526044808201849052825180830390910181526064909101909152602080820180516001600160e01b031663a9059cbb60e01b1781528251610d7c938793909260009283929183919082885af1806112f3576040513d6000823e3d81fd5b50506000513d9150811561130b578060011415611318565b6001600160a01b0384163b155b1561134157604051635274afe760e01b81526001600160a01b03851660048201526024016104eb565b50505050565b80356001600160a01b038116811461135e57600080fd5b919050565b60006020828403121561137557600080fd5b61137e82611347565b9392505050565b60208101600783106113a757634e487b7160e01b600052602160045260246000fd5b91905290565b6000602082840312156113bf57600080fd5b8135801515811461137e57600080fd5b602080825282518282018190526000918401906040840190835b818110156114105783516001600160a01b03168352602093840193909201916001016113e9565b509095945050505050565b60006020828403121561142d57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561145f57600080fd5b61146884611347565b925060208401359150604084013567ffffffffffffffff81111561148b57600080fd5b8401601f8101861361149c57600080fd5b803567ffffffffffffffff8111156114b6576114b6611434565b8060051b604051601f19603f830116810181811067ffffffffffffffff821117156114e3576114e3611434565b60405291825260208184018101929081018984111561150157600080fd5b6020850194505b838510156115275761151985611347565b815260209485019401611508565b50809450505050509250925092565b8215158152604060208201526000825180604084015260005b8181101561156c576020818601810151606086840101520161154f565b506000606082850101526060601f19601f8301168401019150509392505050565b634e487b7160e01b600052603260045260246000fd5b81810381811115610a1d57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000602082840312156115ec57600080fd5b5051919050565b60008261161057634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b0384168152602080820184905260606040830181905283549083018190526000848152918220906080840190835b818110156116715783546001600160a01b031683526001938401936020909301920161164a565b509097965050505050505056fea264697066735822122079b146043a09cd1f3088a4e37eaccc79bdf898977b878897cce438756a522c5964736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000038dafb5a3f0abe1f4e3f45162b480142aae29d38
-----Decoded View---------------
Arg [0] : _category (uint8): 0
Arg [1] : _automationBot (address): 0x38dAFB5A3f0aBE1F4e3F45162B480142Aae29d38
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 00000000000000000000000038dafb5a3f0abe1f4e3f45162b480142aae29d38
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
SONIC | 100.00% | $0.421163 | 0.2264 | $0.095352 |
[ 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.