Overview
ETH Balance
8.99750041818970279 ETH
Eth Value
$20,545.25 (@ $2,283.44/ETH)Token Holdings
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 7,266 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Cancel Order | 20690404 | 41 hrs ago | IN | 0 ETH | 0.00032218 | ||||
Cancel Order | 20635828 | 9 days ago | IN | 0 ETH | 0.0000916 | ||||
Deposit Eth | 20631043 | 10 days ago | IN | 0.45 ETH | 0.00006572 | ||||
Cancel Order | 20398936 | 42 days ago | IN | 0 ETH | 0.00032722 | ||||
Deposit Eth | 20386330 | 44 days ago | IN | 0.2 ETH | 0.00021641 | ||||
Cancel Order | 20328370 | 52 days ago | IN | 0 ETH | 0.00123898 | ||||
Cancel Order | 20186051 | 72 days ago | IN | 0 ETH | 0.00041681 | ||||
Cancel Order | 20172566 | 74 days ago | IN | 0 ETH | 0.00010745 | ||||
Deposit Eth | 20166483 | 74 days ago | IN | 0.13 ETH | 0.00019185 | ||||
Cancel Order | 20163982 | 75 days ago | IN | 0 ETH | 0.00084317 | ||||
Cancel Order | 20014634 | 96 days ago | IN | 0 ETH | 0.00020609 | ||||
Deposit Eth | 20014316 | 96 days ago | IN | 0.005 ETH | 0.0004118 | ||||
Cancel Order | 19600650 | 154 days ago | IN | 0 ETH | 0.00135502 | ||||
Cancel Order | 19600648 | 154 days ago | IN | 0 ETH | 0.00358275 | ||||
Cancel Order | 19600646 | 154 days ago | IN | 0 ETH | 0.0014909 | ||||
Cancel Order | 19583125 | 156 days ago | IN | 0 ETH | 0.00387543 | ||||
Cancel Order | 19508628 | 166 days ago | IN | 0 ETH | 0.00159191 | ||||
Cancel Order | 19508625 | 166 days ago | IN | 0 ETH | 0.00200223 | ||||
Cancel Order | 19489765 | 169 days ago | IN | 0 ETH | 0.00454606 | ||||
Cancel Order | 19392350 | 183 days ago | IN | 0 ETH | 0.00681837 | ||||
Deposit Eth | 19228619 | 206 days ago | IN | 0.18884329 ETH | 0.00123716 | ||||
Cancel Order | 19124862 | 220 days ago | IN | 0 ETH | 0.00216744 | ||||
Deposit Eth | 19117558 | 221 days ago | IN | 0.88 ETH | 0.00083378 | ||||
Cancel Order | 19086035 | 226 days ago | IN | 0 ETH | 0.00080779 | ||||
Deposit Eth | 19075794 | 227 days ago | IN | 0.07 ETH | 0.00072983 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
20690404 | 41 hrs ago | Contract Creation | 0 ETH | |||
20635828 | 9 days ago | 0.45 ETH | ||||
20398936 | 42 days ago | 0.2 ETH | ||||
20328370 | 52 days ago | Contract Creation | 0 ETH | |||
20295530 | 56 days ago | 0.00099 ETH | ||||
20201906 | 69 days ago | 0.00099 ETH | ||||
20201906 | 69 days ago | 0.00099 ETH | ||||
20201895 | 69 days ago | 0.001 ETH | ||||
20201895 | 69 days ago | 0.001 ETH | ||||
20186051 | 72 days ago | Contract Creation | 0 ETH | |||
20172566 | 74 days ago | 0.13 ETH | ||||
20163982 | 75 days ago | Contract Creation | 0 ETH | |||
20161670 | 75 days ago | Contract Creation | 0 ETH | |||
20161670 | 75 days ago | Contract Creation | 0 ETH | |||
20014634 | 96 days ago | 0.005 ETH | ||||
19749326 | 133 days ago | 0.003 ETH | ||||
19658522 | 145 days ago | 0.005 ETH | ||||
19600650 | 154 days ago | Contract Creation | 0 ETH | |||
19600648 | 154 days ago | Contract Creation | 0 ETH | |||
19600646 | 154 days ago | Contract Creation | 0 ETH | |||
19583125 | 156 days ago | Contract Creation | 0 ETH | |||
19549829 | 161 days ago | Contract Creation | 0 ETH | |||
19508628 | 166 days ago | Contract Creation | 0 ETH | |||
19508625 | 166 days ago | Contract Creation | 0 ETH | |||
19489765 | 169 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
GelatoPineCore
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 // // Original work by Pine.Finance // - https://github.com/pine-finance // // Authors: // - Ignacio Mazzara <@nachomazzara> // - Agustin Aguilar <@agusx1211> // solhint-disable-next-line pragma solidity 0.6.12; import {PineCore, IModule, IERC20} from "./PineCore.sol"; contract GelatoPineCore is PineCore { modifier onlyGelato { require( address(0x3CACa7b48D0573D793d3b0279b5F0029180E83b6) == msg.sender, "GelatoPineCore: onlyGelato" ); _; } function executeOrder( IModule _module, IERC20 _inputToken, address payable _owner, bytes calldata _data, bytes calldata _signature, bytes calldata _auxData ) public override onlyGelato { super.executeOrder( _module, _inputToken, _owner, _data, _signature, _auxData ); } }
/** *Submitted for verification at Etherscan.io on 2020-08-30 */ /** *Submitted for verification at Etherscan.io on 2020-08-30 */ // SPDX-License-Identifier: GPL-3.0 // // Original work by Pine.Finance // - https://github.com/pine-finance // // Authors: // - Ignacio Mazzara <@nachomazzara> // - Agustin Aguilar <@agusx1211> // // // / // @, // /&& // &&%%&/ // &%%%%&%%,.. // */%&,*&&&&&&%%&* // /&%%%%%%%#. // ./%&%%%&#/%%%%&#&%%%&#(*. // .%%%%%%%&&%&/ ..,... // .*,%%%%%%%%%&&%%%%( // ,&&%%%&&*%%%%%%%%.*(#%&/ // ./,(*,*,#%%%%%%%%%%%%%%%(, // ,(%%%%%%%%%%%%&%%%%%%%%%#&&%%%#/(* // *#%%%%%%%&%%%&%%#%%%%%%( // .(####%%&%&#*&%%##%%%%%%%%%%%#.,, // ,&%%%%%###%%%%%%%%%%%%#&&. // ..,(&%%%%%%%%%%%%%%%%%%&&%%%%#%&&%&%%%%&&#, // ,##//%((#*/#%%%%%%%%%%%%%%%%%%%%%&(. // (%%%%%%%%%%%%%%%%%%%#%%%%%%%%%&&&&#(*, // ./%%%%&%%%%#%&%%%%%%##%%&&&&%%(*, // #%%%%%%&&%%%#%%%%%%%%%%%%%%%&#,*&&#. // /%##%(%&/ #%%%%%%%%%%%%%%%%%%%%%%%%%&%%%. // *&%%%%&%%%%%%%%#%%%%%%%%%%%%%%%%%&%%%#%#%%, // .*(#&%%%%%%%%&&%%%%%%%%%%#%%%%%%%%%%%%%%%(, // ./#%%%%%%%%%%%%%%%%%%%%%%%#%&%#%%%%%%%%%%%%%%%%%%%%&%%%#####(. // .,,*#%%%%%%%%%%%%%##%%&&%#%%%%%%%%&&%%%%%%(&*#&**/(* // .,(&%%%%%#((%%%%%%#%%%%%%%%%#%%%%%%%&&&&&%%%%&%* // ,,,,,..*&%%%%%%%%%%%%%%%%%%%%%%%&%%%%%%%%%#/*. // ,#&%%%%%%%%%%%%%%%%%%%%%%%%&%%%%%%%%%%%%%%%%%%/, // . .,*(#%%%%%%%%%&&&&%%%%%%&&&%%%%%%%%%&&%##%%%%%#,(%%%%%%%%%%%(((* // ,/((%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%&# . . ... // .,.,,**(%%%%%%%%&%##%%%%%%%%%%%%%%%%%%###%%%%%%%%%&* // ,%&%%%%%&&%%%%%%%#%%%%%%%%%%%%%%%%%%&%%%%##%%%%%%%%%%%%%%%%&&#. // .(&&&%%%%%%&#&&%&%%%%%%%##%%%%&&%%%#%%%%%%&%%%%%%&&%%%%&&&/*(,(#(,,. // ..&%%%%%%#%#%%%%%%%%%%%##%%%%%%%&%%%%%%%%%%%%%%%%&&(. // ,%%%%%%%%%##%%%&%%%%%%%%&%%#%%&&%%%%&%%%%%%&%%%%%&(#%%%#, // ./%&%%%%%%%%%%%%%%%%%%%%%%%%%&&&%%%##%%%%%%%%%%%%%&&&%%%%%%%%&#.//*/,.. // ,#%%%%%%%%%%%%%%%%%%&&%%%%%&&&&%%%%%&&&%%%%%#%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%&&(,.. // ,#* ,&&&%,.,*(%%%%%%%%%&%%%%&&&%%%%%&%%%%#%%%%##%%%%%%%&&%%%%%%%%%%%#%%%%%%%%&%(*. // .,,/((#%&%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&&&&&%#%%%%%%%%%%%%%%%%%#%%%%%%%((* // *,//**,...,/#%%%%%%%%%%%&&&&%%%%%%%%%%%%%#%%%%%%&&&%%%%&&&&%%%#%%#%%%%%%%%%%%%%%%#*. .,(#%&@* // .*%%(*(%%%%%%%%%%&&&&&&&&%%%%%%%&&%%%%%%%%%%%%%&&&%%%%%%%%%##%%%%%%%%%%%%%%%%%%%%%%%%%%%&%%%/.. // .,/%&%%%%%%@#(&%&%%%%%%%%%#&&%%##%#%%%#%%%%&&&%%%%%%%%###%%%%%&&&%%%%%%%%%%%%%%%%&(//%%/ // ,.. .(%%%%##%%%#%%%%%%#%%%%%##%%%%%&&&&%%%%%%%#&%#%%%%%%&&&%%%%%##// ,,. // .,(%#%%##%%%#%%%#%%%#%%*,.*%%%%%%%%%&.,/&%%%%%%% #&%%#%%%%%&%(&%((%&&&(* // ,/#/(%%, ,&%%#%/.// %*&(%# .(,(%%%. pragma solidity 0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // File: contracts/libs/ECDSA.sol /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { // Check the signature length if (signature.length != 65) { revert("ECDSA: invalid signature length"); } // Divide the signature in r, s and v variables bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. // solhint-disable-next-line no-inline-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if ( uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0 ) { revert("ECDSA: invalid signature 's' value"); } if (v != 27 && v != 28) { revert("ECDSA: invalid signature 'v' value"); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); require(signer != address(0), "ECDSA: invalid signature"); return signer; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * replicates the behavior of the * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`] * JSON-RPC method. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256( abi.encodePacked("\x19Ethereum Signed Message:\n32", hash) ); } } // File: contracts/interfaces/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval( address indexed owner, address indexed spender, uint256 value ); } // File: contracts/libs/Fabric.sol /** * @title Fabric * @dev Create deterministics vaults. * * Original work by Pine.Finance * - https://github.com/pine-finance * * Authors: * - Agustin Aguilar <agusx1211> * - Ignacio Mazzara <nachomazzara> */ library Fabric { /*Vault bytecode def _fallback() payable: call cd[56] with: funct call.data[0 len 4] gas cd[56] wei args call.data[4 len 64] selfdestruct(tx.origin) // Constructor bytecode 0x6012600081600A8239f3 0x60 12 - PUSH1 12 // Size of the contract to return 0x60 00 - PUSH1 00 // Memory offset to return stored code 0x81 - DUP2 12 // Size of code to copy 0x60 0a - PUSH1 0A // Start of the code to copy 0x82 - DUP3 00 // Dest memory for code copy 0x39 - CODECOPY 00 0A 12 // Code copy to memory 0xf3 - RETURN 00 12 // Return code to store // Deployed contract bytecode 0x60008060448082803781806038355AF132FF 0x60 00 - PUSH1 00 // Size for the call output 0x80 - DUP1 00 // Offset for the call output 0x60 44 - PUSH1 44 // Size for the call input 0x80 - DUP1 44 // Size for copying calldata to memory 0x82 - DUP3 00 // Offset for calldata copy 0x80 - DUP1 00 // Offset for destination of calldata copy 0x37 - CALLDATACOPY 00 00 44 // Execute calldata copy, is going to be used for next call 0x81 - DUP2 00 // Offset for call input 0x80 - DUP1 00 // Amount of ETH to send during call 0x60 38 - PUSH1 38 // calldata pointer to load value into stack 0x35 - CALLDATALOAD 38 (A) // Load value (A), address to call 0x5a - GAS // Remaining gas 0xf1 - CALL (A) (A) 00 00 44 00 00 // Execute call to address (A) with calldata mem[0:64] 0x32 - ORIGIN (B) // Dest funds for selfdestruct 0xff - SELFDESTRUCT (B) // selfdestruct contract, end of execution */ bytes public constant code = hex"6012600081600A8239F360008060448082803781806038355AF132FF"; bytes32 public constant vaultCodeHash = bytes32( 0xfa3da1081bc86587310fce8f3a5309785fc567b9b20875900cb289302d6bfa97 ); /** * @dev Get a deterministics vault. */ function getVault(bytes32 _key) internal view returns (address) { return address( uint256( keccak256( abi.encodePacked( bytes1(0xff), address(this), _key, vaultCodeHash ) ) ) ); } /** * @dev Create deterministic vault. */ function executeVault( bytes32 _key, IERC20 _token, address _to ) internal returns (uint256 value) { address addr; bytes memory slotcode = code; /* solium-disable-next-line */ assembly { // Create the contract arguments for the constructor addr := create2(0, add(slotcode, 0x20), mload(slotcode), _key) } value = _token.balanceOf(addr); /* solium-disable-next-line */ (bool success, ) = addr.call( abi.encodePacked( abi.encodeWithSelector( _token.transfer.selector, _to, value ), address(_token) ) ); require(success, "Error pulling tokens"); } } // File: contracts/interfaces/IModule.sol /** * Original work by Pine.Finance * - https://github.com/pine-finance * * Authors: * - Ignacio Mazzara <nachomazzara> * - Agustin Aguilar <agusx1211> */ interface IModule { /// @notice receive ETH receive() external payable; /** * @notice Executes an order * @param _inputToken - Address of the input token * @param _inputAmount - uint256 of the input token amount (order amount) * @param _owner - Address of the order's owner * @param _data - Bytes of the order's data * @param _auxData - Bytes of the auxiliar data used for the handlers to execute the order * @return bought - amount of output token bought */ function execute( IERC20 _inputToken, uint256 _inputAmount, address payable _owner, bytes calldata _data, bytes calldata _auxData ) external returns (uint256 bought); /** * @notice Check whether an order can be executed or not * @param _inputToken - Address of the input token * @param _inputAmount - uint256 of the input token amount (order amount) * @param _data - Bytes of the order's data * @param _auxData - Bytes of the auxiliar data used for the handlers to execute the order * @return bool - whether the order can be executed or not */ function canExecute( IERC20 _inputToken, uint256 _inputAmount, bytes calldata _data, bytes calldata _auxData ) external view returns (bool); } // File: contracts/commons/Order.sol contract Order { address public constant ETH_ADDRESS = address(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); } // File: contracts/PineCore.sol /** * Original work by Pine.Finance * - https://github.com/pine-finance * * Authors: * - Ignacio Mazzara <nachomazzara> * - Agustin Aguilar <agusx1211> */ abstract contract PineCore is Order { using SafeMath for uint256; using Fabric for bytes32; // ETH orders mapping(bytes32 => uint256) public ethDeposits; // Events event DepositETH( bytes32 indexed _key, address indexed _caller, uint256 _amount, bytes _data ); event OrderExecuted( bytes32 indexed _key, address _inputToken, address _owner, address _witness, bytes _data, bytes _auxData, uint256 _amount, uint256 _bought ); event OrderCancelled( bytes32 indexed _key, address _inputToken, address _owner, address _witness, bytes _data, uint256 _amount ); /** * @dev Prevent users to send Ether directly to this contract */ receive() external payable { require( msg.sender != tx.origin, "PineCore#receive: NO_SEND_ETH_PLEASE" ); } /** * @notice Create an ETH to token order * @param _data - Bytes of an ETH to token order. See `encodeEthOrder` for more info */ function depositEth(bytes calldata _data) external payable { require(msg.value > 0, "PineCore#depositEth: VALUE_IS_0"); ( address module, address inputToken, address payable owner, address witness, bytes memory data, ) = decodeOrder(_data); require( inputToken == ETH_ADDRESS, "PineCore#depositEth: WRONG_INPUT_TOKEN" ); bytes32 key = keyOf( IModule(uint160(module)), IERC20(inputToken), owner, witness, data ); ethDeposits[key] = ethDeposits[key].add(msg.value); emit DepositETH(key, msg.sender, msg.value, _data); } /** * @notice Cancel order * @dev The params should be the same used for the order creation * @param _module - Address of the module to use for the order execution * @param _inputToken - Address of the input token * @param _owner - Address of the order's owner * @param _witness - Address of the witness * @param _data - Bytes of the order's data */ function cancelOrder( IModule _module, IERC20 _inputToken, address payable _owner, address _witness, bytes calldata _data ) external { require(msg.sender == _owner, "PineCore#cancelOrder: INVALID_OWNER"); bytes32 key = keyOf(_module, _inputToken, _owner, _witness, _data); uint256 amount = _pullOrder(_inputToken, key, msg.sender); emit OrderCancelled( key, address(_inputToken), _owner, _witness, _data, amount ); } /** * @notice Get the calldata needed to create a token to token/ETH order * @dev Returns the input data that the user needs to use to create the order * The _secret is used to prevent a front-running at the order execution * The _amount is used as the param `_value` for the ERC20 `transfer` function * @param _module - Address of the module to use for the order execution * @param _inputToken - Address of the input token * @param _owner - Address of the order's owner * @param _witness - Address of the witness * @param _data - Bytes of the order's data * @param _secret - Private key of the _witness * @param _amount - uint256 of the order amount * @return bytes - input data to send the transaction */ function encodeTokenOrder( IModule _module, IERC20 _inputToken, address payable _owner, address _witness, bytes calldata _data, bytes32 _secret, uint256 _amount ) external view returns (bytes memory) { return abi.encodeWithSelector( _inputToken.transfer.selector, vaultOfOrder(_module, _inputToken, _owner, _witness, _data), _amount, abi.encode( _module, _inputToken, _owner, _witness, _data, _secret ) ); } /** * @notice Get the calldata needed to create a ETH to token order * @dev Returns the input data that the user needs to use to create the order * The _secret is used to prevent a front-running at the order execution * @param _module - Address of the module to use for the order execution * @param _inputToken - Address of the input token * @param _owner - Address of the order's owner * @param _witness - Address of the witness * @param _data - Bytes of the order's data * @param _secret - Private key of the _witness * @return bytes - input data to send the transaction */ function encodeEthOrder( address _module, address _inputToken, address payable _owner, address _witness, bytes calldata _data, bytes32 _secret ) external pure returns (bytes memory) { return abi.encode(_module, _inputToken, _owner, _witness, _data, _secret); } /** * @notice Get order's properties * @param _data - Bytes of the order * @return module - Address of the module to use for the order execution * @return inputToken - Address of the input token * @return owner - Address of the order's owner * @return witness - Address of the witness * @return data - Bytes of the order's data * @return secret - Private key of the _witness */ function decodeOrder(bytes memory _data) public pure returns ( address module, address inputToken, address payable owner, address witness, bytes memory data, bytes32 secret ) { (module, inputToken, owner, witness, data, secret) = abi.decode( _data, (address, address, address, address, bytes, bytes32) ); } /** * @notice Get the vault's address of a token to token/ETH order * @param _module - Address of the module to use for the order execution * @param _inputToken - Address of the input token * @param _owner - Address of the order's owner * @param _witness - Address of the witness * @param _data - Bytes of the order's data * @return address - The address of the vault */ function vaultOfOrder( IModule _module, IERC20 _inputToken, address payable _owner, address _witness, bytes memory _data ) public view returns (address) { return keyOf(_module, _inputToken, _owner, _witness, _data).getVault(); } /** * @notice Executes an order * @dev The sender should use the _secret to sign its own address * to prevent front-runnings * @param _module - Address of the module to use for the order execution * @param _inputToken - Address of the input token * @param _owner - Address of the order's owner * @param _data - Bytes of the order's data * @param _signature - Signature to calculate the witness * @param _auxData - Bytes of the auxiliar data used for the handlers to execute the order */ function executeOrder( IModule _module, IERC20 _inputToken, address payable _owner, bytes calldata _data, bytes calldata _signature, bytes calldata _auxData ) public virtual { // Calculate witness using signature address witness = ECDSA.recover(keccak256(abi.encodePacked(msg.sender)), _signature); bytes32 key = keyOf(_module, _inputToken, _owner, witness, _data); // Pull amount uint256 amount = _pullOrder(_inputToken, key, address(_module)); require(amount > 0, "PineCore#executeOrder: INVALID_ORDER"); uint256 bought = _module.execute(_inputToken, amount, _owner, _data, _auxData); emit OrderExecuted( key, address(_inputToken), _owner, witness, _data, _auxData, amount, bought ); } /** * @notice Check whether an order exists or not * @dev Check the balance of the order * @param _module - Address of the module to use for the order execution * @param _inputToken - Address of the input token * @param _owner - Address of the order's owner * @param _witness - Address of the witness * @param _data - Bytes of the order's data * @return bool - whether the order exists or not */ function existOrder( IModule _module, IERC20 _inputToken, address payable _owner, address _witness, bytes calldata _data ) external view returns (bool) { bytes32 key = keyOf(_module, _inputToken, _owner, _witness, _data); if (address(_inputToken) == ETH_ADDRESS) { return ethDeposits[key] != 0; } else { return _inputToken.balanceOf(key.getVault()) != 0; } } /** * @notice Check whether an order can be executed or not * @param _module - Address of the module to use for the order execution * @param _inputToken - Address of the input token * @param _owner - Address of the order's owner * @param _witness - Address of the witness * @param _data - Bytes of the order's data * @param _auxData - Bytes of the auxiliar data used for the handlers to execute the order * @return bool - whether the order can be executed or not */ function canExecuteOrder( IModule _module, IERC20 _inputToken, address payable _owner, address _witness, bytes calldata _data, bytes calldata _auxData ) external view returns (bool) { bytes32 key = keyOf(_module, _inputToken, _owner, _witness, _data); // Pull amount uint256 amount; if (address(_inputToken) == ETH_ADDRESS) { amount = ethDeposits[key]; } else { amount = _inputToken.balanceOf(key.getVault()); } return _module.canExecute(_inputToken, amount, _data, _auxData); } /** * @notice Transfer the order amount to a recipient. * @dev For an ETH order, the ETH will be transferred from this contract * For a token order, its vault will be executed transferring the amount of tokens to * the recipient * @param _inputToken - Address of the input token * @param _key - Order's key * @param _to - Address of the recipient * @return amount - amount transferred */ function _pullOrder( IERC20 _inputToken, bytes32 _key, address payable _to ) private returns (uint256 amount) { if (address(_inputToken) == ETH_ADDRESS) { amount = ethDeposits[_key]; ethDeposits[_key] = 0; (bool success, ) = _to.call{value: amount}(""); require(success, "PineCore#_pullOrder: PULL_ETHER_FAILED"); } else { amount = _key.executeVault(_inputToken, _to); } } /** * @notice Get the order's key * @param _module - Address of the module to use for the order execution * @param _inputToken - Address of the input token * @param _owner - Address of the order's owner * @param _witness - Address of the witness * @param _data - Bytes of the order's data * @return bytes32 - order's key */ function keyOf( IModule _module, IERC20 _inputToken, address payable _owner, address _witness, bytes memory _data ) public pure returns (bytes32) { return keccak256( abi.encode(_module, _inputToken, _owner, _witness, _data) ); } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_key","type":"bytes32"},{"indexed":true,"internalType":"address","name":"_caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"}],"name":"DepositETH","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_key","type":"bytes32"},{"indexed":false,"internalType":"address","name":"_inputToken","type":"address"},{"indexed":false,"internalType":"address","name":"_owner","type":"address"},{"indexed":false,"internalType":"address","name":"_witness","type":"address"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"OrderCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_key","type":"bytes32"},{"indexed":false,"internalType":"address","name":"_inputToken","type":"address"},{"indexed":false,"internalType":"address","name":"_owner","type":"address"},{"indexed":false,"internalType":"address","name":"_witness","type":"address"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"_auxData","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_bought","type":"uint256"}],"name":"OrderExecuted","type":"event"},{"inputs":[],"name":"ETH_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IModule","name":"_module","type":"address"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"address payable","name":"_owner","type":"address"},{"internalType":"address","name":"_witness","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bytes","name":"_auxData","type":"bytes"}],"name":"canExecuteOrder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IModule","name":"_module","type":"address"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"address payable","name":"_owner","type":"address"},{"internalType":"address","name":"_witness","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"cancelOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"decodeOrder","outputs":[{"internalType":"address","name":"module","type":"address"},{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address payable","name":"owner","type":"address"},{"internalType":"address","name":"witness","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes32","name":"secret","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"depositEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_module","type":"address"},{"internalType":"address","name":"_inputToken","type":"address"},{"internalType":"address payable","name":"_owner","type":"address"},{"internalType":"address","name":"_witness","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bytes32","name":"_secret","type":"bytes32"}],"name":"encodeEthOrder","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"contract IModule","name":"_module","type":"address"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"address payable","name":"_owner","type":"address"},{"internalType":"address","name":"_witness","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bytes32","name":"_secret","type":"bytes32"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"encodeTokenOrder","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"ethDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IModule","name":"_module","type":"address"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"address payable","name":"_owner","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"bytes","name":"_auxData","type":"bytes"}],"name":"executeOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IModule","name":"_module","type":"address"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"address payable","name":"_owner","type":"address"},{"internalType":"address","name":"_witness","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"existOrder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IModule","name":"_module","type":"address"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"address payable","name":"_owner","type":"address"},{"internalType":"address","name":"_witness","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"keyOf","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"contract IModule","name":"_module","type":"address"},{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"address payable","name":"_owner","type":"address"},{"internalType":"address","name":"_witness","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"vaultOfOrder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b50611f6f806100206000396000f3fe6080604052600436106100aa5760003560e01c8063b4c0754711610064578063b4c0754714610519578063d6fc026314610689578063d7665a4814610790578063e55060c514610833578063e8ecb1301461096f578063ebd9c39c14610a12576100f0565b806286f48f146100f55780630d7cf2ad146101ea57806313a76c4c146102d55780632bd470d31461034357806345d0508b1461045b578063a734f06e14610504576100f0565b366100f057333214156100ee5760405162461bcd60e51b8152600401808060200182810382526024815260200180611f166024913960400191505060405180910390fd5b005b600080fd5b34801561010157600080fd5b506101ce600480360360a081101561011857600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b81111561015a57600080fd5b82018360208201111561016c57600080fd5b803590602001918460018302840111600160201b8311171561018d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610a3c945050505050565b604080516001600160a01b039092168252519081900360200190f35b3480156101f657600080fd5b506102c3600480360360a081101561020d57600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b81111561024f57600080fd5b82018360208201111561026157600080fd5b803590602001918460018302840111600160201b8311171561028257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610a5d945050505050565b60408051918252519081900360200190f35b6100ee600480360360208110156102eb57600080fd5b810190602081018135600160201b81111561030557600080fd5b82018360208201111561031757600080fd5b803590602001918460018302840111600160201b8311171561033857600080fd5b509092509050610b37565b34801561034f57600080fd5b506103e6600480360360c081101561036657600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b8111156103a857600080fd5b8201836020820111156103ba57600080fd5b803590602001918460018302840111600160201b831117156103db57600080fd5b919350915035610cf4565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610420578181015183820152602001610408565b50505050905090810190601f16801561044d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561046757600080fd5b506103e6600480360360e081101561047e57600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b8111156104c057600080fd5b8201836020820111156104d257600080fd5b803590602001918460018302840111600160201b831117156104f357600080fd5b919350915080359060200135610d99565b34801561051057600080fd5b506101ce610f48565b34801561052557600080fd5b506105ca6004803603602081101561053c57600080fd5b810190602081018135600160201b81111561055657600080fd5b82018360208201111561056857600080fd5b803590602001918460018302840111600160201b8311171561058957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610f60945050505050565b60405180876001600160a01b03168152602001866001600160a01b03168152602001856001600160a01b03168152602001846001600160a01b0316815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610649578181015183820152602001610631565b50505050905090810190601f1680156106765780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34801561069557600080fd5b5061077c600480360360c08110156106ac57600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b8111156106ee57600080fd5b82018360208201111561070057600080fd5b803590602001918460018302840111600160201b8311171561072157600080fd5b919390929091602081019035600160201b81111561073e57600080fd5b82018360208201111561075057600080fd5b803590602001918460018302840111600160201b8311171561077157600080fd5b509092509050611061565b604080519115158252519081900360200190f35b34801561079c57600080fd5b506100ee600480360360a08110156107b357600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b8111156107f557600080fd5b82018360208201111561080757600080fd5b803590602001918460018302840111600160201b8311171561082857600080fd5b509092509050611259565b34801561083f57600080fd5b506100ee600480360360c081101561085657600080fd5b6001600160a01b0382358116926020810135821692604082013590921691810190608081016060820135600160201b81111561089157600080fd5b8201836020820111156108a357600080fd5b803590602001918460018302840111600160201b831117156108c457600080fd5b919390929091602081019035600160201b8111156108e157600080fd5b8201836020820111156108f357600080fd5b803590602001918460018302840111600160201b8311171561091457600080fd5b919390929091602081019035600160201b81111561093157600080fd5b82018360208201111561094357600080fd5b803590602001918460018302840111600160201b8311171561096457600080fd5b50909250905061139c565b34801561097b57600080fd5b5061077c600480360360a081101561099257600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b8111156109d457600080fd5b8201836020820111156109e657600080fd5b803590602001918460018302840111600160201b83111715610a0757600080fd5b509092509050611420565b348015610a1e57600080fd5b506102c360048036036020811015610a3557600080fd5b5035611531565b6000610a53610a4e8787878787610a5d565b611543565b9695505050505050565b6000858585858560405160200180866001600160a01b03168152602001856001600160a01b03168152602001846001600160a01b03168152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610ae0578181015183820152602001610ac8565b50505050905090810190601f168015610b0d5780820380516001836020036101000a031916815260200191505b50965050505050505060405160208183030381529060405280519060200120905095945050505050565b60003411610b8c576040805162461bcd60e51b815260206004820152601f60248201527f50696e65436f7265236465706f7369744574683a2056414c55455f49535f3000604482015290519081900360640190fd5b6000806000806060610bd387878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610f6092505050565b509450945094509450945073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0316846001600160a01b031614610c425760405162461bcd60e51b8152600401808060200182810382526026815260200180611e856026913960400191505060405180910390fd5b6000610c518686868686610a5d565b600081815260208190526040902054909150610c6d90346115ae565b60008281526020818152604091829020929092558051348082529281018281529181018a9052339284927f294738b98bcebacf616fd72532d3d8d8d229807bf03b68b25681bfbbdb3d3fe5928d918d919060608201848480828437600083820152604051601f909101601f1916909201829003965090945050505050a35050505050505050565b60608787878787878760405160200180886001600160a01b03168152602001876001600160a01b03168152602001866001600160a01b03168152602001856001600160a01b0316815260200180602001838152602001828103825285858281815260200192508082843760008382015260408051601f909201601f19908116909401828103909401825292909252509950505050505050505050979650505050505050565b606063a9059cbb60e01b610de68a8a8a8a8a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a3c92505050565b838b8b8b8b8b8b8b60405160200180886001600160a01b03168152602001876001600160a01b03168152602001866001600160a01b03168152602001856001600160a01b03168152602001806020018381526020018281038252858582818152602001925080828437600081840152601f19601f8201169050808301925050509850505050505050505060405160208183030381529060405260405160240180846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610ed4578181015183820152602001610ebc565b50505050905090810190601f168015610f015780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990981697909717909652509394505050505098975050505050505050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b600080600080606060008680602001905160c0811015610f7f57600080fd5b8151602083015160408085015160608601516080870180519351959794969295919491939282019284600160201b821115610fb957600080fd5b908301906020820185811115610fce57600080fd5b8251600160201b811182820188101715610fe757600080fd5b82525081516020918201929091019080838360005b83811015611014578181015183820152602001610ffc565b50505050905090810190601f1680156110415780820380516001836020036101000a031916815260200191505b5060405260200151969e959d50939b509199509750929550909350505050565b6000806110a78a8a8a8a8a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a5d92505050565b905060006001600160a01b038a1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156110e55750600081815260208190526040902054611169565b896001600160a01b03166370a082316110fd84611543565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561113a57600080fd5b505afa15801561114e573d6000803e3d6000fd5b505050506040513d602081101561116457600080fd5b505190505b8a6001600160a01b031663fd516dab8b838a8a8a8a6040518763ffffffff1660e01b815260040180876001600160a01b0316815260200186815260200180602001806020018381038352878782818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600081840152601f19601f8201169050808301925050509850505050505050505060206040518083038186803b15801561121e57600080fd5b505afa158015611232573d6000803e3d6000fd5b505050506040513d602081101561124857600080fd5b50519b9a5050505050505050505050565b336001600160a01b038516146112a05760405162461bcd60e51b8152600401808060200182810382526023815260200180611ed16023913960400191505060405180910390fd5b60006112e58787878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a5d92505050565b905060006112f487833361160f565b9050817f2063eea53914d2615730712acb14000b23d3e8ae6ab97b9beff35f05b7bba15188888888888760405180876001600160a01b03168152602001866001600160a01b03168152602001856001600160a01b03168152602001806020018381526020018281038252858582818152602001925080828437600083820152604051601f909101601f1916909201829003995090975050505050505050a25050505050505050565b733caca7b48d0573d793d3b0279b5f0029180e83b63314611404576040805162461bcd60e51b815260206004820152601a60248201527f47656c61746f50696e65436f72653a206f6e6c7947656c61746f000000000000604482015290519081900360640190fd5b6114158989898989898989896116f4565b505050505050505050565b6000806114668888888888888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a5d92505050565b90506001600160a01b03871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156114a55760009081526020819052604090205415159050610a53565b866001600160a01b03166370a082316114bd83611543565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156114fa57600080fd5b505afa15801561150e573d6000803e3d6000fd5b505050506040513d602081101561152457600080fd5b505115159150610a539050565b60006020819052908152604090205481565b604080516001600160f81b03196020808301919091523060601b602183015260358201939093527ffa3da1081bc86587310fce8f3a5309785fc567b9b20875900cb289302d6bfa97605580830191909152825180830390910181526075909101909152805191012090565b600082820183811015611608576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60006001600160a01b03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156116e1575060008281526020819052604080822080549083905590519091906001600160a01b0384169083908381818185875af1925050503d8060008114611696576040519150601f19603f3d011682016040523d82523d6000602084013e61169b565b606091505b50509050806116db5760405162461bcd60e51b8152600401808060200182810382526026815260200180611eab6026913960400191505060405180910390fd5b50611608565b6116ec8385846119e5565b949350505050565b60006117683360405160200180826001600160a01b031660601b81526014019150506040516020818303038152906040528051906020012086868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c5d92505050565b905060006117af8b8b8b858c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a5d92505050565b905060006117be8b838e61160f565b9050600081116117ff5760405162461bcd60e51b8152600401808060200182810382526024815260200180611e3f6024913960400191505060405180910390fd5b60008c6001600160a01b031663e7ed35e38d848e8e8e8c8c6040518863ffffffff1660e01b815260040180886001600160a01b03168152602001878152602001866001600160a01b0316815260200180602001806020018381038352878782818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600081840152601f19601f8201169050808301925050509950505050505050505050602060405180830381600087803b1580156118c957600080fd5b505af11580156118dd573d6000803e3d6000fd5b505050506040513d60208110156118f357600080fd5b81019080805190602001909291905050509050827f56afc5839271b796eaa6426e31b9ad823d483abb96183586e52970a9602b39058d8d878e8e8c8c8a8a604051808a6001600160a01b03168152602001896001600160a01b03168152602001886001600160a01b0316815260200180602001806020018581526020018481526020018381038352898982818152602001925080828437600083820152601f01601f191690910184810383528781526020019050878780828437600083820152604051601f909101601f19169092018290039d50909b505050505050505050505050a250505050505050505050505050565b60008060606040518060400160405280601c81526020017f6012600081600a8239f360008060448082803781806038355af132ff000000008152509050858151602083016000f59150846001600160a01b03166370a08231836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611a7b57600080fd5b505afa158015611a8f573d6000803e3d6000fd5b505050506040513d6020811015611aa557600080fd5b5051604080516001600160a01b03878116602483015260448083018590528351808403909101815260649092018352602082810180516001600160e01b031663a9059cbb60e01b17815293518351959850600095928816948b93919092019182918083835b60208310611b295780518252601f199092019160209182019101611b0a565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b031660601b8152601401925050506040516020818303038152906040526040518082805190602001908083835b60208310611b9f5780518252601f199092019160209182019101611b80565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611c01576040519150601f19603f3d011682016040523d82523d6000602084013e611c06565b606091505b5050905080611c53576040805162461bcd60e51b81526020600482015260146024820152734572726f722070756c6c696e6720746f6b656e7360601b604482015290519081900360640190fd5b5050509392505050565b60008151604114611cb5576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115611d265760405162461bcd60e51b8152600401808060200182810382526022815260200180611e636022913960400191505060405180910390fd5b8060ff16601b14158015611d3e57508060ff16601c14155b15611d7a5760405162461bcd60e51b8152600401808060200182810382526022815260200180611ef46022913960400191505060405180910390fd5b600060018783868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611dd6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610a53576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fdfe50696e65436f726523657865637574654f726465723a20494e56414c49445f4f5244455245434453413a20696e76616c6964207369676e6174757265202773272076616c756550696e65436f7265236465706f7369744574683a2057524f4e475f494e5055545f544f4b454e50696e65436f7265235f70756c6c4f726465723a2050554c4c5f45544845525f4641494c454450696e65436f72652363616e63656c4f726465723a20494e56414c49445f4f574e455245434453413a20696e76616c6964207369676e6174757265202776272076616c756550696e65436f726523726563656976653a204e4f5f53454e445f4554485f504c45415345a264697066735822122068e54ceaa35a392aaf5de71df6bf92df1e6737c74ab4517e632601483c4c5f6b64736f6c634300060c0033
Deployed Bytecode
0x6080604052600436106100aa5760003560e01c8063b4c0754711610064578063b4c0754714610519578063d6fc026314610689578063d7665a4814610790578063e55060c514610833578063e8ecb1301461096f578063ebd9c39c14610a12576100f0565b806286f48f146100f55780630d7cf2ad146101ea57806313a76c4c146102d55780632bd470d31461034357806345d0508b1461045b578063a734f06e14610504576100f0565b366100f057333214156100ee5760405162461bcd60e51b8152600401808060200182810382526024815260200180611f166024913960400191505060405180910390fd5b005b600080fd5b34801561010157600080fd5b506101ce600480360360a081101561011857600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b81111561015a57600080fd5b82018360208201111561016c57600080fd5b803590602001918460018302840111600160201b8311171561018d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610a3c945050505050565b604080516001600160a01b039092168252519081900360200190f35b3480156101f657600080fd5b506102c3600480360360a081101561020d57600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b81111561024f57600080fd5b82018360208201111561026157600080fd5b803590602001918460018302840111600160201b8311171561028257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610a5d945050505050565b60408051918252519081900360200190f35b6100ee600480360360208110156102eb57600080fd5b810190602081018135600160201b81111561030557600080fd5b82018360208201111561031757600080fd5b803590602001918460018302840111600160201b8311171561033857600080fd5b509092509050610b37565b34801561034f57600080fd5b506103e6600480360360c081101561036657600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b8111156103a857600080fd5b8201836020820111156103ba57600080fd5b803590602001918460018302840111600160201b831117156103db57600080fd5b919350915035610cf4565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610420578181015183820152602001610408565b50505050905090810190601f16801561044d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561046757600080fd5b506103e6600480360360e081101561047e57600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b8111156104c057600080fd5b8201836020820111156104d257600080fd5b803590602001918460018302840111600160201b831117156104f357600080fd5b919350915080359060200135610d99565b34801561051057600080fd5b506101ce610f48565b34801561052557600080fd5b506105ca6004803603602081101561053c57600080fd5b810190602081018135600160201b81111561055657600080fd5b82018360208201111561056857600080fd5b803590602001918460018302840111600160201b8311171561058957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610f60945050505050565b60405180876001600160a01b03168152602001866001600160a01b03168152602001856001600160a01b03168152602001846001600160a01b0316815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610649578181015183820152602001610631565b50505050905090810190601f1680156106765780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34801561069557600080fd5b5061077c600480360360c08110156106ac57600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b8111156106ee57600080fd5b82018360208201111561070057600080fd5b803590602001918460018302840111600160201b8311171561072157600080fd5b919390929091602081019035600160201b81111561073e57600080fd5b82018360208201111561075057600080fd5b803590602001918460018302840111600160201b8311171561077157600080fd5b509092509050611061565b604080519115158252519081900360200190f35b34801561079c57600080fd5b506100ee600480360360a08110156107b357600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b8111156107f557600080fd5b82018360208201111561080757600080fd5b803590602001918460018302840111600160201b8311171561082857600080fd5b509092509050611259565b34801561083f57600080fd5b506100ee600480360360c081101561085657600080fd5b6001600160a01b0382358116926020810135821692604082013590921691810190608081016060820135600160201b81111561089157600080fd5b8201836020820111156108a357600080fd5b803590602001918460018302840111600160201b831117156108c457600080fd5b919390929091602081019035600160201b8111156108e157600080fd5b8201836020820111156108f357600080fd5b803590602001918460018302840111600160201b8311171561091457600080fd5b919390929091602081019035600160201b81111561093157600080fd5b82018360208201111561094357600080fd5b803590602001918460018302840111600160201b8311171561096457600080fd5b50909250905061139c565b34801561097b57600080fd5b5061077c600480360360a081101561099257600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013516919081019060a081016080820135600160201b8111156109d457600080fd5b8201836020820111156109e657600080fd5b803590602001918460018302840111600160201b83111715610a0757600080fd5b509092509050611420565b348015610a1e57600080fd5b506102c360048036036020811015610a3557600080fd5b5035611531565b6000610a53610a4e8787878787610a5d565b611543565b9695505050505050565b6000858585858560405160200180866001600160a01b03168152602001856001600160a01b03168152602001846001600160a01b03168152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610ae0578181015183820152602001610ac8565b50505050905090810190601f168015610b0d5780820380516001836020036101000a031916815260200191505b50965050505050505060405160208183030381529060405280519060200120905095945050505050565b60003411610b8c576040805162461bcd60e51b815260206004820152601f60248201527f50696e65436f7265236465706f7369744574683a2056414c55455f49535f3000604482015290519081900360640190fd5b6000806000806060610bd387878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610f6092505050565b509450945094509450945073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0316846001600160a01b031614610c425760405162461bcd60e51b8152600401808060200182810382526026815260200180611e856026913960400191505060405180910390fd5b6000610c518686868686610a5d565b600081815260208190526040902054909150610c6d90346115ae565b60008281526020818152604091829020929092558051348082529281018281529181018a9052339284927f294738b98bcebacf616fd72532d3d8d8d229807bf03b68b25681bfbbdb3d3fe5928d918d919060608201848480828437600083820152604051601f909101601f1916909201829003965090945050505050a35050505050505050565b60608787878787878760405160200180886001600160a01b03168152602001876001600160a01b03168152602001866001600160a01b03168152602001856001600160a01b0316815260200180602001838152602001828103825285858281815260200192508082843760008382015260408051601f909201601f19908116909401828103909401825292909252509950505050505050505050979650505050505050565b606063a9059cbb60e01b610de68a8a8a8a8a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a3c92505050565b838b8b8b8b8b8b8b60405160200180886001600160a01b03168152602001876001600160a01b03168152602001866001600160a01b03168152602001856001600160a01b03168152602001806020018381526020018281038252858582818152602001925080828437600081840152601f19601f8201169050808301925050509850505050505050505060405160208183030381529060405260405160240180846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610ed4578181015183820152602001610ebc565b50505050905090810190601f168015610f015780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990981697909717909652509394505050505098975050505050505050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b600080600080606060008680602001905160c0811015610f7f57600080fd5b8151602083015160408085015160608601516080870180519351959794969295919491939282019284600160201b821115610fb957600080fd5b908301906020820185811115610fce57600080fd5b8251600160201b811182820188101715610fe757600080fd5b82525081516020918201929091019080838360005b83811015611014578181015183820152602001610ffc565b50505050905090810190601f1680156110415780820380516001836020036101000a031916815260200191505b5060405260200151969e959d50939b509199509750929550909350505050565b6000806110a78a8a8a8a8a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a5d92505050565b905060006001600160a01b038a1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156110e55750600081815260208190526040902054611169565b896001600160a01b03166370a082316110fd84611543565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561113a57600080fd5b505afa15801561114e573d6000803e3d6000fd5b505050506040513d602081101561116457600080fd5b505190505b8a6001600160a01b031663fd516dab8b838a8a8a8a6040518763ffffffff1660e01b815260040180876001600160a01b0316815260200186815260200180602001806020018381038352878782818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600081840152601f19601f8201169050808301925050509850505050505050505060206040518083038186803b15801561121e57600080fd5b505afa158015611232573d6000803e3d6000fd5b505050506040513d602081101561124857600080fd5b50519b9a5050505050505050505050565b336001600160a01b038516146112a05760405162461bcd60e51b8152600401808060200182810382526023815260200180611ed16023913960400191505060405180910390fd5b60006112e58787878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a5d92505050565b905060006112f487833361160f565b9050817f2063eea53914d2615730712acb14000b23d3e8ae6ab97b9beff35f05b7bba15188888888888760405180876001600160a01b03168152602001866001600160a01b03168152602001856001600160a01b03168152602001806020018381526020018281038252858582818152602001925080828437600083820152604051601f909101601f1916909201829003995090975050505050505050a25050505050505050565b733caca7b48d0573d793d3b0279b5f0029180e83b63314611404576040805162461bcd60e51b815260206004820152601a60248201527f47656c61746f50696e65436f72653a206f6e6c7947656c61746f000000000000604482015290519081900360640190fd5b6114158989898989898989896116f4565b505050505050505050565b6000806114668888888888888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a5d92505050565b90506001600160a01b03871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156114a55760009081526020819052604090205415159050610a53565b866001600160a01b03166370a082316114bd83611543565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156114fa57600080fd5b505afa15801561150e573d6000803e3d6000fd5b505050506040513d602081101561152457600080fd5b505115159150610a539050565b60006020819052908152604090205481565b604080516001600160f81b03196020808301919091523060601b602183015260358201939093527ffa3da1081bc86587310fce8f3a5309785fc567b9b20875900cb289302d6bfa97605580830191909152825180830390910181526075909101909152805191012090565b600082820183811015611608576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60006001600160a01b03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156116e1575060008281526020819052604080822080549083905590519091906001600160a01b0384169083908381818185875af1925050503d8060008114611696576040519150601f19603f3d011682016040523d82523d6000602084013e61169b565b606091505b50509050806116db5760405162461bcd60e51b8152600401808060200182810382526026815260200180611eab6026913960400191505060405180910390fd5b50611608565b6116ec8385846119e5565b949350505050565b60006117683360405160200180826001600160a01b031660601b81526014019150506040516020818303038152906040528051906020012086868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c5d92505050565b905060006117af8b8b8b858c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a5d92505050565b905060006117be8b838e61160f565b9050600081116117ff5760405162461bcd60e51b8152600401808060200182810382526024815260200180611e3f6024913960400191505060405180910390fd5b60008c6001600160a01b031663e7ed35e38d848e8e8e8c8c6040518863ffffffff1660e01b815260040180886001600160a01b03168152602001878152602001866001600160a01b0316815260200180602001806020018381038352878782818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600081840152601f19601f8201169050808301925050509950505050505050505050602060405180830381600087803b1580156118c957600080fd5b505af11580156118dd573d6000803e3d6000fd5b505050506040513d60208110156118f357600080fd5b81019080805190602001909291905050509050827f56afc5839271b796eaa6426e31b9ad823d483abb96183586e52970a9602b39058d8d878e8e8c8c8a8a604051808a6001600160a01b03168152602001896001600160a01b03168152602001886001600160a01b0316815260200180602001806020018581526020018481526020018381038352898982818152602001925080828437600083820152601f01601f191690910184810383528781526020019050878780828437600083820152604051601f909101601f19169092018290039d50909b505050505050505050505050a250505050505050505050505050565b60008060606040518060400160405280601c81526020017f6012600081600a8239f360008060448082803781806038355af132ff000000008152509050858151602083016000f59150846001600160a01b03166370a08231836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611a7b57600080fd5b505afa158015611a8f573d6000803e3d6000fd5b505050506040513d6020811015611aa557600080fd5b5051604080516001600160a01b03878116602483015260448083018590528351808403909101815260649092018352602082810180516001600160e01b031663a9059cbb60e01b17815293518351959850600095928816948b93919092019182918083835b60208310611b295780518252601f199092019160209182019101611b0a565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b031660601b8152601401925050506040516020818303038152906040526040518082805190602001908083835b60208310611b9f5780518252601f199092019160209182019101611b80565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611c01576040519150601f19603f3d011682016040523d82523d6000602084013e611c06565b606091505b5050905080611c53576040805162461bcd60e51b81526020600482015260146024820152734572726f722070756c6c696e6720746f6b656e7360601b604482015290519081900360640190fd5b5050509392505050565b60008151604114611cb5576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115611d265760405162461bcd60e51b8152600401808060200182810382526022815260200180611e636022913960400191505060405180910390fd5b8060ff16601b14158015611d3e57508060ff16601c14155b15611d7a5760405162461bcd60e51b8152600401808060200182810382526022815260200180611ef46022913960400191505060405180910390fd5b600060018783868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611dd6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610a53576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fdfe50696e65436f726523657865637574654f726465723a20494e56414c49445f4f5244455245434453413a20696e76616c6964207369676e6174757265202773272076616c756550696e65436f7265236465706f7369744574683a2057524f4e475f494e5055545f544f4b454e50696e65436f7265235f70756c6c4f726465723a2050554c4c5f45544845525f4641494c454450696e65436f72652363616e63656c4f726465723a20494e56414c49445f4f574e455245434453413a20696e76616c6964207369676e6174757265202776272076616c756550696e65436f726523726563656976653a204e4f5f53454e445f4554485f504c45415345a264697066735822122068e54ceaa35a392aaf5de71df6bf92df1e6737c74ab4517e632601483c4c5f6b64736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $2,283.32 | 8.9975 | $20,544.13 |
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.