More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 128 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Deposit | 21246082 | 22 hrs ago | IN | 0.001 ETH | 0.00588614 | ||||
Deposit | 21226294 | 3 days ago | IN | 0.003 ETH | 0.00378493 | ||||
Deposit | 21225187 | 3 days ago | IN | 0.001 ETH | 0.00259236 | ||||
Deposit | 21219356 | 4 days ago | IN | 0.001 ETH | 0.00321037 | ||||
Deposit | 21216458 | 5 days ago | IN | 0.001 ETH | 0.00621786 | ||||
Deposit | 21206589 | 6 days ago | IN | 0.001 ETH | 0.00244297 | ||||
Deposit | 21199157 | 7 days ago | IN | 0.001 ETH | 0.00315903 | ||||
Deposit | 21194218 | 8 days ago | IN | 0.001 ETH | 0.0085875 | ||||
Deposit | 21189885 | 8 days ago | IN | 0.001 ETH | 0.00554984 | ||||
Deposit | 21162163 | 12 days ago | IN | 0.001 ETH | 0.00416121 | ||||
Deposit | 21150509 | 14 days ago | IN | 0.005 ETH | 0.00298647 | ||||
Deposit | 21150071 | 14 days ago | IN | 0.01 ETH | 0.0033925 | ||||
Deposit | 21147814 | 14 days ago | IN | 0.001 ETH | 0.0018353 | ||||
Deposit | 21146558 | 14 days ago | IN | 0.001 ETH | 0.00266304 | ||||
Deposit | 21131513 | 16 days ago | IN | 0.001 ETH | 0.00659282 | ||||
Deposit | 21130038 | 17 days ago | IN | 0.01 ETH | 0.00395625 | ||||
Deposit | 21126316 | 17 days ago | IN | 0.005 ETH | 0.00886791 | ||||
Deposit | 21119049 | 18 days ago | IN | 0.001 ETH | 0.00094786 | ||||
Deposit | 21114434 | 19 days ago | IN | 0.001 ETH | 0.00123668 | ||||
Deposit | 21095328 | 21 days ago | IN | 0.01 ETH | 0.00258122 | ||||
Deposit | 21093179 | 22 days ago | IN | 0.0025 ETH | 0.00407271 | ||||
Deposit | 21069074 | 25 days ago | IN | 0.01 ETH | 0.00220452 | ||||
Deposit | 21068880 | 25 days ago | IN | 0.001 ETH | 0.00225072 | ||||
Deposit | 21064816 | 26 days ago | IN | 0.01 ETH | 0.00326006 | ||||
Deposit | 21063036 | 26 days ago | IN | 0.001 ETH | 0.00222906 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
21246082 | 22 hrs ago | 0.001 ETH | ||||
21226294 | 3 days ago | 0.003 ETH | ||||
21225187 | 3 days ago | 0.001 ETH | ||||
21219356 | 4 days ago | 0.001 ETH | ||||
21216458 | 5 days ago | 0.001 ETH | ||||
21206589 | 6 days ago | 0.001 ETH | ||||
21199157 | 7 days ago | 0.001 ETH | ||||
21194218 | 8 days ago | 0.001 ETH | ||||
21189885 | 8 days ago | 0.001 ETH | ||||
21162163 | 12 days ago | 0.001 ETH | ||||
21150509 | 14 days ago | 0.005 ETH | ||||
21150071 | 14 days ago | 0.01 ETH | ||||
21147814 | 14 days ago | 0.001 ETH | ||||
21146558 | 14 days ago | 0.001 ETH | ||||
21131513 | 16 days ago | 0.001 ETH | ||||
21130038 | 17 days ago | 0.01 ETH | ||||
21126316 | 17 days ago | 0.005 ETH | ||||
21119049 | 18 days ago | 0.001 ETH | ||||
21114434 | 19 days ago | 0.001 ETH | ||||
21095328 | 21 days ago | 0.01 ETH | ||||
21093179 | 22 days ago | 0.0025 ETH | ||||
21069074 | 25 days ago | 0.01 ETH | ||||
21068880 | 25 days ago | 0.001 ETH | ||||
21064816 | 26 days ago | 0.01 ETH | ||||
21063036 | 26 days ago | 0.001 ETH |
Loading...
Loading
Contract Name:
ZkEVMWrapperV2
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 999999 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.20; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {IERC20Permit} from "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol"; import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; import {IZkEVMBridge} from "./interfaces/IZkEVMBridge.sol"; import {IDai} from "./interfaces/IDai.sol"; /// @title ZkEVMWrapperV2 /// @author QEDK, DhairyaSethi (https://polygon.technology) /// @notice This contract is a wrapper for the zkEVM bridge allowing deposits of Ether and ERC20 /// @custom:security [email protected] contract ZkEVMWrapperV2 { using SafeERC20 for IERC20; using SafeERC20 for IERC20Permit; using SafeERC20 for IDai; IZkEVMBridge private immutable _zkEVMBridge; constructor(IZkEVMBridge zkEVMBridge_) { _zkEVMBridge = zkEVMBridge_; } /// @notice Bridge Ether and ERC20 to zkEVM using traditional approval /// @dev User/UI must be aware of the existing/available networks when choosing the destination network /// @param token Address of ERC20 token to deposit /// @param destinationNetwork The destination network on the zkEVM bridge (does not revert on invalid destinationNetwork) /// @param destinationAddress The destination address on the zkEVM bridge /// @param amount Amount to deposit function deposit( IERC20 token, uint32 destinationNetwork, address destinationAddress, uint256 amount ) external payable { token.safeTransferFrom(msg.sender, address(this), amount); token.forceApprove(address(_zkEVMBridge), amount); _zkEVMBridge.bridgeAsset( destinationNetwork, destinationAddress, amount, address(token), false, // forceUpdateGlobalExitRoot "" // permitData ); _zkEVMBridge.bridgeAsset{value: msg.value}( destinationNetwork, destinationAddress, msg.value, address(0), true, // forceUpdateGlobalExitRoot "" // permitData ); } /// @notice Bridge Ether and ERC20 to zkEVM using EIP-2612 permit /// @dev User/UI must be aware of the existing/available networks when choosing the destination network /// @param token Address of ERC20 token to deposit /// @param destinationNetwork The destination network on the zkEVM bridge (does not revert on invalid destinationNetwork) /// @param destinationAddress The destination address on the zkEVM bridge /// @param amount Amount to deposit function deposit( IERC20 token, uint32 destinationNetwork, address destinationAddress, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable { IERC20Permit(address(token)).safePermit( msg.sender, address(this), amount, deadline, v, r, s ); token.safeTransferFrom(msg.sender, address(this), amount); token.forceApprove(address(_zkEVMBridge), amount); _zkEVMBridge.bridgeAsset( destinationNetwork, destinationAddress, amount, address(token), false, // forceUpdateGlobalExitRoot "" // permitData ); _zkEVMBridge.bridgeAsset{value: msg.value}( destinationNetwork, destinationAddress, msg.value, address(0), true, // forceUpdateGlobalExitRoot "" // permitData ); } /// @notice Bridge Ether and ERC20 to zkEVM using DAI permit /// @param token Address of ERC20 token to deposit /// @param destinationNetwork The destination network on the zkEVM bridge (does not revert on invalid destinationNetwork) /// @param destinationAddress The destination address on the zkEVM bridge /// @param amount Amount to deposit function deposit( IDai token, uint32 destinationNetwork, address destinationAddress, uint256 amount, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s ) external payable { token.permit( msg.sender, address(this), nonce, expiry, allowed, v, r, s ); token.safeTransferFrom(msg.sender, address(this), amount); token.forceApprove(address(_zkEVMBridge), amount); _zkEVMBridge.bridgeAsset( destinationNetwork, destinationAddress, amount, address(token), false, // forceUpdateGlobalExitRoot "" // permitData ); _zkEVMBridge.bridgeAsset{value: msg.value}( destinationNetwork, destinationAddress, msg.value, address(0), true, // forceUpdateGlobalExitRoot "" // permitData ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @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 amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` 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 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @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. */ 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]. */ 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 v4.9.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../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 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.encodeWithSelector(token.transfer.selector, 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.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 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); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to * 0 before setting it to a non-zero value. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @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, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @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.isContract(address(token)); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.20; interface IZkEVMBridge { function bridgeAsset( uint32 destinationNetwork, address destinationAddress, uint256 amount, address token, bool forceUpdateGlobalExitRoot, bytes calldata permitData ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.20; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; interface IDai is IERC20 { function permit( address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @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, it is bubbled up by this * function (like regular Solidity function calls). * * 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. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @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`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage); } } }
{ "remappings": [ "ds-test/=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/", "openzeppelin/=lib/openzeppelin-contracts/contracts/" ], "optimizer": { "enabled": true, "runs": 999999 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IZkEVMBridge","name":"zkEVMBridge_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint32","name":"destinationNetwork","type":"uint32"},{"internalType":"address","name":"destinationAddress","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":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint32","name":"destinationNetwork","type":"uint32"},{"internalType":"address","name":"destinationAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IDai","name":"token","type":"address"},{"internalType":"uint32","name":"destinationNetwork","type":"uint32"},{"internalType":"address","name":"destinationAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"bool","name":"allowed","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"}]
Contract Creation Code
60a03461007857601f610e4038819003918201601f19168301916001600160401b0383118484101761007d5780849260209460405283398101031261007857516001600160a01b038116810361007857608052604051610dac908161009482396080518181816101530152818161038301526105af0152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604081815260048036101561001557600080fd5b600092833560e01c908163228d8f8e1461044157508381634cccfee914610314575063be6e7f921461004657600080fd5b6101407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103105780359173ffffffffffffffffffffffffffffffffffffffff9283811680910361030c5761009c61084c565b906100a561085f565b906064359260c435968715158098036103085760e4359760ff8916809903610303578998843b156102ff578751917f8fcbaf0c000000000000000000000000000000000000000000000000000000008352338a840152306024840152608435604484015260a4356064840152608483015260a48201528881610104803560c48301526101243560e48301528183885af180156102f5579089916102e1575b505061015185303386610922565b7f0000000000000000000000000000000000000000000000000000000000000000169161017f8584836109a0565b823b156102dd578761020b9188968851938492839289887fcd586579000000000000000000000000000000000000000000000000000000009c8d875286019263ffffffff60e0959216845273ffffffffffffffffffffffffffffffffffffffff809316602085015260408401521660608201526000608082015260c060a0820152600060c08201520190565b038183875af180156102d3579088916102bf575b5050813b156102bb57869361028a8651978895869485948552349285019173ffffffffffffffffffffffffffffffffffffffff9063ffffffff60e095931684521660208301526040820152600060608201526001608082015260c060a0820152600060c08201520190565b039134905af19081156102b2575061029f5750f35b6102a890610882565b6102af5780f35b80fd5b513d84823e3d90fd5b8680fd5b6102c890610882565b6102bb57863861021f565b86513d8a823e3d90fd5b8780fd5b6102ea90610882565b6102dd578738610143565b87513d8b823e3d90fd5b8980fd5b600080fd5b8880fd5b8480fd5b8280fd5b92905060807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043d57610349610829565b61035161084c565b61035961085f565b906064359061036a82303387610922565b73ffffffffffffffffffffffffffffffffffffffff91827f000000000000000000000000000000000000000000000000000000000000000016926103af8285886109a0565b833b156103085782899161020b8a88958b5196879586957fcd586579000000000000000000000000000000000000000000000000000000009d8e8852169386019263ffffffff60e0959216845273ffffffffffffffffffffffffffffffffffffffff809316602085015260408401521660608201526000608082015260c060a0820152600060c08201520190565b5050fd5b8483856101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031057610477610829565b61047f61084c565b9061048861085f565b906064359260a4359760ff89168099036102dd5773ffffffffffffffffffffffffffffffffffffffff98898416917f7ecebe0000000000000000000000000000000000000000000000000000000000808252338a8301526020928383602481885afa9283156107ec578c936107fa575b50843b156107f6578951907fd505accf000000000000000000000000000000000000000000000000000000008252338c8301523060248301528960448301526084356064830152608482015260c43560a482015260e43560c48201528b8160e48183895af180156107ec576107d9575b508851908152338a8201528281602481875afa9081156107cf578b916107a2575b506001820180921161077657036106f457506105d685899a6105ad82303389610922565b7f00000000000000000000000000000000000000000000000000000000000000001680956109a0565b823b156102dd57876106629188968851938492839289887fcd586579000000000000000000000000000000000000000000000000000000009c8d875286019263ffffffff60e0959216845273ffffffffffffffffffffffffffffffffffffffff809316602085015260408401521660608201526000608082015260c060a0820152600060c08201520190565b038183875af180156102d3579088916106e0575050813b156102bb57869361028a8651978895869485948552349285019173ffffffffffffffffffffffffffffffffffffffff9063ffffffff60e095931684521660208301526040820152600060608201526001608082015260c060a0820152600060c08201520190565b6106e990610882565b6102bb57868961021f565b876084918851917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602160248201527f5361666545524332303a207065726d697420646964206e6f742073756363656560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152fd5b60248b60118c7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b90508281813d83116107c8575b6107b981836108e1565b8101031261030357518c610589565b503d6107af565b89513d8d823e3d90fd5b6107e5909b919b610882565b998c610568565b8a513d8e823e3d90fd5b8b80fd5b9092508381813d8311610822575b61081281836108e1565b810103126107f65751918d6104f8565b503d610808565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361030357565b6024359063ffffffff8216820361030357565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361030357565b67ffffffffffffffff811161089657604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6080810190811067ffffffffffffffff82111761089657604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761089657604052565b9290604051927f23b872dd00000000000000000000000000000000000000000000000000000000602085015273ffffffffffffffffffffffffffffffffffffffff809216602485015216604483015260648201526064815260a081019181831067ffffffffffffffff8411176108965761099e92604052610ac4565b565b91909160405191602083016000807f095ea7b3000000000000000000000000000000000000000000000000000000009687845273ffffffffffffffffffffffffffffffffffffffff80911694856024890152604488015260448752610a04876108c5565b85169286519082855af190610a17610bf6565b82610a7a575b5081610a6f575b5015610a31575b50505050565b610a6693610a619160405191602083015260248201526000604482015260448152610a5b816108c5565b82610ac4565b610ac4565b38808080610a2b565b90503b151538610a24565b80519192508115918215610a92575b50509038610a1d565b610aa59250602080918301019101610aac565b3880610a89565b90816020910312610303575180151581036103035790565b73ffffffffffffffffffffffffffffffffffffffff16604051604081019181831067ffffffffffffffff84111761089657610b41926040526000806020958685527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656487860152868151910182855af1610b3b610bf6565b91610c54565b805190828215928315610bde575b50505015610b5a5750565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b610bee9350820181019101610aac565b388281610b4f565b3d15610c4f573d9067ffffffffffffffff82116108965760405191610c4360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601846108e1565b82523d6000602084013e565b606090565b91929015610ccf5750815115610c68575090565b3b15610c715790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b825190915015610ce25750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610d5f575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610d1e56fea26469706673582212209bebaf52035a02dea33251d3635850444814ff792f4a6f2d5eece3030157d9db64736f6c634300081400330000000000000000000000002a3dd3eb832af982ec71669e178424b10dca2ede
Deployed Bytecode
0x6080604081815260048036101561001557600080fd5b600092833560e01c908163228d8f8e1461044157508381634cccfee914610314575063be6e7f921461004657600080fd5b6101407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103105780359173ffffffffffffffffffffffffffffffffffffffff9283811680910361030c5761009c61084c565b906100a561085f565b906064359260c435968715158098036103085760e4359760ff8916809903610303578998843b156102ff578751917f8fcbaf0c000000000000000000000000000000000000000000000000000000008352338a840152306024840152608435604484015260a4356064840152608483015260a48201528881610104803560c48301526101243560e48301528183885af180156102f5579089916102e1575b505061015185303386610922565b7f0000000000000000000000002a3dd3eb832af982ec71669e178424b10dca2ede169161017f8584836109a0565b823b156102dd578761020b9188968851938492839289887fcd586579000000000000000000000000000000000000000000000000000000009c8d875286019263ffffffff60e0959216845273ffffffffffffffffffffffffffffffffffffffff809316602085015260408401521660608201526000608082015260c060a0820152600060c08201520190565b038183875af180156102d3579088916102bf575b5050813b156102bb57869361028a8651978895869485948552349285019173ffffffffffffffffffffffffffffffffffffffff9063ffffffff60e095931684521660208301526040820152600060608201526001608082015260c060a0820152600060c08201520190565b039134905af19081156102b2575061029f5750f35b6102a890610882565b6102af5780f35b80fd5b513d84823e3d90fd5b8680fd5b6102c890610882565b6102bb57863861021f565b86513d8a823e3d90fd5b8780fd5b6102ea90610882565b6102dd578738610143565b87513d8b823e3d90fd5b8980fd5b600080fd5b8880fd5b8480fd5b8280fd5b92905060807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043d57610349610829565b61035161084c565b61035961085f565b906064359061036a82303387610922565b73ffffffffffffffffffffffffffffffffffffffff91827f0000000000000000000000002a3dd3eb832af982ec71669e178424b10dca2ede16926103af8285886109a0565b833b156103085782899161020b8a88958b5196879586957fcd586579000000000000000000000000000000000000000000000000000000009d8e8852169386019263ffffffff60e0959216845273ffffffffffffffffffffffffffffffffffffffff809316602085015260408401521660608201526000608082015260c060a0820152600060c08201520190565b5050fd5b8483856101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261031057610477610829565b61047f61084c565b9061048861085f565b906064359260a4359760ff89168099036102dd5773ffffffffffffffffffffffffffffffffffffffff98898416917f7ecebe0000000000000000000000000000000000000000000000000000000000808252338a8301526020928383602481885afa9283156107ec578c936107fa575b50843b156107f6578951907fd505accf000000000000000000000000000000000000000000000000000000008252338c8301523060248301528960448301526084356064830152608482015260c43560a482015260e43560c48201528b8160e48183895af180156107ec576107d9575b508851908152338a8201528281602481875afa9081156107cf578b916107a2575b506001820180921161077657036106f457506105d685899a6105ad82303389610922565b7f0000000000000000000000002a3dd3eb832af982ec71669e178424b10dca2ede1680956109a0565b823b156102dd57876106629188968851938492839289887fcd586579000000000000000000000000000000000000000000000000000000009c8d875286019263ffffffff60e0959216845273ffffffffffffffffffffffffffffffffffffffff809316602085015260408401521660608201526000608082015260c060a0820152600060c08201520190565b038183875af180156102d3579088916106e0575050813b156102bb57869361028a8651978895869485948552349285019173ffffffffffffffffffffffffffffffffffffffff9063ffffffff60e095931684521660208301526040820152600060608201526001608082015260c060a0820152600060c08201520190565b6106e990610882565b6102bb57868961021f565b876084918851917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602160248201527f5361666545524332303a207065726d697420646964206e6f742073756363656560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152fd5b60248b60118c7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b90508281813d83116107c8575b6107b981836108e1565b8101031261030357518c610589565b503d6107af565b89513d8d823e3d90fd5b6107e5909b919b610882565b998c610568565b8a513d8e823e3d90fd5b8b80fd5b9092508381813d8311610822575b61081281836108e1565b810103126107f65751918d6104f8565b503d610808565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361030357565b6024359063ffffffff8216820361030357565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361030357565b67ffffffffffffffff811161089657604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6080810190811067ffffffffffffffff82111761089657604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761089657604052565b9290604051927f23b872dd00000000000000000000000000000000000000000000000000000000602085015273ffffffffffffffffffffffffffffffffffffffff809216602485015216604483015260648201526064815260a081019181831067ffffffffffffffff8411176108965761099e92604052610ac4565b565b91909160405191602083016000807f095ea7b3000000000000000000000000000000000000000000000000000000009687845273ffffffffffffffffffffffffffffffffffffffff80911694856024890152604488015260448752610a04876108c5565b85169286519082855af190610a17610bf6565b82610a7a575b5081610a6f575b5015610a31575b50505050565b610a6693610a619160405191602083015260248201526000604482015260448152610a5b816108c5565b82610ac4565b610ac4565b38808080610a2b565b90503b151538610a24565b80519192508115918215610a92575b50509038610a1d565b610aa59250602080918301019101610aac565b3880610a89565b90816020910312610303575180151581036103035790565b73ffffffffffffffffffffffffffffffffffffffff16604051604081019181831067ffffffffffffffff84111761089657610b41926040526000806020958685527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656487860152868151910182855af1610b3b610bf6565b91610c54565b805190828215928315610bde575b50505015610b5a5750565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b610bee9350820181019101610aac565b388281610b4f565b3d15610c4f573d9067ffffffffffffffff82116108965760405191610c4360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601846108e1565b82523d6000602084013e565b606090565b91929015610ccf5750815115610c68575090565b3b15610c715790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b825190915015610ce25750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610d5f575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610d1e56fea26469706673582212209bebaf52035a02dea33251d3635850444814ff792f4a6f2d5eece3030157d9db64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002a3dd3eb832af982ec71669e178424b10dca2ede
-----Decoded View---------------
Arg [0] : zkEVMBridge_ (address): 0x2a3DD3EB832aF982ec71669E178424b10Dca2EDe
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000002a3dd3eb832af982ec71669e178424b10dca2ede
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.