Address Contract Verified
Address
0xbc69975248f7faDE8322dD7F4960a2dDe3444441
Balance
0 ETH
Nonce
1
Code Size
942 bytes
Creator
0xA37C50b0...0829 at tx 0xf0806538...2f0a9a
Indexed Transactions
0
Contract Bytecode
942 bytes
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063715018a6146100515780638da5cb5b1461005b578063c18752ba1461007a578063f2fde38b1461008d575b600080fd5b6100596100a0565b005b600054604080516001600160a01b039092168252519081900360200190f35b6100596100883660046102e9565b6100b4565b61005961009b366004610334565b61020d565b6100a8610250565b6100b2600061027d565b565b6100bc610250565b6001600160a01b03831615806100d957506001600160a01b038216155b156100f7576040516321c7e04360e11b815260040160405180910390fd5b8060000361011857604051631c23a34f60e01b815260040160405180910390fd5b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd906064016020604051808303816000875af115801561016f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101939190610356565b6101b0576040516305cbeb8160e41b815260040160405180910390fd5b816001600160a01b0316846001600160a01b0316846001600160a01b03167f37d0bfe35bc34e8be3df71291bd69ca8351259fc6dc6447627bb98935bcc9ee4846040516101ff91815260200190565b60405180910390a450505050565b610215610250565b6001600160a01b03811661024457604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b61024d8161027d565b50565b6000546001600160a01b031633146100b25760405163118cdaa760e01b815233600482015260240161023b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146102e457600080fd5b919050565b600080600080608085870312156102ff57600080fd5b610308856102cd565b9350610316602086016102cd565b9250610324604086016102cd565b9396929550929360600135925050565b60006020828403121561034657600080fd5b61034f826102cd565b9392505050565b60006020828403121561036857600080fd5b8151801515811461034f57600080fdfea2646970667358221220aa6693277706fd4a3fb1dfed7b25b69325721a013ff2e49b8febb745d36dc33764736f6c634300081b0033
Verified Source Code Full Match
Compiler: v0.8.27+commit.40a35a09
EVM: paris
Optimization: Yes (200 runs)
Ownable.sol 100 lines
// 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);
}
}
Context.sol 28 lines
// 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;
}
}
DCAForwarder.sol 81 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/access/Ownable.sol";
/// -----------------------------------------------------------------------
/// Interfaces
/// -----------------------------------------------------------------------
/// @dev Minimal ERC20 interface for transferFrom
interface IERC20 {
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
/// @title DCA Forwarder Contract
/// @notice Enables pull-based ERC20 transfers from user wallets to arbitrary destinations
/// for automated Dollar-Cost Averaging (DCA) strategies. Users give one-time
/// infinite allowance; then this contract pulls tokens as needed.
contract DCAForwarder is Ownable {
/// -----------------------------------------------------------------------
/// Errors
/// -----------------------------------------------------------------------
/// @notice Thrown when a zero address is provided
error DCAForwarder_ZeroAddress();
/// @notice Thrown when a zero amount is provided
error DCAForwarder_ZeroAmount();
/// @notice Thrown when ERC20 transferFrom fails
error DCAForwarder_TransferFailed();
/// -----------------------------------------------------------------------
/// Events
/// -----------------------------------------------------------------------
/// @notice Emitted when funds are pulled and forwarded
/// @param user The address of the user from whose balance tokens were pulled
/// @param token The ERC20 token contract address transferred
/// @param dest The destination address receiving the tokens
/// @param amount The exact amount of tokens transferred
event FundsPulled(
address indexed user,
address indexed token,
address indexed dest,
uint256 amount
);
/// -----------------------------------------------------------------------
/// Constructor
/// -----------------------------------------------------------------------
/// @notice Initializes the contract and sets the deployer as the owner
constructor() Ownable(msg.sender) {
// Ownable constructor sets msg.sender as owner
}
/// -----------------------------------------------------------------------
/// Public Functions (onlyOwner)
/// -----------------------------------------------------------------------
/// @notice Pulls `amount` of `token` from `user` and forwards it to `dest`
/// @dev Requires user has previously approved this contract for at least `amount`
/// @param token The ERC20 token contract address
/// @param user The token holder's address
/// @param dest The recipient address (e.g., swap provider)
/// @param amount The number of tokens to transfer
function pullAndForward(
address token,
address user,
address dest,
uint256 amount
) external onlyOwner {
if (user == address(0) || dest == address(0))
revert DCAForwarder_ZeroAddress();
if (amount == 0) revert DCAForwarder_ZeroAmount();
if (!IERC20(token).transferFrom(user, dest, amount))
revert DCAForwarder_TransferFailed();
emit FundsPulled(user, token, dest, amount);
}
}
Read Contract
owner 0x8da5cb5b → address
Write Contract 3 functions
These functions modify contract state and require a wallet transaction to execute.
pullAndForward 0xc18752ba
address token
address user
address dest
uint256 amount
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address