Feature Tip: Add private address tag to any address under My Name Tag !
Latest 25 from a total of 25,301 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Deposit | 23254181 | 181 days ago | IN | 0 ETH | 0.00001322 | ||||
| Deposit | 23254139 | 181 days ago | IN | 0 ETH | 0.0000149 | ||||
| Permit And Depos... | 23235886 | 184 days ago | IN | 0 ETH | 0.0001498 | ||||
| Permit And Depos... | 23230386 | 184 days ago | IN | 0 ETH | 0.00005537 | ||||
| Permit And Depos... | 23221153 | 186 days ago | IN | 0 ETH | 0.0001203 | ||||
| Permit And Depos... | 23203228 | 188 days ago | IN | 0 ETH | 0.00002368 | ||||
| Permit And Depos... | 23184028 | 191 days ago | IN | 0 ETH | 0.00028974 | ||||
| Permit And Depos... | 23183787 | 191 days ago | IN | 0 ETH | 0.00014256 | ||||
| Permit And Depos... | 23183200 | 191 days ago | IN | 0 ETH | 0.00056236 | ||||
| Permit And Depos... | 23141111 | 197 days ago | IN | 0 ETH | 0.00028929 | ||||
| Permit And Depos... | 23134069 | 198 days ago | IN | 0 ETH | 0.0001608 | ||||
| Permit And Depos... | 23106095 | 202 days ago | IN | 0 ETH | 0.00022674 | ||||
| Permit And Depos... | 23083955 | 205 days ago | IN | 0 ETH | 0.00018853 | ||||
| Permit And Depos... | 23051922 | 209 days ago | IN | 0 ETH | 0.00012282 | ||||
| Permit And Depos... | 23039396 | 211 days ago | IN | 0 ETH | 0.00048369 | ||||
| Permit And Depos... | 23032443 | 212 days ago | IN | 0 ETH | 0.00040966 | ||||
| Permit And Depos... | 23032433 | 212 days ago | IN | 0 ETH | 0.00039716 | ||||
| Permit And Depos... | 23032237 | 212 days ago | IN | 0 ETH | 0.00043138 | ||||
| Permit And Depos... | 23002021 | 216 days ago | IN | 0 ETH | 0.0000716 | ||||
| Permit And Depos... | 22965001 | 221 days ago | IN | 0 ETH | 0.00005089 | ||||
| Permit And Depos... | 22959932 | 222 days ago | IN | 0 ETH | 0.00010097 | ||||
| Permit And Depos... | 22923648 | 227 days ago | IN | 0 ETH | 0.00010449 | ||||
| Permit And Depos... | 22900589 | 230 days ago | IN | 0 ETH | 0.0000616 | ||||
| Permit And Depos... | 22896631 | 231 days ago | IN | 0 ETH | 0.00092729 | ||||
| Permit And Depos... | 22861646 | 236 days ago | IN | 0 ETH | 0.00020751 |
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| 0x60a06040 | 21782447 | 387 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
SuccinctBridge
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {ISuccinctBridge} from "./interfaces/ISuccinctBridge.sol";
import {Ownable} from "../lib/openzeppelin-contracts/contracts/access/Ownable.sol";
import {Pausable} from "../lib/openzeppelin-contracts/contracts/utils/Pausable.sol";
import {SafeERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import {IERC20Permit} from
"../lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol";
/// @title Succinct Prover Network Bridge
/// @author Succinct Labs
/// @notice A bridge that allows for deposits and withdrawals of USDC for usage in
/// the Succinct Prover Network.
contract SuccinctBridge is Ownable, Pausable, ISuccinctBridge {
using SafeERC20 for IERC20;
/// @dev The USDC token address, which is used as the underlying asset for this bridge.
address internal immutable USDC;
constructor(address _owner, address _USDC) Ownable(_owner) {
USDC = _USDC;
}
/// @inheritdoc ISuccinctBridge
function usdc() external view override returns (address) {
return USDC;
}
/// @inheritdoc ISuccinctBridge
function permitAndDeposit(
address _from,
uint256 _amount,
uint256 _deadline,
uint8 _v,
bytes32 _r,
bytes32 _s
) external override whenNotPaused {
IERC20Permit(USDC).permit(_from, address(this), _amount, _deadline, _v, _r, _s);
_deposit(_from, _amount);
}
/// @inheritdoc ISuccinctBridge
function deposit(uint256 _amount) public override whenNotPaused {
_deposit(msg.sender, _amount);
}
/// @inheritdoc ISuccinctBridge
function withdraw(address _to, uint256 _amount) external override onlyOwner {
IERC20(USDC).safeTransfer(_to, _amount);
emit Withdrawal(_to, _amount);
}
/// @inheritdoc ISuccinctBridge
function pause() external override onlyOwner whenNotPaused {
_pause();
}
/// @inheritdoc ISuccinctBridge
function unpause() external override onlyOwner whenPaused {
_unpause();
}
/// @dev Transfers USDC from the specified address to this contract.
function _deposit(address _from, uint256 _amount) internal {
IERC20(USDC).safeTransferFrom(_from, address(this), _amount);
emit Deposit(_from, _amount);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/// @notice Interface for the SuccinctBridge.
interface ISuccinctBridge {
/// @notice Emitted when a deposit is made.
event Deposit(address indexed from, uint256 amount);
/// @notice Emitted when a withdrawal is made.
event Withdrawal(address indexed to, uint256 amount);
/// @notice The USDC token address, which is used as the underlying asset for this bridge.
function usdc() external view returns (address);
/// @notice Approve and deposit USDC in a single call using a permit signature.
/// @dev Assumes USDC implements permit (https://eips.ethereum.org/EIPS/eip-2612).
/// @param from The address to spend the USDC from. Must correspond to the signer of the permit
/// signature.
/// @param amount The amount of USDC to spend for the deposit.
/// @param deadline The deadline for the permit signature.
/// @param v The v component of the permit signature.
/// @param r The r component of the permit signature.
/// @param s The s component of the permit signature.
function permitAndDeposit(
address from,
uint256 amount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/// @notice Deposit USDC, must have already approved the contract.
/// @param amount The amount of USDC to spend for the deposit.
function deposit(uint256 amount) external;
/// @notice Withdraw USDC to the specified address. Only callable by the owner.
/// @param to The address to send the withdrawn USDC to.
/// @param amount The amount of USDC to withdraw from the bridge.
function withdraw(address to, uint256 amount) external;
/// @notice Pauses deposits. Only callable by the owner.
function pause() external;
/// @notice Unpauses deposits. Only callable by the owner.
function unpause() external;
}// 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.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.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 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 {
using Address for address;
/**
* @dev An operation with an ERC20 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.
*/
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.
*/
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.
*/
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 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).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
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 silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}// 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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: 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.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @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 AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @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
* {FailedInnerCall} 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 AddressInsufficientBalance(address(this));
}
(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 {FailedInnerCall}) 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 {FailedInnerCall} 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 {FailedInnerCall}.
*/
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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}{
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "shanghai",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_USDC","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","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":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","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":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"permitAndDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a060405234801561000f575f80fd5b506040516109e93803806109e983398101604081905261002e916100ee565b816001600160a01b03811661005c57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b61006581610084565b505f805460ff60a01b191690556001600160a01b03166080525061011f565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100e9575f80fd5b919050565b5f80604083850312156100ff575f80fd5b610108836100d3565b9150610116602084016100d3565b90509250929050565b60805161089e61014b5f395f818160a1015281816101dc015281816102d70152610425015261089e5ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c80638456cb59116100635780638456cb591461011f5780638da5cb5b14610127578063b6b55f2514610137578063f2fde38b1461014a578063f3fef3a31461015d575f80fd5b80633e413bee1461009f5780633f4ba83a146100de57806358981c7e146100e85780635c975abb146100fb578063715018a614610117575b5f80fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b6100e6610170565b005b6100e66100f636600461076a565b61018a565b5f54600160a01b900460ff1660405190151581526020016100d5565b6100e6610245565b6100e6610256565b5f546001600160a01b03166100c1565b6100e66101453660046107c5565b61026e565b6100e66101583660046107dc565b610283565b6100e661016b3660046107f5565b6102c2565b610178610345565b610180610371565b61018861039a565b565b6101926103ee565b60405163d505accf60e01b81526001600160a01b038781166004830152306024830152604482018790526064820186905260ff8516608483015260a4820184905260c482018390527f0000000000000000000000000000000000000000000000000000000000000000169063d505accf9060e4015f604051808303815f87803b15801561021d575f80fd5b505af115801561022f573d5f803e3d5ffd5b5050505061023d8686610418565b505050505050565b61024d610345565b6101885f610488565b61025e610345565b6102666103ee565b6101886104d7565b6102766103ee565b6102803382610418565b50565b61028b610345565b6001600160a01b0381166102b957604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61028081610488565b6102ca610345565b6102fe6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168383610519565b816001600160a01b03167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b658260405161033991815260200190565b60405180910390a25050565b5f546001600160a01b031633146101885760405163118cdaa760e01b81523360048201526024016102b0565b5f54600160a01b900460ff1661018857604051638dfc202b60e01b815260040160405180910390fd5b6103a2610371565b5f805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b5f54600160a01b900460ff16156101885760405163d93c066560e01b815260040160405180910390fd5b61044d6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683308461057d565b816001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8260405161033991815260200190565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6104df6103ee565b5f805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586103d13390565b6040516001600160a01b0383811660248301526044820183905261057891859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506105bc565b505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526105b69186918216906323b872dd90608401610546565b50505050565b5f6105d06001600160a01b0384168361061d565b905080515f141580156105f45750808060200190518101906105f2919061081d565b155b1561057857604051635274afe760e01b81526001600160a01b03841660048201526024016102b0565b606061062a83835f610631565b9392505050565b6060814710156106565760405163cd78605960e01b81523060048201526024016102b0565b5f80856001600160a01b03168486604051610671919061083c565b5f6040518083038185875af1925050503d805f81146106ab576040519150601f19603f3d011682016040523d82523d5f602084013e6106b0565b606091505b50915091506106c08683836106ca565b9695505050505050565b6060826106df576106da82610726565b61062a565b81511580156106f657506001600160a01b0384163b155b1561071f57604051639996b31560e01b81526001600160a01b03851660048201526024016102b0565b508061062a565b8051156107365780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610765575f80fd5b919050565b5f805f805f8060c0878903121561077f575f80fd5b6107888761074f565b95506020870135945060408701359350606087013560ff811681146107ab575f80fd5b9598949750929560808101359460a0909101359350915050565b5f602082840312156107d5575f80fd5b5035919050565b5f602082840312156107ec575f80fd5b61062a8261074f565b5f8060408385031215610806575f80fd5b61080f8361074f565b946020939093013593505050565b5f6020828403121561082d575f80fd5b8151801515811461062a575f80fd5b5f82515f5b8181101561085b5760208186018101518583015201610841565b505f92019182525091905056fea26469706673582212202fea9d91c1dff79c39b0783b8e71b9dd3601983334c7bd7ceb9087f4f73085c864736f6c63430008140033000000000000000000000000cafef00d348adbd57c37d1b77e0619c6244c6878000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061009b575f3560e01c80638456cb59116100635780638456cb591461011f5780638da5cb5b14610127578063b6b55f2514610137578063f2fde38b1461014a578063f3fef3a31461015d575f80fd5b80633e413bee1461009f5780633f4ba83a146100de57806358981c7e146100e85780635c975abb146100fb578063715018a614610117575b5f80fd5b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb485b6040516001600160a01b0390911681526020015b60405180910390f35b6100e6610170565b005b6100e66100f636600461076a565b61018a565b5f54600160a01b900460ff1660405190151581526020016100d5565b6100e6610245565b6100e6610256565b5f546001600160a01b03166100c1565b6100e66101453660046107c5565b61026e565b6100e66101583660046107dc565b610283565b6100e661016b3660046107f5565b6102c2565b610178610345565b610180610371565b61018861039a565b565b6101926103ee565b60405163d505accf60e01b81526001600160a01b038781166004830152306024830152604482018790526064820186905260ff8516608483015260a4820184905260c482018390527f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48169063d505accf9060e4015f604051808303815f87803b15801561021d575f80fd5b505af115801561022f573d5f803e3d5ffd5b5050505061023d8686610418565b505050505050565b61024d610345565b6101885f610488565b61025e610345565b6102666103ee565b6101886104d7565b6102766103ee565b6102803382610418565b50565b61028b610345565b6001600160a01b0381166102b957604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61028081610488565b6102ca610345565b6102fe6001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48168383610519565b816001600160a01b03167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b658260405161033991815260200190565b60405180910390a25050565b5f546001600160a01b031633146101885760405163118cdaa760e01b81523360048201526024016102b0565b5f54600160a01b900460ff1661018857604051638dfc202b60e01b815260040160405180910390fd5b6103a2610371565b5f805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b5f54600160a01b900460ff16156101885760405163d93c066560e01b815260040160405180910390fd5b61044d6001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb481683308461057d565b816001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8260405161033991815260200190565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6104df6103ee565b5f805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586103d13390565b6040516001600160a01b0383811660248301526044820183905261057891859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506105bc565b505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526105b69186918216906323b872dd90608401610546565b50505050565b5f6105d06001600160a01b0384168361061d565b905080515f141580156105f45750808060200190518101906105f2919061081d565b155b1561057857604051635274afe760e01b81526001600160a01b03841660048201526024016102b0565b606061062a83835f610631565b9392505050565b6060814710156106565760405163cd78605960e01b81523060048201526024016102b0565b5f80856001600160a01b03168486604051610671919061083c565b5f6040518083038185875af1925050503d805f81146106ab576040519150601f19603f3d011682016040523d82523d5f602084013e6106b0565b606091505b50915091506106c08683836106ca565b9695505050505050565b6060826106df576106da82610726565b61062a565b81511580156106f657506001600160a01b0384163b155b1561071f57604051639996b31560e01b81526001600160a01b03851660048201526024016102b0565b508061062a565b8051156107365780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610765575f80fd5b919050565b5f805f805f8060c0878903121561077f575f80fd5b6107888761074f565b95506020870135945060408701359350606087013560ff811681146107ab575f80fd5b9598949750929560808101359460a0909101359350915050565b5f602082840312156107d5575f80fd5b5035919050565b5f602082840312156107ec575f80fd5b61062a8261074f565b5f8060408385031215610806575f80fd5b61080f8361074f565b946020939093013593505050565b5f6020828403121561082d575f80fd5b8151801515811461062a575f80fd5b5f82515f5b8181101561085b5760208186018101518583015201610841565b505f92019182525091905056fea26469706673582212202fea9d91c1dff79c39b0783b8e71b9dd3601983334c7bd7ceb9087f4f73085c864736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000cafef00d348adbd57c37d1b77e0619c6244c6878000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
-----Decoded View---------------
Arg [0] : _owner (address): 0xCafEf00d348Adbd57c37d1B77e0619C6244C6878
Arg [1] : _USDC (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000cafef00d348adbd57c37d1b77e0619c6244c6878
Arg [1] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
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.