Source Code
Latest 12 from a total of 12 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Multicall | 47350819 | 17 days ago | IN | 0 MON | 0.10693945 | ||||
| Multicall | 47347294 | 17 days ago | IN | 0 MON | 0.10672056 | ||||
| Multicall | 47341537 | 17 days ago | IN | 0 MON | 0.10674422 | ||||
| Multicall | 40067904 | 51 days ago | IN | 0 MON | 0.17278957 | ||||
| Multicall | 40051287 | 51 days ago | IN | 0 MON | 0.10702464 | ||||
| Multicall | 39895908 | 52 days ago | IN | 0 MON | 0.10671811 | ||||
| Multicall | 39894415 | 52 days ago | IN | 0 MON | 0.11593156 | ||||
| Multicall | 39830271 | 52 days ago | IN | 0 MON | 0.20409719 | ||||
| Multicall | 39830020 | 52 days ago | IN | 0 MON | 0.21108619 | ||||
| Multicall | 39829115 | 52 days ago | IN | 0 MON | 0.11693953 | ||||
| Multicall | 39828876 | 52 days ago | IN | 0 MON | 0.11752176 | ||||
| Multicall | 38577193 | 58 days ago | IN | 0 MON | 0.11814992 |
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 37091147 | 65 days ago | Contract Creation | 0 MON |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x9e0fD4B8...eDCdb9bec The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
SolverMulticallV1
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 999999 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./libraries/CallParams.sol";
/// @title A multicall contract that can be called only by the solver.
/// Allows Solver to approve max approvals to it and safely execute multiple transactions at once
contract SolverMulticallV1 {
using SafeERC20 for IERC20;
using CallParams for CallParams.Params;
struct Call {
CallParams.Params params; // encoded params
address target; // `call.to` - address of smart contract that should be called
uint256 msgValue; // `msg.value` that should be attached to the call
bytes data; // `call.data` that should be passed to the call
}
struct BalanceCheck {
address token; // ERC20 token address or address(0) for native token
address receiver; // Tokens receiver
uint256 minAmount; // Minimum amount to receive
}
address public immutable solver;
address public immutable factory;
error BelowAmountOutMin(uint256 balanceIndex, uint256 received);
error CallFailed(uint256 index, bytes errorData);
error NotASolver();
/// @notice Only immutable solver can call the functions.
modifier onlySolver() {
if (msg.sender != solver) revert NotASolver();
_;
}
/**
* @param _solver Multicall owner address
* @param _factory Factory contract address
*/
constructor(
address _solver,
address _factory
) {
solver = _solver;
factory = _factory;
}
receive() external payable {}
/**
* @notice Executes multiple calls
* @param calls Encoded array of calls that must be executed
* @param balanceChecks Encoded of balance changes that should be checked.
* Should not contain duplicate token-receiver pairs
*/
function multicall(
Call[] memory calls,
BalanceCheck[] calldata balanceChecks
) external payable onlySolver {
uint256[] memory initialBalances = new uint256[](balanceChecks.length);
for (uint256 balanceIndex = 0; balanceIndex < balanceChecks.length; balanceIndex++) {
initialBalances[balanceIndex] = _getBalance(
balanceChecks[balanceIndex].token,
balanceChecks[balanceIndex].receiver
);
}
for (uint256 i = 0; i < calls.length; i++) {
Call memory call = calls[i];
// special params case - no call is required
if (call.params.checkSlippage()) {
for (uint256 balanceIndex = 0; balanceIndex < balanceChecks.length; balanceIndex++) {
uint256 received = _getBalance(
balanceChecks[balanceIndex].token,
balanceChecks[balanceIndex].receiver
) - initialBalances[balanceIndex];
if (received < balanceChecks[balanceIndex].minAmount) {
revert BelowAmountOutMin(balanceIndex, received);
}
}
continue;
}
call.params.updateCallData(call.data, call.msgValue);
if (call.params.shouldApproveIfRequired()) {
_safeApproveIfRequired(
call.params.getToken(),
call.target,
call.params.getAmountIn(call.data)
);
}
if (call.params.shouldSkipCall()) continue;
if (call.params.shouldPassFullNativeBalance()) {
call.msgValue = address(this).balance;
}
(bool success, bytes memory data) = call.target.call{value: call.msgValue}(call.data);
if (!success) revert CallFailed(i, data);
}
}
/**
* @notice Approves ERC20 token to `spender` in case of insufficient allowance
* @param token ERC20 token that needs to be approved
* @param spender Spender address
* @param amountToSpend Amount of tokens to spend
*/
function _safeApproveIfRequired(
IERC20 token,
address spender,
uint256 amountToSpend
) internal {
uint256 allowance = token.allowance(address(this), spender);
if (allowance < amountToSpend) {
// Approves to 0 in case token processes `approve` like `increaseAllowance`
if (allowance != 0) {
token.forceApprove(spender, 0);
}
token.forceApprove(spender, type(uint256).max);
}
}
/**
* @notice Returns balance of token OUT
* @param token ERC20 token address (address(0) if native token)
* @param account Account, which balance should be checked
*/
function _getBalance(
address token,
address account
) internal view returns (uint256) {
if (token == address(0)) {
return account.balance;
} else {
return IERC20(token).balanceOf(account);
}
}
}
/// @title A factory contract that allows easily deploying your own SolverMulticallV1
contract SolverMulticallV1Factory {
// Mapping for easy search of already deployed Multicall contracts
mapping(address owner => address) public multicallAddress;
error AlreadyDeployed(address);
event MulticallDeployed(address owner, address multicall);
/// @notice Deploys new multicall contract instance. Only one can be deployed by the Solver
function deploySolverMulticall() external returns (address deployedAddress) {
if (multicallAddress[msg.sender] != address(0)) {
revert AlreadyDeployed(multicallAddress[msg.sender]);
}
SolverMulticallV1 multicall = new SolverMulticallV1{salt: bytes32(uint256(uint160(msg.sender)))}(
msg.sender,
address(this)
);
deployedAddress = address(multicall);
multicallAddress[msg.sender] = deployedAddress;
emit MulticallDeployed(msg.sender, deployedAddress);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)
pragma solidity ^0.8.20;
import {Errors} from "./Errors.sol";
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert Errors.FailedCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {Errors.FailedCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
* of an unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {Errors.FailedCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly ("memory-safe") {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.FailedCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of common custom errors used in multiple contracts
*
* IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
* It is recommended to avoid relying on the error API for critical functionality.
*
* _Available since v5.1._
*/
library Errors {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedCall();
/**
* @dev The deployment failed.
*/
error FailedDeployment();
/**
* @dev A necessary precompile is missing.
*/
error MissingPrecompile(address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/// @title Library for decoding call params, tightly encoded into bytes32 and updating calldata
/// Main purpose - decrease amount of calldata passed to Multicall contract
library CallParams {
/*
Encoded call params (256 bits total)
(160 bits) - token address that should be approved/checked `balanceOf(address(this))`
(8 bits) - uint8 index of calldata word which should be replaced with `balanceOf(address(this))`
(8 bits) - uint8 index of calldata word which should be replaced with native balance of smart contract
(8 bits) - uint8 index of calldata word which should adjusted proportionally to `balanceOf(address(this))`
Example usage: adjust `amountOutMin` proportionally to difference between `balanceOf` and `amountIn`
(8 bits) - uint8 index of calldata word which should adjusted proportionally to native balance
Example usage: adjust `amountOutMin` proportionally to difference between address(this).balance and `amountIn`
(8 bits) - uint8 index of calldata word which should be considered as amountIn for approval or proportional amount increase
...
empty bits
...
(1 bit) - boolean, true = should scip actual call
(1 bit) - boolean, true = should approve tokens if required
(1 bit) - boolean, true = should update calldata value proportionally to `balanceOf(address(this))` difference
(1 bit) - boolean, true = should replace calldata value with `balanceOf(address(this))`
(1 bit) - boolean, true = should update calldata value proportionally to native balance difference
(1 bit) - boolean, true = should pass full native balance
*/
type Params is bytes32;
// bits shift right values
uint256 private constant PASS_FULL_NATIVE_BALANCE_SHR = 0;
uint256 private constant REPLACE_NATIVE_BALANCE_SHR = 1;
uint256 private constant PROPORTIONALLY_UPDATE_NATIVE_BALANCE_SHR = 2;
uint256 private constant REPLACE_BALANCE_OF_SHR = 3;
uint256 private constant PROPORTIONALLY_UPDATE_BALANCE_OF_SHR = 4;
uint256 private constant APPROVE_SHR = 5;
uint256 private constant SKIP_CALL_SHR = 6;
uint256 private constant SKIP_CALL_IF_ZERO_TOKENS_SHR = 7;
uint256 private constant SKIP_CALL_IF_ZERO_NATIVE_SHR = 8;
uint256 private constant TOKEN_ADDRESS_SHR = 256 - 160;
uint256 private constant BALANCE_OF_REPLACE_INDEX_SHR = 256 - 160 - 8;
uint256 private constant NATIVE_BALANCE_REPLACE_INDEX_SHR = 256 - 160 - 8 * 2;
uint256 private constant UPDATE_PROPORTIONALLY_TO_BALANCE_OF_INDEX_SHR = 256 - 160 - 8 * 3;
uint256 private constant UPDATE_PROPORTIONALLY_TO_NATIVE_BALANCE_INDEX_SHR = 256 - 160 - 8 * 4;
uint256 private constant AMOUNT_IN_INDEX_SHR = 256 - 160 - 8 * 5;
// Special params
bytes32 private constant SLIPPAGE_CHECK = 0xF000000000000000000000000000000000000000000000000000000000000000;
error InvalidIndex(uint32 startIndex, uint32 calldataLength);
/**
* @notice Returns ERC20 token decoded from params that we want to use for
* - approval in case of `shouldApproveIfRequired`
* - value replacement in case of `shouldReplaceBalanceOf`
* - value update in case of `shouldUpdateProportionallyToBalanceOf`
* @param params Call params
*/
function getToken(Params params) internal pure returns (IERC20 token) {
assembly {
token := and(
shr(TOKEN_ADDRESS_SHR, params),
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
)
}
}
// -------------------------- SPECIAL PARAMS --------------------------
/**
* @notice Returns true slippage check is required
* @param params Call params
* @dev This means no external call will be required. The only thing to do now is check slippage
*/
function checkSlippage(Params params) internal pure returns (bool) {
return Params.unwrap(params) == SLIPPAGE_CHECK;
}
// -------------------------- CALLDATA FUNCTIONS --------------------------
/**
* @notice Updates calldata according to requirements
* @param params Call params
* @param callData Calldata
*/
function updateCallData(
Params params,
bytes memory callData,
uint256 initialMsgValue
) internal view {
if (shouldReplaceBalanceOf(params)) {
// usually for updating `amountIn`
uint256 balance = getToken(params).balanceOf(address(this));
uint8 indexToReplace = getIndexToReplaceWithBalanceOf(params);
if (shouldUpdateProportionallyToBalanceOf(params)) {
// usually for updating `amountOutMin`
uint256 currentValue = getCalldataValueAtIndex(
callData,
indexToReplace
);
uint8 indexToUpdate = getIndexToUpdateProportionallyToBalanceOf(params);
uint256 currentValueToReplace = getCalldataValueAtIndex(
callData,
indexToUpdate
);
// replacing value proportionally to difference with balanceOf amount
replaceCalldataValue(
callData,
indexToUpdate,
currentValueToReplace * balance / currentValue
);
}
replaceCalldataValue(
callData,
indexToReplace,
balance
);
}
// if msg. value doesn't change - no need to update calldata
if (shouldPassFullNativeBalance(params)) {
uint256 nativeBalance = address(this).balance;
if (shouldReplaceNativeBalance(params)) {
uint8 indexToReplace = getIndexToReplaceWithNativeBalance(params);
replaceCalldataValue(
callData,
indexToReplace,
nativeBalance
);
}
if (shouldUpdateProportionallyToNativeBalance(params)) {
uint8 indexToUpdate = getIndexToUpdateProportionallyToNativeBalance(params);
// usually for updating `amountOutMin`
uint256 currentValueToReplace = getCalldataValueAtIndex(
callData,
indexToUpdate
);
// replacing value proportionally to difference with native balance amount
replaceCalldataValue(
callData,
indexToUpdate,
currentValueToReplace * nativeBalance / initialMsgValue
);
}
}
}
/**
* @notice Replaces calldata value at `index` with `newValue`
* @param callData Calldata memory
* @param index Index of 32-byte calldata word to replace
* @param newValue New value to replace with
*/
function replaceCalldataValue(
bytes memory callData,
uint8 index,
uint256 newValue
) internal pure {
uint256 startIndex = getStartIndex(callData.length, index);
assembly {
mstore(add(callData, startIndex), newValue)
}
}
/**
* @notice Gets uint256 calldata value from specific index
* @param callData Calldata memory
* @param index Index of 32-byte calldata word to get
* @return value uint256 value
*/
function getCalldataValueAtIndex(
bytes memory callData,
uint8 index
) internal pure returns(uint256 value) {
uint256 startIndex = getStartIndex(callData.length, index);
assembly {
value := mload(add(callData, startIndex))
}
}
/**
* @notice Gets amountIn value for approval (amountToSpend)
* @param params Call params
* @param callData Calldata memory
* @return amountIn Amount of tokens that expected to be spent
*/
function getAmountIn(
Params params,
bytes memory callData
) internal pure returns(uint256 amountIn) {
uint256 startIndex = getStartIndex(
callData.length,
getIndexOfAmountIn(params)
);
assembly {
amountIn := mload(add(callData, startIndex))
}
}
/**
* @notice Gets start index for specific value in calldata
* @param callDataLength Calldata length
* @param index Index of 32-byte calldata word
* @return startIndex Start index of value in calldata
*/
function getStartIndex(uint256 callDataLength, uint256 index) private pure returns(uint256 startIndex) {
// 32 for prefix + 4 for selector
startIndex = 32 + 4 + index * 32;
if (startIndex > callDataLength) {
revert InvalidIndex(uint32(startIndex), uint32(callDataLength));
}
}
/**
* @notice Do we want to skip call? Checks all possible conditions to skip the call
* @param params Call params
*/
function shouldSkipCall(Params params) internal view returns (bool) {
if (shouldSkipCallUnconditionally(params)) return true;
if (shouldSkipCallIfZeroERC20Tokens(params)) {
uint256 balance = getToken(params).balanceOf(address(this));
if (balance == 0) return true;
}
if (shouldSkipCallIfZeroNativeTokens(params)) {
uint256 nativeBalance = address(this).balance;
return nativeBalance == 0;
}
return false;
}
// -------------------------- BOOLEAN ENCODING --------------------------
/**
* @notice Should this call pass all smart contracts native balance as `msg.value`?
* @param params Call params
*/
function shouldPassFullNativeBalance(Params params) internal pure returns (bool value) {
assembly {value := and(shr(PASS_FULL_NATIVE_BALANCE_SHR, params), 1)}
}
/**
* @notice Do we want to update calldata value proportionally to difference
* between native tokens balance and value at `indexOfAmountIn` in calldata
* {newValue} = {oldValue} * {nativeBalance} / {amountIn}?
* @param params Call params
*/
function shouldUpdateProportionallyToNativeBalance(Params params) internal pure returns (bool value) {
assembly {value := and(shr(PROPORTIONALLY_UPDATE_NATIVE_BALANCE_SHR, params), 1)}
}
/**
* @notice do we want to replace calldata value with amount
* of ERC20 tokens available at the moment before the call? (`balanceOf(address(this))`)
* @param params Call params
*/
function shouldReplaceBalanceOf(Params params) internal pure returns (bool value) {
assembly {value := and(shr(REPLACE_BALANCE_OF_SHR, params), 1)}
}
/**
* @notice Do we want to replace calldata value with amount
* of native tokens available at the moment before the call?
* @param params Call params
*/
function shouldReplaceNativeBalance(Params params) internal pure returns (bool value) {
assembly {value := and(shr(REPLACE_NATIVE_BALANCE_SHR, params), 1)}
}
/**
* @notice Do we want to update calldata value proportionally to difference
* between ERC20 tokens balance and value at `indexOfAmountIn` in calldata
* {newValue} = {oldValue} * {erc20Balance} / {amountIn}?
* @param params Call params
*/
function shouldUpdateProportionallyToBalanceOf(Params params) internal pure returns (bool value) {
assembly {value := and(shr(PROPORTIONALLY_UPDATE_BALANCE_OF_SHR, params), 1)}
}
/**
* @notice Do we want to approve ERC20 token to the target we're about to call?
* (usually it's a router contract)
* @param params Call params
*/
function shouldApproveIfRequired(Params params) internal pure returns (bool value) {
assembly {value := and(shr(APPROVE_SHR, params), 1)}
}
/**
* @notice Do we want to skip actual call no matter what. Usually will be used if only
* approval is required
* @param params Call params
*/
function shouldSkipCallUnconditionally(Params params) internal pure returns (bool value) {
assembly {value := and(shr(SKIP_CALL_SHR, params), 1)}
}
/**
* @notice Do we want to skip actual call if ERC20 token balance is zero. Can be used to skip
* transfer of remaining tokens if there are none
* @param params Call params
*/
function shouldSkipCallIfZeroERC20Tokens(Params params) internal pure returns (bool value) {
assembly {value := and(shr(SKIP_CALL_IF_ZERO_TOKENS_SHR, params), 1)}
}
/**
* @notice Do we want to skip actual call if native token balance is zero. Can be used to skip
* transfer of remaining tokens if there are none
* @param params Call params
*/
function shouldSkipCallIfZeroNativeTokens(Params params) internal pure returns (bool value) {
assembly {value := and(shr(SKIP_CALL_IF_ZERO_NATIVE_SHR, params), 1)}
}
// -------------------------- INDEX ENCODING --------------------------
/**
* @notice Returns index of calldata value that should be replaced with balanceOf amount
* @param params Call params
*/
function getIndexToReplaceWithBalanceOf(Params params) internal pure returns (uint8 index) {
assembly {index := and(shr(BALANCE_OF_REPLACE_INDEX_SHR, params), 0xFF)}
}
/**
* @notice Returns index of calldata value that should be updated proportionally to token balanceOf
* @param params Call params
*/
function getIndexToUpdateProportionallyToBalanceOf(Params params) internal pure returns (uint8 index) {
assembly {index := and(shr(UPDATE_PROPORTIONALLY_TO_BALANCE_OF_INDEX_SHR, params), 0xFF)}
}
/**
* @notice Returns index of calldata value that should be replaced with native balance
* @param params Call params
*/
function getIndexToReplaceWithNativeBalance(Params params) internal pure returns (uint8 index) {
assembly {index := and(shr(NATIVE_BALANCE_REPLACE_INDEX_SHR, params), 0xFF)}
}
/**
* @notice Returns index of calldata value that should be updated proportionally to native balance
* @param params Call params
*/
function getIndexToUpdateProportionallyToNativeBalance(Params params) internal pure returns (uint8 index) {
assembly {index := and(shr(UPDATE_PROPORTIONALLY_TO_NATIVE_BALANCE_INDEX_SHR, params), 0xFF)}
}
/**
* @notice Returns index of value in calldata that should be considered as
* {amountIn} in case of `shouldUpdateProportionallyToNativeBalance`
* and `shouldUpdateProportionallyToBalanceOf` calculations
* @param params Call params
*/
function getIndexOfAmountIn(Params params) internal pure returns (uint8 index) {
assembly {index := and(shr(AMOUNT_IN_INDEX_SHR, params), 0xFF)}
}
}{
"optimizer": {
"enabled": true,
"runs": 999999
},
"metadata": {
"bytecodeHash": "ipfs"
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_solver","type":"address"},{"internalType":"address","name":"_factory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"balanceIndex","type":"uint256"},{"internalType":"uint256","name":"received","type":"uint256"}],"name":"BelowAmountOutMin","type":"error"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"bytes","name":"errorData","type":"bytes"}],"name":"CallFailed","type":"error"},{"inputs":[{"internalType":"uint32","name":"startIndex","type":"uint32"},{"internalType":"uint32","name":"calldataLength","type":"uint32"}],"name":"InvalidIndex","type":"error"},{"inputs":[],"name":"NotASolver","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"CallParams.Params","name":"params","type":"bytes32"},{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"msgValue","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct SolverMulticallV1.Call[]","name":"calls","type":"tuple[]"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"minAmount","type":"uint256"}],"internalType":"struct SolverMulticallV1.BalanceCheck[]","name":"balanceChecks","type":"tuple[]"}],"name":"multicall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"solver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
0x60c060405234801561001057600080fd5b506040516111e53803806111e583398101604081905261002f91610062565b6001600160a01b039182166080521660a052610095565b80516001600160a01b038116811461005d57600080fd5b919050565b6000806040838503121561007557600080fd5b61007e83610046565b915061008c60208401610046565b90509250929050565b60805160a0516111266100bf600039600060b30152600081816056015261010201526111266000f3fe6080604052600436106100385760003560e01c806349a7a26d14610044578063c45a0155146100a1578063ebdf0563146100d557600080fd5b3661003f57005b600080fd5b34801561005057600080fd5b506100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100ad57600080fd5b506100787f000000000000000000000000000000000000000000000000000000000000000081565b6100e86100e3366004610d43565b6100ea565b005b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610159576040517f95b2fb6900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff81111561017457610174610c27565b60405190808252806020026020018201604052801561019d578160200160208202803683370190505b50905060005b8281101561022a576102058484838181106101c0576101c0610f47565b6101d69260206060909202019081019150610f76565b8585848181106101e8576101e8610f47565b90506060020160200160208101906102009190610f76565b6104aa565b82828151811061021757610217610f47565b60209081029190910101526001016101a3565b5060005b84518110156104a357600085828151811061024b5761024b610f47565b6020026020010151905061028281600001517ff0000000000000000000000000000000000000000000000000000000000000001490565b1561036b5760005b848110156103645760008482815181106102a6576102a6610f47565b60200260200101516102eb8888858181106102c3576102c3610f47565b6102d99260206060909202019081019150610f76565b8989868181106101e8576101e8610f47565b6102f59190610fc7565b905086868381811061030957610309610f47565b9050606002016040013581101561035b576040517f18889b4200000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044015b60405180910390fd5b5060010161028a565b505061049b565b60608101516040820151825161038292909161057e565b80516103919060051c60011690565b156103b95780516103b99060601c6020830151606084015184516103b49161072d565b610756565b80516103c490610863565b156103cf575061049b565b8051600116156103e0574760408201525b600080826020015173ffffffffffffffffffffffffffffffffffffffff16836040015184606001516040516104159190610ffe565b60006040518083038185875af1925050503d8060008114610452576040519150601f19603f3d011682016040523d82523d6000602084013e610457565b606091505b5091509150816104975783816040517f5c0dee5d00000000000000000000000000000000000000000000000000000000815260040161035292919061101a565b5050505b60010161022e565b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff83166104e5575073ffffffffffffffffffffffffffffffffffffffff811631610578565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906370a0823190602401602060405180830381865afa158015610551573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105759190611072565b90505b92915050565b61058b8360031c60011690565b156106af57600061059c8460601c90565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610608573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062c9190611072565b9050600061063d8560581c60ff1690565b905061064c8560041c60011690565b156106a157600061065d8583610963565b9050600061066e8760481c60ff1690565b9050600061067c8783610963565b905061069d87838561068e898661108b565b61069891906110a2565b610980565b5050505b6106ac848284610980565b50505b60018316156107285747600184811c16156106e25760006106d38560501c60ff1690565b90506106e0848284610980565b505b6106ef8460021c60011690565b156107265760006107038560401c60ff1690565b905060006107118583610963565b905061072385838661068e878661108b565b50505b505b505050565b60008061074a83516107428660381c60ff1690565b60ff16610999565b92909201519392505050565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff83811660248301526000919085169063dd62ed3e90604401602060405180830381865afa1580156107cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f09190611072565b9050818110156107265780156108225761082273ffffffffffffffffffffffffffffffffffffffff85168460006109fd565b61072673ffffffffffffffffffffffffffffffffffffffff8516847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6109fd565b60006108728260061c60011690565b1561087f57506001919050565b61088c8260071c60011690565b1561094257600061089d8360601c90565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092d9190611072565b9050806000036109405750600192915050565b505b61094f8260081c60011690565b1561095b575050471590565b506000919050565b60008061097484518460ff16610999565b93909301519392505050565b600061099084518460ff16610999565b93909301525050565b60006109a682602061108b565b6109b19060246110dd565b905082811115610578576040517fec08253d00000000000000000000000000000000000000000000000000000000815263ffffffff808316600483015284166024820152604401610352565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610a898482610b27565b610726576040805173ffffffffffffffffffffffffffffffffffffffff8516602482015260006044808301919091528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610b1d908590610b83565b6107268482610b83565b6000806000806020600086516020880160008a5af192503d91506000519050828015610b7957508115610b5d5780600114610b79565b60008673ffffffffffffffffffffffffffffffffffffffff163b115b9695505050505050565b600080602060008451602086016000885af180610ba6576040513d6000823e3d81fd5b50506000513d91508115610bbe578060011415610bd8565b73ffffffffffffffffffffffffffffffffffffffff84163b155b15610726576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610352565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715610c7957610c79610c27565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610cc657610cc6610c27565b604052919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610cf257600080fd5b919050565b60008083601f840112610d0957600080fd5b50813567ffffffffffffffff811115610d2157600080fd5b602083019150836020606083028501011115610d3c57600080fd5b9250929050565b600080600060408486031215610d5857600080fd5b833567ffffffffffffffff811115610d6f57600080fd5b8401601f81018613610d8057600080fd5b803567ffffffffffffffff811115610d9a57610d9a610c27565b8060051b610daa60208201610c7f565b91825260208184018101929081019089841115610dc657600080fd5b6020850192505b83831015610f0d57823567ffffffffffffffff811115610dec57600080fd5b85016080818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0011215610e2057600080fd5b610e28610c56565b60208201358152610e3b60408301610cce565b602082015260608201356040820152608082013567ffffffffffffffff811115610e6457600080fd5b6020818401019250508b601f830112610e7c57600080fd5b813567ffffffffffffffff811115610e9657610e96610c27565b610ec760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610c7f565b8181528d6020838601011115610edc57600080fd5b8160208501602083013760006020838301015280606084015250508084525050602082019150602083019250610dcd565b96505050506020850135905067ffffffffffffffff811115610f2e57600080fd5b610f3a86828701610cf7565b9497909650939450505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215610f8857600080fd5b610f9182610cce565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561057857610578610f98565b60005b83811015610ff5578181015183820152602001610fdd565b50506000910152565b60008251611010818460208701610fda565b9190910192915050565b828152604060208201526000825180604084015261103f816060850160208701610fda565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b60006020828403121561108457600080fd5b5051919050565b808202811582820484141761057857610578610f98565b6000826110d8577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082018082111561057857610578610f9856fea26469706673582212201b0935c83b9f4877a24d465e1d14c2ab88dc049345c66939f0d63d4561dfaeee64736f6c634300081c00330000000000000000000000009ecdc9af2a8254dde8bbce8778efae695044cc9f0000000000000000000000003ac9a0cdf681d66b1b0483d8fc9db83dcc0bd20b
Deployed Bytecode
0x6080604052600436106100385760003560e01c806349a7a26d14610044578063c45a0155146100a1578063ebdf0563146100d557600080fd5b3661003f57005b600080fd5b34801561005057600080fd5b506100787f0000000000000000000000009ecdc9af2a8254dde8bbce8778efae695044cc9f81565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100ad57600080fd5b506100787f0000000000000000000000003ac9a0cdf681d66b1b0483d8fc9db83dcc0bd20b81565b6100e86100e3366004610d43565b6100ea565b005b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000009ecdc9af2a8254dde8bbce8778efae695044cc9f1614610159576040517f95b2fb6900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff81111561017457610174610c27565b60405190808252806020026020018201604052801561019d578160200160208202803683370190505b50905060005b8281101561022a576102058484838181106101c0576101c0610f47565b6101d69260206060909202019081019150610f76565b8585848181106101e8576101e8610f47565b90506060020160200160208101906102009190610f76565b6104aa565b82828151811061021757610217610f47565b60209081029190910101526001016101a3565b5060005b84518110156104a357600085828151811061024b5761024b610f47565b6020026020010151905061028281600001517ff0000000000000000000000000000000000000000000000000000000000000001490565b1561036b5760005b848110156103645760008482815181106102a6576102a6610f47565b60200260200101516102eb8888858181106102c3576102c3610f47565b6102d99260206060909202019081019150610f76565b8989868181106101e8576101e8610f47565b6102f59190610fc7565b905086868381811061030957610309610f47565b9050606002016040013581101561035b576040517f18889b4200000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044015b60405180910390fd5b5060010161028a565b505061049b565b60608101516040820151825161038292909161057e565b80516103919060051c60011690565b156103b95780516103b99060601c6020830151606084015184516103b49161072d565b610756565b80516103c490610863565b156103cf575061049b565b8051600116156103e0574760408201525b600080826020015173ffffffffffffffffffffffffffffffffffffffff16836040015184606001516040516104159190610ffe565b60006040518083038185875af1925050503d8060008114610452576040519150601f19603f3d011682016040523d82523d6000602084013e610457565b606091505b5091509150816104975783816040517f5c0dee5d00000000000000000000000000000000000000000000000000000000815260040161035292919061101a565b5050505b60010161022e565b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff83166104e5575073ffffffffffffffffffffffffffffffffffffffff811631610578565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906370a0823190602401602060405180830381865afa158015610551573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105759190611072565b90505b92915050565b61058b8360031c60011690565b156106af57600061059c8460601c90565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610608573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062c9190611072565b9050600061063d8560581c60ff1690565b905061064c8560041c60011690565b156106a157600061065d8583610963565b9050600061066e8760481c60ff1690565b9050600061067c8783610963565b905061069d87838561068e898661108b565b61069891906110a2565b610980565b5050505b6106ac848284610980565b50505b60018316156107285747600184811c16156106e25760006106d38560501c60ff1690565b90506106e0848284610980565b505b6106ef8460021c60011690565b156107265760006107038560401c60ff1690565b905060006107118583610963565b905061072385838661068e878661108b565b50505b505b505050565b60008061074a83516107428660381c60ff1690565b60ff16610999565b92909201519392505050565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff83811660248301526000919085169063dd62ed3e90604401602060405180830381865afa1580156107cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f09190611072565b9050818110156107265780156108225761082273ffffffffffffffffffffffffffffffffffffffff85168460006109fd565b61072673ffffffffffffffffffffffffffffffffffffffff8516847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6109fd565b60006108728260061c60011690565b1561087f57506001919050565b61088c8260071c60011690565b1561094257600061089d8360601c90565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092d9190611072565b9050806000036109405750600192915050565b505b61094f8260081c60011690565b1561095b575050471590565b506000919050565b60008061097484518460ff16610999565b93909301519392505050565b600061099084518460ff16610999565b93909301525050565b60006109a682602061108b565b6109b19060246110dd565b905082811115610578576040517fec08253d00000000000000000000000000000000000000000000000000000000815263ffffffff808316600483015284166024820152604401610352565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610a898482610b27565b610726576040805173ffffffffffffffffffffffffffffffffffffffff8516602482015260006044808301919091528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610b1d908590610b83565b6107268482610b83565b6000806000806020600086516020880160008a5af192503d91506000519050828015610b7957508115610b5d5780600114610b79565b60008673ffffffffffffffffffffffffffffffffffffffff163b115b9695505050505050565b600080602060008451602086016000885af180610ba6576040513d6000823e3d81fd5b50506000513d91508115610bbe578060011415610bd8565b73ffffffffffffffffffffffffffffffffffffffff84163b155b15610726576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610352565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715610c7957610c79610c27565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610cc657610cc6610c27565b604052919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610cf257600080fd5b919050565b60008083601f840112610d0957600080fd5b50813567ffffffffffffffff811115610d2157600080fd5b602083019150836020606083028501011115610d3c57600080fd5b9250929050565b600080600060408486031215610d5857600080fd5b833567ffffffffffffffff811115610d6f57600080fd5b8401601f81018613610d8057600080fd5b803567ffffffffffffffff811115610d9a57610d9a610c27565b8060051b610daa60208201610c7f565b91825260208184018101929081019089841115610dc657600080fd5b6020850192505b83831015610f0d57823567ffffffffffffffff811115610dec57600080fd5b85016080818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0011215610e2057600080fd5b610e28610c56565b60208201358152610e3b60408301610cce565b602082015260608201356040820152608082013567ffffffffffffffff811115610e6457600080fd5b6020818401019250508b601f830112610e7c57600080fd5b813567ffffffffffffffff811115610e9657610e96610c27565b610ec760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610c7f565b8181528d6020838601011115610edc57600080fd5b8160208501602083013760006020838301015280606084015250508084525050602082019150602083019250610dcd565b96505050506020850135905067ffffffffffffffff811115610f2e57600080fd5b610f3a86828701610cf7565b9497909650939450505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215610f8857600080fd5b610f9182610cce565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561057857610578610f98565b60005b83811015610ff5578181015183820152602001610fdd565b50506000910152565b60008251611010818460208701610fda565b9190910192915050565b828152604060208201526000825180604084015261103f816060850160208701610fda565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b60006020828403121561108457600080fd5b5051919050565b808202811582820484141761057857610578610f98565b6000826110d8577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082018082111561057857610578610f9856fea26469706673582212201b0935c83b9f4877a24d465e1d14c2ab88dc049345c66939f0d63d4561dfaeee64736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in MON
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.