Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 427566132 | 3 hrs ago | 0.01263194 ETH | ||||
| 427566132 | 3 hrs ago | 0.01263194 ETH | ||||
| 427560542 | 4 hrs ago | 0.00217135 ETH | ||||
| 427560542 | 4 hrs ago | 0.00217135 ETH | ||||
| 427553378 | 4 hrs ago | 0.00323342 ETH | ||||
| 427553378 | 4 hrs ago | 0.00323342 ETH | ||||
| 427527938 | 6 hrs ago | 0.0004279 ETH | ||||
| 427527938 | 6 hrs ago | 0.0004279 ETH | ||||
| 427511807 | 7 hrs ago | 0.80111173 ETH | ||||
| 427511807 | 7 hrs ago | 0.80111173 ETH | ||||
| 427508261 | 7 hrs ago | 0.00100818 ETH | ||||
| 427508261 | 7 hrs ago | 0.00100818 ETH | ||||
| 427496580 | 8 hrs ago | 0.00125549 ETH | ||||
| 427496580 | 8 hrs ago | 0.00125549 ETH | ||||
| 427415243 | 14 hrs ago | 0.00826993 ETH | ||||
| 427415243 | 14 hrs ago | 0.00826993 ETH | ||||
| 427357894 | 18 hrs ago | 0.00408616 ETH | ||||
| 427357894 | 18 hrs ago | 0.00408616 ETH | ||||
| 427355522 | 18 hrs ago | 0.00077226 ETH | ||||
| 427355522 | 18 hrs ago | 0.00077226 ETH | ||||
| 427354944 | 18 hrs ago | 0.00197788 ETH | ||||
| 427354944 | 18 hrs ago | 0.00197788 ETH | ||||
| 427290032 | 23 hrs ago | 0.00830288 ETH | ||||
| 427290032 | 23 hrs ago | 0.00830288 ETH | ||||
| 427283108 | 23 hrs ago | 0.13000168 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
DaimoPayExecutor
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 999999 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.12;
import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import "openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol";
import "./TokenUtils.sol";
/// Represents a contract call.
struct Call {
/// Address of the contract to call.
address to;
/// Native token amount for call, or 0
uint256 value;
/// Calldata for call
bytes data;
}
/// @author Daimo, Inc
/// @custom:security-contact [email protected]
/// @notice This contract is used to execute arbitrary contract calls on behalf
/// of the DaimoPay escrow contract.
/// WARNING: Never approve tokens directly to this contract. Never transfer
/// tokens to this contract. Such tokens can be stolen by anyone. All
/// interactions with this contract should be done via the DaimoPay contract.
contract DaimoPayExecutor is ReentrancyGuard {
using SafeERC20 for IERC20;
/// The only address that is allowed to call the `execute` function.
address public immutable escrow;
constructor(address _escrow) {
escrow = _escrow;
}
/// Execute arbitrary calls. Revert if any fail.
/// Check that at least one of the expectedOutput tokens is present. Assumes
/// that exactly one token is present and transfers it to the recipient.
/// Returns any surplus tokens to the surplus recipient.
function execute(
Call[] calldata calls,
TokenAmount[] calldata expectedOutput,
address payable recipient,
address payable surplusRecipient
) external nonReentrant {
require(msg.sender == escrow, "DPCE: only escrow");
// Execute provided calls.
uint256 callsLength = calls.length;
for (uint256 i = 0; i < callsLength; ++i) {
Call calldata call = calls[i];
(bool success, ) = call.to.call{value: call.value}(call.data);
require(success, "DPCE: call failed");
}
/// Check that at least one of the expectedOutput tokens is present
/// with enough balance.
uint256 outputIndex = TokenUtils.checkBalance({
tokenAmounts: expectedOutput
});
require(
outputIndex < expectedOutput.length,
"DPCE: insufficient output"
);
// Transfer the expected amount of the token to the recipient.
TokenUtils.transfer({
token: expectedOutput[outputIndex].token,
recipient: recipient,
amount: expectedOutput[outputIndex].amount
});
// Transfer any surplus tokens to the surplus recipient.
TokenUtils.transferBalance({
token: expectedOutput[outputIndex].token,
recipient: surplusRecipient
});
}
/// Execute a final call. Approve the final token and make the call.
/// Return whether the call succeeded.
function executeFinalCall(
Call calldata finalCall,
TokenAmount calldata finalCallToken,
address payable refundAddr
) external nonReentrant returns (bool success) {
require(msg.sender == escrow, "DPCE: only escrow");
// Approve the final call token to the final call contract.
TokenUtils.approve({
token: finalCallToken.token,
spender: address(finalCall.to),
amount: finalCallToken.amount
});
// Then, execute the final call.
(success, ) = finalCall.to.call{value: finalCall.value}(finalCall.data);
// Send any excess funds to the refund address.
TokenUtils.transferBalance({
token: finalCallToken.token,
recipient: refundAddr
});
}
/// Accept native-token (eg ETH) inputs
receive() external payable {}
}// 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 Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (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: GPL-3.0-or-later
pragma solidity ^0.8.12;
import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
/// Asset amount, e.g. $100 USDC or 0.1 ETH
struct TokenAmount {
/// Zero address = native asset, e.g. ETH
IERC20 token;
uint256 amount;
}
/// Event emitted when native tokens (ETH, etc.) are transferred
event NativeTransfer(address indexed from, address indexed to, uint256 value);
/// Utility functions that work for both ERC20 and native tokens.
library TokenUtils {
using SafeERC20 for IERC20;
/// Returns ERC20 or ETH balance.
function getBalanceOf(
IERC20 token,
address addr
) internal view returns (uint256) {
if (address(token) == address(0)) {
return addr.balance;
} else {
return token.balanceOf(addr);
}
}
/// Approves a token transfer.
function approve(IERC20 token, address spender, uint256 amount) internal {
if (address(token) != address(0)) {
token.forceApprove({spender: spender, value: amount});
} // Do nothing for native token.
}
/// Sends an ERC20 or ETH transfer. For ETH, verify call success.
function transfer(
IERC20 token,
address payable recipient,
uint256 amount
) internal {
if (address(token) != address(0)) {
token.safeTransfer({to: recipient, value: amount});
} else {
// Native token transfer
(bool success, ) = recipient.call{value: amount}("");
require(success, "TokenUtils: ETH transfer failed");
}
}
/// Sends an ERC20 or ETH transfer. Returns true if successful.
function tryTransfer(
IERC20 token,
address payable recipient,
uint256 amount
) internal returns (bool) {
if (address(token) != address(0)) {
return token.trySafeTransfer({to: recipient, value: amount});
} else {
(bool success, ) = recipient.call{value: amount}("");
return success;
}
}
/// Sends an ERC20 transfer.
function transferFrom(
IERC20 token,
address from,
address to,
uint256 amount
) internal {
require(
address(token) != address(0),
"TokenUtils: ETH transferFrom must be caller"
);
token.safeTransferFrom({from: from, to: to, value: amount});
}
/// Sends any token balance in the contract to the recipient.
function transferBalance(
IERC20 token,
address payable recipient
) internal returns (uint256) {
uint256 balance = getBalanceOf({token: token, addr: address(this)});
if (balance > 0) {
transfer({token: token, recipient: recipient, amount: balance});
}
return balance;
}
/// Check that the address has enough of at least one of the tokenAmounts.
/// Returns the index of the first token that has sufficient balance, or
/// the length of the tokenAmounts array if no token has sufficient balance.
function checkBalance(
TokenAmount[] calldata tokenAmounts
) internal view returns (uint256) {
uint256 n = tokenAmounts.length;
for (uint256 i = 0; i < n; ++i) {
TokenAmount calldata tokenAmount = tokenAmounts[i];
uint256 balance = getBalanceOf({
token: tokenAmount.token,
addr: address(this)
});
if (balance >= tokenAmount.amount) {
return i;
}
}
return n;
}
/// @notice Converts a token amount between different decimal representations.
/// @param amount The token amount in the source decimal format.
/// @param fromDecimals Decimals of the source token (e.g., 6 for USDC).
/// @param toDecimals Decimals of the destination token (e.g., 18 for DAI).
/// @param roundUp If true, rounds up when scaling down (losing precision).
/// Use true when calculating required input amounts (user pays more).
/// Use false when calculating output amounts (user receives less).
/// @return The converted amount in the destination decimal format.
function convertTokenAmountDecimals(
uint256 amount,
uint256 fromDecimals,
uint256 toDecimals,
bool roundUp
) internal pure returns (uint256) {
if (toDecimals == fromDecimals) {
return amount;
} else if (toDecimals > fromDecimals) {
return amount * 10 ** (toDecimals - fromDecimals);
} else {
uint256 decimalDiff = fromDecimals - toDecimals;
uint256 divisor = 10 ** decimalDiff;
if (roundUp) {
return (amount + divisor - 1) / divisor;
} else {
return amount / divisor;
}
}
}
}// 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.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/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// 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.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);
}{
"remappings": [
"@axelar-network/=lib/axelar-gmp-sdk-solidity/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"@layerzerolabs/oft-evm/=lib/devtools/packages/oft-evm/",
"@layerzerolabs/oapp-evm/=lib/devtools/packages/oapp-evm/",
"@layerzerolabs/lz-evm-protocol-v2/=lib/LayerZero-v2/packages/layerzero-v2/evm/protocol/",
"@layerzerolabs/lz-evm-messagelib-v2/=lib/LayerZero-v2/packages/layerzero-v2/evm/messagelib/",
"@layerzerolabs/lz-evm-oapp-v2/=lib/LayerZero-v2/packages/layerzero-v2/evm/oapp/",
"@stargatefinance/stg-evm-v2/=lib/stargate-v2/packages/stg-evm-v2/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"LayerZero-v2/=lib/LayerZero-v2/",
"axelar-gmp-sdk-solidity/=lib/axelar-gmp-sdk-solidity/contracts/",
"devtools/=lib/devtools/packages/toolbox-foundry/src/",
"ds-test/=lib/solmate/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"solmate/=lib/solmate/src/",
"stargate-v2/=lib/stargate-v2/packages/stg-evm-v2/src/"
],
"optimizer": {
"enabled": true,
"runs": 999999
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"viaIR": true
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_escrow","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"escrow","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Call[]","name":"calls","type":"tuple[]"},{"components":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenAmount[]","name":"expectedOutput","type":"tuple[]"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"address payable","name":"surplusRecipient","type":"address"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Call","name":"finalCall","type":"tuple"},{"components":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenAmount","name":"finalCallToken","type":"tuple"},{"internalType":"address payable","name":"refundAddr","type":"address"}],"name":"executeFinalCall","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60a034607957601f610c3d38819003918201601f19168301916001600160401b03831184841017607e57808492602094604052833981010312607957516001600160a01b03811681036079576001600055608052604051610ba8908161009582396080518181816101460152818161036e01526104630152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c80637644f5c814610392578063e2fdcc17146103235763f17774100361000e573461031e5760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031e5760043567ffffffffffffffff811161031e573660238201121561031e5780600401359067ffffffffffffffff821161031e573660248360051b8301011161031e576024359167ffffffffffffffff831161031e573660238401121561031e57826004013567ffffffffffffffff811161031e576024840193602436918360061b01011161031e576044359373ffffffffffffffffffffffffffffffffffffffff8516850361031e57610123949294610648565b9061012c610872565b61016d73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016331461066b565b6000937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7d86360301945b8781101561026357600060248260051b890101358781121561025f57819089016044602482016101d46101c9826106f3565b916064850190610714565b9290836040519485928337810186815203930135905af16101f36107d5565b501561020157600101610197565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f445043453a2063616c6c206661696c65640000000000000000000000000000006044820152fd5b5080fd5b5061026e84836108d6565b848110156102c05784836102ae61029394610298610293866102b89b6102b39a610833565b6106f3565b9060206102a6878787610833565b01359161091b565b610833565b6108ad565b506001600055005b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f445043453a20696e73756666696369656e74206f7574707574000000000000006044820152fd5b600080fd5b3461031e5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031e57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b3461031e5760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031e5760043567ffffffffffffffff811161031e578060040160607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc833603011261031e5760407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc36011261031e576104fd6000806020946024610440610648565b95610449610872565b61048a73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016331461066b565b6104926106d0565b61049b826106f3565b9073ffffffffffffffffffffffffffffffffffffffff8116908161050d575b5050506104d46104c9826106f3565b916044850190610714565b9290836040519485928337810186815203930135905af1916104f46107d5565b506102b36106d0565b5060016000556040519015158152f35b604051918b888185017f095ea7b300000000000000000000000000000000000000000000000000000000815261059b8661056f6044358a8d84016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101885287610765565b85519082865af1903d89519083610626575b5050506104ba5761061961061e9373ffffffffffffffffffffffffffffffffffffffff604051917f095ea7b3000000000000000000000000000000000000000000000000000000008f840152168782015288604482015260448152610613606482610765565b82610ae7565b610ae7565b8880806104ba565b9091925015891461063e57503b15155b8c80806105ad565b6001915014610636565b6064359073ffffffffffffffffffffffffffffffffffffffff8216820361031e57565b1561067257565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f445043453a206f6e6c7920657363726f770000000000000000000000000000006044820152fd5b60243573ffffffffffffffffffffffffffffffffffffffff8116810361031e5790565b3573ffffffffffffffffffffffffffffffffffffffff8116810361031e5790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18136030182121561031e570180359067ffffffffffffffff821161031e5760200191813603831361031e57565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176107a657604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b3d1561082e573d9067ffffffffffffffff82116107a6576040519161082260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184610765565b82523d6000602084013e565b606090565b91908110156108435760061b0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600260005414610883576002600055565b7f3ee5aeb50000000000000000000000000000000000000000000000000000000060005260046000fd5b6108b73082610a2c565b8092816108c5575b50505090565b6108ce9261091b565b3881816108bf565b60005b8281106108e557505090565b6108f0818484610833565b6020610904306108ff846106f3565b610a2c565b9101351115610915576001016108d9565b91505090565b9073ffffffffffffffffffffffffffffffffffffffff82161561099d576040517fa9059cbb00000000000000000000000000000000000000000000000000000000602082015273ffffffffffffffffffffffffffffffffffffffff91909116602482015260448082019390935291825261099b9190610619606483610765565b565b6000809381935073ffffffffffffffffffffffffffffffffffffffff8293165af16109c66107d5565b50156109ce57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f546f6b656e5574696c733a20455448207472616e73666572206661696c6564006044820152fd5b73ffffffffffffffffffffffffffffffffffffffff1680610a4c57503190565b9073ffffffffffffffffffffffffffffffffffffffff602460209260405194859384927f70a082310000000000000000000000000000000000000000000000000000000084521660048301525afa908115610adb57600091610aac575090565b90506020813d602011610ad3575b81610ac760209383610765565b8101031261031e575190565b3d9150610aba565b6040513d6000823e3d90fd5b906000602091828151910182855af115610adb576000513d610b69575073ffffffffffffffffffffffffffffffffffffffff81163b155b610b255750565b73ffffffffffffffffffffffffffffffffffffffff907f5274afe7000000000000000000000000000000000000000000000000000000006000521660045260246000fd5b60011415610b1e56fea2646970667358221220d18b4c5904404c75abcfa990c50342dd0c91b6fb99597f32dc8af3ebde036ef164736f6c634300081a0033000000000000000000000000bdb9f958e2f0e38d89173374e24ee335b50ed128
Deployed Bytecode
0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c80637644f5c814610392578063e2fdcc17146103235763f17774100361000e573461031e5760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031e5760043567ffffffffffffffff811161031e573660238201121561031e5780600401359067ffffffffffffffff821161031e573660248360051b8301011161031e576024359167ffffffffffffffff831161031e573660238401121561031e57826004013567ffffffffffffffff811161031e576024840193602436918360061b01011161031e576044359373ffffffffffffffffffffffffffffffffffffffff8516850361031e57610123949294610648565b9061012c610872565b61016d73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000bdb9f958e2f0e38d89173374e24ee335b50ed12816331461066b565b6000937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7d86360301945b8781101561026357600060248260051b890101358781121561025f57819089016044602482016101d46101c9826106f3565b916064850190610714565b9290836040519485928337810186815203930135905af16101f36107d5565b501561020157600101610197565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f445043453a2063616c6c206661696c65640000000000000000000000000000006044820152fd5b5080fd5b5061026e84836108d6565b848110156102c05784836102ae61029394610298610293866102b89b6102b39a610833565b6106f3565b9060206102a6878787610833565b01359161091b565b610833565b6108ad565b506001600055005b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f445043453a20696e73756666696369656e74206f7574707574000000000000006044820152fd5b600080fd5b3461031e5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031e57602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000bdb9f958e2f0e38d89173374e24ee335b50ed128168152f35b3461031e5760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031e5760043567ffffffffffffffff811161031e578060040160607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc833603011261031e5760407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc36011261031e576104fd6000806020946024610440610648565b95610449610872565b61048a73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000bdb9f958e2f0e38d89173374e24ee335b50ed12816331461066b565b6104926106d0565b61049b826106f3565b9073ffffffffffffffffffffffffffffffffffffffff8116908161050d575b5050506104d46104c9826106f3565b916044850190610714565b9290836040519485928337810186815203930135905af1916104f46107d5565b506102b36106d0565b5060016000556040519015158152f35b604051918b888185017f095ea7b300000000000000000000000000000000000000000000000000000000815261059b8661056f6044358a8d84016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101885287610765565b85519082865af1903d89519083610626575b5050506104ba5761061961061e9373ffffffffffffffffffffffffffffffffffffffff604051917f095ea7b3000000000000000000000000000000000000000000000000000000008f840152168782015288604482015260448152610613606482610765565b82610ae7565b610ae7565b8880806104ba565b9091925015891461063e57503b15155b8c80806105ad565b6001915014610636565b6064359073ffffffffffffffffffffffffffffffffffffffff8216820361031e57565b1561067257565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f445043453a206f6e6c7920657363726f770000000000000000000000000000006044820152fd5b60243573ffffffffffffffffffffffffffffffffffffffff8116810361031e5790565b3573ffffffffffffffffffffffffffffffffffffffff8116810361031e5790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18136030182121561031e570180359067ffffffffffffffff821161031e5760200191813603831361031e57565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176107a657604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b3d1561082e573d9067ffffffffffffffff82116107a6576040519161082260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184610765565b82523d6000602084013e565b606090565b91908110156108435760061b0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600260005414610883576002600055565b7f3ee5aeb50000000000000000000000000000000000000000000000000000000060005260046000fd5b6108b73082610a2c565b8092816108c5575b50505090565b6108ce9261091b565b3881816108bf565b60005b8281106108e557505090565b6108f0818484610833565b6020610904306108ff846106f3565b610a2c565b9101351115610915576001016108d9565b91505090565b9073ffffffffffffffffffffffffffffffffffffffff82161561099d576040517fa9059cbb00000000000000000000000000000000000000000000000000000000602082015273ffffffffffffffffffffffffffffffffffffffff91909116602482015260448082019390935291825261099b9190610619606483610765565b565b6000809381935073ffffffffffffffffffffffffffffffffffffffff8293165af16109c66107d5565b50156109ce57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f546f6b656e5574696c733a20455448207472616e73666572206661696c6564006044820152fd5b73ffffffffffffffffffffffffffffffffffffffff1680610a4c57503190565b9073ffffffffffffffffffffffffffffffffffffffff602460209260405194859384927f70a082310000000000000000000000000000000000000000000000000000000084521660048301525afa908115610adb57600091610aac575090565b90506020813d602011610ad3575b81610ac760209383610765565b8101031261031e575190565b3d9150610aba565b6040513d6000823e3d90fd5b906000602091828151910182855af115610adb576000513d610b69575073ffffffffffffffffffffffffffffffffffffffff81163b155b610b255750565b73ffffffffffffffffffffffffffffffffffffffff907f5274afe7000000000000000000000000000000000000000000000000000000006000521660045260246000fd5b60011415610b1e56fea2646970667358221220d18b4c5904404c75abcfa990c50342dd0c91b6fb99597f32dc8af3ebde036ef164736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000bdb9f958e2f0e38d89173374e24ee335b50ed128
-----Decoded View---------------
Arg [0] : _escrow (address): 0xbdb9F958e2F0e38D89173374E24Ee335B50ed128
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000bdb9f958e2f0e38d89173374e24ee335b50ed128
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.