Source Code
Latest 25 from a total of 2,990 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Transfer | 24020115 | 4 days ago | IN | 0.004 ETH | 0.00001292 | ||||
| Transfer | 23980783 | 9 days ago | IN | 0.004 ETH | 0.00004802 | ||||
| Transfer | 23969261 | 11 days ago | IN | 0.004 ETH | 0.0088516 | ||||
| Transfer | 23736883 | 43 days ago | IN | 0.004 ETH | 0.00005022 | ||||
| Transfer | 23728278 | 45 days ago | IN | 0.004 ETH | 0.00014874 | ||||
| Transfer | 23605416 | 62 days ago | IN | 0.004 ETH | 0.00003565 | ||||
| Transfer | 23605411 | 62 days ago | IN | 0.004 ETH | 0.00003572 | ||||
| Transfer | 23575486 | 66 days ago | IN | 0.004 ETH | 0.00004705 | ||||
| Transfer | 23568540 | 67 days ago | IN | 0.0040001 ETH | 0.00005075 | ||||
| Transfer | 23563552 | 68 days ago | IN | 0.004 ETH | 0.00004244 | ||||
| Transfer | 23527066 | 73 days ago | IN | 0.004 ETH | 0.00010489 | ||||
| Transfer | 23435604 | 86 days ago | IN | 0.004 ETH | 0.00002591 | ||||
| Transfer | 23402826 | 90 days ago | IN | 0.004 ETH | 0.00002575 | ||||
| Transfer | 23388168 | 92 days ago | IN | 0.004 ETH | 0.00001829 | ||||
| Transfer | 23361991 | 96 days ago | IN | 0.004 ETH | 0.00003256 | ||||
| Transfer | 23331597 | 100 days ago | IN | 0.008 ETH | 0.00001493 | ||||
| Transfer | 23173573 | 122 days ago | IN | 0.004 ETH | 0.00001472 | ||||
| Transfer | 23159641 | 124 days ago | IN | 0.004 ETH | 0.00004785 | ||||
| Transfer | 23138870 | 127 days ago | IN | 0.004 ETH | 0.0000671 | ||||
| Transfer | 23128882 | 128 days ago | IN | 0.004 ETH | 0.00005999 | ||||
| Transfer | 23126500 | 129 days ago | IN | 0.004 ETH | 0.00009971 | ||||
| Transfer | 23115738 | 130 days ago | IN | 0.004 ETH | 0.00005326 | ||||
| Transfer | 23041427 | 141 days ago | IN | 0.004 ETH | 0.00006358 | ||||
| Transfer | 23006990 | 145 days ago | IN | 0.004 ETH | 0.00004898 | ||||
| Transfer | 23006276 | 146 days ago | IN | 0.004 ETH | 0.00004944 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 22295820 | 245 days ago | 0.50074077 ETH | ||||
| Transfer | 21620208 | 339 days ago | 0.004 ETH | ||||
| Transfer | 21458363 | 362 days ago | 0.004 ETH | ||||
| Transfer | 21144655 | 406 days ago | 0.50206943 ETH | ||||
| Transfer | 20132275 | 547 days ago | 0.50080514 ETH | ||||
| Transfer | 20061847 | 557 days ago | 0.00400001 ETH | ||||
| Transfer | 19925378 | 576 days ago | 0.016 ETH | ||||
| Transfer | 19919622 | 577 days ago | 0.004 ETH | ||||
| Transfer | 19742506 | 602 days ago | 0.004 ETH | ||||
| Transfer | 19643613 | 615 days ago | 0.504 ETH | ||||
| Transfer | 19185533 | 680 days ago | 0.02 ETH | ||||
| Transfer | 19175950 | 681 days ago | 0.5026318 ETH | ||||
| Transfer | 19097169 | 692 days ago | 0.004 ETH | ||||
| Transfer | 18753962 | 740 days ago | 0.504 ETH | ||||
| Transfer | 18232693 | 813 days ago | 0.5036738 ETH | ||||
| Transfer | 17744143 | 882 days ago | 0.524 ETH | ||||
| Transfer | 17508341 | 915 days ago | 0.004 ETH | ||||
| Transfer | 17296220 | 945 days ago | 0.5018238 ETH | ||||
| Transfer | 16984064 | 989 days ago | 0.50473841 ETH | ||||
| Transfer | 16919198 | 998 days ago | 0.02873841 ETH | ||||
| Transfer | 16908065 | 999 days ago | 0.512 ETH | ||||
| Transfer | 16754203 | 1021 days ago | 0.504 ETH | ||||
| Transfer | 16630888 | 1038 days ago | 0.004 ETH | ||||
| Transfer | 16580358 | 1045 days ago | 0.004 ETH | ||||
| Transfer | 16449926 | 1064 days ago | 0.004 ETH |
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ForcedExit
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
// SPDX-License-Identifier: MIT OR Apache-2.0
import "./Utils.sol";
import "./Ownable.sol";
import "./ReentrancyGuard.sol";
contract ForcedExit is Ownable, ReentrancyGuard {
// This is the role of the zkSync server
// that will be able to withdraw the funds
address payable public receiver;
bool public enabled = true;
constructor(address _master, address _receiver) Ownable(_master) {
initializeReentrancyGuard();
// The master is the default receiver
receiver = payable(_receiver);
}
event FundsReceived(uint256 _amount);
function setReceiver(address payable _newReceiver) external {
requireMaster(msg.sender);
receiver = _newReceiver;
}
function withdrawPendingFunds(address payable _to) external nonReentrant {
require(
msg.sender == receiver || msg.sender == getMaster(),
"Only the receiver or master can withdraw funds from the smart contract"
);
uint256 balance = address(this).balance;
(bool success, ) = _to.call{value: balance}("");
require(success, "ETH withdraw failed");
}
// We have to use fallback instead of `receive` since the ethabi
// library can't decode the receive function:
// https://github.com/rust-ethereum/ethabi/issues/185
fallback() external payable {
emit FundsReceived(msg.value);
}
}pragma solidity ^0.7.0;
// SPDX-License-Identifier: MIT OR Apache-2.0
import "./IERC20.sol";
import "./Bytes.sol";
library Utils {
/// @notice Returns lesser of two values
function minU32(uint32 a, uint32 b) internal pure returns (uint32) {
return a < b ? a : b;
}
/// @notice Returns lesser of two values
function minU64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
/// @notice Sends tokens
/// @dev NOTE: this function handles tokens that have transfer function not strictly compatible with ERC20 standard
/// @dev NOTE: call `transfer` to this token may return (bool) or nothing
/// @param _token Token address
/// @param _to Address of recipient
/// @param _amount Amount of tokens to transfer
/// @return bool flag indicating that transfer is successful
function sendERC20(
IERC20 _token,
address _to,
uint256 _amount
) internal returns (bool) {
(bool callSuccess, bytes memory callReturnValueEncoded) =
address(_token).call(abi.encodeWithSignature("transfer(address,uint256)", _to, _amount));
// `transfer` method may return (bool) or nothing.
bool returnedSuccess = callReturnValueEncoded.length == 0 || abi.decode(callReturnValueEncoded, (bool));
return callSuccess && returnedSuccess;
}
/// @notice Transfers token from one address to another
/// @dev NOTE: this function handles tokens that have transfer function not strictly compatible with ERC20 standard
/// @dev NOTE: call `transferFrom` to this token may return (bool) or nothing
/// @param _token Token address
/// @param _from Address of sender
/// @param _to Address of recipient
/// @param _amount Amount of tokens to transfer
/// @return bool flag indicating that transfer is successful
function transferFromERC20(
IERC20 _token,
address _from,
address _to,
uint256 _amount
) internal returns (bool) {
(bool callSuccess, bytes memory callReturnValueEncoded) =
address(_token).call(abi.encodeWithSignature("transferFrom(address,address,uint256)", _from, _to, _amount));
// `transferFrom` method may return (bool) or nothing.
bool returnedSuccess = callReturnValueEncoded.length == 0 || abi.decode(callReturnValueEncoded, (bool));
return callSuccess && returnedSuccess;
}
/// @notice Recovers signer's address from ethereum signature for given message
/// @param _signature 65 bytes concatenated. R (32) + S (32) + V (1)
/// @param _messageHash signed message hash.
/// @return address of the signer
function recoverAddressFromEthSignature(bytes memory _signature, bytes32 _messageHash)
internal
pure
returns (address)
{
require(_signature.length == 65, "P"); // incorrect signature length
bytes32 signR;
bytes32 signS;
uint8 signV;
assembly {
signR := mload(add(_signature, 32))
signS := mload(add(_signature, 64))
signV := byte(0, mload(add(_signature, 96)))
}
return ecrecover(_messageHash, signV, signR, signS);
}
/// @notice Returns new_hash = hash(old_hash + bytes)
function concatHash(bytes32 _hash, bytes memory _bytes) internal pure returns (bytes32) {
bytes32 result;
assembly {
let bytesLen := add(mload(_bytes), 32)
mstore(_bytes, _hash)
result := keccak256(_bytes, bytesLen)
}
return result;
}
function hashBytesToBytes20(bytes memory _bytes) internal pure returns (bytes20) {
return bytes20(uint160(uint256(keccak256(_bytes))));
}
}pragma solidity ^0.7.0;
// SPDX-License-Identifier: MIT OR Apache-2.0
/// @title Ownable Contract
/// @author Matter Labs
contract Ownable {
/// @dev Storage position of the masters address (keccak256('eip1967.proxy.admin') - 1)
bytes32 private constant masterPosition = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/// @notice Contract constructor
/// @dev Sets msg sender address as masters address
/// @param masterAddress Master address
constructor(address masterAddress) {
setMaster(masterAddress);
}
/// @notice Check if specified address is master
/// @param _address Address to check
function requireMaster(address _address) internal view {
require(_address == getMaster(), "1c"); // oro11 - only by master
}
/// @notice Returns contract masters address
/// @return master Master's address
function getMaster() public view returns (address master) {
bytes32 position = masterPosition;
assembly {
master := sload(position)
}
}
/// @dev Sets new masters address
/// @param _newMaster New master's address
function setMaster(address _newMaster) internal {
bytes32 position = masterPosition;
assembly {
sstore(position, _newMaster)
}
}
/// @notice Transfer mastership of the contract to new master
/// @param _newMaster New masters address
function transferMastership(address _newMaster) external {
requireMaster(msg.sender);
require(_newMaster != address(0), "1d"); // otp11 - new masters address can't be zero address
setMaster(_newMaster);
}
}pragma solidity ^0.7.0;
// SPDX-License-Identifier: MIT OR Apache-2.0
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*
* _Since v2.5.0:_ this module is now much more gas efficient, given net gas
* metering changes introduced in the Istanbul hardfork.
*/
contract ReentrancyGuard {
/// @dev Address of lock flag variable.
/// @dev Flag is placed at random memory location to not interfere with Storage contract.
uint256 private constant LOCK_FLAG_ADDRESS = 0x8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf4; // keccak256("ReentrancyGuard") - 1;
function initializeReentrancyGuard() internal {
// Storing an initial non-zero value makes deployment a bit more
// expensive, but in exchange the refund on every call to nonReentrant
// will be lower in amount. Since refunds are capped to a percetange of
// the total transaction's gas, it is best to keep them low in cases
// like this one, to increase the likelihood of the full refund coming
// into effect.
assembly {
sstore(LOCK_FLAG_ADDRESS, 1)
}
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
bool notEntered;
assembly {
notEntered := sload(LOCK_FLAG_ADDRESS)
}
// On the first call to nonReentrant, _notEntered will be true
require(notEntered, "1b");
// Any calls to nonReentrant after this point will fail
assembly {
sstore(LOCK_FLAG_ADDRESS, 0)
}
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
assembly {
sstore(LOCK_FLAG_ADDRESS, 1)
}
}
}pragma solidity ^0.7.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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);
}pragma solidity ^0.7.0;
// SPDX-License-Identifier: MIT OR Apache-2.0
// Functions named bytesToX, except bytesToBytes20, where X is some type of size N < 32 (size of one word)
// implements the following algorithm:
// f(bytes memory input, uint offset) -> X out
// where byte representation of out is N bytes from input at the given offset
// 1) We compute memory location of the word W such that last N bytes of W is input[offset..offset+N]
// W_address = input + 32 (skip stored length of bytes) + offset - (32 - N) == input + offset + N
// 2) We load W from memory into out, last N bytes of W are placed into out
library Bytes {
function toBytesFromUInt16(uint16 self) internal pure returns (bytes memory _bts) {
return toBytesFromUIntTruncated(uint256(self), 2);
}
function toBytesFromUInt24(uint24 self) internal pure returns (bytes memory _bts) {
return toBytesFromUIntTruncated(uint256(self), 3);
}
function toBytesFromUInt32(uint32 self) internal pure returns (bytes memory _bts) {
return toBytesFromUIntTruncated(uint256(self), 4);
}
function toBytesFromUInt128(uint128 self) internal pure returns (bytes memory _bts) {
return toBytesFromUIntTruncated(uint256(self), 16);
}
// Copies 'len' lower bytes from 'self' into a new 'bytes memory'.
// Returns the newly created 'bytes memory'. The returned bytes will be of length 'len'.
function toBytesFromUIntTruncated(uint256 self, uint8 byteLength) private pure returns (bytes memory bts) {
require(byteLength <= 32, "Q");
bts = new bytes(byteLength);
// Even though the bytes will allocate a full word, we don't want
// any potential garbage bytes in there.
uint256 data = self << ((32 - byteLength) * 8);
assembly {
mstore(
add(bts, 32), // BYTES_HEADER_SIZE
data
)
}
}
// Copies 'self' into a new 'bytes memory'.
// Returns the newly created 'bytes memory'. The returned bytes will be of length '20'.
function toBytesFromAddress(address self) internal pure returns (bytes memory bts) {
bts = toBytesFromUIntTruncated(uint256(self), 20);
}
// See comment at the top of this file for explanation of how this function works.
// NOTE: theoretically possible overflow of (_start + 20)
function bytesToAddress(bytes memory self, uint256 _start) internal pure returns (address addr) {
uint256 offset = _start + 20;
require(self.length >= offset, "R");
assembly {
addr := mload(add(self, offset))
}
}
// Reasoning about why this function works is similar to that of other similar functions, except NOTE below.
// NOTE: that bytes1..32 is stored in the beginning of the word unlike other primitive types
// NOTE: theoretically possible overflow of (_start + 20)
function bytesToBytes20(bytes memory self, uint256 _start) internal pure returns (bytes20 r) {
require(self.length >= (_start + 20), "S");
assembly {
r := mload(add(add(self, 0x20), _start))
}
}
// See comment at the top of this file for explanation of how this function works.
// NOTE: theoretically possible overflow of (_start + 0x2)
function bytesToUInt16(bytes memory _bytes, uint256 _start) internal pure returns (uint16 r) {
uint256 offset = _start + 0x2;
require(_bytes.length >= offset, "T");
assembly {
r := mload(add(_bytes, offset))
}
}
// See comment at the top of this file for explanation of how this function works.
// NOTE: theoretically possible overflow of (_start + 0x3)
function bytesToUInt24(bytes memory _bytes, uint256 _start) internal pure returns (uint24 r) {
uint256 offset = _start + 0x3;
require(_bytes.length >= offset, "U");
assembly {
r := mload(add(_bytes, offset))
}
}
// NOTE: theoretically possible overflow of (_start + 0x4)
function bytesToUInt32(bytes memory _bytes, uint256 _start) internal pure returns (uint32 r) {
uint256 offset = _start + 0x4;
require(_bytes.length >= offset, "V");
assembly {
r := mload(add(_bytes, offset))
}
}
// NOTE: theoretically possible overflow of (_start + 0x10)
function bytesToUInt128(bytes memory _bytes, uint256 _start) internal pure returns (uint128 r) {
uint256 offset = _start + 0x10;
require(_bytes.length >= offset, "W");
assembly {
r := mload(add(_bytes, offset))
}
}
// See comment at the top of this file for explanation of how this function works.
// NOTE: theoretically possible overflow of (_start + 0x14)
function bytesToUInt160(bytes memory _bytes, uint256 _start) internal pure returns (uint160 r) {
uint256 offset = _start + 0x14;
require(_bytes.length >= offset, "X");
assembly {
r := mload(add(_bytes, offset))
}
}
// NOTE: theoretically possible overflow of (_start + 0x20)
function bytesToBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32 r) {
uint256 offset = _start + 0x20;
require(_bytes.length >= offset, "Y");
assembly {
r := mload(add(_bytes, offset))
}
}
// Original source code: https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol#L228
// Get slice from bytes arrays
// Returns the newly created 'bytes memory'
// NOTE: theoretically possible overflow of (_start + _length)
function slice(
bytes memory _bytes,
uint256 _start,
uint256 _length
) internal pure returns (bytes memory) {
require(_bytes.length >= (_start + _length), "Z"); // bytes length is less then start byte + length bytes
bytes memory tempBytes = new bytes(_length);
if (_length != 0) {
assembly {
let slice_curr := add(tempBytes, 0x20)
let slice_end := add(slice_curr, _length)
for {
let array_current := add(_bytes, add(_start, 0x20))
} lt(slice_curr, slice_end) {
slice_curr := add(slice_curr, 0x20)
array_current := add(array_current, 0x20)
} {
mstore(slice_curr, mload(array_current))
}
}
}
return tempBytes;
}
/// Reads byte stream
/// @return new_offset - offset + amount of bytes read
/// @return data - actually read data
// NOTE: theoretically possible overflow of (_offset + _length)
function read(
bytes memory _data,
uint256 _offset,
uint256 _length
) internal pure returns (uint256 new_offset, bytes memory data) {
data = slice(_data, _offset, _length);
new_offset = _offset + _length;
}
// NOTE: theoretically possible overflow of (_offset + 1)
function readBool(bytes memory _data, uint256 _offset) internal pure returns (uint256 new_offset, bool r) {
new_offset = _offset + 1;
r = uint8(_data[_offset]) != 0;
}
// NOTE: theoretically possible overflow of (_offset + 1)
function readUint8(bytes memory _data, uint256 _offset) internal pure returns (uint256 new_offset, uint8 r) {
new_offset = _offset + 1;
r = uint8(_data[_offset]);
}
// NOTE: theoretically possible overflow of (_offset + 2)
function readUInt16(bytes memory _data, uint256 _offset) internal pure returns (uint256 new_offset, uint16 r) {
new_offset = _offset + 2;
r = bytesToUInt16(_data, _offset);
}
// NOTE: theoretically possible overflow of (_offset + 3)
function readUInt24(bytes memory _data, uint256 _offset) internal pure returns (uint256 new_offset, uint24 r) {
new_offset = _offset + 3;
r = bytesToUInt24(_data, _offset);
}
// NOTE: theoretically possible overflow of (_offset + 4)
function readUInt32(bytes memory _data, uint256 _offset) internal pure returns (uint256 new_offset, uint32 r) {
new_offset = _offset + 4;
r = bytesToUInt32(_data, _offset);
}
// NOTE: theoretically possible overflow of (_offset + 16)
function readUInt128(bytes memory _data, uint256 _offset) internal pure returns (uint256 new_offset, uint128 r) {
new_offset = _offset + 16;
r = bytesToUInt128(_data, _offset);
}
// NOTE: theoretically possible overflow of (_offset + 20)
function readUInt160(bytes memory _data, uint256 _offset) internal pure returns (uint256 new_offset, uint160 r) {
new_offset = _offset + 20;
r = bytesToUInt160(_data, _offset);
}
// NOTE: theoretically possible overflow of (_offset + 20)
function readAddress(bytes memory _data, uint256 _offset) internal pure returns (uint256 new_offset, address r) {
new_offset = _offset + 20;
r = bytesToAddress(_data, _offset);
}
// NOTE: theoretically possible overflow of (_offset + 20)
function readBytes20(bytes memory _data, uint256 _offset) internal pure returns (uint256 new_offset, bytes20 r) {
new_offset = _offset + 20;
r = bytesToBytes20(_data, _offset);
}
// NOTE: theoretically possible overflow of (_offset + 32)
function readBytes32(bytes memory _data, uint256 _offset) internal pure returns (uint256 new_offset, bytes32 r) {
new_offset = _offset + 32;
r = bytesToBytes32(_data, _offset);
}
/// Trim bytes into single word
function trim(bytes memory _data, uint256 _new_length) internal pure returns (uint256 r) {
require(_new_length <= 0x20, "10"); // new_length is longer than word
require(_data.length >= _new_length, "11"); // data is to short
uint256 a;
assembly {
a := mload(add(_data, 0x20)) // load bytes into uint256
}
return a >> ((0x20 - _new_length) * 8);
}
// Helper function for hex conversion.
function halfByteToHex(bytes1 _byte) internal pure returns (bytes1 _hexByte) {
require(uint8(_byte) < 0x10, "hbh11"); // half byte's value is out of 0..15 range.
// "FEDCBA9876543210" ASCII-encoded, shifted and automatically truncated.
return bytes1(uint8(0x66656463626139383736353433323130 >> (uint8(_byte) * 8)));
}
// Convert bytes to ASCII hex representation
function bytesToHexASCIIBytes(bytes memory _input) internal pure returns (bytes memory _output) {
bytes memory outStringBytes = new bytes(_input.length * 2);
// code in `assembly` construction is equivalent of the next code:
// for (uint i = 0; i < _input.length; ++i) {
// outStringBytes[i*2] = halfByteToHex(_input[i] >> 4);
// outStringBytes[i*2+1] = halfByteToHex(_input[i] & 0x0f);
// }
assembly {
let input_curr := add(_input, 0x20)
let input_end := add(input_curr, mload(_input))
for {
let out_curr := add(outStringBytes, 0x20)
} lt(input_curr, input_end) {
input_curr := add(input_curr, 0x01)
out_curr := add(out_curr, 0x02)
} {
let curr_input_byte := shr(0xf8, mload(input_curr))
// here outStringByte from each half of input byte calculates by the next:
//
// "FEDCBA9876543210" ASCII-encoded, shifted and automatically truncated.
// outStringByte = byte (uint8 (0x66656463626139383736353433323130 >> (uint8 (_byteHalf) * 8)))
mstore(
out_curr,
shl(0xf8, shr(mul(shr(0x04, curr_input_byte), 0x08), 0x66656463626139383736353433323130))
)
mstore(
add(out_curr, 0x01),
shl(0xf8, shr(mul(and(0x0f, curr_input_byte), 0x08), 0x66656463626139383736353433323130))
)
}
}
return outStringBytes;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_master","type":"address"},{"internalType":"address","name":"_receiver","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"FundsReceived","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"enabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaster","outputs":[{"internalType":"address","name":"master","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"receiver","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_newReceiver","type":"address"}],"name":"setReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMaster","type":"address"}],"name":"transferMastership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"}],"name":"withdrawPendingFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040526000805460ff60a01b1916600160a01b17905534801561002357600080fd5b5060405161065e38038061065e833981016040819052610042916100e1565b8161004c8161007b565b5061005561009f565b600080546001600160a01b0319166001600160a01b039290921691909117905550610113565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b60017f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf455565b80516001600160a01b03811681146100dc57600080fd5b919050565b600080604083850312156100f3578182fd5b6100fc836100c5565b915061010a602084016100c5565b90509250929050565b61053c806101226000396000f3fe6080604052600436106100555760003560e01c8063238dafe01461008e5780635a99719e146100b9578063718da7ee146100db5780637be9c682146100fd578063c3f596871461011d578063f7260d3e1461013d575b7fbcdc7071c1beb6dcf2744621e0b29a2f2432ee20812d9ca5e3d5e8f9308d93a33460405161008491906104e8565b60405180910390a1005b34801561009a57600080fd5b506100a3610152565b6040516100b09190610444565b60405180910390f35b3480156100c557600080fd5b506100ce610162565b6040516100b09190610430565b3480156100e757600080fd5b506100fb6100f636600461040a565b610187565b005b34801561010957600080fd5b506100fb61011836600461040a565b6101b2565b34801561012957600080fd5b506100fb61013836600461040a565b610330565b34801561014957600080fd5b506100ce610385565b600054600160a01b900460ff1681565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61019033610394565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b7f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf4548061020b576040805162461bcd60e51b815260206004820152600260248201526118b160f11b604482015290519081900360640190fd5b60007f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf4819055546001600160a01b0316331480610260575061024b610162565b6001600160a01b0316336001600160a01b0316145b6102855760405162461bcd60e51b815260040161027c9061044f565b60405180910390fd5b60004790506000836001600160a01b0316826040516102a39061042d565b60006040518083038185875af1925050503d80600081146102e0576040519150601f19603f3d011682016040523d82523d6000602084013e6102e5565b606091505b50509050806103065760405162461bcd60e51b815260040161027c906104bb565b505060017f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf4555050565b61033933610394565b6001600160a01b038116610379576040805162461bcd60e51b81526020600482015260026024820152610c5960f21b604482015290519081900360640190fd5b610382816103e6565b50565b6000546001600160a01b031681565b61039c610162565b6001600160a01b0316816001600160a01b031614610382576040805162461bcd60e51b8152602060048201526002602482015261316360f01b604482015290519081900360640190fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b60006020828403121561041b578081fd5b8135610426816104f1565b9392505050565b90565b6001600160a01b0391909116815260200190565b901515815260200190565b60208082526046908201527f4f6e6c7920746865207265636569766572206f72206d61737465722063616e2060408201527f77697468647261772066756e64732066726f6d2074686520736d61727420636f6060820152651b9d1c9858dd60d21b608082015260a00190565b602080825260139082015272115512081dda5d1a191c985dc819985a5b1959606a1b604082015260600190565b90815260200190565b6001600160a01b038116811461038257600080fdfea2646970667358221220decd52e1c341444dbc13a791684bce3446f39ed8924f43c96c5555d5f4a564c464736f6c63430007060033000000000000000000000000017674bd734f120a60b43965fb76fbcd0a89cd24000000000000000000000000e1fab3efd74a77c23b426c302d96372140ff7d0c
Deployed Bytecode
0x6080604052600436106100555760003560e01c8063238dafe01461008e5780635a99719e146100b9578063718da7ee146100db5780637be9c682146100fd578063c3f596871461011d578063f7260d3e1461013d575b7fbcdc7071c1beb6dcf2744621e0b29a2f2432ee20812d9ca5e3d5e8f9308d93a33460405161008491906104e8565b60405180910390a1005b34801561009a57600080fd5b506100a3610152565b6040516100b09190610444565b60405180910390f35b3480156100c557600080fd5b506100ce610162565b6040516100b09190610430565b3480156100e757600080fd5b506100fb6100f636600461040a565b610187565b005b34801561010957600080fd5b506100fb61011836600461040a565b6101b2565b34801561012957600080fd5b506100fb61013836600461040a565b610330565b34801561014957600080fd5b506100ce610385565b600054600160a01b900460ff1681565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61019033610394565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b7f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf4548061020b576040805162461bcd60e51b815260206004820152600260248201526118b160f11b604482015290519081900360640190fd5b60007f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf4819055546001600160a01b0316331480610260575061024b610162565b6001600160a01b0316336001600160a01b0316145b6102855760405162461bcd60e51b815260040161027c9061044f565b60405180910390fd5b60004790506000836001600160a01b0316826040516102a39061042d565b60006040518083038185875af1925050503d80600081146102e0576040519150601f19603f3d011682016040523d82523d6000602084013e6102e5565b606091505b50509050806103065760405162461bcd60e51b815260040161027c906104bb565b505060017f8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf4555050565b61033933610394565b6001600160a01b038116610379576040805162461bcd60e51b81526020600482015260026024820152610c5960f21b604482015290519081900360640190fd5b610382816103e6565b50565b6000546001600160a01b031681565b61039c610162565b6001600160a01b0316816001600160a01b031614610382576040805162461bcd60e51b8152602060048201526002602482015261316360f01b604482015290519081900360640190fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b60006020828403121561041b578081fd5b8135610426816104f1565b9392505050565b90565b6001600160a01b0391909116815260200190565b901515815260200190565b60208082526046908201527f4f6e6c7920746865207265636569766572206f72206d61737465722063616e2060408201527f77697468647261772066756e64732066726f6d2074686520736d61727420636f6060820152651b9d1c9858dd60d21b608082015260a00190565b602080825260139082015272115512081dda5d1a191c985dc819985a5b1959606a1b604082015260600190565b90815260200190565b6001600160a01b038116811461038257600080fdfea2646970667358221220decd52e1c341444dbc13a791684bce3446f39ed8924f43c96c5555d5f4a564c464736f6c63430007060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000017674bd734f120a60b43965fb76fbcd0a89cd24000000000000000000000000e1fab3efd74a77c23b426c302d96372140ff7d0c
-----Decoded View---------------
Arg [0] : _master (address): 0x017674bD734f120a60B43965fB76FbCd0a89Cd24
Arg [1] : _receiver (address): 0xe1faB3eFD74A77C23B426c302D96372140FF7d0C
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000017674bd734f120a60b43965fb76fbcd0a89cd24
Arg [1] : 000000000000000000000000e1fab3efd74a77c23b426c302d96372140ff7d0c
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 74.88% | $2,985.45 | 0.224 | $668.74 | |
| BSC | 9.98% | $2,987.4 | 0.0298 | $89.14 | |
| BSC | 1.17% | $126.91 | 0.0826 | $10.48 | |
| BSC | 1.10% | $0.999528 | 9.8 | $9.8 | |
| BSC | 0.77% | $855.99 | 0.008 | $6.85 | |
| ZKSYNC | 5.35% | $2,985.45 | 0.016 | $47.77 | |
| ARB | 4.08% | $2,985.57 | 0.0122 | $36.42 | |
| OP | 2.67% | $2,985.55 | 0.008 | $23.88 | |
| GNO | <0.01% | $0.999677 | 0.012 | $0.011996 | |
| POL | <0.01% | $0.109312 | 0.012 | $0.001312 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.