This nametag was submitted by Kleros Curate.
Overview
ETH Balance
0 ETH
Eth Value
$0.00Token Holdings
More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0xbea092f914ecf82d06b40d7816caefa67ac79b987555d52a1bf4f466598f597f | Deposit | (pending) | 2 days ago | IN | 0 ETH | (Pending) | |||
0x08d65f9bac04f1401be1d58e5439b36d6fcdbdbe38092c87c74e81db584c39d3 | Deposit | (pending) | 4 days ago | IN | 0 ETH | (Pending) | |||
0x9c39116adac9814d629a5ae79039c8c346548591d841697ca3834d6d679d987d | Deposit | (pending) | 4 days ago | IN | 0 ETH | (Pending) | |||
0x0d2e1d61c4b89a565a492f2e71d5b689a12fdfd6f22fd036419e934a63b81eb8 | Deposit ERC20 | (pending) | 4 days ago | IN | 0 ETH | (Pending) | |||
0xb5d1230b966748caebfb6ced29f22c58b64da0c89b28df84294a3f1783afd9a3 | Deposit Eth | (pending) | 4 days ago | IN | 0.024 ETH | (Pending) | |||
0x05306f0ab5b5c93e4767fa3e9a61411ef314e2aa32b410e9b9b80ac96ba88864 | Deposit Eth | (pending) | 4 days ago | IN | 0.024 ETH | (Pending) | |||
0x233ab578fe4d4b0380efd75e756055c5e7baf42eddd20fdf1347ebd32cf2ca04 | Deposit | (pending) | 4 days ago | IN | 0 ETH | (Pending) | |||
Deposit | 20583499 | 2 hrs ago | IN | 0 ETH | 0.00005895 | ||||
Deposit Eth | 20582408 | 6 hrs ago | IN | 0.15 ETH | 0.00036588 | ||||
Deposit | 20579793 | 15 hrs ago | IN | 0 ETH | 0.00006663 | ||||
Deposit | 20579484 | 16 hrs ago | IN | 0 ETH | 0.000562 | ||||
Deposit | 20579230 | 17 hrs ago | IN | 0 ETH | 0.00022152 | ||||
Deposit | 20578621 | 19 hrs ago | IN | 0 ETH | 0.00047855 | ||||
Deposit | 20578347 | 20 hrs ago | IN | 0 ETH | 0.00070314 | ||||
Deposit | 20576013 | 27 hrs ago | IN | 0 ETH | 0.00012846 | ||||
Deposit | 20573945 | 34 hrs ago | IN | 0 ETH | 0.00010765 | ||||
Deposit ERC20 | 20572500 | 39 hrs ago | IN | 0 ETH | 0.00052941 | ||||
Deposit ERC20 | 20572468 | 39 hrs ago | IN | 0 ETH | 0.00065191 | ||||
Deposit Eth | 20572109 | 40 hrs ago | IN | 0.02 ETH | 0.00054196 | ||||
Deposit | 20572030 | 41 hrs ago | IN | 0 ETH | 0.00016459 | ||||
Deposit Eth | 20571942 | 41 hrs ago | IN | 1.5 ETH | 0.00049155 | ||||
Deposit | 20571523 | 42 hrs ago | IN | 0 ETH | 0.00038204 | ||||
Deposit Eth | 20571357 | 43 hrs ago | IN | 4 ETH | 0.00066178 | ||||
Deposit | 20571120 | 44 hrs ago | IN | 0 ETH | 0.000119 | ||||
Deposit | 20570617 | 45 hrs ago | IN | 0 ETH | 0.00073908 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers. Name tag integration is not available in advanced view.
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | ||||
---|---|---|---|---|---|---|---|
20583575 | 2 hrs ago | 0 ETH | |||||
20583575 | 2 hrs ago | 0 ETH | |||||
20583575 | 2 hrs ago | 0 ETH | |||||
20583499 | 2 hrs ago | 0 ETH | |||||
20583496 | 2 hrs ago | 0 ETH | |||||
20583496 | 2 hrs ago | 0 ETH | |||||
20583496 | 2 hrs ago | 0 ETH | |||||
20582408 | 6 hrs ago | 0 ETH | |||||
20582408 | 6 hrs ago | 0 ETH | |||||
20582408 | 6 hrs ago | 0.15 ETH | |||||
20582408 | 6 hrs ago | 0 ETH | |||||
20581214 | 10 hrs ago | 0 ETH | |||||
20581214 | 10 hrs ago | 0 ETH | |||||
20581214 | 10 hrs ago | 0 ETH | |||||
20580834 | 11 hrs ago | 0 ETH | |||||
20580834 | 11 hrs ago | 0 ETH | |||||
20580834 | 11 hrs ago | 0 ETH | |||||
20579793 | 15 hrs ago | 0 ETH | |||||
20579484 | 16 hrs ago | 0 ETH | |||||
20579484 | 16 hrs ago | 0 ETH | |||||
20579484 | 16 hrs ago | 0 ETH | |||||
20579353 | 16 hrs ago | 0 ETH | |||||
20579353 | 16 hrs ago | 0 ETH | |||||
20579353 | 16 hrs ago | 0 ETH | |||||
20579353 | 16 hrs ago | 0 ETH |
Loading...
Loading
Contract Name:
CurrencyConvertor
Compiler Version
v0.8.0+commit.c7dfd78e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/* Copyright 2021 dYdX Trading Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { ERC2771Context } from "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { Context } from "@openzeppelin/contracts/utils/Context.sol"; import { I_ExchangeProxy } from "../interfaces/I_ExchangeProxy.sol"; import { I_StarkwareContract } from "../interfaces/I_StarkwareContracts.sol"; /** * @title CurrencyConvertor * @author dYdX * * @notice Contract for depositing to dYdX L2 in non-USDC tokens. */ contract CurrencyConvertor is ERC2771Context, Pausable, Ownable, ReentrancyGuard { using SafeERC20 for IERC20; // ============ State Variables ============ I_StarkwareContract public immutable STARKWARE_CONTRACT; IERC20 immutable USDC_ADDRESS; uint256 immutable USDC_ASSET_TYPE; address immutable ETH_PLACEHOLDER_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // ============ Constructor ============ constructor( I_StarkwareContract starkwareContractAddress, IERC20 usdcAddress, uint256 usdcAssetType, address trustedForwarder ) ERC2771Context(trustedForwarder) { STARKWARE_CONTRACT = starkwareContractAddress; USDC_ADDRESS = usdcAddress; USDC_ASSET_TYPE = usdcAssetType; // Set the allowance to the highest possible value. usdcAddress.safeApprove(address(starkwareContractAddress), type(uint256).max); } // ============ Events ============ event LogConvertedDeposit( address indexed sender, address tokenFrom, uint256 tokenFromAmount, uint256 usdcAmount ); // ============ External Functions ============ /** * @notice Pause this contract. */ function pause() external onlyOwner { _pause(); } /** * @notice Unpause this contract. */ function unpause() external onlyOwner { _unpause(); } /** * @notice Make a deposit to the Starkware Layer2. * * @param depositAmount The amount of USDC to deposit. * @param starkKey The starkKey of the L2 account to deposit into. * @param positionId The positionId of the L2 account to deposit into. * @param signature The signature for registering. NOTE: if length is 0, will not try to register. */ function deposit( uint256 depositAmount, uint256 starkKey, uint256 positionId, bytes calldata signature ) external nonReentrant whenNotPaused { address sender = _msgSender(); // Register address in Starkware Layer2. if (signature.length > 0) { STARKWARE_CONTRACT.registerUser(sender, starkKey, signature); } // Deposit depositAmount of USDC to the L2 exchange account of the sender. USDC_ADDRESS.safeTransferFrom( sender, address(this), depositAmount ); STARKWARE_CONTRACT.deposit( starkKey, USDC_ASSET_TYPE, positionId, depositAmount ); } /** * @notice Make a deposit to the Starkware Layer2, after converting funds to USDC. * Funds will be transferred from the sender and USDC will be deposited into the trading account * specified by the starkKey and positionId. * @dev Emits LogConvertedDeposit event. * * @param tokenFrom The ERC20 token to convert from. * @param tokenFromAmount The amount of `tokenFrom` tokens to deposit. * @param starkKey The starkKey of the L2 account to deposit into. * @param positionId The positionId of the L2 account to deposit into. * @param exchangeProxy The exchangeProxy being used to swap the `tokenFrom` for USDC. * @param exchangeProxyData Trade parameters for the exchangeProxy. * @param signature The signature for registering. NOTE: if length is 0, will not try to register. */ function depositERC20( IERC20 tokenFrom, uint256 tokenFromAmount, uint256 starkKey, uint256 positionId, I_ExchangeProxy exchangeProxy, bytes calldata exchangeProxyData, bytes calldata signature ) external nonReentrant whenNotPaused returns (uint256) { address sender = _msgSender(); // Register address in Starkware Layer2. if (signature.length > 0) { STARKWARE_CONTRACT.registerUser(sender, starkKey, signature); } // Send `tokenFrom` to this contract. tokenFrom.safeTransferFrom( sender, address(exchangeProxy), tokenFromAmount ); // Swap token. exchangeProxy.proxyExchange(exchangeProxyData); // Deposit full balance of USDC in CurrencyConvertor to the L2 exchange account of the sender. uint256 usdcBalance = USDC_ADDRESS.balanceOf(address(this)); STARKWARE_CONTRACT.deposit( starkKey, USDC_ASSET_TYPE, positionId, usdcBalance ); // Log the result. emit LogConvertedDeposit( sender, address(tokenFrom), tokenFromAmount, usdcBalance ); return usdcBalance; } /** * @notice Make a deposit to the Starkware Layer2, after converting funds to USDC. * Ether will be transferred from the sender and USDC will be deposited into the trading account * specified by the starkKey and positionId. * @dev Emits LogConvertedDeposit event. * * @param starkKey The starkKey of the L2 account to deposit into. * @param positionId The positionId of the L2 account to deposit into. * @param exchangeProxy The exchangeProxy being used to swap the `tokenFrom` for USDC. * @param exchangeProxyData Trade parameters for the exchangeProxy. * @param signature The signature for registering. NOTE: if length is 0, will not try to register. */ function depositEth( uint256 starkKey, uint256 positionId, I_ExchangeProxy exchangeProxy, bytes calldata exchangeProxyData, bytes calldata signature ) external payable nonReentrant whenNotPaused returns (uint256) { address sender = _msgSender(); // Register address in Starkware Layer2. if (signature.length > 0) { STARKWARE_CONTRACT.registerUser(sender, starkKey, signature); } // Swap token. exchangeProxy.proxyExchange{ value: msg.value }(exchangeProxyData); // Deposit full balance of USDC in CurrencyConvertor to the L2 exchange account of the sender. uint256 usdcBalance = USDC_ADDRESS.balanceOf(address(this)); STARKWARE_CONTRACT.deposit( starkKey, USDC_ASSET_TYPE, positionId, usdcBalance ); // Log the result. emit LogConvertedDeposit( sender, ETH_PLACEHOLDER_ADDRESS, msg.value, usdcBalance ); return usdcBalance; } // ============ Internal Functions ============ function _msgSender() internal view virtual override(Context, ERC2771Context) returns (address sender) { return ERC2771Context._msgSender(); } function _msgData() internal view virtual override(Context, ERC2771Context) returns (bytes calldata) { return ERC2771Context._msgData(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/Ownable.sol) pragma solidity ^0.8.0; import "../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. * * By default, the owner account will be the one that deploys the contract. 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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing 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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); _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 v4.4.0 (metatx/ERC2771Context.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract ERC2771Context is Context { address private _trustedForwarder; constructor(address trustedForwarder) { _trustedForwarder = trustedForwarder; } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return forwarder == _trustedForwarder; } function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return super._msgSender(); } } function _msgData() internal view virtual override returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 20]; } else { return super._msgData(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (security/Pausable.sol) pragma solidity ^0.8.0; import "../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 { /** * @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); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @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 v4.4.0 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @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 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; 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() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount ) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.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; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } 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)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } 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"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @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"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Context.sol) pragma solidity ^0.8.0; /** * @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; } }
/* Copyright 2021 dYdX Trading Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /** * @title I_ExchangeProxy * @author dYdX * * Interface for interacting with exchanges. */ interface I_ExchangeProxy { // ============ State-Changing Functions ============ /** * @notice Make a call to an exchange via proxy. * * @param proxyExchangeData Bytes data for the trade, specific to the exchange proxy implementation. */ function proxyExchange( bytes calldata proxyExchangeData ) external payable; }
/* Copyright 2021 dYdX Trading Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /** * @title I_StarkwareContract * @author dYdX * * Interface for starkex-contracts. */ interface I_StarkwareContract { // ============ State-Changing Functions ============ /** * @notice Make a deposit to the Starkware Layer2. * * @param starkKey The starkKey of the L2 account to deposit into. * @param assetType The assetType to deposit in. * @param vaultId The L2 id to deposit into. * @param quantizedAmount The quantized amount being deposited. */ function deposit( uint256 starkKey, uint256 assetType, uint256 vaultId, uint256 quantizedAmount ) external; /** * @notice Register to the Starkware Layer2. * * @param ethKey The ethKey of the L2 account to deposit into. * @param starkKey The starkKey of the L2 account to deposit into. * @param signature The signature for registering. */ function registerUser( address ethKey, uint256 starkKey, bytes calldata signature ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Address.sol) pragma solidity ^0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(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) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract I_StarkwareContract","name":"starkwareContractAddress","type":"address"},{"internalType":"contract IERC20","name":"usdcAddress","type":"address"},{"internalType":"uint256","name":"usdcAssetType","type":"uint256"},{"internalType":"address","name":"trustedForwarder","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"tokenFrom","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenFromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"usdcAmount","type":"uint256"}],"name":"LogConvertedDeposit","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"},{"inputs":[],"name":"STARKWARE_CONTRACT","outputs":[{"internalType":"contract I_StarkwareContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"positionId","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"tokenFrom","type":"address"},{"internalType":"uint256","name":"tokenFromAmount","type":"uint256"},{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"positionId","type":"uint256"},{"internalType":"contract I_ExchangeProxy","name":"exchangeProxy","type":"address"},{"internalType":"bytes","name":"exchangeProxyData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"depositERC20","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"positionId","type":"uint256"},{"internalType":"contract I_ExchangeProxy","name":"exchangeProxy","type":"address"},{"internalType":"bytes","name":"exchangeProxyData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"depositEth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":[],"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"}]
Contract Creation Code
6101006040527feeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000060e0523480156200003657600080fd5b5060405162001d7a38038062001d7a8339810160408190526200005991620004ad565b600080546001600160a01b0319166001600160a01b0383161760ff60a01b191690556200008f62000089620000e3565b62000100565b6001600255606084811b6001600160601b03199081166080529084901b1660a05260c0829052620000d96001600160a01b0384168560001962000152602090811b62000b5217901c565b5050505062000717565b6000620000fa6200026960201b62000c511760201c565b90505b90565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b801580620001e15750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e906200018b90309086906004016200053f565b60206040518083038186803b158015620001a457600080fd5b505afa158015620001b9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001df919062000508565b155b620002095760405162461bcd60e51b815260040162000200906200066e565b60405180910390fd5b620002648363095ea7b360e01b84846040516024016200022b92919062000559565b60408051808303601f190181529190526020810180516001600160e01b0319939093166001600160e01b0393841617905290620002a916565b505050565b6000620002763362000345565b156200028c575060131936013560601c620000fd565b620002a16200035960201b62000c7f1760201c565b9050620000fd565b600062000305826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166200035d60201b62000c83179092919060201c565b8051909150156200026457808060200190518101906200032691906200048b565b620002645760405162461bcd60e51b8152600401620002009062000624565b6000546001600160a01b0390811691161490565b3390565b60606200036e848460008562000378565b90505b9392505050565b6060824710156200039d5760405162461bcd60e51b81526004016200020090620005a7565b620003a88562000447565b620003c75760405162461bcd60e51b81526004016200020090620005ed565b600080866001600160a01b03168587604051620003e5919062000521565b60006040518083038185875af1925050503d806000811462000424576040519150601f19603f3d011682016040523d82523d6000602084013e62000429565b606091505b5090925090506200043c8282866200044d565b979650505050505050565b3b151590565b606083156200045e57508162000371565b8251156200046f5782518084602001fd5b8160405162461bcd60e51b815260040162000200919062000572565b6000602082840312156200049d578081fd5b8151801515811462000371578182fd5b60008060008060808587031215620004c3578283fd5b8451620004d081620006fe565b6020860151909450620004e381620006fe565b604086015160608701519194509250620004fd81620006fe565b939692955090935050565b6000602082840312156200051a578081fd5b5051919050565b6000825162000535818460208701620006cb565b9190910192915050565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b600060208252825180602084015262000593816040850160208701620006cb565b601f01601f19169190910160400192915050565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000606082015260800190565b60005b83811015620006e8578181015183820152602001620006ce565b83811115620006f8576000848401525b50505050565b6001600160a01b03811681146200071457600080fd5b50565b60805160601c60a05160601c60c05160e05160601c6115da620007a06000396000610a9701526000818161034a015281816107270152610a0c0152600081816102dc01528181610658015261093c0152600081816102610152818161031b015281816104250152818161055c015281816106f80152818161085401526109dd01526115da6000f3fe60806040526004361061009c5760003560e01c8063715018a611610064578063715018a6146101455780638456cb591461015a5780638da5cb5b1461016f5780639f2c365a14610184578063e1e1a91a146101b1578063f2fde38b146101c45761009c565b806327cc37b0146100a15780633f4ba83a146100c3578063572b6c05146100d85780635c975abb1461010e5780636d98ebe314610123575b600080fd5b3480156100ad57600080fd5b506100c16100bc366004611163565b6101e4565b005b3480156100cf57600080fd5b506100c16103b5565b3480156100e457600080fd5b506100f86100f3366004610fcb565b6103fe565b60405161010591906112c6565b60405180910390f35b34801561011a57600080fd5b506100f8610412565b34801561012f57600080fd5b50610138610423565b6040516101059190611208565b34801561015157600080fd5b506100c1610447565b34801561016657600080fd5b506100c1610490565b34801561017b57600080fd5b506101386104d7565b34801561019057600080fd5b506101a461019f366004611007565b6104e6565b604051610105919061153f565b6101a46101bf3660046110d0565b6107de565b3480156101d057600080fd5b506100c16101df366004610fcb565b610ae1565b60028054141561020f5760405162461bcd60e51b8152600401610206906114b2565b60405180910390fd5b6002805561021b610412565b156102385760405162461bcd60e51b8152600401610206906113d2565b6000610242610c9c565b905081156102cf57604051633749053560e21b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063dd2414d49061029c908490899088908890600401611273565b600060405180830381600087803b1580156102b657600080fd5b505af11580156102ca573d6000803e3d6000fd5b505050505b6103046001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016823089610cab565b604051632505c3d960e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632505c3d9906103769088907f00000000000000000000000000000000000000000000000000000000000000009089908c90600401611548565b600060405180830381600087803b15801561039057600080fd5b505af11580156103a4573d6000803e3d6000fd5b505060016002555050505050505050565b6103bd610c9c565b6001600160a01b03166103ce6104d7565b6001600160a01b0316146103f45760405162461bcd60e51b8152600401610206906113fc565b6103fc610cd2565b565b6000546001600160a01b0390811691161490565b600054600160a01b900460ff165b90565b7f000000000000000000000000000000000000000000000000000000000000000081565b61044f610c9c565b6001600160a01b03166104606104d7565b6001600160a01b0316146104865760405162461bcd60e51b8152600401610206906113fc565b6103fc6000610d43565b610498610c9c565b6001600160a01b03166104a96104d7565b6001600160a01b0316146104cf5760405162461bcd60e51b8152600401610206906113fc565b6103fc610d95565b6001546001600160a01b031690565b600060028054141561050a5760405162461bcd60e51b8152600401610206906114b2565b60028055610516610412565b156105335760405162461bcd60e51b8152600401610206906113d2565b600061053d610c9c565b905082156105ca57604051633749053560e21b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063dd2414d4906105979084908d9089908990600401611273565b600060405180830381600087803b1580156105b157600080fd5b505af11580156105c5573d6000803e3d6000fd5b505050505b6105df6001600160a01b038c1682898d610cab565b604051633d6a60db60e21b81526001600160a01b0388169063f5a9836c9061060d90899089906004016112d1565b600060405180830381600087803b15801561062757600080fd5b505af115801561063b573d6000803e3d6000fd5b50506040516370a0823160e01b8152600092506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691506370a082319061068e903090600401611208565b60206040518083038186803b1580156106a657600080fd5b505afa1580156106ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106de91906110b8565b604051632505c3d960e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632505c3d990610753908d907f0000000000000000000000000000000000000000000000000000000000000000908e908790600401611548565b600060405180830381600087803b15801561076d57600080fd5b505af1158015610781573d6000803e3d6000fd5b50505050816001600160a01b03167f3e0a29a2dbb5fca584b437ca620962b0f4899e3cfc0ac2cd4fd4e8e5e874faf58d8d846040516107c2939291906112a5565b60405180910390a260016002559b9a5050505050505050505050565b60006002805414156108025760405162461bcd60e51b8152600401610206906114b2565b6002805561080e610412565b1561082b5760405162461bcd60e51b8152600401610206906113d2565b6000610835610c9c565b905082156108c257604051633749053560e21b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063dd2414d49061088f9084908d9089908990600401611273565b600060405180830381600087803b1580156108a957600080fd5b505af11580156108bd573d6000803e3d6000fd5b505050505b604051633d6a60db60e21b81526001600160a01b0388169063f5a9836c9034906108f2908a908a906004016112d1565b6000604051808303818588803b15801561090b57600080fd5b505af115801561091f573d6000803e3d6000fd5b50506040516370a0823160e01b8152600093506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692506370a082319150610973903090600401611208565b60206040518083038186803b15801561098b57600080fd5b505afa15801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c391906110b8565b604051632505c3d960e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632505c3d990610a38908d907f0000000000000000000000000000000000000000000000000000000000000000908e908790600401611548565b600060405180830381600087803b158015610a5257600080fd5b505af1158015610a66573d6000803e3d6000fd5b50505050816001600160a01b03167f3e0a29a2dbb5fca584b437ca620962b0f4899e3cfc0ac2cd4fd4e8e5e874faf57f00000000000000000000000000000000000000000000000000000000000000003484604051610ac7939291906112a5565b60405180910390a260016002559998505050505050505050565b610ae9610c9c565b6001600160a01b0316610afa6104d7565b6001600160a01b031614610b205760405162461bcd60e51b8152600401610206906113fc565b6001600160a01b038116610b465760405162461bcd60e51b815260040161020690611346565b610b4f81610d43565b50565b801580610bda5750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e90610b88903090869060040161121c565b60206040518083038186803b158015610ba057600080fd5b505afa158015610bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd891906110b8565b155b610bf65760405162461bcd60e51b8152600401610206906114e9565b610c4c8363095ea7b360e01b8484604051602401610c1592919061125a565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610df6565b505050565b6000610c5c336103fe565b15610c70575060131936013560601c610420565b610c78610c7f565b9050610420565b3390565b6060610c928484600085610e85565b90505b9392505050565b6000610ca6610c51565b905090565b610ccc846323b872dd60e01b858585604051602401610c1593929190611236565b50505050565b610cda610412565b610cf65760405162461bcd60e51b815260040161020690611318565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610d2c610c9c565b604051610d399190611208565b60405180910390a1565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610d9d610412565b15610dba5760405162461bcd60e51b8152600401610206906113d2565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610d2c610c9c565b6000610e4b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c839092919063ffffffff16565b805190915015610c4c5780806020019051810190610e699190610fe7565b610c4c5760405162461bcd60e51b815260040161020690611468565b606082471015610ea75760405162461bcd60e51b81526004016102069061138c565b610eb085610f45565b610ecc5760405162461bcd60e51b815260040161020690611431565b600080866001600160a01b03168587604051610ee891906111ec565b60006040518083038185875af1925050503d8060008114610f25576040519150601f19603f3d011682016040523d82523d6000602084013e610f2a565b606091505b5091509150610f3a828286610f4b565b979650505050505050565b3b151590565b60608315610f5a575081610c95565b825115610f6a5782518084602001fd5b8160405162461bcd60e51b815260040161020691906112e5565b60008083601f840112610f95578182fd5b50813567ffffffffffffffff811115610fac578182fd5b602083019150836020828501011115610fc457600080fd5b9250929050565b600060208284031215610fdc578081fd5b8135610c958161158f565b600060208284031215610ff8578081fd5b81518015158114610c95578182fd5b600080600080600080600080600060e08a8c031215611024578485fd5b893561102f8161158f565b985060208a0135975060408a0135965060608a0135955060808a01356110548161158f565b945060a08a013567ffffffffffffffff80821115611070578586fd5b61107c8d838e01610f84565b909650945060c08c0135915080821115611094578384fd5b506110a18c828d01610f84565b915080935050809150509295985092959850929598565b6000602082840312156110c9578081fd5b5051919050565b600080600080600080600060a0888a0312156110ea578283fd5b873596506020880135955060408801356111038161158f565b9450606088013567ffffffffffffffff8082111561111f578485fd5b61112b8b838c01610f84565b909650945060808a0135915080821115611143578384fd5b506111508a828b01610f84565b989b979a50959850939692959293505050565b60008060008060006080868803121561117a578081fd5b853594506020860135935060408601359250606086013567ffffffffffffffff8111156111a5578182fd5b6111b188828901610f84565b969995985093965092949392505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b600082516111fe818460208701611563565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b03861682528460208301526060604083015261129b6060830184866111c2565b9695505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b901515815260200190565b600060208252610c926020830184866111c2565b6000602082528251806020840152611304816040850160208701611563565b601f01601f19169190910160400192915050565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606082015260800190565b90815260200190565b93845260208401929092526040830152606082015260800190565b60005b8381101561157e578181015183820152602001611566565b83811115610ccc5750506000910152565b6001600160a01b0381168114610b4f57600080fdfea2646970667358221220e86e1f6873d8977e1ca36c07742cec3b1eea878cf8e1890834e21cbce361398164736f6c63430008000033000000000000000000000000d54f502e184b6b739d7d27a6410a67dc462d69c8000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4802893294412a4c8f915f75892b395ebbf6859ec246ec365c3b1f56f47c3a0a5d00000000000000000000000084a0856b038eaad1cc7e297cf34a7e72685a8693
Deployed Bytecode
0x60806040526004361061009c5760003560e01c8063715018a611610064578063715018a6146101455780638456cb591461015a5780638da5cb5b1461016f5780639f2c365a14610184578063e1e1a91a146101b1578063f2fde38b146101c45761009c565b806327cc37b0146100a15780633f4ba83a146100c3578063572b6c05146100d85780635c975abb1461010e5780636d98ebe314610123575b600080fd5b3480156100ad57600080fd5b506100c16100bc366004611163565b6101e4565b005b3480156100cf57600080fd5b506100c16103b5565b3480156100e457600080fd5b506100f86100f3366004610fcb565b6103fe565b60405161010591906112c6565b60405180910390f35b34801561011a57600080fd5b506100f8610412565b34801561012f57600080fd5b50610138610423565b6040516101059190611208565b34801561015157600080fd5b506100c1610447565b34801561016657600080fd5b506100c1610490565b34801561017b57600080fd5b506101386104d7565b34801561019057600080fd5b506101a461019f366004611007565b6104e6565b604051610105919061153f565b6101a46101bf3660046110d0565b6107de565b3480156101d057600080fd5b506100c16101df366004610fcb565b610ae1565b60028054141561020f5760405162461bcd60e51b8152600401610206906114b2565b60405180910390fd5b6002805561021b610412565b156102385760405162461bcd60e51b8152600401610206906113d2565b6000610242610c9c565b905081156102cf57604051633749053560e21b81526001600160a01b037f000000000000000000000000d54f502e184b6b739d7d27a6410a67dc462d69c8169063dd2414d49061029c908490899088908890600401611273565b600060405180830381600087803b1580156102b657600080fd5b505af11580156102ca573d6000803e3d6000fd5b505050505b6103046001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4816823089610cab565b604051632505c3d960e01b81526001600160a01b037f000000000000000000000000d54f502e184b6b739d7d27a6410a67dc462d69c81690632505c3d9906103769088907f02893294412a4c8f915f75892b395ebbf6859ec246ec365c3b1f56f47c3a0a5d9089908c90600401611548565b600060405180830381600087803b15801561039057600080fd5b505af11580156103a4573d6000803e3d6000fd5b505060016002555050505050505050565b6103bd610c9c565b6001600160a01b03166103ce6104d7565b6001600160a01b0316146103f45760405162461bcd60e51b8152600401610206906113fc565b6103fc610cd2565b565b6000546001600160a01b0390811691161490565b600054600160a01b900460ff165b90565b7f000000000000000000000000d54f502e184b6b739d7d27a6410a67dc462d69c881565b61044f610c9c565b6001600160a01b03166104606104d7565b6001600160a01b0316146104865760405162461bcd60e51b8152600401610206906113fc565b6103fc6000610d43565b610498610c9c565b6001600160a01b03166104a96104d7565b6001600160a01b0316146104cf5760405162461bcd60e51b8152600401610206906113fc565b6103fc610d95565b6001546001600160a01b031690565b600060028054141561050a5760405162461bcd60e51b8152600401610206906114b2565b60028055610516610412565b156105335760405162461bcd60e51b8152600401610206906113d2565b600061053d610c9c565b905082156105ca57604051633749053560e21b81526001600160a01b037f000000000000000000000000d54f502e184b6b739d7d27a6410a67dc462d69c8169063dd2414d4906105979084908d9089908990600401611273565b600060405180830381600087803b1580156105b157600080fd5b505af11580156105c5573d6000803e3d6000fd5b505050505b6105df6001600160a01b038c1682898d610cab565b604051633d6a60db60e21b81526001600160a01b0388169063f5a9836c9061060d90899089906004016112d1565b600060405180830381600087803b15801561062757600080fd5b505af115801561063b573d6000803e3d6000fd5b50506040516370a0823160e01b8152600092506001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb481691506370a082319061068e903090600401611208565b60206040518083038186803b1580156106a657600080fd5b505afa1580156106ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106de91906110b8565b604051632505c3d960e01b81529091506001600160a01b037f000000000000000000000000d54f502e184b6b739d7d27a6410a67dc462d69c81690632505c3d990610753908d907f02893294412a4c8f915f75892b395ebbf6859ec246ec365c3b1f56f47c3a0a5d908e908790600401611548565b600060405180830381600087803b15801561076d57600080fd5b505af1158015610781573d6000803e3d6000fd5b50505050816001600160a01b03167f3e0a29a2dbb5fca584b437ca620962b0f4899e3cfc0ac2cd4fd4e8e5e874faf58d8d846040516107c2939291906112a5565b60405180910390a260016002559b9a5050505050505050505050565b60006002805414156108025760405162461bcd60e51b8152600401610206906114b2565b6002805561080e610412565b1561082b5760405162461bcd60e51b8152600401610206906113d2565b6000610835610c9c565b905082156108c257604051633749053560e21b81526001600160a01b037f000000000000000000000000d54f502e184b6b739d7d27a6410a67dc462d69c8169063dd2414d49061088f9084908d9089908990600401611273565b600060405180830381600087803b1580156108a957600080fd5b505af11580156108bd573d6000803e3d6000fd5b505050505b604051633d6a60db60e21b81526001600160a01b0388169063f5a9836c9034906108f2908a908a906004016112d1565b6000604051808303818588803b15801561090b57600080fd5b505af115801561091f573d6000803e3d6000fd5b50506040516370a0823160e01b8152600093506001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb481692506370a082319150610973903090600401611208565b60206040518083038186803b15801561098b57600080fd5b505afa15801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c391906110b8565b604051632505c3d960e01b81529091506001600160a01b037f000000000000000000000000d54f502e184b6b739d7d27a6410a67dc462d69c81690632505c3d990610a38908d907f02893294412a4c8f915f75892b395ebbf6859ec246ec365c3b1f56f47c3a0a5d908e908790600401611548565b600060405180830381600087803b158015610a5257600080fd5b505af1158015610a66573d6000803e3d6000fd5b50505050816001600160a01b03167f3e0a29a2dbb5fca584b437ca620962b0f4899e3cfc0ac2cd4fd4e8e5e874faf57f000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee3484604051610ac7939291906112a5565b60405180910390a260016002559998505050505050505050565b610ae9610c9c565b6001600160a01b0316610afa6104d7565b6001600160a01b031614610b205760405162461bcd60e51b8152600401610206906113fc565b6001600160a01b038116610b465760405162461bcd60e51b815260040161020690611346565b610b4f81610d43565b50565b801580610bda5750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e90610b88903090869060040161121c565b60206040518083038186803b158015610ba057600080fd5b505afa158015610bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd891906110b8565b155b610bf65760405162461bcd60e51b8152600401610206906114e9565b610c4c8363095ea7b360e01b8484604051602401610c1592919061125a565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610df6565b505050565b6000610c5c336103fe565b15610c70575060131936013560601c610420565b610c78610c7f565b9050610420565b3390565b6060610c928484600085610e85565b90505b9392505050565b6000610ca6610c51565b905090565b610ccc846323b872dd60e01b858585604051602401610c1593929190611236565b50505050565b610cda610412565b610cf65760405162461bcd60e51b815260040161020690611318565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610d2c610c9c565b604051610d399190611208565b60405180910390a1565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610d9d610412565b15610dba5760405162461bcd60e51b8152600401610206906113d2565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610d2c610c9c565b6000610e4b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c839092919063ffffffff16565b805190915015610c4c5780806020019051810190610e699190610fe7565b610c4c5760405162461bcd60e51b815260040161020690611468565b606082471015610ea75760405162461bcd60e51b81526004016102069061138c565b610eb085610f45565b610ecc5760405162461bcd60e51b815260040161020690611431565b600080866001600160a01b03168587604051610ee891906111ec565b60006040518083038185875af1925050503d8060008114610f25576040519150601f19603f3d011682016040523d82523d6000602084013e610f2a565b606091505b5091509150610f3a828286610f4b565b979650505050505050565b3b151590565b60608315610f5a575081610c95565b825115610f6a5782518084602001fd5b8160405162461bcd60e51b815260040161020691906112e5565b60008083601f840112610f95578182fd5b50813567ffffffffffffffff811115610fac578182fd5b602083019150836020828501011115610fc457600080fd5b9250929050565b600060208284031215610fdc578081fd5b8135610c958161158f565b600060208284031215610ff8578081fd5b81518015158114610c95578182fd5b600080600080600080600080600060e08a8c031215611024578485fd5b893561102f8161158f565b985060208a0135975060408a0135965060608a0135955060808a01356110548161158f565b945060a08a013567ffffffffffffffff80821115611070578586fd5b61107c8d838e01610f84565b909650945060c08c0135915080821115611094578384fd5b506110a18c828d01610f84565b915080935050809150509295985092959850929598565b6000602082840312156110c9578081fd5b5051919050565b600080600080600080600060a0888a0312156110ea578283fd5b873596506020880135955060408801356111038161158f565b9450606088013567ffffffffffffffff8082111561111f578485fd5b61112b8b838c01610f84565b909650945060808a0135915080821115611143578384fd5b506111508a828b01610f84565b989b979a50959850939692959293505050565b60008060008060006080868803121561117a578081fd5b853594506020860135935060408601359250606086013567ffffffffffffffff8111156111a5578182fd5b6111b188828901610f84565b969995985093965092949392505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b600082516111fe818460208701611563565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b03861682528460208301526060604083015261129b6060830184866111c2565b9695505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b901515815260200190565b600060208252610c926020830184866111c2565b6000602082528251806020840152611304816040850160208701611563565b601f01601f19169190910160400192915050565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606082015260800190565b90815260200190565b93845260208401929092526040830152606082015260800190565b60005b8381101561157e578181015183820152602001611566565b83811115610ccc5750506000910152565b6001600160a01b0381168114610b4f57600080fdfea2646970667358221220e86e1f6873d8977e1ca36c07742cec3b1eea878cf8e1890834e21cbce361398164736f6c63430008000033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d54f502e184b6b739d7d27a6410a67dc462d69c8000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4802893294412a4c8f915f75892b395ebbf6859ec246ec365c3b1f56f47c3a0a5d00000000000000000000000084a0856b038eaad1cc7e297cf34a7e72685a8693
-----Decoded View---------------
Arg [0] : starkwareContractAddress (address): 0xD54f502e184B6B739d7D27a6410a67dc462D69c8
Arg [1] : usdcAddress (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [2] : usdcAssetType (uint256): 1147032829293317481173155891309375254605214077236177772270270553197624560221
Arg [3] : trustedForwarder (address): 0x84a0856b038eaAd1cC7E297cF34A7e72685A8693
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000d54f502e184b6b739d7d27a6410a67dc462d69c8
Arg [1] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [2] : 02893294412a4c8f915f75892b395ebbf6859ec246ec365c3b1f56f47c3a0a5d
Arg [3] : 00000000000000000000000084a0856b038eaad1cc7e297cf34a7e72685a8693
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
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.