Address Contract Verified
Address
0xADB8401D85E203F101aC715D5Aa7745a0ABcd42C
Balance
0 ETH
Nonce
1
Code Size
4283 bytes
Creator
0x5f5a24e4...C2A8 at tx 0xfdca29ec...09a0d5
Indexed Transactions
0
Contract Bytecode
4283 bytes
0x608060405234801561001057600080fd5b50600436106100875760003560e01c80638da5cb5b1161005b5780638da5cb5b146100ea578063e78cea9214610108578063f2fde38b14610126578063fc0c546a1461014257610087565b806202ef781461008c5780632d7dd676146100a85780636eb38212146100c4578063715018a6146100e0575b600080fd5b6100a660048036038101906100a19190610be3565b610160565b005b6100c260048036038101906100bd9190610be3565b610359565b005b6100de60048036038101906100d99190610c23565b61064e565b005b6100e86108ea565b005b6100f26108fe565b6040516100ff9190610c5f565b60405180910390f35b610110610927565b60405161011d9190610cd9565b60405180910390f35b610140600480360381019061013b9190610c23565b61094d565b005b61014a6109d3565b6040516101579190610d15565b60405180910390f35b6101686109f7565b807f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016101c29190610c5f565b602060405180830381865afa1580156101df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102039190610d45565b1015610244576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161023b90610dcf565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e2d298482847f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486040518463ffffffff1660e01b81526004016102c393929190610dfe565b6020604051808303816000875af11580156102e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103069190610d45565b508173ffffffffffffffffffffffffffffffffffffffff167f9936746a4565f9766fa768f88f56a7487c78780ac179562773d1c75c5269537e8260405161034d9190610e35565b60405180910390a25050565b6103616109f7565b807f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016103bb9190610c5f565b602060405180830381865afa1580156103d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fc9190610d45565b101561043d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161043490610dcf565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ce9190610e65565b73ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff161461055b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161055290610ede565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ee778c5982846040518363ffffffff1660e01b81526004016105b8929190610efe565b6020604051808303816000875af11580156105d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fb9190610d45565b508173ffffffffffffffffffffffffffffffffffffffff167f9936746a4565f9766fa768f88f56a7487c78780ac179562773d1c75c5269537e826040516106429190610e35565b60405180910390a25050565b6106566109f7565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036106c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106bc90610f73565b60405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690507f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff1663095ea7b38260006040518363ffffffff1660e01b8152600401610748929190610fce565b6020604051808303816000875af1158015610767573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078b919061102f565b5081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff1663095ea7b3837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161084892919061105c565b6020604051808303816000875af1158015610867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088b919061102f565b508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167faae9beddccf584528e87b66c6ff2563825c8a1433305b8a656e9b5f9bf39049960405160405180910390a35050565b6108f26109f7565b6108fc6000610a7e565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109556109f7565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036109c75760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016109be9190610c5f565b60405180910390fd5b6109d081610a7e565b50565b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b6109ff610b42565b73ffffffffffffffffffffffffffffffffffffffff16610a1d6108fe565b73ffffffffffffffffffffffffffffffffffffffff1614610a7c57610a40610b42565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610a739190610c5f565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b7a82610b4f565b9050919050565b610b8a81610b6f565b8114610b9557600080fd5b50565b600081359050610ba781610b81565b92915050565b6000819050919050565b610bc081610bad565b8114610bcb57600080fd5b50565b600081359050610bdd81610bb7565b92915050565b60008060408385031215610bfa57610bf9610b4a565b5b6000610c0885828601610b98565b9250506020610c1985828601610bce565b9150509250929050565b600060208284031215610c3957610c38610b4a565b5b6000610c4784828501610b98565b91505092915050565b610c5981610b6f565b82525050565b6000602082019050610c746000830184610c50565b92915050565b6000819050919050565b6000610c9f610c9a610c9584610b4f565b610c7a565b610b4f565b9050919050565b6000610cb182610c84565b9050919050565b6000610cc382610ca6565b9050919050565b610cd381610cb8565b82525050565b6000602082019050610cee6000830184610cca565b92915050565b6000610cff82610ca6565b9050919050565b610d0f81610cf4565b82525050565b6000602082019050610d2a6000830184610d06565b92915050565b600081519050610d3f81610bb7565b92915050565b600060208284031215610d5b57610d5a610b4a565b5b6000610d6984828501610d30565b91505092915050565b600082825260208201905092915050565b7f496e73756666696369656e742062616c616e6365000000000000000000000000600082015250565b6000610db9601483610d72565b9150610dc482610d83565b602082019050919050565b60006020820190508181036000830152610de881610dac565b9050919050565b610df881610bad565b82525050565b6000606082019050610e136000830186610def565b610e206020830185610c50565b610e2d6040830184610c50565b949350505050565b6000602082019050610e4a6000830184610def565b92915050565b600081519050610e5f81610b81565b92915050565b600060208284031215610e7b57610e7a610b4a565b5b6000610e8984828501610e50565b91505092915050565b7f546f6b656e206d75737420626520756e6465726c79696e670000000000000000600082015250565b6000610ec8601883610d72565b9150610ed382610e92565b602082019050919050565b60006020820190508181036000830152610ef781610ebb565b9050919050565b6000604082019050610f136000830185610def565b610f206020830184610c50565b9392505050565b7f496e76616c696420627269646765206164647265737300000000000000000000600082015250565b6000610f5d601683610d72565b9150610f6882610f27565b602082019050919050565b60006020820190508181036000830152610f8c81610f50565b9050919050565b6000819050919050565b6000610fb8610fb3610fae84610f93565b610c7a565b610bad565b9050919050565b610fc881610f9d565b82525050565b6000604082019050610fe36000830185610c50565b610ff06020830184610fbf565b9392505050565b60008115159050919050565b61100c81610ff7565b811461101757600080fd5b50565b60008151905061102981611003565b92915050565b60006020828403121561104557611044610b4a565b5b60006110538482850161101a565b91505092915050565b60006040820190506110716000830185610c50565b61107e6020830184610def565b939250505056fea26469706673582212207b822f22164668d525fb19e71717c2b9c6141d15b1ebac5e1dd394ca8ff1800b64736f6c63430008180033
Verified Source Code Full Match
Compiler: v0.8.24+commit.e11b9ed9
EVM: paris
Optimization: No
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);
}
}
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the 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);
}
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;
}
}
Deposit.sol 63 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
interface IBridge {
function deposit(uint256 amount, address receiver, address token) external returns(uint256);
function depositUnderlying(uint256 amount, address receiver) external returns(uint256);
function underlying() external view returns (address);
}
contract Deposit is Ownable {
IERC20 public immutable token;
IBridge public bridge; // Remove immutable to allow bridge updates
event DepositReceived(address indexed from, uint256 amount);
event BridgeUpdated(address indexed oldBridge, address indexed newBridge);
constructor(address _token, address _bridge) Ownable(msg.sender) {
token = IERC20(_token);
bridge = IBridge(_bridge);
// Approve bridge to spend our tokens
token.approve(_bridge, type(uint256).max);
}
// Add function to update bridge address
function updateBridge(address newBridge) external onlyOwner {
require(newBridge != address(0), "Invalid bridge address");
address oldBridge = address(bridge);
// Remove approval from old bridge
token.approve(oldBridge, 0);
// Update bridge
bridge = IBridge(newBridge);
// Approve new bridge
token.approve(newBridge, type(uint256).max);
emit BridgeUpdated(oldBridge, newBridge);
}
// This will be called by our backend when it detects a deposit
function forwardDeposit(address user, uint256 amount) external onlyOwner {
require(token.balanceOf(address(this)) >= amount, "Insufficient balance");
// Use deposit function instead of depositUnderlying
bridge.deposit(amount, user, address(token));
emit DepositReceived(user, amount);
}
// Add forwardDepositUnderlying for cases where we want to use that specifically
function forwardDepositUnderlying(address user, uint256 amount) external onlyOwner {
require(token.balanceOf(address(this)) >= amount, "Insufficient balance");
require(address(token) == bridge.underlying(), "Token must be underlying");
bridge.depositUnderlying(amount, user);
emit DepositReceived(user, amount);
}
}
Read Contract
bridge 0xe78cea92 → address
owner 0x8da5cb5b → address
token 0xfc0c546a → address
Write Contract 5 functions
These functions modify contract state and require a wallet transaction to execute.
forwardDeposit 0x0002ef78
address user
uint256 amount
forwardDepositUnderlying 0x2d7dd676
address user
uint256 amount
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
updateBridge 0x6eb38212
address newBridge
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address