20M+ users trust MoonPay worldwide. Checkout with your preferred payment method.
Ready to onboard to Ethereum? With MetaMask Portfolio, you're in control.
Don’t invest unless you’re prepared to lose all the money you invest.
Everyday giveaways up to 100 ETH, Lucky Spins. Deposit BONUS 300% and Cashbacks!
5000+ Slots & Live Casino Games, 50+cryptos. Register with Etherscan and get 760% deposit bonus. Win Big$, withdraw it fast.
Slots, Roulette, Poker & more - Proud sponsors of UFC, Everton & StakeF1 team!
5000+ Slots & Live Casino Games, 50+cryptos. Register with Etherscan and get 760% deposit bonus. Win Big$, withdraw it fast.
Anonymous play on awesome games - sign up now for 25 free jackpot spins - worth $100s!
100s of games, generous bonuses, 20+ years of trusted gaming. Join CryptoWins & start winning today!
Overview
ETH Balance
Eth Value
$0.00Token Holdings
Could not find any matches!
- ERC-20 Tokens (4)0 stETHstETH (stETH)$0.00@3,340.19312.47024686 JUPJupiter$0.67@0.002140,307,842,415.8637 TotoroTotoro Inu (Totoro)1 TokenERC-20 TOKEN*[Suspicious]NFT Tokens (14)t.me/shibarmy_botShiba Inu Token AirdropERC-1155claim rewards on stakedeth.orgstakedeth.orgERC-1155ether-origin.comWithdrawal NFT ether-origin.comERC-1155Let's Go!🎁ERC-1155Let's Go!🎁ERC-1155ERC-1155 TOKEN*[Suspicious]
More Info
Private Name Tags
ContractCreator
Multichain Info
2 addresses found via- Transactions
- Internal Transactions
- Token Transfers (ERC-20)
- NFT Transfers
- Contract
- Events
- Analytics
- Multichain Portfolio
- Cards New
Advanced Filter- Filter by Tx Type:
- Tx
- Internal Tx
- ERC-20
- NFTs
Latest 25 from a total of 84,667 transactions
Transaction Hash MethodBlockFromToProxied Swap To 21249008 2024-11-23 7:41:11 3 mins ago 1732347671 IN 0.02082735 ETH$69.61 0.0005306 10.49050983 Proxied Swap To 21248986 2024-11-23 7:36:35 8 mins ago 1732347395 IN 0.13710024 ETH$458.20 0.00054699 10.83669073 Proxied Swap To 21248937 2024-11-23 7:26:47 18 mins ago 1732346807 IN 0.13749471 ETH$459.52 0.00050242 9.95382481 Proxied Swap To 21248906 2024-11-23 7:20:35 24 mins ago 1732346435 IN 0.2583637 ETH$863.47 0.00054727 9.42796184 Proxied Swap To 21248867 2024-11-23 7:12:35 32 mins ago 1732345955 IN 0.02030869 ETH$67.87 0.00053499 10.511548 Proxied Swap To 21248841 2024-11-23 7:07:23 37 mins ago 1732345643 IN 0.04989606 ETH$166.76 0.00046687 9.16886681 Proxied Swap To 21248811 2024-11-23 7:01:23 43 mins ago 1732345283 IN 0.13589194 ETH$454.16 0.00052411 9.85184917 Proxied Swap To 21248802 2024-11-23 6:59:35 45 mins ago 1732345175 IN 0.03328528 ETH$111.24 0.0005159 9.62403812 Proxied Swap To 21248793 2024-11-23 6:57:47 47 mins ago 1732345067 IN 0.03261074 ETH$108.99 0.00053632 10.00485335 Proxied Swap To 21248789 2024-11-23 6:56:59 47 mins ago 1732345019 IN 0.0060934 ETH$20.36 0.00058059 10.83559819 Proxied Swap To 21248783 2024-11-23 6:55:47 49 mins ago 1732344947 IN 0.0131638 ETH$43.99 0.00054165 10.73866399 Proxied Swap To 21248779 2024-11-23 6:54:59 49 mins ago 1732344899 IN 0.13586527 ETH$454.07 0.00061952 11.64528357 Proxied Swap To 21248770 2024-11-23 6:53:11 51 mins ago 1732344791 IN 0.02169689 ETH$72.51 0.00049938 9.90521892 Proxied Swap To 21248742 2024-11-23 6:47:35 57 mins ago 1732344455 IN 0.00711593 ETH$23.78 0.00049481 9.80992267 Proxied Swap To 21248709 2024-11-23 6:40:59 1 hr ago 1732344059 IN 0.01311213 ETH$43.82 0.00051157 10.14218035 Proxied Swap To 21248650 2024-11-23 6:29:11 1 hr ago 1732343351 IN 0.00659601 ETH$22.04 0.00050375 9.98716378 Proxied Swap To 21248566 2024-11-23 6:12:23 1 hr ago 1732342343 IN 0.16674492 ETH$557.27 0.0005441 10.03286667 Proxied Swap To 21248542 2024-11-23 6:07:35 1 hr ago 1732342055 IN 0.02052263 ETH$68.59 0.00053561 9.88294363 Proxied Swap To 21248512 2024-11-23 6:01:35 1 hr ago 1732341695 IN 0.13857973 ETH$463.14 0.00056051 10.3377169 Proxied Swap To 21248474 2024-11-23 5:53:59 1 hr ago 1732341239 IN 0.13986373 ETH$467.43 0.00050737 10.02159296 Proxied Swap To 21248393 2024-11-23 5:37:47 2 hrs ago 1732340267 IN 2.89939421 ETH$9,689.98 0.00059917 10.00186905 Proxied Swap To 21248265 2024-11-23 5:11:47 2 hrs ago 1732338707 IN 0.00738717 ETH$24.69 0.00047738 9.46667369 Proxied Swap To 21248257 2024-11-23 5:10:11 2 hrs ago 1732338611 IN 0.00665359 ETH$22.24 0.00048403 9.5985816 Proxied Swap To 21248229 2024-11-23 5:04:35 2 hrs ago 1732338275 IN 0.1372231 ETH$458.61 0.00051631 10.19584041 Proxied Swap To 21248167 2024-11-23 4:52:11 2 hrs ago 1732337531 IN 0.00686332 ETH$22.94 0.0005234 9.766155 Latest 25 internal transactions (View All)
Advanced mode:Parent Transaction Hash Block From To 21249008 2024-11-23 7:41:11 3 mins ago 1732347671 0.02082735 ETH$69.61 21248986 2024-11-23 7:36:35 8 mins ago 1732347395 0.13710024 ETH$458.20 21248937 2024-11-23 7:26:47 18 mins ago 1732346807 0.13749471 ETH$459.52 21248906 2024-11-23 7:20:35 24 mins ago 1732346435 0.2583637 ETH$863.47 21248867 2024-11-23 7:12:35 32 mins ago 1732345955 0.02030869 ETH$67.87 21248841 2024-11-23 7:07:23 37 mins ago 1732345643 0.04989606 ETH$166.76 21248811 2024-11-23 7:01:23 43 mins ago 1732345283 0.13589194 ETH$454.16 21248802 2024-11-23 6:59:35 45 mins ago 1732345175 0.03328528 ETH$111.24 21248793 2024-11-23 6:57:47 47 mins ago 1732345067 0.03261074 ETH$108.99 21248789 2024-11-23 6:56:59 47 mins ago 1732345019 0.0060934 ETH$20.36 21248783 2024-11-23 6:55:47 49 mins ago 1732344947 0.0131638 ETH$43.99 21248779 2024-11-23 6:54:59 49 mins ago 1732344899 0.13586527 ETH$454.07 21248770 2024-11-23 6:53:11 51 mins ago 1732344791 0.02169689 ETH$72.51 21248742 2024-11-23 6:47:35 57 mins ago 1732344455 0.00711593 ETH$23.78 21248709 2024-11-23 6:40:59 1 hr ago 1732344059 0.01311213 ETH$43.82 21248650 2024-11-23 6:29:11 1 hr ago 1732343351 0.00659601 ETH$22.04 21248566 2024-11-23 6:12:23 1 hr ago 1732342343 0.16674492 ETH$557.27 21248542 2024-11-23 6:07:35 1 hr ago 1732342055 0.02052263 ETH$68.59 21248512 2024-11-23 6:01:35 1 hr ago 1732341695 0.13857973 ETH$463.14 21248474 2024-11-23 5:53:59 1 hr ago 1732341239 0.13986373 ETH$467.43 21248393 2024-11-23 5:37:47 2 hrs ago 1732340267 2.89939421 ETH$9,689.98 21248265 2024-11-23 5:11:47 2 hrs ago 1732338707 0.00738717 ETH$24.69 21248257 2024-11-23 5:10:11 2 hrs ago 1732338611 0.00665359 ETH$22.24 21248229 2024-11-23 5:04:35 2 hrs ago 1732338275 0.1372231 ETH$458.61 21248167 2024-11-23 4:52:11 2 hrs ago 1732337531 0.00686332 ETH$22.94 Loading...LoadingThis contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.Contract Name:ZeroExProxy
Compiler Versionv0.6.12+commit.27d51765
Optimization Enabled:Yes with 1000000 runs
Other Settings:default evmVersionContract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "./IZeroEx.sol"; import "@0x/contracts-utils/contracts/src/v06/LibBytesV06.sol"; import "@0x/contracts-zero-ex/contracts/src/errors/LibProxyRichErrors.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /// @title Coinbase proxy contract for 0x proxy /// @dev A generic proxy contract which extracts a fee before delegation contract ZeroExProxy is Ownable { using LibBytesV06 for bytes; using SafeERC20 for IERC20; using SafeMath for uint256; address private constant _ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address private constant _NULL_ADDRESS = 0x0000000000000000000000000000000000000000; address payable private _beneficiary; address payable private _allowanceTarget; IZeroEx private _zeroEx; mapping(bytes4 => address) private _implementationOverrides; event BeneficiaryChanged(address indexed beneficiary); event ImplementationOverrideSet(bytes4 indexed signature, address indexed implementation); event AllowanceTargetChanged(address indexed allowanceTarget); event ZeroExChanged(address indexed zeroEx); /// @dev Construct this contract and specify a fee beneficiary, 0x proxy contract address, and allowance target constructor( IZeroEx zeroEx, address payable allowanceTarget, address payable beneficiary ) public { _zeroEx = zeroEx; _allowanceTarget = allowanceTarget; _beneficiary = beneficiary; } /// @dev Fallback for just receiving ether. receive() external payable {} /// @dev Delegates calls to the specified implementation contract and extracts a fee based on provided arguments /// @param msgData The byte data representing a swap using the original ZeroEx contract. This is either recieved from the 0x API directly or we construct it in order to perform a Uniswap trade /// @param feeToken The ERC20 we wish to extract a user fee from. If this is ETH it should be the standard 0xeee ETH address /// @param fee Fee amount collected and sent to the beneficiary function optimalSwap( bytes calldata msgData, address feeToken, uint256 fee ) external payable returns (bytes memory) { _payFees(feeToken, fee); bytes4 signature = msgData.readBytes4(0); address target = getFunctionImplementation(signature); if (target == address(0)) { _revertWithData(LibProxyRichErrors.NotImplementedError(signature)); } (bool success, bytes memory resultData) = target.delegatecall(msgData); if (!success) { _revertWithData(resultData); } _returnWithData(resultData); } /// @dev Forwards calls to the zeroEx contract and extracts a fee based on provided arguments /// @param msgData The byte data representing a swap using the original ZeroEx contract. This is either recieved from the 0x API directly or we construct it in order to perform a Uniswap trade /// @param feeToken The ERC20 we wish to extract a user fee from. If this is ETH it should be the standard 0xeee ETH address /// @param inputToken The ERC20 the user is selling. If this is ETH it should be the standard 0xeee ETH address /// @param inputAmount The amount of _inputToken being sold /// @param outputToken The ERC20 the user is buying. If this is ETH it should be the standard 0xeee ETH address /// @param fee Fee amount collected and sent to the beneficiary function proxiedSwap( bytes calldata msgData, address feeToken, address inputToken, uint256 inputAmount, address outputToken, uint256 fee ) external payable returns (bytes memory) { return _proxiedSwap(msgData, feeToken, inputToken, inputAmount, outputToken, msg.sender, fee); } function proxiedSwapTo( bytes calldata msgData, address feeToken, address inputToken, uint256 inputAmount, address outputToken, address receiver, uint256 fee ) external payable returns (bytes memory) { return _proxiedSwap(msgData, feeToken, inputToken, inputAmount, outputToken, receiver, fee); } function _proxiedSwap( bytes calldata msgData, address feeToken, address inputToken, uint256 inputAmount, address outputToken, address receiver, uint256 fee ) internal returns (bytes memory) { _payFees(feeToken, fee); uint256 value = 0; if (inputToken == _ETH_ADDRESS) { if (feeToken == _ETH_ADDRESS) { require(msg.value == inputAmount.add(fee),"Insufficient value with fee"); } else { require(msg.value == inputAmount, "Insufficient value"); } value = inputAmount; } else { _sendERC20(IERC20(inputToken), msg.sender, address(this), inputAmount); uint256 allowedAmount = IERC20(inputToken).allowance(address(this), _allowanceTarget); if (allowedAmount < inputAmount) { IERC20(inputToken).safeIncreaseAllowance(_allowanceTarget, inputAmount.sub(allowedAmount)); } } (bool success, bytes memory resultData) = address(_zeroEx).call{value: value}(msgData); if (!success) { _revertWithData(resultData); } if (outputToken == _ETH_ADDRESS) { if (address(this).balance > 0) { _sendETH(payable(receiver), address(this).balance); } else { _revertWithData(resultData); } } else { uint256 tokenBalance = IERC20(outputToken).balanceOf(address(this)); if (tokenBalance > 0) { IERC20(outputToken).safeTransfer(receiver, tokenBalance); } else { _revertWithData(resultData); } } _returnWithData(resultData); } /// @dev Set a new 0x proxy contract address /// @param newZeroEx New 0x proxy address function setZeroEx(IZeroEx newZeroEx) public onlyOwner{ require(address(newZeroEx) != _NULL_ADDRESS, "Invalid zeroEx address"); _zeroEx = newZeroEx; emit ZeroExChanged(address(_zeroEx)); } /// @dev Set a new new allowance target address /// @param newAllowanceTarget New allowance target address function setAllowanceTarget(address payable newAllowanceTarget) public onlyOwner { require(newAllowanceTarget != _NULL_ADDRESS, "Invalid allowance target"); _allowanceTarget = newAllowanceTarget; emit AllowanceTargetChanged(_allowanceTarget); } /// @dev Set a new beneficiary address /// @param beneficiary New beneficiary target address function setBeneficiary(address payable beneficiary) public onlyOwner { require(beneficiary != _NULL_ADDRESS, "Invalid beneficiary"); _beneficiary = beneficiary; emit BeneficiaryChanged(_beneficiary); } /// @dev Set a custom implementation feature /// @param signature function signature /// @param implementation address of the custom feature function setImplementationOverride(bytes4 signature, address implementation) public onlyOwner { _implementationOverrides[signature] = implementation; emit ImplementationOverrideSet(signature, implementation); } /// @dev Get function implementation address based on signature /// @param signature function signature /// @return impl address of implementation function getFunctionImplementation(bytes4 signature) public returns (address impl) { impl = _implementationOverrides[signature]; if (impl == _NULL_ADDRESS) { impl = _zeroEx.getFunctionImplementation(signature); } } function getBeneficiary() public view returns(address) { return _beneficiary; } function getAllowanceTarget() public view returns(address){ return _allowanceTarget; } function getZeroEx() public view returns(IZeroEx) { return _zeroEx; } /// @dev Pay fee to beneficiary /// @param token token address to pay fee in, can be ETH /// @param amount fee amount to pay function _payFees(address token, uint256 amount) private { if (token == _ETH_ADDRESS) { return _sendETH(_beneficiary, amount); } return _sendERC20(IERC20(token), msg.sender, _beneficiary, amount); } function _sendETH(address payable toAddress, uint256 amount) private { if (amount > 0) { (bool success,) = toAddress.call{ value: amount }(""); require(success, "Unable to send ETH"); } } function _sendERC20(IERC20 token, address fromAddress, address toAddress, uint256 amount) private { if (amount > 0) { token.safeTransferFrom(fromAddress, toAddress, amount); } } /// @dev Revert with arbitrary bytes. /// @param data Revert data. function _revertWithData(bytes memory data) private pure { assembly { revert(add(data, 32), mload(data)) } } /// @dev Return with arbitrary bytes. /// @param data Return data. function _returnWithData(bytes memory data) private pure { assembly { return(add(data, 32), mload(data)) } } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; interface IZeroEx { function getFunctionImplementation(bytes4 _signature) external returns (address); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 GSN 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 payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <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; // solhint-disable-next-line no-inline-assembly 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"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./IERC20.sol"; import "../../math/SafeMath.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 SafeMath for uint256; 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' // solhint-disable-next-line max-line-length 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).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _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 // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), 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 { emit OwnershipTransferred(_owner, address(0)); _owner = 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"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. 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. */ pragma solidity ^0.6.5; library LibProxyRichErrors { // solhint-disable func-name-mixedcase function NotImplementedError(bytes4 selector) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("NotImplementedError(bytes4)")), selector ); } function InvalidBootstrapCallerError(address actual, address expected) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("InvalidBootstrapCallerError(address,address)")), actual, expected ); } function InvalidDieCallerError(address actual, address expected) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("InvalidDieCallerError(address,address)")), actual, expected ); } function BootstrapCallFailedError(address target, bytes memory resultData) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("BootstrapCallFailedError(address,bytes)")), target, resultData ); } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. 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. */ pragma solidity ^0.6.5; library LibRichErrorsV06 { // bytes4(keccak256("Error(string)")) bytes4 internal constant STANDARD_ERROR_SELECTOR = 0x08c379a0; /// @dev ABI encode a standard, string revert error payload. /// This is the same payload that would be included by a `revert(string)` /// solidity statement. It has the function signature `Error(string)`. /// @param message The error string. /// @return The ABI encoded error. function StandardError(string memory message) internal pure returns (bytes memory) { return abi.encodeWithSelector(STANDARD_ERROR_SELECTOR, bytes(message)); } /// @dev Reverts an encoded rich revert reason `errorData`. /// @param errorData ABI encoded error data. function rrevert(bytes memory errorData) internal pure { assembly { revert(add(errorData, 0x20), mload(errorData)) } } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. 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. */ pragma solidity ^0.6.5; library LibBytesRichErrorsV06 { enum InvalidByteOperationErrorCodes { FromLessThanOrEqualsToRequired, ToLessThanOrEqualsLengthRequired, LengthGreaterThanZeroRequired, LengthGreaterThanOrEqualsFourRequired, LengthGreaterThanOrEqualsTwentyRequired, LengthGreaterThanOrEqualsThirtyTwoRequired, LengthGreaterThanOrEqualsNestedBytesLengthRequired, DestinationLengthGreaterThanOrEqualSourceLengthRequired } // bytes4(keccak256("InvalidByteOperationError(uint8,uint256,uint256)")) bytes4 internal constant INVALID_BYTE_OPERATION_ERROR_SELECTOR = 0x28006595; function InvalidByteOperationError( InvalidByteOperationErrorCodes errorCode, uint256 offset, uint256 required ) internal pure returns (bytes memory) { return abi.encodeWithSelector(INVALID_BYTE_OPERATION_ERROR_SELECTOR, errorCode, offset, required); } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. 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. */ pragma solidity ^0.6.5; import "./errors/LibBytesRichErrorsV06.sol"; import "./errors/LibRichErrorsV06.sol"; library LibBytesV06 { using LibBytesV06 for bytes; /// @dev Gets the memory address for a byte array. /// @param input Byte array to lookup. /// @return memoryAddress Memory address of byte array. This /// points to the header of the byte array which contains /// the length. function rawAddress(bytes memory input) internal pure returns (uint256 memoryAddress) { assembly { memoryAddress := input } return memoryAddress; } /// @dev Gets the memory address for the contents of a byte array. /// @param input Byte array to lookup. /// @return memoryAddress Memory address of the contents of the byte array. function contentAddress(bytes memory input) internal pure returns (uint256 memoryAddress) { assembly { memoryAddress := add(input, 32) } return memoryAddress; } /// @dev Copies `length` bytes from memory location `source` to `dest`. /// @param dest memory address to copy bytes to. /// @param source memory address to copy bytes from. /// @param length number of bytes to copy. function memCopy( uint256 dest, uint256 source, uint256 length ) internal pure { if (length < 32) { // Handle a partial word by reading destination and masking // off the bits we are interested in. // This correctly handles overlap, zero lengths and source == dest assembly { let mask := sub(exp(256, sub(32, length)), 1) let s := and(mload(source), not(mask)) let d := and(mload(dest), mask) mstore(dest, or(s, d)) } } else { // Skip the O(length) loop when source == dest. if (source == dest) { return; } // For large copies we copy whole words at a time. The final // word is aligned to the end of the range (instead of after the // previous) to handle partial words. So a copy will look like this: // // #### // #### // #### // #### // // We handle overlap in the source and destination range by // changing the copying direction. This prevents us from // overwriting parts of source that we still need to copy. // // This correctly handles source == dest // if (source > dest) { assembly { // We subtract 32 from `sEnd` and `dEnd` because it // is easier to compare with in the loop, and these // are also the addresses we need for copying the // last bytes. length := sub(length, 32) let sEnd := add(source, length) let dEnd := add(dest, length) // Remember the last 32 bytes of source // This needs to be done here and not after the loop // because we may have overwritten the last bytes in // source already due to overlap. let last := mload(sEnd) // Copy whole words front to back // Note: the first check is always true, // this could have been a do-while loop. for { } lt(source, sEnd) { } { mstore(dest, mload(source)) source := add(source, 32) dest := add(dest, 32) } // Write the last 32 bytes mstore(dEnd, last) } } else { assembly { // We subtract 32 from `sEnd` and `dEnd` because those // are the starting points when copying a word at the end. length := sub(length, 32) let sEnd := add(source, length) let dEnd := add(dest, length) // Remember the first 32 bytes of source // This needs to be done here and not after the loop // because we may have overwritten the first bytes in // source already due to overlap. let first := mload(source) // Copy whole words back to front // We use a signed comparisson here to allow dEnd to become // negative (happens when source and dest < 32). Valid // addresses in local memory will never be larger than // 2**255, so they can be safely re-interpreted as signed. // Note: the first check is always true, // this could have been a do-while loop. for { } slt(dest, dEnd) { } { mstore(dEnd, mload(sEnd)) sEnd := sub(sEnd, 32) dEnd := sub(dEnd, 32) } // Write the first 32 bytes mstore(dest, first) } } } } /// @dev Returns a slices from a byte array. /// @param b The byte array to take a slice from. /// @param from The starting index for the slice (inclusive). /// @param to The final index for the slice (exclusive). /// @return result The slice containing bytes at indices [from, to) function slice( bytes memory b, uint256 from, uint256 to ) internal pure returns (bytes memory result) { // Ensure that the from and to positions are valid positions for a slice within // the byte array that is being used. if (from > to) { LibRichErrorsV06.rrevert( LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.FromLessThanOrEqualsToRequired, from, to ) ); } if (to > b.length) { LibRichErrorsV06.rrevert( LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.ToLessThanOrEqualsLengthRequired, to, b.length ) ); } // Create a new bytes structure and copy contents result = new bytes(to - from); memCopy(result.contentAddress(), b.contentAddress() + from, result.length); return result; } /// @dev Returns a slice from a byte array without preserving the input. /// When `from == 0`, the original array will match the slice. /// In other cases its state will be corrupted. /// @param b The byte array to take a slice from. Will be destroyed in the process. /// @param from The starting index for the slice (inclusive). /// @param to The final index for the slice (exclusive). /// @return result The slice containing bytes at indices [from, to) function sliceDestructive( bytes memory b, uint256 from, uint256 to ) internal pure returns (bytes memory result) { // Ensure that the from and to positions are valid positions for a slice within // the byte array that is being used. if (from > to) { LibRichErrorsV06.rrevert( LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.FromLessThanOrEqualsToRequired, from, to ) ); } if (to > b.length) { LibRichErrorsV06.rrevert( LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.ToLessThanOrEqualsLengthRequired, to, b.length ) ); } // Create a new bytes structure around [from, to) in-place. assembly { result := add(b, from) mstore(result, sub(to, from)) } return result; } /// @dev Pops the last byte off of a byte array by modifying its length. /// @param b Byte array that will be modified. /// @return result The byte that was popped off. function popLastByte(bytes memory b) internal pure returns (bytes1 result) { if (b.length == 0) { LibRichErrorsV06.rrevert( LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanZeroRequired, b.length, 0 ) ); } // Store last byte. result = b[b.length - 1]; assembly { // Decrement length of byte array. let newLen := sub(mload(b), 1) mstore(b, newLen) } return result; } /// @dev Tests equality of two byte arrays. /// @param lhs First byte array to compare. /// @param rhs Second byte array to compare. /// @return equal True if arrays are the same. False otherwise. function equals(bytes memory lhs, bytes memory rhs) internal pure returns (bool equal) { // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare. // We early exit on unequal lengths, but keccak would also correctly // handle this. return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs); } /// @dev Reads an address from a position in a byte array. /// @param b Byte array containing an address. /// @param index Index in byte array of address. /// @return result address from byte array. function readAddress(bytes memory b, uint256 index) internal pure returns (address result) { if (b.length < index + 20) { LibRichErrorsV06.rrevert( LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsTwentyRequired, b.length, index + 20 // 20 is length of address ) ); } // Add offset to index: // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index) // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index) index += 20; // Read address from array memory assembly { // 1. Add index to address of bytes array // 2. Load 32-byte word from memory // 3. Apply 20-byte mask to obtain address result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff) } return result; } /// @dev Writes an address into a specific position in a byte array. /// @param b Byte array to insert address into. /// @param index Index in byte array of address. /// @param input Address to put into byte array. function writeAddress( bytes memory b, uint256 index, address input ) internal pure { if (b.length < index + 20) { LibRichErrorsV06.rrevert( LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsTwentyRequired, b.length, index + 20 // 20 is length of address ) ); } // Add offset to index: // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index) // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index) index += 20; // Store address into array memory assembly { // The address occupies 20 bytes and mstore stores 32 bytes. // First fetch the 32-byte word where we'll be storing the address, then // apply a mask so we have only the bytes in the word that the address will not occupy. // Then combine these bytes with the address and store the 32 bytes back to memory with mstore. // 1. Add index to address of bytes array // 2. Load 32-byte word from memory // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address let neighbors := and( mload(add(b, index)), 0xffffffffffffffffffffffff0000000000000000000000000000000000000000 ) // Make sure input address is clean. // (Solidity does not guarantee this) input := and(input, 0xffffffffffffffffffffffffffffffffffffffff) // Store the neighbors and address into memory mstore(add(b, index), xor(input, neighbors)) } } /// @dev Reads a bytes32 value from a position in a byte array. /// @param b Byte array containing a bytes32 value. /// @param index Index in byte array of bytes32 value. /// @return result bytes32 value from byte array. function readBytes32(bytes memory b, uint256 index) internal pure returns (bytes32 result) { if (b.length < index + 32) { LibRichErrorsV06.rrevert( LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsThirtyTwoRequired, b.length, index + 32 ) ); } // Arrays are prefixed by a 256 bit length parameter index += 32; // Read the bytes32 from array memory assembly { result := mload(add(b, index)) } return result; } /// @dev Writes a bytes32 into a specific position in a byte array. /// @param b Byte array to insert <input> into. /// @param index Index in byte array of <input>. /// @param input bytes32 to put into byte array. function writeBytes32( bytes memory b, uint256 index, bytes32 input ) internal pure { if (b.length < index + 32) { LibRichErrorsV06.rrevert( LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsThirtyTwoRequired, b.length, index + 32 ) ); } // Arrays are prefixed by a 256 bit length parameter index += 32; // Read the bytes32 from array memory assembly { mstore(add(b, index), input) } } /// @dev Reads a uint256 value from a position in a byte array. /// @param b Byte array containing a uint256 value. /// @param index Index in byte array of uint256 value. /// @return result uint256 value from byte array. function readUint256(bytes memory b, uint256 index) internal pure returns (uint256 result) { result = uint256(readBytes32(b, index)); return result; } /// @dev Writes a uint256 into a specific position in a byte array. /// @param b Byte array to insert <input> into. /// @param index Index in byte array of <input>. /// @param input uint256 to put into byte array. function writeUint256( bytes memory b, uint256 index, uint256 input ) internal pure { writeBytes32(b, index, bytes32(input)); } /// @dev Reads an unpadded bytes4 value from a position in a byte array. /// @param b Byte array containing a bytes4 value. /// @param index Index in byte array of bytes4 value. /// @return result bytes4 value from byte array. function readBytes4(bytes memory b, uint256 index) internal pure returns (bytes4 result) { if (b.length < index + 4) { LibRichErrorsV06.rrevert( LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsFourRequired, b.length, index + 4 ) ); } // Arrays are prefixed by a 32 byte length field index += 32; // Read the bytes4 from array memory assembly { result := mload(add(b, index)) // Solidity does not require us to clean the trailing bytes. // We do it anyway result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000) } return result; } /// @dev Writes a new length to a byte array. /// Decreasing length will lead to removing the corresponding lower order bytes from the byte array. /// Increasing length may lead to appending adjacent in-memory bytes to the end of the byte array. /// @param b Bytes array to write new length to. /// @param length New length of byte array. function writeLength(bytes memory b, uint256 length) internal pure { assembly { mstore(b, length) } } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 1000000 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
[{"inputs":[{"internalType":"contract IZeroEx","name":"zeroEx","type":"address"},{"internalType":"address payable","name":"allowanceTarget","type":"address"},{"internalType":"address payable","name":"beneficiary","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"allowanceTarget","type":"address"}],"name":"AllowanceTargetChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"}],"name":"BeneficiaryChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes4","name":"signature","type":"bytes4"},{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"ImplementationOverrideSet","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":true,"internalType":"address","name":"zeroEx","type":"address"}],"name":"ZeroExChanged","type":"event"},{"inputs":[],"name":"getAllowanceTarget","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBeneficiary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"signature","type":"bytes4"}],"name":"getFunctionImplementation","outputs":[{"internalType":"address","name":"impl","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getZeroEx","outputs":[{"internalType":"contract IZeroEx","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"msgData","type":"bytes"},{"internalType":"address","name":"feeToken","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"optimalSwap","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"msgData","type":"bytes"},{"internalType":"address","name":"feeToken","type":"address"},{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"proxiedSwap","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"msgData","type":"bytes"},{"internalType":"address","name":"feeToken","type":"address"},{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"proxiedSwapTo","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"newAllowanceTarget","type":"address"}],"name":"setAllowanceTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"beneficiary","type":"address"}],"name":"setBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"signature","type":"bytes4"},{"internalType":"address","name":"implementation","type":"address"}],"name":"setImplementationOverride","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IZeroEx","name":"newZeroEx","type":"address"}],"name":"setZeroEx","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162002090380380620020908339810160408190526200003491620000d1565b600062000040620000cd565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600380546001600160a01b039485166001600160a01b0319918216179091556002805493851693821693909317909255600180549190931691161790556200013d565b3390565b600080600060608486031215620000e6578283fd5b8351620000f38162000124565b6020850151909350620001068162000124565b6040850151909250620001198162000124565b809150509250925092565b6001600160a01b03811681146200013a57600080fd5b50565b611f43806200014d6000396000f3fe6080604052600436106100e15760003560e01c8063b6016b771161007f578063f7c3a33b11610059578063f7c3a33b1461020c578063f914382614610221578063fdf03fa114610241578063fe53d0b614610261576100e8565b8063b6016b77146101c4578063f2fde38b146101d9578063f7232392146101f9576100e8565b8063715018a6116100bb578063715018a61461015a5780638a14c7591461016f5780638da5cb5b1461018f578063972fdd26146101a4576100e8565b80631c31f710146100ed578063565a2e2c1461010f5780635cf540261461013a576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b5061010d61010836600461178c565b610274565b005b34801561011b57600080fd5b506101246103b2565b6040516101319190611a52565b60405180910390f35b61014d6101483660046118d8565b6103ce565b6040516101319190611b1e565b34801561016657600080fd5b5061010d6103ec565b34801561017b57600080fd5b5061010d61018a36600461178c565b6104ce565b34801561019b57600080fd5b50610124610603565b3480156101b057600080fd5b506101246101bf3660046117e4565b61061f565b3480156101d057600080fd5b5061012461071c565b3480156101e557600080fd5b5061010d6101f436600461178c565b610738565b61014d610207366004611838565b610885565b34801561021857600080fd5b506101246108a4565b34801561022d57600080fd5b5061010d61023c36600461178c565b6108c0565b34801561024d57600080fd5b5061010d61025c366004611800565b6109f5565b61014d61026f366004611966565b610b07565b61027c610c27565b73ffffffffffffffffffffffffffffffffffffffff1661029a610603565b73ffffffffffffffffffffffffffffffffffffffff16146102f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811661033d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611ce9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d90600090a250565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b60606103e08888888888883389610c2b565b98975050505050505050565b6103f4610c27565b73ffffffffffffffffffffffffffffffffffffffff16610412610603565b73ffffffffffffffffffffffffffffffffffffffff161461045f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6104d6610c27565b73ffffffffffffffffffffffffffffffffffffffff166104f4610603565b73ffffffffffffffffffffffffffffffffffffffff1614610541576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b73ffffffffffffffffffffffffffffffffffffffff811661058e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611cb2565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907f12de7cdcfa92c9e2744861bffda63417a4bc29e3c916f0d3e9655d684cc7acc690600090a250565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b7fffffffff00000000000000000000000000000000000000000000000000000000811660009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610717576003546040517f972fdd2600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063972fdd26906106c2908590600401611af1565b602060405180830381600087803b1580156106dc57600080fd5b505af11580156106f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071491906117a8565b90505b919050565b60035473ffffffffffffffffffffffffffffffffffffffff1690565b610740610c27565b73ffffffffffffffffffffffffffffffffffffffff1661075e610603565b73ffffffffffffffffffffffffffffffffffffffff16146107ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b73ffffffffffffffffffffffffffffffffffffffff81166107f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611b53565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606108978989898989898989610c2b565b9998505050505050505050565b60025473ffffffffffffffffffffffffffffffffffffffff1690565b6108c8610c27565b73ffffffffffffffffffffffffffffffffffffffff166108e6610603565b73ffffffffffffffffffffffffffffffffffffffff1614610933576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b73ffffffffffffffffffffffffffffffffffffffff8116610980576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611dc3565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907f058ec768b4d987625b47f998642d52a1ef938ff8445348c5653a5a7c15c9d79290600090a250565b6109fd610c27565b73ffffffffffffffffffffffffffffffffffffffff16610a1b610603565b73ffffffffffffffffffffffffffffffffffffffff1614610a68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b7fffffffff00000000000000000000000000000000000000000000000000000000821660008181526004602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590519092917fc161c67ca327eadedf1f0825c92841b42fcc2127c83d52d8849770c997f9962091a35050565b6060610b138383611001565b6000610b59600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506110869050565b90506000610b668261061f565b905073ffffffffffffffffffffffffffffffffffffffff8116610b9457610b94610b8f836110d2565b61118a565b600060608273ffffffffffffffffffffffffffffffffffffffff168989604051610bbf929190611a23565b600060405180830381855af49150503d8060008114610bfa576040519150601f19603f3d011682016040523d82523d6000602084013e610bff565b606091505b509150915081610c1257610c128161118a565b610c1b81611192565b50505050949350505050565b3390565b6060610c378783611001565b600073ffffffffffffffffffffffffffffffffffffffff871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610d245773ffffffffffffffffffffffffffffffffffffffff881673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610ce457610ca7868461119a565b3414610cdf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611dfa565b610d1d565b853414610d1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d55565b5084610e2d565b610d30873330896111e0565b6002546040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff808b169263dd62ed3e92610d8c923092911690600401611a73565b60206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906119c1565b905086811015610e2b57600254610e2b9073ffffffffffffffffffffffffffffffffffffffff16610e0d898461120e565b73ffffffffffffffffffffffffffffffffffffffff8b169190611250565b505b60035460405160009160609173ffffffffffffffffffffffffffffffffffffffff909116908490610e61908f908f90611a23565b60006040518083038185875af1925050503d8060008114610e9e576040519150601f19603f3d011682016040523d82523d6000602084013e610ea3565b606091505b509150915081610eb657610eb68161118a565b73ffffffffffffffffffffffffffffffffffffffff871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610f0b574715610efd57610ef8864761138a565b610f06565b610f068161118a565b610fe9565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8916906370a0823190610f60903090600401611a52565b60206040518083038186803b158015610f7857600080fd5b505afa158015610f8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb091906119c1565b90508015610fde57610fd973ffffffffffffffffffffffffffffffffffffffff89168883611438565b610fe7565b610fe78261118a565b505b610ff281611192565b50505098975050505050505050565b73ffffffffffffffffffffffffffffffffffffffff821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561105b576001546110569073ffffffffffffffffffffffffffffffffffffffff168261138a565b611082565b600154611082908390339073ffffffffffffffffffffffffffffffffffffffff16846111e0565b5050565b600081600401835110156110a7576110a7610b8f6003855185600401611457565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b60607f734e6e1c6ec3f883cac8d13d3e7390b280f5e94424662aa29e27394ed56586c9826040516024016111069190611af1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091529050919050565b805160208201fd5b805160208201f35b6000828201838110156111d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611bb0565b9392505050565b80156112085761120873ffffffffffffffffffffffffffffffffffffffff85168484846114fc565b50505050565b60008282111561124a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611c1e565b50900390565b60006112e7828573ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30876040518363ffffffff1660e01b8152600401611291929190611a73565b60206040518083038186803b1580156112a957600080fd5b505afa1580156112bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e191906119c1565b9061119a565b90506112088463095ea7b360e01b8584604051602401611308929190611acb565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261151d565b80156110825760008273ffffffffffffffffffffffffffffffffffffffff16826040516113b690611a4f565b60006040518083038185875af1925050503d80600081146113f3576040519150601f19603f3d011682016040523d82523d6000602084013e6113f8565b606091505b5050905080611433576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611be7565b505050565b6114338363a9059cbb60e01b8484604051602401611308929190611acb565b6060632800659560e01b84848460405160240161147693929190611b31565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915290509392505050565b611208846323b872dd60e01b85858560405160240161130893929190611a9a565b606061157f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166115d39092919063ffffffff16565b805190915015611433578080602001905181019061159d91906117c4565b611433576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611e31565b60606115e284846000856115ea565b949350505050565b606082471015611626576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611c55565b61162f856116ec565b611665576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d8c565b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161168f9190611a33565b60006040518083038185875af1925050503d80600081146116cc576040519150601f19603f3d011682016040523d82523d6000602084013e6116d1565b606091505b50915091506116e18282866116f2565b979650505050505050565b3b151590565b606083156117015750816111d9565b8251156117115782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e79190611b1e565b60008083601f840112611756578182fd5b50813567ffffffffffffffff81111561176d578182fd5b60208301915083602082850101111561178557600080fd5b9250929050565b60006020828403121561179d578081fd5b81356111d981611eba565b6000602082840312156117b9578081fd5b81516111d981611eba565b6000602082840312156117d5578081fd5b815180151581146111d9578182fd5b6000602082840312156117f5578081fd5b81356111d981611edf565b60008060408385031215611812578081fd5b823561181d81611edf565b9150602083013561182d81611eba565b809150509250929050565b60008060008060008060008060e0898b031215611853578384fd5b883567ffffffffffffffff811115611869578485fd5b6118758b828c01611745565b909950975050602089013561188981611eba565b9550604089013561189981611eba565b94506060890135935060808901356118b081611eba565b925060a08901356118c081611eba565b8092505060c089013590509295985092959890939650565b600080600080600080600060c0888a0312156118f2578283fd5b873567ffffffffffffffff811115611908578384fd5b6119148a828b01611745565b909850965050602088013561192881611eba565b9450604088013561193881611eba565b935060608801359250608088013561194f81611eba565b8092505060a0880135905092959891949750929550565b6000806000806060858703121561197b578384fd5b843567ffffffffffffffff811115611991578485fd5b61199d87828801611745565b90955093505060208501356119b181611eba565b9396929550929360400135925050565b6000602082840312156119d2578081fd5b5051919050565b600081518084526119f1816020860160208601611e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000828483379101908152919050565b60008251611a45818460208701611e8e565b9190910192915050565b90565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b7fffffffff0000000000000000000000000000000000000000000000000000000091909116815260200190565b6000602082526111d960208301846119d9565b6060810160088510611b3f57fe5b938152602081019290925260409091015290565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526012908201527f556e61626c6520746f2073656e64204554480000000000000000000000000000604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60408201527f722063616c6c0000000000000000000000000000000000000000000000000000606082015260800190565b60208082526018908201527f496e76616c696420616c6c6f77616e6365207461726765740000000000000000604082015260600190565b60208082526013908201527f496e76616c69642062656e656669636961727900000000000000000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526012908201527f496e73756666696369656e742076616c75650000000000000000000000000000604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60208082526016908201527f496e76616c6964207a65726f4578206164647265737300000000000000000000604082015260600190565b6020808252601b908201527f496e73756666696369656e742076616c75652077697468206665650000000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60408201527f6f74207375636365656400000000000000000000000000000000000000000000606082015260800190565b60005b83811015611ea9578181015183820152602001611e91565b838111156112085750506000910152565b73ffffffffffffffffffffffffffffffffffffffff81168114611edc57600080fd5b50565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611edc57600080fdfea2646970667358221220bdc12fc5011804fe14cad27ac2e045ca4d9afe1b2a901734f8182a7b77a3843264736f6c634300060c0033000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff000000000000000000000000382ffce2287252f930e1c8dc9328dac5bf282ba1Deployed Bytecode
0x6080604052600436106100e15760003560e01c8063b6016b771161007f578063f7c3a33b11610059578063f7c3a33b1461020c578063f914382614610221578063fdf03fa114610241578063fe53d0b614610261576100e8565b8063b6016b77146101c4578063f2fde38b146101d9578063f7232392146101f9576100e8565b8063715018a6116100bb578063715018a61461015a5780638a14c7591461016f5780638da5cb5b1461018f578063972fdd26146101a4576100e8565b80631c31f710146100ed578063565a2e2c1461010f5780635cf540261461013a576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b5061010d61010836600461178c565b610274565b005b34801561011b57600080fd5b506101246103b2565b6040516101319190611a52565b60405180910390f35b61014d6101483660046118d8565b6103ce565b6040516101319190611b1e565b34801561016657600080fd5b5061010d6103ec565b34801561017b57600080fd5b5061010d61018a36600461178c565b6104ce565b34801561019b57600080fd5b50610124610603565b3480156101b057600080fd5b506101246101bf3660046117e4565b61061f565b3480156101d057600080fd5b5061012461071c565b3480156101e557600080fd5b5061010d6101f436600461178c565b610738565b61014d610207366004611838565b610885565b34801561021857600080fd5b506101246108a4565b34801561022d57600080fd5b5061010d61023c36600461178c565b6108c0565b34801561024d57600080fd5b5061010d61025c366004611800565b6109f5565b61014d61026f366004611966565b610b07565b61027c610c27565b73ffffffffffffffffffffffffffffffffffffffff1661029a610603565b73ffffffffffffffffffffffffffffffffffffffff16146102f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811661033d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611ce9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d90600090a250565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b60606103e08888888888883389610c2b565b98975050505050505050565b6103f4610c27565b73ffffffffffffffffffffffffffffffffffffffff16610412610603565b73ffffffffffffffffffffffffffffffffffffffff161461045f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6104d6610c27565b73ffffffffffffffffffffffffffffffffffffffff166104f4610603565b73ffffffffffffffffffffffffffffffffffffffff1614610541576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b73ffffffffffffffffffffffffffffffffffffffff811661058e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611cb2565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907f12de7cdcfa92c9e2744861bffda63417a4bc29e3c916f0d3e9655d684cc7acc690600090a250565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b7fffffffff00000000000000000000000000000000000000000000000000000000811660009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610717576003546040517f972fdd2600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063972fdd26906106c2908590600401611af1565b602060405180830381600087803b1580156106dc57600080fd5b505af11580156106f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071491906117a8565b90505b919050565b60035473ffffffffffffffffffffffffffffffffffffffff1690565b610740610c27565b73ffffffffffffffffffffffffffffffffffffffff1661075e610603565b73ffffffffffffffffffffffffffffffffffffffff16146107ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b73ffffffffffffffffffffffffffffffffffffffff81166107f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611b53565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606108978989898989898989610c2b565b9998505050505050505050565b60025473ffffffffffffffffffffffffffffffffffffffff1690565b6108c8610c27565b73ffffffffffffffffffffffffffffffffffffffff166108e6610603565b73ffffffffffffffffffffffffffffffffffffffff1614610933576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b73ffffffffffffffffffffffffffffffffffffffff8116610980576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611dc3565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907f058ec768b4d987625b47f998642d52a1ef938ff8445348c5653a5a7c15c9d79290600090a250565b6109fd610c27565b73ffffffffffffffffffffffffffffffffffffffff16610a1b610603565b73ffffffffffffffffffffffffffffffffffffffff1614610a68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d20565b7fffffffff00000000000000000000000000000000000000000000000000000000821660008181526004602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590519092917fc161c67ca327eadedf1f0825c92841b42fcc2127c83d52d8849770c997f9962091a35050565b6060610b138383611001565b6000610b59600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506110869050565b90506000610b668261061f565b905073ffffffffffffffffffffffffffffffffffffffff8116610b9457610b94610b8f836110d2565b61118a565b600060608273ffffffffffffffffffffffffffffffffffffffff168989604051610bbf929190611a23565b600060405180830381855af49150503d8060008114610bfa576040519150601f19603f3d011682016040523d82523d6000602084013e610bff565b606091505b509150915081610c1257610c128161118a565b610c1b81611192565b50505050949350505050565b3390565b6060610c378783611001565b600073ffffffffffffffffffffffffffffffffffffffff871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610d245773ffffffffffffffffffffffffffffffffffffffff881673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610ce457610ca7868461119a565b3414610cdf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611dfa565b610d1d565b853414610d1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d55565b5084610e2d565b610d30873330896111e0565b6002546040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff808b169263dd62ed3e92610d8c923092911690600401611a73565b60206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906119c1565b905086811015610e2b57600254610e2b9073ffffffffffffffffffffffffffffffffffffffff16610e0d898461120e565b73ffffffffffffffffffffffffffffffffffffffff8b169190611250565b505b60035460405160009160609173ffffffffffffffffffffffffffffffffffffffff909116908490610e61908f908f90611a23565b60006040518083038185875af1925050503d8060008114610e9e576040519150601f19603f3d011682016040523d82523d6000602084013e610ea3565b606091505b509150915081610eb657610eb68161118a565b73ffffffffffffffffffffffffffffffffffffffff871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610f0b574715610efd57610ef8864761138a565b610f06565b610f068161118a565b610fe9565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8916906370a0823190610f60903090600401611a52565b60206040518083038186803b158015610f7857600080fd5b505afa158015610f8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb091906119c1565b90508015610fde57610fd973ffffffffffffffffffffffffffffffffffffffff89168883611438565b610fe7565b610fe78261118a565b505b610ff281611192565b50505098975050505050505050565b73ffffffffffffffffffffffffffffffffffffffff821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561105b576001546110569073ffffffffffffffffffffffffffffffffffffffff168261138a565b611082565b600154611082908390339073ffffffffffffffffffffffffffffffffffffffff16846111e0565b5050565b600081600401835110156110a7576110a7610b8f6003855185600401611457565b5001602001517fffffffff000000000000000000000000000000000000000000000000000000001690565b60607f734e6e1c6ec3f883cac8d13d3e7390b280f5e94424662aa29e27394ed56586c9826040516024016111069190611af1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091529050919050565b805160208201fd5b805160208201f35b6000828201838110156111d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611bb0565b9392505050565b80156112085761120873ffffffffffffffffffffffffffffffffffffffff85168484846114fc565b50505050565b60008282111561124a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611c1e565b50900390565b60006112e7828573ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30876040518363ffffffff1660e01b8152600401611291929190611a73565b60206040518083038186803b1580156112a957600080fd5b505afa1580156112bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e191906119c1565b9061119a565b90506112088463095ea7b360e01b8584604051602401611308929190611acb565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261151d565b80156110825760008273ffffffffffffffffffffffffffffffffffffffff16826040516113b690611a4f565b60006040518083038185875af1925050503d80600081146113f3576040519150601f19603f3d011682016040523d82523d6000602084013e6113f8565b606091505b5050905080611433576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611be7565b505050565b6114338363a9059cbb60e01b8484604051602401611308929190611acb565b6060632800659560e01b84848460405160240161147693929190611b31565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915290509392505050565b611208846323b872dd60e01b85858560405160240161130893929190611a9a565b606061157f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166115d39092919063ffffffff16565b805190915015611433578080602001905181019061159d91906117c4565b611433576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611e31565b60606115e284846000856115ea565b949350505050565b606082471015611626576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611c55565b61162f856116ec565b611665576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e790611d8c565b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161168f9190611a33565b60006040518083038185875af1925050503d80600081146116cc576040519150601f19603f3d011682016040523d82523d6000602084013e6116d1565b606091505b50915091506116e18282866116f2565b979650505050505050565b3b151590565b606083156117015750816111d9565b8251156117115782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e79190611b1e565b60008083601f840112611756578182fd5b50813567ffffffffffffffff81111561176d578182fd5b60208301915083602082850101111561178557600080fd5b9250929050565b60006020828403121561179d578081fd5b81356111d981611eba565b6000602082840312156117b9578081fd5b81516111d981611eba565b6000602082840312156117d5578081fd5b815180151581146111d9578182fd5b6000602082840312156117f5578081fd5b81356111d981611edf565b60008060408385031215611812578081fd5b823561181d81611edf565b9150602083013561182d81611eba565b809150509250929050565b60008060008060008060008060e0898b031215611853578384fd5b883567ffffffffffffffff811115611869578485fd5b6118758b828c01611745565b909950975050602089013561188981611eba565b9550604089013561189981611eba565b94506060890135935060808901356118b081611eba565b925060a08901356118c081611eba565b8092505060c089013590509295985092959890939650565b600080600080600080600060c0888a0312156118f2578283fd5b873567ffffffffffffffff811115611908578384fd5b6119148a828b01611745565b909850965050602088013561192881611eba565b9450604088013561193881611eba565b935060608801359250608088013561194f81611eba565b8092505060a0880135905092959891949750929550565b6000806000806060858703121561197b578384fd5b843567ffffffffffffffff811115611991578485fd5b61199d87828801611745565b90955093505060208501356119b181611eba565b9396929550929360400135925050565b6000602082840312156119d2578081fd5b5051919050565b600081518084526119f1816020860160208601611e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000828483379101908152919050565b60008251611a45818460208701611e8e565b9190910192915050565b90565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b7fffffffff0000000000000000000000000000000000000000000000000000000091909116815260200190565b6000602082526111d960208301846119d9565b6060810160088510611b3f57fe5b938152602081019290925260409091015290565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526012908201527f556e61626c6520746f2073656e64204554480000000000000000000000000000604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60408201527f722063616c6c0000000000000000000000000000000000000000000000000000606082015260800190565b60208082526018908201527f496e76616c696420616c6c6f77616e6365207461726765740000000000000000604082015260600190565b60208082526013908201527f496e76616c69642062656e656669636961727900000000000000000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526012908201527f496e73756666696369656e742076616c75650000000000000000000000000000604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60208082526016908201527f496e76616c6964207a65726f4578206164647265737300000000000000000000604082015260600190565b6020808252601b908201527f496e73756666696369656e742076616c75652077697468206665650000000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60408201527f6f74207375636365656400000000000000000000000000000000000000000000606082015260800190565b60005b83811015611ea9578181015183820152602001611e91565b838111156112085750506000910152565b73ffffffffffffffffffffffffffffffffffffffff81168114611edc57600080fd5b50565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611edc57600080fdfea2646970667358221220bdc12fc5011804fe14cad27ac2e045ca4d9afe1b2a901734f8182a7b77a3843264736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff000000000000000000000000382ffce2287252f930e1c8dc9328dac5bf282ba1
-----Decoded View---------------
Arg [0] : zeroEx (address): 0xDef1C0ded9bec7F1a1670819833240f027b25EfF
Arg [1] : allowanceTarget (address): 0xDef1C0ded9bec7F1a1670819833240f027b25EfF
Arg [2] : beneficiary (address): 0x382fFCe2287252F930E1C8DC9328dac5BF282bA1
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff
Arg [1] : 000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff
Arg [2] : 000000000000000000000000382ffce2287252f930e1c8dc9328dac5bf282ba1Loading...LoadingLoading...Loading
Loading...Loading
Loading...LoadingLoading...LoadingLoading...LoadingLoading...LoadingLoading...LoadingLoading...LoadingLoading...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.
Address QR Code
My Address - Private Name Tag or Note
My Name Tag:
Private Name Tags (up to 35 characters) can be used for easy identification of addressesPrivate Note:
A private note (up to 500 characters) can be attached to this address.
Please DO NOT store any passwords or private keys here.Compiler specific version warnings:
The compiled contract might be susceptible to FullInlinerNonExpressionSplitArgumentEvaluationOrder (low-severity), MissingSideEffectsOnSelectorAccess (low-severity), AbiReencodingHeadOverflowWithStaticArrayCleanup (medium-severity), DirtyBytesArrayToStorage (low-severity), DataLocationChangeInInternalOverride (very low-severity), NestedCalldataArrayAbiReencodingSizeValidation (very low-severity), SignedImmutables (very low-severity), ABIDecodeTwoDimensionalArrayMemory (very low-severity), KeccakCaching (medium-severity), EmptyByteArrayCopy (medium-severity), DynamicArrayCleanup (medium-severity) Solidity Compiler Bugs.
Connect a Wallet
Connecting wallet for read function is optional, useful if you want to call certain functions or simply use your wallet's node.Connect a Wallet
Connecting wallet for read function is optional, useful if you want to call certain functions or simply use your wallet's node.Connect a Wallet
Connecting wallet for read function is optional, useful if you want to call certain functions or simply use your wallet's node.SignIn
Address Cards
To use this feature, please login to your Etherscan account and return to this page.Before You Copy
Transaction Private Note
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.