Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
21221744 | 49 days ago | 0.0009 ETH | ||||
21221744 | 49 days ago | 0.0009 ETH | ||||
20938110 | 88 days ago | 0.00069 ETH | ||||
20938110 | 88 days ago | 0.00069 ETH | ||||
20916617 | 91 days ago | 0.00104 ETH | ||||
20916617 | 91 days ago | 0.00104 ETH | ||||
20902974 | 93 days ago | 0.00104 ETH | ||||
20902974 | 93 days ago | 0.00104 ETH | ||||
20776446 | 111 days ago | 0.00128 ETH | ||||
20776446 | 111 days ago | 0.00128 ETH | ||||
20539086 | 144 days ago | 0.002 ETH | ||||
20539086 | 144 days ago | 0.002 ETH | ||||
20483016 | 152 days ago | 0.00075 ETH | ||||
20483016 | 152 days ago | 0.00075 ETH | ||||
20347062 | 171 days ago | 0.00074 ETH | ||||
20347062 | 171 days ago | 0.00074 ETH | ||||
20329675 | 173 days ago | 0.00101 ETH | ||||
20329675 | 173 days ago | 0.00101 ETH | ||||
20329655 | 173 days ago | 0.00101 ETH | ||||
20329655 | 173 days ago | 0.00101 ETH | ||||
20329641 | 173 days ago | 0.00101 ETH | ||||
20329641 | 173 days ago | 0.00101 ETH | ||||
20276383 | 181 days ago | 0.00059 ETH | ||||
20276383 | 181 days ago | 0.00059 ETH | ||||
20084250 | 207 days ago | 0.00311 ETH |
Loading...
Loading
Contract Name:
SocketPlug
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // OSEAN DAO Socket for BSC ETH Bridge - https://osean.online // Official telegram: https://t.me/oseadao import {ISocket} from "../../interfaces/ISocket.sol"; import {IPlug} from "../../interfaces/IPlug.sol"; import {AccessControl} from "../../common/AccessControl.sol"; import {RescueFundsLib} from "../../libraries/RescueFundsLib.sol"; import {IMessageBridge} from "./../IMessageBridge.sol"; import {ISuperTokenOrVault} from "./../ISuperTokenOrVault.sol"; /** * @title SocketPlug * @notice It enables message bridging in Super token and Super Token Vault. * @dev This contract implements Socket's IPlug to enable message bridging and IMessageBridge * to support any type of message bridge. */ contract SocketPlug is IPlug, AccessControl, IMessageBridge { bytes32 constant RESCUE_ROLE = keccak256("RESCUE_ROLE"); // socket address ISocket public immutable socket__; // super token or vault address ISuperTokenOrVault public tokenOrVault__; // chain slug of current chain uint32 public immutable chainSlug; // map of sibling chain slugs with the plug addresses mapping(uint32 => address) public siblingPlugs; //////////////////////////////////////////////////////// ////////////////////// EVENTS ////////////////////////// //////////////////////////////////////////////////////// // emitted when a plug is disconnected event SocketPlugDisconnected(uint32 siblingChainSlug); // emitted when a super token or vault address is set event SuperTokenOrVaultSet(); //////////////////////////////////////////////////////// ////////////////////// ERRORS ////////////////////////// //////////////////////////////////////////////////////// error NotSuperTokenOrVault(); error NotSocket(); error TokenOrVaultAlreadySet(); /** * @notice constructor for creating a new SocketPlug. * @param socket_ The address of the Socket contract used to transmit messages. * @param owner_ The address of the owner who has the initial admin role. * @param chainSlug_ The unique identifier of the chain this plug is deployed on. */ constructor( address socket_, address owner_, uint32 chainSlug_ ) AccessControl(owner_) { socket__ = ISocket(socket_); chainSlug = chainSlug_; } /** * @notice calls socket's outbound function which transmits msg to `siblingChainSlug_`. * @dev Only super token or vault can call this function * @param siblingChainSlug_ The unique identifier of the sibling chain. * @param msgGasLimit_ min gas limit needed to execute the message on sibling * @param payload_ payload which should be executed at the sibling chain. * @return messageId_ identifier used to get message details from Socket. */ function outbound( uint32 siblingChainSlug_, uint256 msgGasLimit_, bytes memory payload_, bytes memory ) external payable returns (bytes32 messageId_) { if (msg.sender != address(tokenOrVault__)) revert NotSuperTokenOrVault(); return socket__.outbound{value: msg.value}( siblingChainSlug_, msgGasLimit_, bytes32(0), bytes32(0), payload_ ); } /** * @notice this function receives the message from sibling chain. * @dev Only socket can call this function. * @param siblingChainSlug_ The unique identifier of the sibling chain. * @param payload_ payload which should be executed at the super token or vault. */ function inbound( uint32 siblingChainSlug_, bytes memory payload_ ) external payable override { if (msg.sender != address(socket__)) revert NotSocket(); tokenOrVault__.inbound(siblingChainSlug_, payload_); } /** * @notice this function calculates the fees needed to send the message to Socket. * @param siblingChainSlug_ The unique identifier of the sibling chain. * @param msgGasLimit_ min gas limit needed at destination chain to execute the message. */ function getMinFees( uint32 siblingChainSlug_, uint256 msgGasLimit_, uint256 payloadSize_ ) external view returns (uint256 totalFees) { return socket__.getMinFees( msgGasLimit_, payloadSize_, bytes32(0), bytes32(0), siblingChainSlug_, address(this) ); } /** * @notice this function is used to set the Super token or Vault address * @dev only owner can set the token address. * @dev this can be called only once. * @param tokenOrVault_ The super token or vault address connected to this plug. */ function setSuperTokenOrVault(address tokenOrVault_) external onlyOwner { if (address(tokenOrVault__) != address(0)) revert TokenOrVaultAlreadySet(); tokenOrVault__ = ISuperTokenOrVault(tokenOrVault_); emit SuperTokenOrVaultSet(); } /** * @notice this function is used to connect Socket for a `siblingChainSlug_`. * @dev only owner can connect Socket with preferred switchboard address. * @param siblingChainSlug_ The unique identifier of the sibling chain. * @param siblingPlug_ address of plug present at siblingChainSlug_ to call at inbound * @param inboundSwitchboard_ the address of switchboard to use for verifying messages at inbound * @param outboundSwitchboard_ the address of switchboard to use for sending messages */ function connect( uint32 siblingChainSlug_, address siblingPlug_, address inboundSwitchboard_, address outboundSwitchboard_ ) external onlyOwner { siblingPlugs[siblingChainSlug_] = siblingPlug_; socket__.connect( siblingChainSlug_, siblingPlug_, inboundSwitchboard_, outboundSwitchboard_ ); } /** * @notice this function is used to disconnect Socket for a `siblingChainSlug_`. * @dev only owner can disconnect Socket * @dev it sets sibling plug as address(0) which makes it revert at `outbound()` hence * @dev stopping it from sending any message. * @param siblingChainSlug_ The unique identifier of the sibling chain. */ function disconnect(uint32 siblingChainSlug_) external onlyOwner { delete siblingPlugs[siblingChainSlug_]; ( , address inboundSwitchboard, address outboundSwitchboard, , ) = socket__.getPlugConfig(address(this), siblingChainSlug_); socket__.connect( siblingChainSlug_, address(0), inboundSwitchboard, outboundSwitchboard ); emit SocketPlugDisconnected(siblingChainSlug_); } /** * @notice this function is used to calculate message id before sending outbound(). * @param siblingChainSlug_ The unique identifier of the sibling chain. * @return message id */ function getMessageId( uint32 siblingChainSlug_ ) public view returns (bytes32) { return bytes32( (uint256(chainSlug) << 224) | (uint256(uint160(siblingPlugs[siblingChainSlug_])) << 64) | (ISocket(socket__).globalMessageCount()) ); } /** * @notice Rescues funds from the contract if they are locked by mistake. * @param token_ The address of the token contract. * @param rescueTo_ The address where rescued tokens need to be sent. * @param amount_ The amount of tokens to be rescued. */ function rescueFunds( address token_, address rescueTo_, uint256 amount_ ) external onlyRole(RESCUE_ROLE) { RescueFundsLib.rescueFunds(token_, rescueTo_, amount_); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./Ownable.sol"; /** * @title AccessControl * @dev This abstract contract implements access control mechanism based on roles. * Each role can have one or more addresses associated with it, which are granted * permission to execute functions with the onlyRole modifier. */ abstract contract AccessControl is Ownable { /** * @dev A mapping of roles to a mapping of addresses to boolean values indicating whether or not they have the role. */ mapping(bytes32 => mapping(address => bool)) private _permits; /** * @dev Emitted when a role is granted to an address. */ event RoleGranted(bytes32 indexed role, address indexed grantee); /** * @dev Emitted when a role is revoked from an address. */ event RoleRevoked(bytes32 indexed role, address indexed revokee); /** * @dev Error message thrown when an address does not have permission to execute a function with onlyRole modifier. */ error NoPermit(bytes32 role); /** * @dev Constructor that sets the owner of the contract. */ constructor(address owner_) Ownable(owner_) {} /** * @dev Modifier that restricts access to addresses having roles * Throws an error if the caller do not have permit */ modifier onlyRole(bytes32 role) { if (!_permits[role][msg.sender]) revert NoPermit(role); _; } /** * @dev Checks and reverts if an address do not have a specific role. * @param role_ The role to check. * @param address_ The address to check. */ function _checkRole(bytes32 role_, address address_) internal virtual { if (!_hasRole(role_, address_)) revert NoPermit(role_); } /** * @dev Grants a role to a given address. * @param role_ The role to grant. * @param grantee_ The address to grant the role to. * Emits a RoleGranted event. * Can only be called by the owner of the contract. */ function grantRole( bytes32 role_, address grantee_ ) external virtual onlyOwner { _grantRole(role_, grantee_); } /** * @dev Revokes a role from a given address. * @param role_ The role to revoke. * @param revokee_ The address to revoke the role from. * Emits a RoleRevoked event. * Can only be called by the owner of the contract. */ function revokeRole( bytes32 role_, address revokee_ ) external virtual onlyOwner { _revokeRole(role_, revokee_); } /** * @dev Internal function to grant a role to a given address. * @param role_ The role to grant. * @param grantee_ The address to grant the role to. * Emits a RoleGranted event. */ function _grantRole(bytes32 role_, address grantee_) internal { _permits[role_][grantee_] = true; emit RoleGranted(role_, grantee_); } /** * @dev Internal function to revoke a role from a given address. * @param role_ The role to revoke. * @param revokee_ The address to revoke the role from. * Emits a RoleRevoked event. */ function _revokeRole(bytes32 role_, address revokee_) internal { _permits[role_][revokee_] = false; emit RoleRevoked(role_, revokee_); } /** * @dev Checks whether an address has a specific role. * @param role_ The role to check. * @param address_ The address to check. * @return A boolean value indicating whether or not the address has the role. */ function hasRole( bytes32 role_, address address_ ) external view returns (bool) { return _hasRole(role_, address_); } function _hasRole( bytes32 role_, address address_ ) internal view returns (bool) { return _permits[role_][address_]; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title Ownable * @dev The Ownable contract provides a simple way to manage ownership of a contract * and allows for ownership to be transferred to a nominated address. */ abstract contract Ownable { address private _owner; address private _nominee; event OwnerNominated(address indexed nominee); event OwnerClaimed(address indexed claimer); error OnlyOwner(); error OnlyNominee(); /** * @dev Sets the contract's owner to the address that is passed to the constructor. */ constructor(address owner_) { _claimOwner(owner_); } /** * @dev Modifier that restricts access to only the contract's owner. * Throws an error if the caller is not the owner. */ modifier onlyOwner() { if (msg.sender != _owner) revert OnlyOwner(); _; } /** * @dev Returns the current owner of the contract. */ function owner() external view returns (address) { return _owner; } /** * @dev Returns the current nominee for ownership of the contract. */ function nominee() external view returns (address) { return _nominee; } /** * @dev Allows the current owner to nominate a new owner for the contract. * Throws an error if the caller is not the owner. * Emits an `OwnerNominated` event with the address of the nominee. */ function nominateOwner(address nominee_) external { if (msg.sender != _owner) revert OnlyOwner(); _nominee = nominee_; emit OwnerNominated(_nominee); } /** * @dev Allows the nominated owner to claim ownership of the contract. * Throws an error if the caller is not the nominee. * Sets the nominated owner as the new owner of the contract. * Emits an `OwnerClaimed` event with the address of the new owner. */ function claimOwner() external { if (msg.sender != _nominee) revert OnlyNominee(); _claimOwner(msg.sender); } /** * @dev Internal function that sets the owner of the contract to the specified address * and sets the nominee to address(0). */ function _claimOwner(address claimer_) internal { _owner = claimer_; _nominee = address(0); emit OwnerClaimed(claimer_); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title IPlug * @notice Interface for a plug contract that executes the message received from a source chain. */ interface IPlug { /** * @dev this should be only executable by socket * @notice executes the message received from source chain * @notice It is expected to have original sender checks in the destination plugs using payload * @param srcChainSlug_ chain slug of source * @param payload_ the data which is needed by plug at inbound call on remote */ function inbound( uint32 srcChainSlug_, bytes calldata payload_ ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ISocket * @notice An interface for a cross-chain communication contract * @dev This interface provides methods for transmitting and executing messages between chains, * connecting a plug to a remote chain and setting up switchboards for the message transmission * This interface also emits events for important operations such as message transmission, execution status, * and plug connection */ interface ISocket { /** * @notice A struct containing fees required for message transmission and execution * @param transmissionFees fees needed for transmission * @param switchboardFees fees needed by switchboard * @param executionFee fees needed for execution */ struct Fees { uint128 transmissionFees; uint128 executionFee; uint128 switchboardFees; } /** * @title MessageDetails * @dev This struct defines the details of a message to be executed in a Decapacitor contract. */ struct MessageDetails { // A unique identifier for the message. bytes32 msgId; // The fee to be paid for executing the message. uint256 executionFee; // The maximum amount of gas that can be used to execute the message. uint256 minMsgGasLimit; // The extra params which provides msg value and additional info needed for message exec bytes32 executionParams; // The payload data to be executed in the message. bytes payload; } /** * @title ExecutionDetails * @dev This struct defines the execution details */ struct ExecutionDetails { // packet id bytes32 packetId; // proposal count uint256 proposalCount; // gas limit needed to execute inbound uint256 executionGasLimit; // proof data required by the Decapacitor contract to verify the message's authenticity bytes decapacitorProof; // signature of executor bytes signature; } /** * @notice emits the message details when a new message arrives at outbound * @param localChainSlug local chain slug * @param localPlug local plug address * @param dstChainSlug remote chain slug * @param dstPlug remote plug address * @param msgId message id packed with remoteChainSlug and nonce * @param minMsgGasLimit gas limit needed to execute the inbound at remote * @param payload the data which will be used by inbound at remote */ event MessageOutbound( uint32 localChainSlug, address localPlug, uint32 dstChainSlug, address dstPlug, bytes32 msgId, uint256 minMsgGasLimit, bytes32 executionParams, bytes32 transmissionParams, bytes payload, Fees fees ); /** * @notice emits the status of message after inbound call * @param msgId msg id which is executed */ event ExecutionSuccess(bytes32 msgId); /** * @notice emits the config set by a plug for a remoteChainSlug * @param plug address of plug on current chain * @param siblingChainSlug sibling chain slug * @param siblingPlug address of plug on sibling chain * @param inboundSwitchboard inbound switchboard (select from registered options) * @param outboundSwitchboard outbound switchboard (select from registered options) * @param capacitor capacitor selected based on outbound switchboard * @param decapacitor decapacitor selected based on inbound switchboard */ event PlugConnected( address plug, uint32 siblingChainSlug, address siblingPlug, address inboundSwitchboard, address outboundSwitchboard, address capacitor, address decapacitor ); /** * @notice registers a message * @dev Packs the message and includes it in a packet with capacitor * @param remoteChainSlug_ the remote chain slug * @param minMsgGasLimit_ the gas limit needed to execute the payload on remote * @param payload_ the data which is needed by plug at inbound call on remote */ function outbound( uint32 remoteChainSlug_, uint256 minMsgGasLimit_, bytes32 executionParams_, bytes32 transmissionParams_, bytes memory payload_ ) external payable returns (bytes32 msgId); /** * @notice executes a message * @param executionDetails_ the packet details, proof and signature needed for message execution * @param messageDetails_ the message details */ function execute( ISocket.ExecutionDetails calldata executionDetails_, ISocket.MessageDetails calldata messageDetails_ ) external payable; /** * @notice sets the config specific to the plug * @param siblingChainSlug_ the sibling chain slug * @param siblingPlug_ address of plug present at sibling chain to call inbound * @param inboundSwitchboard_ the address of switchboard to use for receiving messages * @param outboundSwitchboard_ the address of switchboard to use for sending messages */ function connect( uint32 siblingChainSlug_, address siblingPlug_, address inboundSwitchboard_, address outboundSwitchboard_ ) external; /** * @notice Retrieves the minimum fees required for a message with a specified gas limit and destination chain. * @param minMsgGasLimit_ The gas limit of the message. * @param remoteChainSlug_ The slug of the destination chain for the message. * @param plug_ The address of the plug through which the message is sent. * @return totalFees The minimum fees required for the specified message. */ function getMinFees( uint256 minMsgGasLimit_, uint256 payloadSize_, bytes32 executionParams_, bytes32 transmissionParams_, uint32 remoteChainSlug_, address plug_ ) external view returns (uint256 totalFees); /** * @notice returns chain slug * @return chainSlug current chain slug */ function chainSlug() external view returns (uint32 chainSlug); function globalMessageCount() external view returns (uint64); /** * @notice returns the config for given `plugAddress_` and `siblingChainSlug_` * @param siblingChainSlug_ the sibling chain slug * @param plugAddress_ address of plug present at current chain */ function getPlugConfig( address plugAddress_, uint32 siblingChainSlug_ ) external view returns ( address siblingPlug, address inboundSwitchboard__, address outboundSwitchboard__, address capacitor__, address decapacitor__ ); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "solmate/src/utils/SafeTransferLib.sol"; error ZeroAddress(); /** * @title RescueFundsLib * @dev A library that provides a function to rescue funds from a contract. */ library RescueFundsLib { /** * @dev The address used to identify ETH. */ address public constant ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); /** * @dev thrown when the given token address don't have any code */ error InvalidTokenAddress(); /** * @dev Rescues funds from a contract. * @param token_ The address of the token contract. * @param rescueTo_ The address of the user. * @param amount_ The amount of tokens to be rescued. */ function rescueFunds( address token_, address rescueTo_, uint256 amount_ ) internal { if (rescueTo_ == address(0)) revert ZeroAddress(); if (token_ == ETH_ADDRESS) { SafeTransferLib.safeTransferETH(rescueTo_, amount_); } else { if (token_.code.length == 0) revert InvalidTokenAddress(); SafeTransferLib.safeTransfer(ERC20(token_), rescueTo_, amount_); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title IMessageBridge * @notice It should be implemented by message bridge integrated to Super token and Vault. */ interface IMessageBridge { /** * @notice calls socket's outbound function which transmits msg to `siblingChainSlug_`. * @dev Only super token or vault can call this contract * @param siblingChainSlug_ The unique identifier of the sibling chain. * @param msgGasLimit_ min gas limit needed to execute the message on sibling * @param payload_ payload which should be executed at the sibling chain. * @param options_ extra bytes memory can be used by other protocol plugs for additional options */ function outbound( uint32 siblingChainSlug_, uint256 msgGasLimit_, bytes memory payload_, bytes memory options_ ) external payable returns (bytes32 messageId_); /** * @notice this function is used to calculate message id before sending outbound(). * @param siblingChainSlug_ The unique identifier of the sibling chain. * @return message id */ function getMessageId( uint32 siblingChainSlug_ ) external view returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ISuperTokenOrVault * @notice It should be implemented Super token and Vault for plugs to communicate. */ interface ISuperTokenOrVault { /** * @dev this should be only executable by socket. * @notice executes the message received from source chain. * @notice It is expected to have original sender checks in the destination plugs using payload. * @param siblingChainSlug_ chain slug of source. * @param payload_ the data which is needed to decode receiver, amount, msgId and payload. */ function inbound( uint32 siblingChainSlug_, bytes memory payload_ ) external payable; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) /// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it. abstract contract ERC20 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); /*////////////////////////////////////////////////////////////// METADATA STORAGE //////////////////////////////////////////////////////////////*/ string public name; string public symbol; uint8 public immutable decimals; /*////////////////////////////////////////////////////////////// ERC20 STORAGE //////////////////////////////////////////////////////////////*/ uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; /*////////////////////////////////////////////////////////////// EIP-2612 STORAGE //////////////////////////////////////////////////////////////*/ uint256 internal immutable INITIAL_CHAIN_ID; bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR; mapping(address => uint256) public nonces; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor( string memory _name, string memory _symbol, uint8 _decimals ) { name = _name; symbol = _symbol; decimals = _decimals; INITIAL_CHAIN_ID = block.chainid; INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); } /*////////////////////////////////////////////////////////////// ERC20 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 amount) public virtual returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address to, uint256 amount) public virtual returns (bool) { balanceOf[msg.sender] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(msg.sender, to, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals. if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; balanceOf[from] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(from, to, amount); return true; } /*////////////////////////////////////////////////////////////// EIP-2612 LOGIC //////////////////////////////////////////////////////////////*/ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED"); // Unchecked because the only math done is incrementing // the owner's nonce which cannot realistically overflow. unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner, spender, value, nonces[owner]++, deadline ) ) ) ), v, r, s ); require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER"); allowance[recoveredAddress][spender] = value; } emit Approval(owner, spender, value); } function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); } function computeDomainSeparator() internal view virtual returns (bytes32) { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256("1"), block.chainid, address(this) ) ); } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 amount) internal virtual { totalSupply += amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(address(0), to, amount); } function _burn(address from, uint256 amount) internal virtual { balanceOf[from] -= amount; // Cannot underflow because a user's balance // will never be larger than the total supply. unchecked { totalSupply -= amount; } emit Transfer(from, address(0), amount); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import {ERC20} from "../tokens/ERC20.sol"; /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer. /// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller. library SafeTransferLib { /*////////////////////////////////////////////////////////////// ETH OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferETH(address to, uint256 amount) internal { bool success; /// @solidity memory-safe-assembly assembly { // Transfer the ETH and store if it succeeded or not. success := call(gas(), to, amount, 0, 0, 0, 0) } require(success, "ETH_TRANSFER_FAILED"); } /*////////////////////////////////////////////////////////////// ERC20 OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferFrom( ERC20 token, address from, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "from" argument. mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 100, 0, 32) ) } require(success, "TRANSFER_FROM_FAILED"); } function safeTransfer( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "TRANSFER_FAILED"); } function safeApprove( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "APPROVE_FAILED"); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"socket_","type":"address"},{"internalType":"address","name":"owner_","type":"address"},{"internalType":"uint32","name":"chainSlug_","type":"uint32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidTokenAddress","type":"error"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"NoPermit","type":"error"},{"inputs":[],"name":"NotSocket","type":"error"},{"inputs":[],"name":"NotSuperTokenOrVault","type":"error"},{"inputs":[],"name":"OnlyNominee","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[],"name":"TokenOrVaultAlreadySet","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"claimer","type":"address"}],"name":"OwnerClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nominee","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"grantee","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"revokee","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"siblingChainSlug","type":"uint32"}],"name":"SocketPlugDisconnected","type":"event"},{"anonymous":false,"inputs":[],"name":"SuperTokenOrVaultSet","type":"event"},{"inputs":[],"name":"chainSlug","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"siblingChainSlug_","type":"uint32"},{"internalType":"address","name":"siblingPlug_","type":"address"},{"internalType":"address","name":"inboundSwitchboard_","type":"address"},{"internalType":"address","name":"outboundSwitchboard_","type":"address"}],"name":"connect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"siblingChainSlug_","type":"uint32"}],"name":"disconnect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"siblingChainSlug_","type":"uint32"}],"name":"getMessageId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"siblingChainSlug_","type":"uint32"},{"internalType":"uint256","name":"msgGasLimit_","type":"uint256"},{"internalType":"uint256","name":"payloadSize_","type":"uint256"}],"name":"getMinFees","outputs":[{"internalType":"uint256","name":"totalFees","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role_","type":"bytes32"},{"internalType":"address","name":"grantee_","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role_","type":"bytes32"},{"internalType":"address","name":"address_","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"siblingChainSlug_","type":"uint32"},{"internalType":"bytes","name":"payload_","type":"bytes"}],"name":"inbound","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"nominee_","type":"address"}],"name":"nominateOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"siblingChainSlug_","type":"uint32"},{"internalType":"uint256","name":"msgGasLimit_","type":"uint256"},{"internalType":"bytes","name":"payload_","type":"bytes"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"outbound","outputs":[{"internalType":"bytes32","name":"messageId_","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"address","name":"rescueTo_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role_","type":"bytes32"},{"internalType":"address","name":"revokee_","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenOrVault_","type":"address"}],"name":"setSuperTokenOrVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"siblingPlugs","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"socket__","outputs":[{"internalType":"contract ISocket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenOrVault__","outputs":[{"internalType":"contract ISuperTokenOrVault","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60c06040523480156200001157600080fd5b5060405162001485380380620014858339810160408190526200003491620000d1565b8180620000418162000061565b50506001600160a01b039092166080525063ffffffff1660a05262000127565b600080546001600160a01b0383166001600160a01b0319918216811783556001805490921690915560405190917ffbe19c9b601f5ee90b44c7390f3fa2319eba01762d34ee372aeafd59b25c7f8791a250565b80516001600160a01b0381168114620000cc57600080fd5b919050565b600080600060608486031215620000e757600080fd5b620000f284620000b4565b92506200010260208501620000b4565b9150604084015163ffffffff811681146200011c57600080fd5b809150509250925092565b60805160a051611300620001856000396000818161031e015261095201526000818161037a0152818161053f015281816106190152818161074e015281816108960152818161099301528181610ae70152610b9401526113006000f3fe6080604052600436106101145760003560e01c8063608b677d116100a0578063b349ba6511610064578063b349ba651461030c578063c41f1f6c14610355578063c6a261d214610368578063d547741f1461039c578063ddcb4497146103bc57600080fd5b8063608b677d146102485780636ccae0541461027e5780638da5cb5b1461029e57806391d14854146102bc5780639dc11289146102ec57600080fd5b80633b1be678116100e75780633b1be678146101b25780633bd1adec146101d25780634964a390146101e75780635b94db27146102155780636064b5041461023557600080fd5b806320f99c0a1461011957806328b6644c146101505780632f2ff15d1461017057806337eccf9114610192575b600080fd5b34801561012557600080fd5b506001546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015c57600080fd5b50600354610133906001600160a01b031681565b34801561017c57600080fd5b5061019061018b366004610eb3565b6103dc565b005b34801561019e57600080fd5b506101906101ad366004610ee3565b610415565b3480156101be57600080fd5b506101906101cd366004610f19565b6104b1565b3480156101de57600080fd5b506101906105a3565b3480156101f357600080fd5b50610207610202366004610f73565b6105d9565b604051908152602001610147565b34801561022157600080fd5b50610190610230366004610ee3565b610694565b610207610243366004611049565b610709565b34801561025457600080fd5b506101336102633660046110c7565b6004602052600090815260409020546001600160a01b031681565b34801561028a57600080fd5b506101906102993660046110e2565b6107da565b3480156102aa57600080fd5b506000546001600160a01b0316610133565b3480156102c857600080fd5b506102dc6102d7366004610eb3565b610864565b6040519015158152602001610147565b3480156102f857600080fd5b506102076103073660046110c7565b610892565b34801561031857600080fd5b506103407f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff9091168152602001610147565b610190610363366004611123565b610988565b34801561037457600080fd5b506101337f000000000000000000000000000000000000000000000000000000000000000081565b3480156103a857600080fd5b506101906103b7366004610eb3565b610a39565b3480156103c857600080fd5b506101906103d73660046110c7565b610a6e565b6000546001600160a01b0316331461040757604051635fc483c560e01b815260040160405180910390fd5b6104118282610c32565b5050565b6000546001600160a01b0316331461044057604051635fc483c560e01b815260040160405180910390fd5b6003546001600160a01b03161561046a57604051631f4da6fb60e31b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0383161790556040517f36ec927eea4543008fc89875572126b24f55ce3264763ab4f0397191f87895fa90600090a150565b6000546001600160a01b031633146104dc57604051635fc483c560e01b815260040160405180910390fd5b63ffffffff841660008181526004602081905260409182902080546001600160a01b0319166001600160a01b0388811691821790925592516307637ccf60e31b8152918201939093526024810191909152838216604482015282821660648201527f000000000000000000000000000000000000000000000000000000000000000090911690633b1be67890608401600060405180830381600087803b15801561058557600080fd5b505af1158015610599573d6000803e3d6000fd5b5050505050505050565b6001546001600160a01b031633146105ce57604051637c91ccdd60e01b815260040160405180910390fd5b6105d733610c8d565b565b604051634d71f82d60e11b815260048101839052602481018290526000604482018190526064820181905263ffffffff851660848301523060a4830152907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639ae3f05a9060c401602060405180830381865afa158015610668573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068c9190611171565b949350505050565b6000546001600160a01b031633146106bf57604051635fc483c560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290600090a250565b6003546000906001600160a01b0316331461073757604051634e53298760e01b815260040160405180910390fd5b604051633386774f60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690633386774f90349061078e908990899060009081908b906004016111d0565b60206040518083038185885af11580156107ac573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107d19190611171565b95945050505050565b3360009081527f4933f7bec34ee32db93e9f5cd7e0519781b395282211f4f6857489046ea38f7660205260409020547fc4c453d647953c0fd35db5a34ee76e60fb4abc3a8fb891a25936b70b38f292539060ff166108535760405163962f633360e01b8152600481018290526024015b60405180910390fd5b61085e848484610ce0565b50505050565b60008281526002602090815260408083206001600160a01b038516845290915281205460ff165b9392505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e992e0ff6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610916919061120c565b63ffffffff92909216600090815260046020526040908190205467ffffffffffffffff90931692901b68010000000000000000600160e01b03167f000000000000000000000000000000000000000000000000000000000000000060e01b6001600160e01b0319161791909117919050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109d157604051633167e3df60e21b815260040160405180910390fd5b600354604051633107c7db60e21b81526001600160a01b039091169063c41f1f6c90610a039085908590600401611236565b600060405180830381600087803b158015610a1d57600080fd5b505af1158015610a31573d6000803e3d6000fd5b505050505050565b6000546001600160a01b03163314610a6457604051635fc483c560e01b815260040160405180910390fd5b6104118282610d71565b6000546001600160a01b03163314610a9957604051635fc483c560e01b815260040160405180910390fd5b63ffffffff8116600081815260046020819052604080832080546001600160a01b0319169055516306f38f8760e41b8152309181019190915260248101929092529081906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636f38f8709060440160a060405180830381865afa158015610b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b529190611255565b50506040516307637ccf60e31b815263ffffffff87166004820152600060248201526001600160a01b03808416604483015280831660648301529295509093507f00000000000000000000000000000000000000000000000000000000000000009091169150633b1be67890608401600060405180830381600087803b158015610bdb57600080fd5b505af1158015610bef573d6000803e3d6000fd5b505060405163ffffffff861681527f95774ff9b5d227d0266feeffbfed32e564b9b74951cf310b8c15436c4412bbfd9250602001905060405180910390a1505050565b60008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551909184917f2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f39190a35050565b600080546001600160a01b0383166001600160a01b0319918216811783556001805490921690915560405190917ffbe19c9b601f5ee90b44c7390f3fa2319eba01762d34ee372aeafd59b25c7f8791a250565b6001600160a01b038216610d075760405163d92e233d60e01b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03841601610d3b57610d368282610dc9565b505050565b826001600160a01b03163b600003610d6657604051630f58058360e11b815260040160405180910390fd5b610d36838383610e1a565b60008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551909184917f155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a529190a35050565b600080600080600085875af1905080610d365760405162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b604482015260640161084a565b600060405163a9059cbb60e01b81526001600160a01b0384166004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061085e5760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b604482015260640161084a565b6001600160a01b0381168114610eb057600080fd5b50565b60008060408385031215610ec657600080fd5b823591506020830135610ed881610e9b565b809150509250929050565b600060208284031215610ef557600080fd5b813561088b81610e9b565b803563ffffffff81168114610f1457600080fd5b919050565b60008060008060808587031215610f2f57600080fd5b610f3885610f00565b93506020850135610f4881610e9b565b92506040850135610f5881610e9b565b91506060850135610f6881610e9b565b939692955090935050565b600080600060608486031215610f8857600080fd5b610f9184610f00565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610fcd57600080fd5b813567ffffffffffffffff80821115610fe857610fe8610fa6565b604051601f8301601f19908116603f0116810190828211818310171561101057611010610fa6565b8160405283815286602085880101111561102957600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806080858703121561105f57600080fd5b61106885610f00565b935060208501359250604085013567ffffffffffffffff8082111561108c57600080fd5b61109888838901610fbc565b935060608701359150808211156110ae57600080fd5b506110bb87828801610fbc565b91505092959194509250565b6000602082840312156110d957600080fd5b61088b82610f00565b6000806000606084860312156110f757600080fd5b833561110281610e9b565b9250602084013561111281610e9b565b929592945050506040919091013590565b6000806040838503121561113657600080fd5b61113f83610f00565b9150602083013567ffffffffffffffff81111561115b57600080fd5b61116785828601610fbc565b9150509250929050565b60006020828403121561118357600080fd5b5051919050565b6000815180845260005b818110156111b057602081850181015186830182015201611194565b506000602082860101526020601f19601f83011685010191505092915050565b63ffffffff8616815284602082015283604082015282606082015260a06080820152600061120160a083018461118a565b979650505050505050565b60006020828403121561121e57600080fd5b815167ffffffffffffffff8116811461088b57600080fd5b63ffffffff8316815260406020820152600061068c604083018461118a565b600080600080600060a0868803121561126d57600080fd5b855161127881610e9b565b602087015190955061128981610e9b565b604087015190945061129a81610e9b565b60608701519093506112ab81610e9b565b60808701519092506112bc81610e9b565b80915050929550929590935056fea2646970667358221220a3b0a0fb01639518a1ccfea77e27b4e2935f6c464524b6f3eb1f2a844cdbeb0664736f6c63430008110033000000000000000000000000943ac2775928318653e91d350574436a1b9b16f90000000000000000000000004cac359ab2a020cf212d82c1b66fc8abf81b1dd00000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x6080604052600436106101145760003560e01c8063608b677d116100a0578063b349ba6511610064578063b349ba651461030c578063c41f1f6c14610355578063c6a261d214610368578063d547741f1461039c578063ddcb4497146103bc57600080fd5b8063608b677d146102485780636ccae0541461027e5780638da5cb5b1461029e57806391d14854146102bc5780639dc11289146102ec57600080fd5b80633b1be678116100e75780633b1be678146101b25780633bd1adec146101d25780634964a390146101e75780635b94db27146102155780636064b5041461023557600080fd5b806320f99c0a1461011957806328b6644c146101505780632f2ff15d1461017057806337eccf9114610192575b600080fd5b34801561012557600080fd5b506001546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015c57600080fd5b50600354610133906001600160a01b031681565b34801561017c57600080fd5b5061019061018b366004610eb3565b6103dc565b005b34801561019e57600080fd5b506101906101ad366004610ee3565b610415565b3480156101be57600080fd5b506101906101cd366004610f19565b6104b1565b3480156101de57600080fd5b506101906105a3565b3480156101f357600080fd5b50610207610202366004610f73565b6105d9565b604051908152602001610147565b34801561022157600080fd5b50610190610230366004610ee3565b610694565b610207610243366004611049565b610709565b34801561025457600080fd5b506101336102633660046110c7565b6004602052600090815260409020546001600160a01b031681565b34801561028a57600080fd5b506101906102993660046110e2565b6107da565b3480156102aa57600080fd5b506000546001600160a01b0316610133565b3480156102c857600080fd5b506102dc6102d7366004610eb3565b610864565b6040519015158152602001610147565b3480156102f857600080fd5b506102076103073660046110c7565b610892565b34801561031857600080fd5b506103407f000000000000000000000000000000000000000000000000000000000000000181565b60405163ffffffff9091168152602001610147565b610190610363366004611123565b610988565b34801561037457600080fd5b506101337f000000000000000000000000943ac2775928318653e91d350574436a1b9b16f981565b3480156103a857600080fd5b506101906103b7366004610eb3565b610a39565b3480156103c857600080fd5b506101906103d73660046110c7565b610a6e565b6000546001600160a01b0316331461040757604051635fc483c560e01b815260040160405180910390fd5b6104118282610c32565b5050565b6000546001600160a01b0316331461044057604051635fc483c560e01b815260040160405180910390fd5b6003546001600160a01b03161561046a57604051631f4da6fb60e31b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0383161790556040517f36ec927eea4543008fc89875572126b24f55ce3264763ab4f0397191f87895fa90600090a150565b6000546001600160a01b031633146104dc57604051635fc483c560e01b815260040160405180910390fd5b63ffffffff841660008181526004602081905260409182902080546001600160a01b0319166001600160a01b0388811691821790925592516307637ccf60e31b8152918201939093526024810191909152838216604482015282821660648201527f000000000000000000000000943ac2775928318653e91d350574436a1b9b16f990911690633b1be67890608401600060405180830381600087803b15801561058557600080fd5b505af1158015610599573d6000803e3d6000fd5b5050505050505050565b6001546001600160a01b031633146105ce57604051637c91ccdd60e01b815260040160405180910390fd5b6105d733610c8d565b565b604051634d71f82d60e11b815260048101839052602481018290526000604482018190526064820181905263ffffffff851660848301523060a4830152907f000000000000000000000000943ac2775928318653e91d350574436a1b9b16f96001600160a01b031690639ae3f05a9060c401602060405180830381865afa158015610668573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068c9190611171565b949350505050565b6000546001600160a01b031633146106bf57604051635fc483c560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290600090a250565b6003546000906001600160a01b0316331461073757604051634e53298760e01b815260040160405180910390fd5b604051633386774f60e01b81526001600160a01b037f000000000000000000000000943ac2775928318653e91d350574436a1b9b16f91690633386774f90349061078e908990899060009081908b906004016111d0565b60206040518083038185885af11580156107ac573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107d19190611171565b95945050505050565b3360009081527f4933f7bec34ee32db93e9f5cd7e0519781b395282211f4f6857489046ea38f7660205260409020547fc4c453d647953c0fd35db5a34ee76e60fb4abc3a8fb891a25936b70b38f292539060ff166108535760405163962f633360e01b8152600481018290526024015b60405180910390fd5b61085e848484610ce0565b50505050565b60008281526002602090815260408083206001600160a01b038516845290915281205460ff165b9392505050565b60007f000000000000000000000000943ac2775928318653e91d350574436a1b9b16f96001600160a01b031663e992e0ff6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610916919061120c565b63ffffffff92909216600090815260046020526040908190205467ffffffffffffffff90931692901b68010000000000000000600160e01b03167f000000000000000000000000000000000000000000000000000000000000000160e01b6001600160e01b0319161791909117919050565b336001600160a01b037f000000000000000000000000943ac2775928318653e91d350574436a1b9b16f916146109d157604051633167e3df60e21b815260040160405180910390fd5b600354604051633107c7db60e21b81526001600160a01b039091169063c41f1f6c90610a039085908590600401611236565b600060405180830381600087803b158015610a1d57600080fd5b505af1158015610a31573d6000803e3d6000fd5b505050505050565b6000546001600160a01b03163314610a6457604051635fc483c560e01b815260040160405180910390fd5b6104118282610d71565b6000546001600160a01b03163314610a9957604051635fc483c560e01b815260040160405180910390fd5b63ffffffff8116600081815260046020819052604080832080546001600160a01b0319169055516306f38f8760e41b8152309181019190915260248101929092529081906001600160a01b037f000000000000000000000000943ac2775928318653e91d350574436a1b9b16f91690636f38f8709060440160a060405180830381865afa158015610b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b529190611255565b50506040516307637ccf60e31b815263ffffffff87166004820152600060248201526001600160a01b03808416604483015280831660648301529295509093507f000000000000000000000000943ac2775928318653e91d350574436a1b9b16f99091169150633b1be67890608401600060405180830381600087803b158015610bdb57600080fd5b505af1158015610bef573d6000803e3d6000fd5b505060405163ffffffff861681527f95774ff9b5d227d0266feeffbfed32e564b9b74951cf310b8c15436c4412bbfd9250602001905060405180910390a1505050565b60008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551909184917f2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f39190a35050565b600080546001600160a01b0383166001600160a01b0319918216811783556001805490921690915560405190917ffbe19c9b601f5ee90b44c7390f3fa2319eba01762d34ee372aeafd59b25c7f8791a250565b6001600160a01b038216610d075760405163d92e233d60e01b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03841601610d3b57610d368282610dc9565b505050565b826001600160a01b03163b600003610d6657604051630f58058360e11b815260040160405180910390fd5b610d36838383610e1a565b60008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551909184917f155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a529190a35050565b600080600080600085875af1905080610d365760405162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b604482015260640161084a565b600060405163a9059cbb60e01b81526001600160a01b0384166004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061085e5760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b604482015260640161084a565b6001600160a01b0381168114610eb057600080fd5b50565b60008060408385031215610ec657600080fd5b823591506020830135610ed881610e9b565b809150509250929050565b600060208284031215610ef557600080fd5b813561088b81610e9b565b803563ffffffff81168114610f1457600080fd5b919050565b60008060008060808587031215610f2f57600080fd5b610f3885610f00565b93506020850135610f4881610e9b565b92506040850135610f5881610e9b565b91506060850135610f6881610e9b565b939692955090935050565b600080600060608486031215610f8857600080fd5b610f9184610f00565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610fcd57600080fd5b813567ffffffffffffffff80821115610fe857610fe8610fa6565b604051601f8301601f19908116603f0116810190828211818310171561101057611010610fa6565b8160405283815286602085880101111561102957600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806080858703121561105f57600080fd5b61106885610f00565b935060208501359250604085013567ffffffffffffffff8082111561108c57600080fd5b61109888838901610fbc565b935060608701359150808211156110ae57600080fd5b506110bb87828801610fbc565b91505092959194509250565b6000602082840312156110d957600080fd5b61088b82610f00565b6000806000606084860312156110f757600080fd5b833561110281610e9b565b9250602084013561111281610e9b565b929592945050506040919091013590565b6000806040838503121561113657600080fd5b61113f83610f00565b9150602083013567ffffffffffffffff81111561115b57600080fd5b61116785828601610fbc565b9150509250929050565b60006020828403121561118357600080fd5b5051919050565b6000815180845260005b818110156111b057602081850181015186830182015201611194565b506000602082860101526020601f19601f83011685010191505092915050565b63ffffffff8616815284602082015283604082015282606082015260a06080820152600061120160a083018461118a565b979650505050505050565b60006020828403121561121e57600080fd5b815167ffffffffffffffff8116811461088b57600080fd5b63ffffffff8316815260406020820152600061068c604083018461118a565b600080600080600060a0868803121561126d57600080fd5b855161127881610e9b565b602087015190955061128981610e9b565b604087015190945061129a81610e9b565b60608701519093506112ab81610e9b565b60808701519092506112bc81610e9b565b80915050929550929590935056fea2646970667358221220a3b0a0fb01639518a1ccfea77e27b4e2935f6c464524b6f3eb1f2a844cdbeb0664736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000943ac2775928318653e91d350574436a1b9b16f90000000000000000000000004cac359ab2a020cf212d82c1b66fc8abf81b1dd00000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : socket_ (address): 0x943AC2775928318653e91d350574436A1b9b16f9
Arg [1] : owner_ (address): 0x4cAC359ab2A020CF212D82C1b66fC8abF81b1Dd0
Arg [2] : chainSlug_ (uint32): 1
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000943ac2775928318653e91d350574436a1b9b16f9
Arg [1] : 0000000000000000000000004cac359ab2a020cf212d82c1b66fc8abf81b1dd0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000001
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.