Source Code
Latest 25 from a total of 84,255 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Fulfill With ERC... | 22898465 | 1 min ago | IN | 0 ETH | 0.00352413 | ||||
Fulfill With ERC... | 22898463 | 1 min ago | IN | 0 ETH | 0.00350177 | ||||
Fulfill With ERC... | 22898447 | 4 mins ago | IN | 0 ETH | 0.00356324 | ||||
Fulfill With ERC... | 22898421 | 9 mins ago | IN | 0 ETH | 0.00478429 | ||||
Fulfill With ERC... | 22898418 | 10 mins ago | IN | 0 ETH | 0.00449624 | ||||
Fulfill With ERC... | 22898412 | 11 mins ago | IN | 0 ETH | 0.00352117 | ||||
Fulfill With ERC... | 22898399 | 14 mins ago | IN | 0 ETH | 0.00359251 | ||||
Fulfill With Eth | 22898395 | 15 mins ago | IN | 0.69134049 ETH | 0.00237955 | ||||
Fulfill With ERC... | 22898355 | 23 mins ago | IN | 0 ETH | 0.00279671 | ||||
Fulfill With ERC... | 22898331 | 28 mins ago | IN | 0 ETH | 0.00273583 | ||||
Fulfill With ERC... | 22898314 | 31 mins ago | IN | 0 ETH | 0.00231573 | ||||
Fulfill With ERC... | 22898313 | 31 mins ago | IN | 0 ETH | 0.00031684 | ||||
Fulfill With ERC... | 22898313 | 31 mins ago | IN | 0 ETH | 0.00215494 | ||||
Fulfill With ERC... | 22898275 | 39 mins ago | IN | 0 ETH | 0.00250735 | ||||
Fulfill With ERC... | 22898268 | 40 mins ago | IN | 0 ETH | 0.00195269 | ||||
Fulfill With ERC... | 22898261 | 42 mins ago | IN | 0 ETH | 0.00222143 | ||||
Fulfill With ERC... | 22898247 | 44 mins ago | IN | 0 ETH | 0.00232166 | ||||
Fulfill With ERC... | 22898246 | 45 mins ago | IN | 0 ETH | 0.00205432 | ||||
Fulfill With ERC... | 22898217 | 50 mins ago | IN | 0 ETH | 0.00257341 | ||||
Fulfill With ERC... | 22898210 | 52 mins ago | IN | 0 ETH | 0.00236727 | ||||
Fulfill With ERC... | 22898210 | 52 mins ago | IN | 0 ETH | 0.00304612 | ||||
Fulfill With ERC... | 22898170 | 1 hr ago | IN | 0 ETH | 0.00243814 | ||||
Fulfill With ERC... | 22898157 | 1 hr ago | IN | 0 ETH | 0.00229778 | ||||
Fulfill With ERC... | 22898153 | 1 hr ago | IN | 0 ETH | 0.00212544 | ||||
Fulfill With ERC... | 22898125 | 1 hr ago | IN | 0 ETH | 0.00252788 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Method | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|---|
Fulfill Order | 22898447 | 4 mins ago | 0.00761385 ETH | ||||
Transfer | 22898447 | 4 mins ago | 0.00761385 ETH | ||||
Swap Wrap | 22898395 | 15 mins ago | 0.69134049 ETH | ||||
Fulfill Order | 22898355 | 23 mins ago | 0.00910262 ETH | ||||
Transfer | 22898355 | 23 mins ago | 0.00910262 ETH | ||||
Fulfill Order | 22898268 | 40 mins ago | 0.04115622 ETH | ||||
Transfer | 22898268 | 40 mins ago | 0.04115622 ETH | ||||
Fulfill Order | 22898246 | 45 mins ago | 0.02970359 ETH | ||||
Transfer | 22898246 | 45 mins ago | 0.02970359 ETH | ||||
Fulfill Order | 22898109 | 1 hr ago | 0.12568852 ETH | ||||
Transfer | 22898109 | 1 hr ago | 0.12568852 ETH | ||||
Fulfill Order | 22898065 | 1 hr ago | 0.00255184 ETH | ||||
Transfer | 22898065 | 1 hr ago | 0.00255184 ETH | ||||
Fulfill Order | 22898064 | 1 hr ago | 0.69977661 ETH | ||||
Transfer | 22898064 | 1 hr ago | 0.69977661 ETH | ||||
Fulfill Order | 22898038 | 1 hr ago | 0.00856512 ETH | ||||
Transfer | 22898038 | 1 hr ago | 0.00856512 ETH | ||||
Fulfill Order | 22898008 | 1 hr ago | 0.02358272 ETH | ||||
Transfer | 22898008 | 1 hr ago | 0.02358272 ETH | ||||
Fulfill Order | 22897997 | 1 hr ago | 0.0035997 ETH | ||||
Transfer | 22897997 | 1 hr ago | 0.0035997 ETH | ||||
Fulfill Order | 22897960 | 1 hr ago | 0.00914001 ETH | ||||
Transfer | 22897960 | 1 hr ago | 0.00914001 ETH | ||||
Fulfill Order | 22897956 | 1 hr ago | 0.0790297 ETH | ||||
Transfer | 22897956 | 1 hr ago | 0.0790297 ETH |
Loading...
Loading
Contract Name:
FulfillHelper
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IFeeManager.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; contract FulfillHelper { using SafeERC20 for IERC20; address public guardian; address public nextGuardian; mapping(address => bool) public swapProtocols; mapping(address => bool) public mayanProtocols; error UnsupportedProtocol(); struct PermitParams { uint256 value; uint256 deadline; uint8 v; bytes32 r; bytes32 s; } constructor(address _guardian, address[] memory _swapProtocols, address[] memory _mayanProtocols) { guardian = _guardian; for (uint256 i = 0; i < _swapProtocols.length; i++) { swapProtocols[_swapProtocols[i]] = true; } for (uint256 i = 0; i < _mayanProtocols.length; i++) { mayanProtocols[_mayanProtocols[i]] = true; } } function directFulfill( address tokenIn, uint256 amountIn, address mayanProtocol, bytes calldata mayanData, PermitParams calldata permitParams ) external payable { if (!mayanProtocols[mayanProtocol]) { revert UnsupportedProtocol(); } pullTokenIn(tokenIn, amountIn, permitParams); maxApproveIfNeeded(tokenIn, mayanProtocol, amountIn); (bool success, bytes memory returnedData) = mayanProtocol.call{value: msg.value}(mayanData); if (!success) { if (returnedData.length > 0) { assembly { let returndata_size := mload(returnedData) revert(add(32, returnedData), returndata_size) } } else { revert('Mayan protocol call failed'); } } } function fulfillWithEth( uint256 amountIn, address fulfillToken, address swapProtocol, bytes calldata swapData, address mayanProtocol, bytes calldata mayanData ) external payable { if (!swapProtocols[swapProtocol] || !mayanProtocols[mayanProtocol]) { revert UnsupportedProtocol(); } require(fulfillToken != address(0), 'Invalid fulfill token'); require(msg.value >= amountIn, 'Insufficient input value'); uint256 fulfillAmount = IERC20(fulfillToken).balanceOf(address(this)); (bool success, bytes memory returnedData) = swapProtocol.call{value: amountIn}(swapData); if (!success) { if (returnedData.length > 0) { assembly { let returndata_size := mload(returnedData) revert(add(32, returnedData), returndata_size) } } else { revert('Swap protocol call failed'); } } fulfillAmount = IERC20(fulfillToken).balanceOf(address(this)) - fulfillAmount; bytes memory modifiedData = replaceFulfillAmount(mayanData, fulfillAmount); maxApproveIfNeeded(fulfillToken, mayanProtocol, fulfillAmount); (success, returnedData) = mayanProtocol.call{value: msg.value - amountIn}(modifiedData); if (!success) { if (returnedData.length > 0) { assembly { let returndata_size := mload(returnedData) revert(add(32, returnedData), returndata_size) } } else { revert('Mayan protocol call failed'); } } } function fulfillWithERC20( address tokenIn, uint256 amountIn, address fulfillToken, address swapProtocol, bytes calldata swapData, address mayanProtocol, bytes calldata mayanData, PermitParams calldata permitParams ) external payable { if (!swapProtocols[swapProtocol] || !mayanProtocols[mayanProtocol]) { revert UnsupportedProtocol(); } pullTokenIn(tokenIn, amountIn, permitParams); maxApproveIfNeeded(tokenIn, swapProtocol, amountIn); uint256 fulfillAmount; if (fulfillToken == address(0)) { fulfillAmount = address(this).balance; } else { fulfillAmount = IERC20(fulfillToken).balanceOf(address(this)); } (bool success, bytes memory returnedData) = swapProtocol.call(swapData); if (!success) { if (returnedData.length > 0) { assembly { let returndata_size := mload(returnedData) revert(add(32, returnedData), returndata_size) } } else { revert('Swap protocol call failed'); } } transferBackRemaining(tokenIn, amountIn); if (fulfillToken == address(0)) { fulfillAmount = address(this).balance - fulfillAmount; } else { fulfillAmount = IERC20(fulfillToken).balanceOf(address(this)) - fulfillAmount; } bytes memory modifiedData = replaceFulfillAmount(mayanData, fulfillAmount); if (fulfillToken == address(0)) { (success, returnedData) = mayanProtocol.call{value: msg.value + fulfillAmount}(modifiedData); } else { maxApproveIfNeeded(fulfillToken, mayanProtocol, fulfillAmount); (success, returnedData) = mayanProtocol.call{value: msg.value}(modifiedData); } if (!success) { if (returnedData.length > 0) { assembly { let returndata_size := mload(returnedData) revert(add(32, returnedData), returndata_size) } } else { revert('Mayan protocol call failed'); } } } function replaceFulfillAmount(bytes calldata mayanData, uint256 fulfillAmount) internal pure returns(bytes memory) { require(mayanData.length >= 36, "Mayan data too short"); bytes memory modifiedData = new bytes(mayanData.length); // Copy the function selector for (uint i = 0; i < 4; i++) { modifiedData[i] = mayanData[i]; } // Encode the amount and place it into the modified call data // Starting from byte 4 to byte 35 (32 bytes for uint256) bytes memory encodedAmount = abi.encode(fulfillAmount); for (uint i = 0; i < 32; i++) { modifiedData[i + 4] = encodedAmount[i]; } // Copy the rest of the original data after the first argument for (uint i = 36; i < mayanData.length; i++) { modifiedData[i] = mayanData[i]; } return modifiedData; } function transferBackRemaining(address token, uint256 maxAmount) internal { uint256 remaining = IERC20(token).balanceOf(address(this)); if (remaining > 0 && remaining <= maxAmount) { IERC20(token).safeTransfer(msg.sender, remaining); } } function maxApproveIfNeeded(address tokenAddr, address spender, uint256 amount) internal { IERC20 token = IERC20(tokenAddr); uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < amount) { token.safeApprove(spender, 0); token.safeApprove(spender, type(uint256).max); } } function pullTokenIn( address tokenIn, uint256 amountIn, PermitParams calldata permitParams ) internal { uint256 allowance = IERC20(tokenIn).allowance(msg.sender, address(this)); if (allowance < amountIn) { execPermit(tokenIn, msg.sender, permitParams); } IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), amountIn); } function execPermit( address token, address owner, PermitParams calldata permitParams ) internal { IERC20Permit(token).permit( owner, address(this), permitParams.value, permitParams.deadline, permitParams.v, permitParams.r, permitParams.s ); } function rescueToken(address token, uint256 amount, address to) public { require(msg.sender == guardian, 'only guardian'); IERC20(token).safeTransfer(to, amount); } function rescueEth(uint256 amount, address payable to) public { require(msg.sender == guardian, 'only guardian'); require(to != address(0), 'transfer to the zero address'); to.transfer(amount); } function changeGuardian(address newGuardian) public { require(msg.sender == guardian, 'only guardian'); nextGuardian = newGuardian; } function claimGuardian() public { require(msg.sender == nextGuardian, 'only next guardian'); guardian = nextGuardian; } function setSwapProtocol(address swapProtocol, bool enabled) public { require(msg.sender == guardian, 'only guardian'); swapProtocols[swapProtocol] = enabled; } function setMayanProtocol(address mayanProtocol, bool enabled) public { require(msg.sender == guardian, 'only guardian'); mayanProtocols[mayanProtocol] = enabled; } receive() external payable {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. 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. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IFeeManager { event ProtocolFeeCalced(uint8 bps); event FeeDeposited(address relayer, address token, uint256 amount); event FeeWithdrawn(address token, uint256 amount); function calcProtocolBps( uint64 amountIn, address tokenIn, bytes32 tokenOut, uint16 destChain, uint8 referrerBps ) external returns (uint8); function feeCollector() external view returns (address); function depositRelayerFee(address relayer, address token, uint256 amount) payable external; function withdrawRelayerFee(address token, uint256 amount) external; }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_guardian","type":"address"},{"internalType":"address[]","name":"_swapProtocols","type":"address[]"},{"internalType":"address[]","name":"_mayanProtocols","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"UnsupportedProtocol","type":"error"},{"inputs":[{"internalType":"address","name":"newGuardian","type":"address"}],"name":"changeGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"mayanProtocol","type":"address"},{"internalType":"bytes","name":"mayanData","type":"bytes"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct FulfillHelper.PermitParams","name":"permitParams","type":"tuple"}],"name":"directFulfill","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"fulfillToken","type":"address"},{"internalType":"address","name":"swapProtocol","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"},{"internalType":"address","name":"mayanProtocol","type":"address"},{"internalType":"bytes","name":"mayanData","type":"bytes"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct FulfillHelper.PermitParams","name":"permitParams","type":"tuple"}],"name":"fulfillWithERC20","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"fulfillToken","type":"address"},{"internalType":"address","name":"swapProtocol","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"},{"internalType":"address","name":"mayanProtocol","type":"address"},{"internalType":"bytes","name":"mayanData","type":"bytes"}],"name":"fulfillWithEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"guardian","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mayanProtocols","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextGuardian","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"}],"name":"rescueEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"rescueToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"mayanProtocol","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setMayanProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"swapProtocol","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setSwapProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"swapProtocols","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162001dd738038062001dd783398101604081905262000034916200021b565b600080546001600160a01b0319166001600160a01b0385161781555b8251811015620000c8576001600260008584815181106200008157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620000bf8162000295565b91505062000050565b5060005b81518110156200014457600160036000848481518110620000fd57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806200013b8162000295565b915050620000cc565b50505050620002d3565b80516001600160a01b03811681146200016657600080fd5b919050565b600082601f8301126200017c578081fd5b815160206001600160401b03808311156200019b576200019b620002bd565b8260051b604051601f19603f83011681018181108482111715620001c357620001c3620002bd565b60405284815283810192508684018288018501891015620001e2578687fd5b8692505b858310156200020f57620001fa816200014e565b845292840192600192909201918401620001e6565b50979650505050505050565b60008060006060848603121562000230578283fd5b6200023b846200014e565b60208501519093506001600160401b038082111562000258578384fd5b62000266878388016200016b565b935060408601519150808211156200027c578283fd5b506200028b868287016200016b565b9150509250925092565b6000600019821415620002b657634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b611af480620002e36000396000f3fe6080604052600436106100c65760003560e01c80637fc920eb1161007f578063b25ea8fb11610059578063b25ea8fb1461020c578063bc127b881461022c578063f8a67a621461023f578063ffe805411461025f57600080fd5b80637fc920eb1461018c578063a44382fe146101ac578063af56ca03146101cc57600080fd5b80631c5cf072146100d25780632fcb4f04146100e7578063452a932014610107578063459656ee146101445780634818e84d146101595780636befa3a51461017957600080fd5b366100cd57005b600080fd5b6100e56100e03660046118b5565b61028f565b005b3480156100f357600080fd5b506100e561010236600461166a565b610643565b34801561011357600080fd5b50600054610127906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015057600080fd5b506100e561068f565b34801561016557600080fd5b50600154610127906001600160a01b031681565b6100e56101873660046117db565b610702565b34801561019857600080fd5b506100e56101a736600461168d565b6107d5565b3480156101b857600080fd5b506100e56101c736600461168d565b61082a565b3480156101d857600080fd5b506101fc6101e736600461166a565b60036020526000908152604090205460ff1681565b604051901515815260200161013b565b34801561021857600080fd5b506100e5610227366004611891565b61087f565b6100e561023a366004611706565b61093a565b34801561024b57600080fd5b506100e561025a3660046116c5565b610c86565b34801561026b57600080fd5b506101fc61027a36600461166a565b60026020526000908152604090205460ff1681565b6001600160a01b03861660009081526002602052604090205460ff1615806102d057506001600160a01b03831660009081526003602052604090205460ff16155b156102ee5760405163743f26e160e01b815260040160405180910390fd5b6001600160a01b0387166103415760405162461bcd60e51b815260206004820152601560248201527424b73b30b634b210333ab63334b636103a37b5b2b760591b60448201526064015b60405180910390fd5b873410156103915760405162461bcd60e51b815260206004820152601860248201527f496e73756666696369656e7420696e7075742076616c756500000000000000006044820152606401610338565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a082319060240160206040518083038186803b1580156103d357600080fd5b505afa1580156103e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040b9190611879565b9050600080886001600160a01b03168b898960405161042b929190611986565b60006040518083038185875af1925050503d8060008114610468576040519150601f19603f3d011682016040523d82523d6000602084013e61046d565b606091505b5091509150816104cf578051156104875780518082602001fd5b60405162461bcd60e51b815260206004820152601960248201527f537761702070726f746f636f6c2063616c6c206661696c6564000000000000006044820152606401610338565b6040516370a0823160e01b815230600482015283906001600160a01b038c16906370a082319060240160206040518083038186803b15801561051057600080fd5b505afa158015610524573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105489190611879565b6105529190611a24565b92506000610561868686610cc4565b905061056e8b8886610f22565b6001600160a01b0387166105828d34611a24565b826040516105909190611996565b60006040518083038185875af1925050503d80600081146105cd576040519150601f19603f3d011682016040523d82523d6000602084013e6105d2565b606091505b50909350915082610635578151156105ed5781518083602001fd5b60405162461bcd60e51b815260206004820152601a60248201527f4d6179616e2070726f746f636f6c2063616c6c206661696c65640000000000006044820152606401610338565b505050505050505050505050565b6000546001600160a01b0316331461066d5760405162461bcd60e51b8152600401610338906119e5565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146106de5760405162461bcd60e51b815260206004820152601260248201527137b7363c903732bc3a1033bab0b93234b0b760711b6044820152606401610338565b600154600080546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b03841660009081526003602052604090205460ff1661073b5760405163743f26e160e01b815260040160405180910390fd5b610746868683610fe2565b610751868587610f22565b600080856001600160a01b031634868660405161076f929190611986565b60006040518083038185875af1925050503d80600081146107ac576040519150601f19603f3d011682016040523d82523d6000602084013e6107b1565b606091505b5091509150816107cb578051156105ed5780518082602001fd5b5050505050505050565b6000546001600160a01b031633146107ff5760405162461bcd60e51b8152600401610338906119e5565b6001600160a01b03919091166000908152600260205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108545760405162461bcd60e51b8152600401610338906119e5565b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108a95760405162461bcd60e51b8152600401610338906119e5565b6001600160a01b0381166108ff5760405162461bcd60e51b815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610338565b6040516001600160a01b0382169083156108fc029084906000818181858888f19350505050158015610935573d6000803e3d6000fd5b505050565b6001600160a01b03871660009081526002602052604090205460ff16158061097b57506001600160a01b03841660009081526003602052604090205460ff16155b156109995760405163743f26e160e01b815260040160405180910390fd5b6109a48a8a83610fe2565b6109af8a888b610f22565b60006001600160a01b0389166109c6575047610a40565b6040516370a0823160e01b81523060048201526001600160a01b038a16906370a082319060240160206040518083038186803b158015610a0557600080fd5b505afa158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3d9190611879565b90505b600080896001600160a01b03168989604051610a5d929190611986565b6000604051808303816000865af19150503d8060008114610a9a576040519150601f19603f3d011682016040523d82523d6000602084013e610a9f565b606091505b509150915081610ab9578051156104875780518082602001fd5b610ac38d8d611092565b6001600160a01b038b16610ae257610adb8347611a24565b9250610b68565b6040516370a0823160e01b815230600482015283906001600160a01b038d16906370a082319060240160206040518083038186803b158015610b2357600080fd5b505afa158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190611879565b610b659190611a24565b92505b6000610b75878786610cc4565b90506001600160a01b038c16610bf4576001600160a01b038816610b998534611a0c565b82604051610ba79190611996565b60006040518083038185875af1925050503d8060008114610be4576040519150601f19603f3d011682016040523d82523d6000602084013e610be9565b606091505b509093509150610c61565b610bff8c8986610f22565b876001600160a01b03163482604051610c189190611996565b60006040518083038185875af1925050503d8060008114610c55576040519150601f19603f3d011682016040523d82523d6000602084013e610c5a565b606091505b5090935091505b82610c76578151156105ed5781518083602001fd5b5050505050505050505050505050565b6000546001600160a01b03163314610cb05760405162461bcd60e51b8152600401610338906119e5565b6109356001600160a01b0384168284611133565b60606024831015610d0e5760405162461bcd60e51b815260206004820152601460248201527313585e585b8819185d18481d1bdbc81cda1bdc9d60621b6044820152606401610338565b60008367ffffffffffffffff811115610d3757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610d61576020820181803683370190505b50905060005b6004811015610de357858582818110610d9057634e487b7160e01b600052603260045260246000fd5b9050013560f81c60f81b828281518110610dba57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080610ddb81611a67565b915050610d67565b50600083604051602001610df991815260200190565b604051602081830303815290604052905060005b6020811015610e9857818181518110610e3657634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b03191683610e51836004611a0c565b81518110610e6f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080610e9081611a67565b915050610e0d565b5060245b85811015610f1757868682818110610ec457634e487b7160e01b600052603260045260246000fd5b9050013560f81c60f81b838281518110610eee57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080610f0f81611a67565b915050610e9c565b509095945050505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152849160009183169063dd62ed3e9060440160206040518083038186803b158015610f6e57600080fd5b505afa158015610f82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa69190611879565b905082811015610fdb57610fc56001600160a01b038316856000611196565b610fdb6001600160a01b03831685600019611196565b5050505050565b604051636eb1769f60e11b81523360048201523060248201526000906001600160a01b0385169063dd62ed3e9060440160206040518083038186803b15801561102a57600080fd5b505afa15801561103e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110629190611879565b905082811015611077576110778433846112ba565b61108c6001600160a01b038516333086611372565b50505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a082319060240160206040518083038186803b1580156110d457600080fd5b505afa1580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c9190611879565b905060008111801561111e5750818111155b15610935576109356001600160a01b03841633835b6040516001600160a01b03831660248201526044810182905261093590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526113aa565b80158061121f5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156111e557600080fd5b505afa1580156111f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121d9190611879565b155b61128a5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610338565b6040516001600160a01b03831660248201526044810182905261093590849063095ea7b360e01b9060640161115f565b6001600160a01b03831663d505accf8330843560208601356112e26060880160408901611965565b6040516001600160e01b031960e088901b1681526001600160a01b0395861660048201529490931660248501526044840191909152606483015260ff166084820152606084013560a4820152608084013560c482015260e401600060405180830381600087803b15801561135557600080fd5b505af1158015611369573d6000803e3d6000fd5b50505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261108c9085906323b872dd60e01b9060840161115f565b60006113ff826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661147f9092919063ffffffff16565b9050805160001480611420575080806020019051810190611420919061185d565b6109355760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610338565b606061148e8484600085611496565b949350505050565b6060824710156114f75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610338565b600080866001600160a01b031685876040516115139190611996565b60006040518083038185875af1925050503d8060008114611550576040519150601f19603f3d011682016040523d82523d6000602084013e611555565b606091505b509150915061156687838387611571565b979650505050505050565b606083156115dd5782516115d6576001600160a01b0385163b6115d65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610338565b508161148e565b61148e83838151156115f25781518083602001fd5b8060405162461bcd60e51b815260040161033891906119b2565b60008083601f84011261161d578182fd5b50813567ffffffffffffffff811115611634578182fd5b60208301915083602082850101111561164c57600080fd5b9250929050565b600060a08284031215611664578081fd5b50919050565b60006020828403121561167b578081fd5b813561168681611a98565b9392505050565b6000806040838503121561169f578081fd5b82356116aa81611a98565b915060208301356116ba81611ab0565b809150509250929050565b6000806000606084860312156116d9578081fd5b83356116e481611a98565b92506020840135915060408401356116fb81611a98565b809150509250925092565b6000806000806000806000806000806101808b8d031215611725578586fd5b8a3561173081611a98565b995060208b0135985060408b013561174781611a98565b975060608b013561175781611a98565b965060808b013567ffffffffffffffff80821115611773578788fd5b61177f8e838f0161160c565b909850965060a08d0135915061179482611a98565b90945060c08c013590808211156117a9578485fd5b506117b68d828e0161160c565b90945092506117ca90508c60e08d01611653565b90509295989b9194979a5092959850565b60008060008060008061012087890312156117f4578182fd5b86356117ff81611a98565b955060208701359450604087013561181681611a98565b9350606087013567ffffffffffffffff811115611831578283fd5b61183d89828a0161160c565b909450925061185190508860808901611653565b90509295509295509295565b60006020828403121561186e578081fd5b815161168681611ab0565b60006020828403121561188a578081fd5b5051919050565b600080604083850312156118a3578182fd5b8235915060208301356116ba81611a98565b60008060008060008060008060c0898b0312156118d0578384fd5b8835975060208901356118e281611a98565b965060408901356118f281611a98565b9550606089013567ffffffffffffffff8082111561190e578586fd5b61191a8c838d0161160c565b909750955060808b0135915061192f82611a98565b90935060a08a01359080821115611944578384fd5b506119518b828c0161160c565b999c989b5096995094979396929594505050565b600060208284031215611976578081fd5b813560ff81168114611686578182fd5b8183823760009101908152919050565b600082516119a8818460208701611a3b565b9190910192915050565b60208152600082518060208401526119d1816040850160208701611a3b565b601f01601f19169190910160400192915050565b6020808252600d908201526c37b7363c9033bab0b93234b0b760991b604082015260600190565b60008219821115611a1f57611a1f611a82565b500190565b600082821015611a3657611a36611a82565b500390565b60005b83811015611a56578181015183820152602001611a3e565b8381111561108c5750506000910152565b6000600019821415611a7b57611a7b611a82565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114611aad57600080fd5b50565b8015158114611aad57600080fdfea2646970667358221220fa899b4fb5d03e20301f7ac2ca88a96bca29a6faa43a7fc4bf14cdb13bd4bcdf64736f6c63430008040033000000000000000000000000933e3922e04d47a466e60a20e486b372b64f1ea8000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000111111125421ca6dc452d289314280a0f8842a650000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c38e4e6a15593f908255214653d3d947ca1c2338
Deployed Bytecode
0x6080604052600436106100c65760003560e01c80637fc920eb1161007f578063b25ea8fb11610059578063b25ea8fb1461020c578063bc127b881461022c578063f8a67a621461023f578063ffe805411461025f57600080fd5b80637fc920eb1461018c578063a44382fe146101ac578063af56ca03146101cc57600080fd5b80631c5cf072146100d25780632fcb4f04146100e7578063452a932014610107578063459656ee146101445780634818e84d146101595780636befa3a51461017957600080fd5b366100cd57005b600080fd5b6100e56100e03660046118b5565b61028f565b005b3480156100f357600080fd5b506100e561010236600461166a565b610643565b34801561011357600080fd5b50600054610127906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015057600080fd5b506100e561068f565b34801561016557600080fd5b50600154610127906001600160a01b031681565b6100e56101873660046117db565b610702565b34801561019857600080fd5b506100e56101a736600461168d565b6107d5565b3480156101b857600080fd5b506100e56101c736600461168d565b61082a565b3480156101d857600080fd5b506101fc6101e736600461166a565b60036020526000908152604090205460ff1681565b604051901515815260200161013b565b34801561021857600080fd5b506100e5610227366004611891565b61087f565b6100e561023a366004611706565b61093a565b34801561024b57600080fd5b506100e561025a3660046116c5565b610c86565b34801561026b57600080fd5b506101fc61027a36600461166a565b60026020526000908152604090205460ff1681565b6001600160a01b03861660009081526002602052604090205460ff1615806102d057506001600160a01b03831660009081526003602052604090205460ff16155b156102ee5760405163743f26e160e01b815260040160405180910390fd5b6001600160a01b0387166103415760405162461bcd60e51b815260206004820152601560248201527424b73b30b634b210333ab63334b636103a37b5b2b760591b60448201526064015b60405180910390fd5b873410156103915760405162461bcd60e51b815260206004820152601860248201527f496e73756666696369656e7420696e7075742076616c756500000000000000006044820152606401610338565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a082319060240160206040518083038186803b1580156103d357600080fd5b505afa1580156103e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040b9190611879565b9050600080886001600160a01b03168b898960405161042b929190611986565b60006040518083038185875af1925050503d8060008114610468576040519150601f19603f3d011682016040523d82523d6000602084013e61046d565b606091505b5091509150816104cf578051156104875780518082602001fd5b60405162461bcd60e51b815260206004820152601960248201527f537761702070726f746f636f6c2063616c6c206661696c6564000000000000006044820152606401610338565b6040516370a0823160e01b815230600482015283906001600160a01b038c16906370a082319060240160206040518083038186803b15801561051057600080fd5b505afa158015610524573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105489190611879565b6105529190611a24565b92506000610561868686610cc4565b905061056e8b8886610f22565b6001600160a01b0387166105828d34611a24565b826040516105909190611996565b60006040518083038185875af1925050503d80600081146105cd576040519150601f19603f3d011682016040523d82523d6000602084013e6105d2565b606091505b50909350915082610635578151156105ed5781518083602001fd5b60405162461bcd60e51b815260206004820152601a60248201527f4d6179616e2070726f746f636f6c2063616c6c206661696c65640000000000006044820152606401610338565b505050505050505050505050565b6000546001600160a01b0316331461066d5760405162461bcd60e51b8152600401610338906119e5565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146106de5760405162461bcd60e51b815260206004820152601260248201527137b7363c903732bc3a1033bab0b93234b0b760711b6044820152606401610338565b600154600080546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b03841660009081526003602052604090205460ff1661073b5760405163743f26e160e01b815260040160405180910390fd5b610746868683610fe2565b610751868587610f22565b600080856001600160a01b031634868660405161076f929190611986565b60006040518083038185875af1925050503d80600081146107ac576040519150601f19603f3d011682016040523d82523d6000602084013e6107b1565b606091505b5091509150816107cb578051156105ed5780518082602001fd5b5050505050505050565b6000546001600160a01b031633146107ff5760405162461bcd60e51b8152600401610338906119e5565b6001600160a01b03919091166000908152600260205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108545760405162461bcd60e51b8152600401610338906119e5565b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108a95760405162461bcd60e51b8152600401610338906119e5565b6001600160a01b0381166108ff5760405162461bcd60e51b815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610338565b6040516001600160a01b0382169083156108fc029084906000818181858888f19350505050158015610935573d6000803e3d6000fd5b505050565b6001600160a01b03871660009081526002602052604090205460ff16158061097b57506001600160a01b03841660009081526003602052604090205460ff16155b156109995760405163743f26e160e01b815260040160405180910390fd5b6109a48a8a83610fe2565b6109af8a888b610f22565b60006001600160a01b0389166109c6575047610a40565b6040516370a0823160e01b81523060048201526001600160a01b038a16906370a082319060240160206040518083038186803b158015610a0557600080fd5b505afa158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3d9190611879565b90505b600080896001600160a01b03168989604051610a5d929190611986565b6000604051808303816000865af19150503d8060008114610a9a576040519150601f19603f3d011682016040523d82523d6000602084013e610a9f565b606091505b509150915081610ab9578051156104875780518082602001fd5b610ac38d8d611092565b6001600160a01b038b16610ae257610adb8347611a24565b9250610b68565b6040516370a0823160e01b815230600482015283906001600160a01b038d16906370a082319060240160206040518083038186803b158015610b2357600080fd5b505afa158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190611879565b610b659190611a24565b92505b6000610b75878786610cc4565b90506001600160a01b038c16610bf4576001600160a01b038816610b998534611a0c565b82604051610ba79190611996565b60006040518083038185875af1925050503d8060008114610be4576040519150601f19603f3d011682016040523d82523d6000602084013e610be9565b606091505b509093509150610c61565b610bff8c8986610f22565b876001600160a01b03163482604051610c189190611996565b60006040518083038185875af1925050503d8060008114610c55576040519150601f19603f3d011682016040523d82523d6000602084013e610c5a565b606091505b5090935091505b82610c76578151156105ed5781518083602001fd5b5050505050505050505050505050565b6000546001600160a01b03163314610cb05760405162461bcd60e51b8152600401610338906119e5565b6109356001600160a01b0384168284611133565b60606024831015610d0e5760405162461bcd60e51b815260206004820152601460248201527313585e585b8819185d18481d1bdbc81cda1bdc9d60621b6044820152606401610338565b60008367ffffffffffffffff811115610d3757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610d61576020820181803683370190505b50905060005b6004811015610de357858582818110610d9057634e487b7160e01b600052603260045260246000fd5b9050013560f81c60f81b828281518110610dba57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080610ddb81611a67565b915050610d67565b50600083604051602001610df991815260200190565b604051602081830303815290604052905060005b6020811015610e9857818181518110610e3657634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b03191683610e51836004611a0c565b81518110610e6f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080610e9081611a67565b915050610e0d565b5060245b85811015610f1757868682818110610ec457634e487b7160e01b600052603260045260246000fd5b9050013560f81c60f81b838281518110610eee57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080610f0f81611a67565b915050610e9c565b509095945050505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152849160009183169063dd62ed3e9060440160206040518083038186803b158015610f6e57600080fd5b505afa158015610f82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa69190611879565b905082811015610fdb57610fc56001600160a01b038316856000611196565b610fdb6001600160a01b03831685600019611196565b5050505050565b604051636eb1769f60e11b81523360048201523060248201526000906001600160a01b0385169063dd62ed3e9060440160206040518083038186803b15801561102a57600080fd5b505afa15801561103e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110629190611879565b905082811015611077576110778433846112ba565b61108c6001600160a01b038516333086611372565b50505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a082319060240160206040518083038186803b1580156110d457600080fd5b505afa1580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c9190611879565b905060008111801561111e5750818111155b15610935576109356001600160a01b03841633835b6040516001600160a01b03831660248201526044810182905261093590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526113aa565b80158061121f5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156111e557600080fd5b505afa1580156111f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121d9190611879565b155b61128a5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610338565b6040516001600160a01b03831660248201526044810182905261093590849063095ea7b360e01b9060640161115f565b6001600160a01b03831663d505accf8330843560208601356112e26060880160408901611965565b6040516001600160e01b031960e088901b1681526001600160a01b0395861660048201529490931660248501526044840191909152606483015260ff166084820152606084013560a4820152608084013560c482015260e401600060405180830381600087803b15801561135557600080fd5b505af1158015611369573d6000803e3d6000fd5b50505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261108c9085906323b872dd60e01b9060840161115f565b60006113ff826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661147f9092919063ffffffff16565b9050805160001480611420575080806020019051810190611420919061185d565b6109355760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610338565b606061148e8484600085611496565b949350505050565b6060824710156114f75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610338565b600080866001600160a01b031685876040516115139190611996565b60006040518083038185875af1925050503d8060008114611550576040519150601f19603f3d011682016040523d82523d6000602084013e611555565b606091505b509150915061156687838387611571565b979650505050505050565b606083156115dd5782516115d6576001600160a01b0385163b6115d65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610338565b508161148e565b61148e83838151156115f25781518083602001fd5b8060405162461bcd60e51b815260040161033891906119b2565b60008083601f84011261161d578182fd5b50813567ffffffffffffffff811115611634578182fd5b60208301915083602082850101111561164c57600080fd5b9250929050565b600060a08284031215611664578081fd5b50919050565b60006020828403121561167b578081fd5b813561168681611a98565b9392505050565b6000806040838503121561169f578081fd5b82356116aa81611a98565b915060208301356116ba81611ab0565b809150509250929050565b6000806000606084860312156116d9578081fd5b83356116e481611a98565b92506020840135915060408401356116fb81611a98565b809150509250925092565b6000806000806000806000806000806101808b8d031215611725578586fd5b8a3561173081611a98565b995060208b0135985060408b013561174781611a98565b975060608b013561175781611a98565b965060808b013567ffffffffffffffff80821115611773578788fd5b61177f8e838f0161160c565b909850965060a08d0135915061179482611a98565b90945060c08c013590808211156117a9578485fd5b506117b68d828e0161160c565b90945092506117ca90508c60e08d01611653565b90509295989b9194979a5092959850565b60008060008060008061012087890312156117f4578182fd5b86356117ff81611a98565b955060208701359450604087013561181681611a98565b9350606087013567ffffffffffffffff811115611831578283fd5b61183d89828a0161160c565b909450925061185190508860808901611653565b90509295509295509295565b60006020828403121561186e578081fd5b815161168681611ab0565b60006020828403121561188a578081fd5b5051919050565b600080604083850312156118a3578182fd5b8235915060208301356116ba81611a98565b60008060008060008060008060c0898b0312156118d0578384fd5b8835975060208901356118e281611a98565b965060408901356118f281611a98565b9550606089013567ffffffffffffffff8082111561190e578586fd5b61191a8c838d0161160c565b909750955060808b0135915061192f82611a98565b90935060a08a01359080821115611944578384fd5b506119518b828c0161160c565b999c989b5096995094979396929594505050565b600060208284031215611976578081fd5b813560ff81168114611686578182fd5b8183823760009101908152919050565b600082516119a8818460208701611a3b565b9190910192915050565b60208152600082518060208401526119d1816040850160208701611a3b565b601f01601f19169190910160400192915050565b6020808252600d908201526c37b7363c9033bab0b93234b0b760991b604082015260600190565b60008219821115611a1f57611a1f611a82565b500190565b600082821015611a3657611a36611a82565b500390565b60005b83811015611a56578181015183820152602001611a3e565b8381111561108c5750506000910152565b6000600019821415611a7b57611a7b611a82565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114611aad57600080fd5b50565b8015158114611aad57600080fdfea2646970667358221220fa899b4fb5d03e20301f7ac2ca88a96bca29a6faa43a7fc4bf14cdb13bd4bcdf64736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000933e3922e04d47a466e60a20e486b372b64f1ea8000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000111111125421ca6dc452d289314280a0f8842a650000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c38e4e6a15593f908255214653d3d947ca1c2338
-----Decoded View---------------
Arg [0] : _guardian (address): 0x933E3922E04d47a466e60A20e486b372B64F1Ea8
Arg [1] : _swapProtocols (address[]): 0x111111125421cA6dc452d289314280a0f8842A65
Arg [2] : _mayanProtocols (address[]): 0xC38e4e6A15593f908255214653d3D947CA1c2338
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000933e3922e04d47a466e60a20e486b372b64f1ea8
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [4] : 000000000000000000000000111111125421ca6dc452d289314280a0f8842a65
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [6] : 000000000000000000000000c38e4e6a15593f908255214653d3d947ca1c2338
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.