Source Code
Latest 25 from a total of 505 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| 0xe89395e9 | 24483756 | 5 days ago | IN | 0.0001364 ETH | 0.00002057 | ||||
| 0xe89395e9 | 24483723 | 5 days ago | IN | 0.00029453 ETH | 0.00002172 | ||||
| Swap Tokens Gene... | 24483714 | 5 days ago | IN | 0 ETH | 0.00002034 | ||||
| 0xe89395e9 | 24432439 | 12 days ago | IN | 0 ETH | 0.00002239 | ||||
| 0x83e342bc | 24432345 | 12 days ago | IN | 0 ETH | 0.00001098 | ||||
| 0xe89395e9 | 24432244 | 12 days ago | IN | 0.0001 ETH | 0.00001499 | ||||
| 0xe89395e9 | 24431647 | 12 days ago | IN | 0 ETH | 0.00001904 | ||||
| 0x83e342bc | 24431561 | 12 days ago | IN | 0 ETH | 0.0000059 | ||||
| 0xe89395e9 | 24431456 | 12 days ago | IN | 0.0001 ETH | 0.00001166 | ||||
| 0xe89395e9 | 24425283 | 13 days ago | IN | 0 ETH | 0.00002012 | ||||
| 0x83e342bc | 24425192 | 13 days ago | IN | 0 ETH | 0.00000852 | ||||
| 0xe89395e9 | 24425107 | 13 days ago | IN | 0.0001 ETH | 0.00002419 | ||||
| 0x83e342bc | 24425091 | 13 days ago | IN | 0 ETH | 0.00001332 | ||||
| 0xe89395e9 | 24425020 | 13 days ago | IN | 0.0001 ETH | 0.00002661 | ||||
| 0xe89395e9 | 24424815 | 13 days ago | IN | 0.0001 ETH | 0.00005029 | ||||
| 0xe89395e9 | 24392246 | 18 days ago | IN | 0 ETH | 0.00087762 | ||||
| 0x83e342bc | 24392151 | 18 days ago | IN | 0 ETH | 0.00045964 | ||||
| 0xe89395e9 | 24392065 | 18 days ago | IN | 0.0001 ETH | 0.00080339 | ||||
| Swap Tokens Gene... | 24345918 | 24 days ago | IN | 0.00111688 ETH | 0.00002807 | ||||
| Swap Tokens Gene... | 24345825 | 24 days ago | IN | 0.00036658 ETH | 0.00002769 | ||||
| Swap Tokens Gene... | 24339477 | 25 days ago | IN | 0 ETH | 0.00002627 | ||||
| 0x83e342bc | 24277155 | 34 days ago | IN | 0 ETH | 0.00004168 | ||||
| 0x83e342bc | 24273789 | 34 days ago | IN | 0 ETH | 0.00001012 | ||||
| 0x83e342bc | 24247804 | 38 days ago | IN | 0 ETH | 0.00001852 | ||||
| Swap Tokens Gene... | 24217228 | 42 days ago | IN | 0 ETH | 0.00001144 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer* | 24483756 | 5 days ago | 0.0001364 ETH | ||||
| Transfer* | 24483723 | 5 days ago | 0.00029453 ETH | ||||
| Transfer | 24483714 | 5 days ago | 0.00012168 ETH | ||||
| Transfer | 24483714 | 5 days ago | 0.00000024 ETH | ||||
| Transfer | 24483714 | 5 days ago | 0.00012192 ETH | ||||
| Transfer* | 24432244 | 12 days ago | 0.0001 ETH | ||||
| Transfer* | 24431456 | 12 days ago | 0.0001 ETH | ||||
| Transfer* | 24425107 | 13 days ago | 0.0001 ETH | ||||
| Transfer* | 24425020 | 13 days ago | 0.0001 ETH | ||||
| Transfer* | 24424815 | 13 days ago | 0.0001 ETH | ||||
| Transfer* | 24392065 | 18 days ago | 0.0001 ETH | ||||
| Transfer* | 24345918 | 24 days ago | 0.00111688 ETH | ||||
| Transfer* | 24345825 | 24 days ago | 0.00036658 ETH | ||||
| Transfer* | 24194113 | 45 days ago | 0.00000003 ETH | ||||
| Transfer* | 24189922 | 46 days ago | 0.00029318 ETH | ||||
| Transfer* | 24167674 | 49 days ago | 0.00000319 ETH | ||||
| Transfer | 24074847 | 62 days ago | 0.00050417 ETH | ||||
| Transfer | 24074847 | 62 days ago | 0.00000101 ETH | ||||
| Transfer | 24074847 | 62 days ago | 0.00050518 ETH | ||||
| Transfer | 24074797 | 62 days ago | 0.00006723 ETH | ||||
| Transfer | 24074797 | 62 days ago | 0.00000013 ETH | ||||
| Transfer | 24074797 | 62 days ago | 0.00006736 ETH | ||||
| Transfer | 24070943 | 63 days ago | 0.00016702 ETH | ||||
| Transfer | 24070943 | 63 days ago | 0.00000033 ETH | ||||
| Transfer | 24070943 | 63 days ago | 0.00016736 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
KanaDiamond
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import {LibDiamond} from "./Libraries/LibDiamond.sol";
import {IDiamondCut} from "./Interfaces/IDiamondCut.sol";
import {LibUtil} from "./Libraries/LibUtil.sol";
contract KanaDiamond {
constructor(address _contractOwner, address _diamondCutFacet) payable {
LibDiamond.setContractOwner(_contractOwner);
// Add the diamondCut external function from the diamondCutFacet
IDiamondCut.FacetCut[] memory cut = new IDiamondCut.FacetCut[](1);
bytes4[] memory functionSelectors = new bytes4[](1);
functionSelectors[0] = IDiamondCut.diamondCut.selector;
cut[0] = IDiamondCut.FacetCut({
facetAddress: _diamondCutFacet,
action: IDiamondCut.FacetCutAction.Add,
functionSelectors: functionSelectors
});
LibDiamond.diamondCut(cut, address(0), "");
}
// Find facet for function that is called and execute the
// function if a facet is found and return any value.
// solhint-disable-next-line no-complex-fallback
fallback() external payable {
LibDiamond.DiamondStorage storage ds;
bytes32 position = LibDiamond.DIAMOND_STORAGE_POSITION;
// get diamond storage
// solhint-disable-next-line no-inline-assembly
assembly {
ds.slot := position
}
// get facet from function selector
address facet = ds.selectorToFacetAndPosition[msg.sig].facetAddress;
if (facet == address(0)) {
revert LibDiamond.FunctionDoesNotExist();
}
// Execute external function from facet using delegatecall and return any value.
// solhint-disable-next-line no-inline-assembly
assembly {
// copy function selector and any arguments
calldatacopy(0, 0, calldatasize())
// execute function call using the facet
let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0)
// get any return value
returndatacopy(0, 0, returndatasize())
// return any return value or error back to the caller
switch result
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
// Able to receive ether
// solhint-disable-next-line no-empty-blocks
receive() external payable {}
}// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; error AlreadyInitialized(); error CannotAuthoriseSelf(); error CannotBridgeToSameNetwork(); error ContractCallNotAllowed(); error CumulativeSlippageTooHigh(uint256 minAmount, uint256 receivedAmount); error ExternalCallFailed(); error InformationMismatch(); error InsufficientBalance(uint256 required, uint256 balance); error InvalidAmount(); error InvalidCallData(); error InvalidConfig(); error InvalidContract(); error InvalidDestinationChain(); error InvalidFallbackAddress(); error InvalidReceiver(); error InvalidSendingToken(); error NativeAssetNotSupported(); error NativeAssetTransferFailed(); error NoSwapDataProvided(); error NoSwapFromZeroBalance(); error NotAContract(); error NotInitialized(); error NoTransferToNullAddress(); error NullAddrIsNotAnERC20Token(); error NullAddrIsNotAValidSpender(); error OnlyContractOwner(); error RecoveryAddressCannotBeZero(); error ReentrancyError(); error TokenNotSupported(); error UnAuthorized(); error UnsupportedChainId(uint256 chainId); error ZeroAmount(); error TokenAddressIsZero(); error ZeroPostSwapBalance(); error NativeValueWithERC(); error InvalidBridgeConfigLength(); error InvalidCaller(); error CannotDepositNativeToken(); error NotEnoughBalance(uint256 requested, uint256 available); error IsNotOwner();
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
interface IDiamondCut {
enum FacetCutAction {
Add,
Replace,
Remove
}
// Add=0, Replace=1, Remove=2
struct FacetCut {
address facetAddress;
FacetCutAction action;
bytes4[] functionSelectors;
}
/// @notice Add/replace/remove any number of functions and optionally execute
/// a function with delegatecall
/// @param _diamondCut Contains the facet addresses and function selectors
/// @param _init The address of the contract or facet to execute _calldata
/// @param _calldata A function call, including function selector and arguments
/// _calldata is executed with delegatecall on _init
function diamondCut(FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata) external;
event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
library LibBytes {
// solhint-disable no-inline-assembly
// LibBytes specific errors
error SliceOverflow();
error SliceOutOfBounds();
error AddressOutOfBounds();
error UintOutOfBounds();
// -------------------------
function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {
bytes memory tempBytes;
assembly {
// Get a location of some free memory and store it in tempBytes as
// Solidity does for memory variables.
tempBytes := mload(0x40)
// Store the length of the first bytes array at the beginning of
// the memory for tempBytes.
let length := mload(_preBytes)
mstore(tempBytes, length)
// Maintain a memory counter for the current write location in the
// temp bytes array by adding the 32 bytes for the array length to
// the starting location.
let mc := add(tempBytes, 0x20)
// Stop copying when the memory counter reaches the length of the
// first bytes array.
let end := add(mc, length)
for {
// Initialize a copy counter to the start of the _preBytes data,
// 32 bytes into its memory.
let cc := add(_preBytes, 0x20)
} lt(mc, end) {
// Increase both counters by 32 bytes each iteration.
mc := add(mc, 0x20)
cc := add(cc, 0x20)
} {
// Write the _preBytes data into the tempBytes memory 32 bytes
// at a time.
mstore(mc, mload(cc))
}
// Add the length of _postBytes to the current length of tempBytes
// and store it as the new length in the first 32 bytes of the
// tempBytes memory.
length := mload(_postBytes)
mstore(tempBytes, add(length, mload(tempBytes)))
// Move the memory counter back from a multiple of 0x20 to the
// actual end of the _preBytes data.
mc := end
// Stop copying when the memory counter reaches the new combined
// length of the arrays.
end := add(mc, length)
for {
let cc := add(_postBytes, 0x20)
} lt(mc, end) {
mc := add(mc, 0x20)
cc := add(cc, 0x20)
} {
mstore(mc, mload(cc))
}
// Update the free-memory pointer by padding our last write location
// to 32 bytes: add 31 bytes to the end of tempBytes to move to the
// next 32 byte block, then round down to the nearest multiple of
// 32. If the sum of the length of the two arrays is zero then add
// one before rounding down to leave a blank 32 bytes (the length block with 0).
mstore(
0x40,
and(
add(add(end, iszero(add(length, mload(_preBytes)))), 31),
not(31) // Round down to the nearest 32 bytes.
)
)
}
return tempBytes;
}
function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {
assembly {
// Read the first 32 bytes of _preBytes storage, which is the length
// of the array. (We don't need to use the offset into the slot
// because arrays use the entire slot.)
let fslot := sload(_preBytes.slot)
// Arrays of 31 bytes or less have an even value in their slot,
// while longer arrays have an odd value. The actual length is
// the slot divided by two for odd values, and the lowest order
// byte divided by two for even values.
// If the slot is even, bitwise and the slot with 255 and divide by
// two to get the length. If the slot is odd, bitwise and the slot
// with -1 and divide by two.
let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
let mlength := mload(_postBytes)
let newlength := add(slength, mlength)
// slength can contain both the length and contents of the array
// if length < 32 bytes so let's prepare for that
// v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
switch add(lt(slength, 32), lt(newlength, 32))
case 2 {
// Since the new array still fits in the slot, we just need to
// update the contents of the slot.
// uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
sstore(
_preBytes.slot,
// all the modifications to the slot are inside this
// next block
add(
// we can just add to the slot contents because the
// bytes we want to change are the LSBs
fslot,
add(
mul(
div(
// load the bytes from memory
mload(add(_postBytes, 0x20)),
// zero all bytes to the right
exp(0x100, sub(32, mlength))
),
// and now shift left the number of bytes to
// leave space for the length in the slot
exp(0x100, sub(32, newlength))
),
// increase length by the double of the memory
// bytes length
mul(mlength, 2)
)
)
)
}
case 1 {
// The stored value fits in the slot, but the combined value
// will exceed it.
// get the keccak hash to get the contents of the array
mstore(0x0, _preBytes.slot)
let sc := add(keccak256(0x0, 0x20), div(slength, 32))
// save new length
sstore(_preBytes.slot, add(mul(newlength, 2), 1))
// The contents of the _postBytes array start 32 bytes into
// the structure. Our first read should obtain the `submod`
// bytes that can fit into the unused space in the last word
// of the stored array. To get this, we read 32 bytes starting
// from `submod`, so the data we read overlaps with the array
// contents by `submod` bytes. Masking the lowest-order
// `submod` bytes allows us to add that value directly to the
// stored value.
let submod := sub(32, slength)
let mc := add(_postBytes, submod)
let end := add(_postBytes, mlength)
let mask := sub(exp(0x100, submod), 1)
sstore(
sc,
add(
and(fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00),
and(mload(mc), mask)
)
)
for {
mc := add(mc, 0x20)
sc := add(sc, 1)
} lt(mc, end) {
sc := add(sc, 1)
mc := add(mc, 0x20)
} {
sstore(sc, mload(mc))
}
mask := exp(0x100, sub(mc, end))
sstore(sc, mul(div(mload(mc), mask), mask))
}
default {
// get the keccak hash to get the contents of the array
mstore(0x0, _preBytes.slot)
// Start copying to the last used word of the stored array.
let sc := add(keccak256(0x0, 0x20), div(slength, 32))
// save new length
sstore(_preBytes.slot, add(mul(newlength, 2), 1))
// Copy over the first `submod` bytes of the new data as in
// case 1 above.
let slengthmod := mod(slength, 32)
let submod := sub(32, slengthmod)
let mc := add(_postBytes, submod)
let end := add(_postBytes, mlength)
let mask := sub(exp(0x100, submod), 1)
sstore(sc, add(sload(sc), and(mload(mc), mask)))
for {
sc := add(sc, 1)
mc := add(mc, 0x20)
} lt(mc, end) {
sc := add(sc, 1)
mc := add(mc, 0x20)
} {
sstore(sc, mload(mc))
}
mask := exp(0x100, sub(mc, end))
sstore(sc, mul(div(mload(mc), mask), mask))
}
}
}
function slice(bytes memory _bytes, uint256 _start, uint256 _length) internal pure returns (bytes memory) {
if (_length + 31 < _length) revert SliceOverflow();
if (_bytes.length < _start + _length) revert SliceOutOfBounds();
bytes memory tempBytes;
assembly {
switch iszero(_length)
case 0 {
// Get a location of some free memory and store it in tempBytes as
// Solidity does for memory variables.
tempBytes := mload(0x40)
// The first word of the slice result is potentially a partial
// word read from the original array. To read it, we calculate
// the length of that partial word and start copying that many
// bytes into the array. The first word we copy will start with
// data we don't care about, but the last `lengthmod` bytes will
// land at the beginning of the contents of the new array. When
// we're done copying, we overwrite the full first word with
// the actual length of the slice.
let lengthmod := and(_length, 31)
// The multiplication in the next line is necessary
// because when slicing multiples of 32 bytes (lengthmod == 0)
// the following copy loop was copying the origin's length
// and then ending prematurely not copying everything it should.
let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
let end := add(mc, _length)
for {
// The multiplication in the next line has the same exact purpose
// as the one above.
let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
} lt(mc, end) {
mc := add(mc, 0x20)
cc := add(cc, 0x20)
} {
mstore(mc, mload(cc))
}
mstore(tempBytes, _length)
//update free-memory pointer
//allocating the array padded to 32 bytes like the compiler does now
mstore(0x40, and(add(mc, 31), not(31)))
}
//if we want a zero-length slice let's just return a zero-length array
default {
tempBytes := mload(0x40)
//zero out the 32 bytes slice we are about to return
//we need to do it because Solidity does not garbage collect
mstore(tempBytes, 0)
mstore(0x40, add(tempBytes, 0x20))
}
}
return tempBytes;
}
function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
if (_bytes.length < _start + 20) {
revert AddressOutOfBounds();
}
address tempAddress;
assembly {
tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
}
return tempAddress;
}
function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
if (_bytes.length < _start + 1) {
revert UintOutOfBounds();
}
uint8 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x1), _start))
}
return tempUint;
}
function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {
if (_bytes.length < _start + 2) {
revert UintOutOfBounds();
}
uint16 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x2), _start))
}
return tempUint;
}
function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {
if (_bytes.length < _start + 4) {
revert UintOutOfBounds();
}
uint32 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x4), _start))
}
return tempUint;
}
function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {
if (_bytes.length < _start + 8) {
revert UintOutOfBounds();
}
uint64 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x8), _start))
}
return tempUint;
}
function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {
if (_bytes.length < _start + 12) {
revert UintOutOfBounds();
}
uint96 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0xc), _start))
}
return tempUint;
}
function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {
if (_bytes.length < _start + 16) {
revert UintOutOfBounds();
}
uint128 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x10), _start))
}
return tempUint;
}
function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {
if (_bytes.length < _start + 32) {
revert UintOutOfBounds();
}
uint256 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x20), _start))
}
return tempUint;
}
function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {
if (_bytes.length < _start + 32) {
revert UintOutOfBounds();
}
bytes32 tempBytes32;
assembly {
tempBytes32 := mload(add(add(_bytes, 0x20), _start))
}
return tempBytes32;
}
function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
bool success = true;
assembly {
let length := mload(_preBytes)
// if lengths don't match the arrays are not equal
switch eq(length, mload(_postBytes))
case 1 {
// cb is a circuit breaker in the for loop since there's
// no said feature for inline assembly loops
// cb = 1 - don't breaker
// cb = 0 - break
let cb := 1
let mc := add(_preBytes, 0x20)
let end := add(mc, length)
for {
let cc := add(_postBytes, 0x20)
// the next line is the loop condition:
// while(uint256(mc < end) + cb == 2)
} eq(add(lt(mc, end), cb), 2) {
mc := add(mc, 0x20)
cc := add(cc, 0x20)
} {
// if any of these checks fails then arrays are not equal
if iszero(eq(mload(mc), mload(cc))) {
// unsuccess:
success := 0
cb := 0
}
}
}
default {
// unsuccess:
success := 0
}
}
return success;
}
function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {
bool success = true;
assembly {
// we know _preBytes_offset is 0
let fslot := sload(_preBytes.slot)
// Decode the length of the stored array like in concatStorage().
let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
let mlength := mload(_postBytes)
// if lengths don't match the arrays are not equal
switch eq(slength, mlength)
case 1 {
// slength can contain both the length and contents of the array
// if length < 32 bytes so let's prepare for that
// v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
if iszero(iszero(slength)) {
switch lt(slength, 32)
case 1 {
// blank the last byte which is the length
fslot := mul(div(fslot, 0x100), 0x100)
if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
// unsuccess:
success := 0
}
}
default {
// cb is a circuit breaker in the for loop since there's
// no said feature for inline assembly loops
// cb = 1 - don't breaker
// cb = 0 - break
let cb := 1
// get the keccak hash to get the contents of the array
mstore(0x0, _preBytes.slot)
let sc := keccak256(0x0, 0x20)
let mc := add(_postBytes, 0x20)
let end := add(mc, mlength)
// the next line is the loop condition:
// while(uint256(mc < end) + cb == 2)
// solhint-disable-next-line no-empty-blocks
for {
} eq(add(lt(mc, end), cb), 2) {
sc := add(sc, 1)
mc := add(mc, 0x20)
} {
if iszero(eq(sload(sc), mload(mc))) {
// unsuccess:
success := 0
cb := 0
}
}
}
}
}
default {
// unsuccess:
success := 0
}
}
return success;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import {IDiamondCut} from "../Interfaces/IDiamondCut.sol";
import {LibUtil} from "../Libraries/LibUtil.sol";
import {OnlyContractOwner} from "../Errors/GenericErrors.sol";
/// Implementation of EIP-2535 Diamond Standard
/// https://eips.ethereum.org/EIPS/eip-2535
library LibDiamond {
bytes32 internal constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage");
// Diamond specific errors
error IncorrectFacetCutAction();
error NoSelectorsInFace();
error FunctionAlreadyExists();
error FacetAddressIsZero();
error FacetAddressIsNotZero();
error FacetContainsNoCode();
error FunctionDoesNotExist();
error FunctionIsImmutable();
error InitZeroButCalldataNotEmpty();
error CalldataEmptyButInitNotZero();
error InitReverted();
// ----------------
struct FacetAddressAndPosition {
address facetAddress;
uint96 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array
}
struct FacetFunctionSelectors {
bytes4[] functionSelectors;
uint256 facetAddressPosition; // position of facetAddress in facetAddresses array
}
struct DiamondStorage {
// maps function selector to the facet address and
// the position of the selector in the facetFunctionSelectors.selectors array
mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;
// maps facet addresses to function selectors
mapping(address => FacetFunctionSelectors) facetFunctionSelectors;
// facet addresses
address[] facetAddresses;
// Used to query if a contract implements an interface.
// Used to implement ERC-165.
mapping(bytes4 => bool) supportedInterfaces;
// owner of the contract
address contractOwner;
}
function diamondStorage() internal pure returns (DiamondStorage storage ds) {
bytes32 position = DIAMOND_STORAGE_POSITION;
// solhint-disable-next-line no-inline-assembly
assembly {
ds.slot := position
}
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function setContractOwner(address _newOwner) internal {
DiamondStorage storage ds = diamondStorage();
address previousOwner = ds.contractOwner;
ds.contractOwner = _newOwner;
emit OwnershipTransferred(previousOwner, _newOwner);
}
function contractOwner() internal view returns (address contractOwner_) {
contractOwner_ = diamondStorage().contractOwner;
}
function enforceIsContractOwner() internal view {
if (msg.sender != diamondStorage().contractOwner) revert OnlyContractOwner();
}
event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);
// Internal function version of diamondCut
function diamondCut(IDiamondCut.FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {
for (uint256 facetIndex; facetIndex < _diamondCut.length; ) {
IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action;
if (action == IDiamondCut.FacetCutAction.Add) {
addFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);
} else if (action == IDiamondCut.FacetCutAction.Replace) {
replaceFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);
} else if (action == IDiamondCut.FacetCutAction.Remove) {
removeFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);
} else {
revert IncorrectFacetCutAction();
}
unchecked {
++facetIndex;
}
}
emit DiamondCut(_diamondCut, _init, _calldata);
initializeDiamondCut(_init, _calldata);
}
function addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {
if (_functionSelectors.length == 0) {
revert NoSelectorsInFace();
}
DiamondStorage storage ds = diamondStorage();
if (LibUtil.isZeroAddress(_facetAddress)) {
revert FacetAddressIsZero();
}
uint96 selectorPosition = uint96(ds.facetFunctionSelectors[_facetAddress].functionSelectors.length);
// add new facet address if it does not exist
if (selectorPosition == 0) {
addFacet(ds, _facetAddress);
}
for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; ) {
bytes4 selector = _functionSelectors[selectorIndex];
address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;
if (!LibUtil.isZeroAddress(oldFacetAddress)) {
revert FunctionAlreadyExists();
}
addFunction(ds, selector, selectorPosition, _facetAddress);
unchecked {
++selectorPosition;
++selectorIndex;
}
}
}
function replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {
if (_functionSelectors.length == 0) {
revert NoSelectorsInFace();
}
DiamondStorage storage ds = diamondStorage();
if (LibUtil.isZeroAddress(_facetAddress)) {
revert FacetAddressIsZero();
}
uint96 selectorPosition = uint96(ds.facetFunctionSelectors[_facetAddress].functionSelectors.length);
// add new facet address if it does not exist
if (selectorPosition == 0) {
addFacet(ds, _facetAddress);
}
for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; ) {
bytes4 selector = _functionSelectors[selectorIndex];
address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;
if (oldFacetAddress == _facetAddress) {
revert FunctionAlreadyExists();
}
removeFunction(ds, oldFacetAddress, selector);
addFunction(ds, selector, selectorPosition, _facetAddress);
unchecked {
++selectorPosition;
++selectorIndex;
}
}
}
function removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {
if (_functionSelectors.length == 0) {
revert NoSelectorsInFace();
}
DiamondStorage storage ds = diamondStorage();
// if function does not exist then do nothing and return
if (!LibUtil.isZeroAddress(_facetAddress)) {
revert FacetAddressIsNotZero();
}
for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; ) {
bytes4 selector = _functionSelectors[selectorIndex];
address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;
removeFunction(ds, oldFacetAddress, selector);
unchecked {
++selectorIndex;
}
}
}
function addFacet(DiamondStorage storage ds, address _facetAddress) internal {
enforceHasContractCode(_facetAddress);
ds.facetFunctionSelectors[_facetAddress].facetAddressPosition = ds.facetAddresses.length;
ds.facetAddresses.push(_facetAddress);
}
function addFunction(
DiamondStorage storage ds,
bytes4 _selector,
uint96 _selectorPosition,
address _facetAddress
) internal {
ds.selectorToFacetAndPosition[_selector].functionSelectorPosition = _selectorPosition;
ds.facetFunctionSelectors[_facetAddress].functionSelectors.push(_selector);
ds.selectorToFacetAndPosition[_selector].facetAddress = _facetAddress;
}
function removeFunction(DiamondStorage storage ds, address _facetAddress, bytes4 _selector) internal {
if (LibUtil.isZeroAddress(_facetAddress)) {
revert FunctionDoesNotExist();
}
// an immutable function is a function defined directly in a diamond
if (_facetAddress == address(this)) {
revert FunctionIsImmutable();
}
// replace selector with last selector, then delete last selector
uint256 selectorPosition = ds.selectorToFacetAndPosition[_selector].functionSelectorPosition;
uint256 lastSelectorPosition = ds.facetFunctionSelectors[_facetAddress].functionSelectors.length - 1;
// if not the same then replace _selector with lastSelector
if (selectorPosition != lastSelectorPosition) {
bytes4 lastSelector = ds.facetFunctionSelectors[_facetAddress].functionSelectors[lastSelectorPosition];
ds.facetFunctionSelectors[_facetAddress].functionSelectors[selectorPosition] = lastSelector;
ds.selectorToFacetAndPosition[lastSelector].functionSelectorPosition = uint96(selectorPosition);
}
// delete the last selector
ds.facetFunctionSelectors[_facetAddress].functionSelectors.pop();
delete ds.selectorToFacetAndPosition[_selector];
// if no more selectors for facet address then delete the facet address
if (lastSelectorPosition == 0) {
// replace facet address with last facet address and delete last facet address
uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;
uint256 facetAddressPosition = ds.facetFunctionSelectors[_facetAddress].facetAddressPosition;
if (facetAddressPosition != lastFacetAddressPosition) {
address lastFacetAddress = ds.facetAddresses[lastFacetAddressPosition];
ds.facetAddresses[facetAddressPosition] = lastFacetAddress;
ds.facetFunctionSelectors[lastFacetAddress].facetAddressPosition = facetAddressPosition;
}
ds.facetAddresses.pop();
delete ds.facetFunctionSelectors[_facetAddress].facetAddressPosition;
}
}
function initializeDiamondCut(address _init, bytes memory _calldata) internal {
if (LibUtil.isZeroAddress(_init)) {
if (_calldata.length != 0) {
revert InitZeroButCalldataNotEmpty();
}
} else {
if (_calldata.length == 0) {
revert CalldataEmptyButInitNotZero();
}
if (_init != address(this)) {
enforceHasContractCode(_init);
}
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory error) = _init.delegatecall(_calldata);
if (!success) {
if (error.length > 0) {
// bubble up the error
revert(string(error));
} else {
revert InitReverted();
}
}
}
}
function enforceHasContractCode(address _contract) internal view {
uint256 contractSize;
// solhint-disable-next-line no-inline-assembly
assembly {
contractSize := extcodesize(_contract)
}
if (contractSize == 0) {
revert FacetContainsNoCode();
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "./LibBytes.sol";
library LibUtil {
using LibBytes for bytes;
function getRevertMsg(bytes memory _res) internal pure returns (string memory) {
// If the _res length is less than 68, then the transaction failed silently (without a revert message)
if (_res.length < 68) return "Transaction reverted silently";
bytes memory revertData = _res.slice(4, _res.length - 4); // Remove the selector which is the first 4 bytes
return abi.decode(revertData, (string)); // All that remains is the revert string
}
/// @notice Determines whether the given address is the zero address
/// @param addr The address to verify
/// @return Boolean indicating if the address is the zero address
function isZeroAddress(address addr) internal pure returns (bool) {
return addr == address(0);
}
}{
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 2000
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_contractOwner","type":"address"},{"internalType":"address","name":"_diamondCutFacet","type":"address"}],"stateMutability":"payable","type":"constructor"},{"inputs":[],"name":"CalldataEmptyButInitNotZero","type":"error"},{"inputs":[],"name":"FacetAddressIsNotZero","type":"error"},{"inputs":[],"name":"FacetAddressIsZero","type":"error"},{"inputs":[],"name":"FacetContainsNoCode","type":"error"},{"inputs":[],"name":"FunctionAlreadyExists","type":"error"},{"inputs":[],"name":"FunctionDoesNotExist","type":"error"},{"inputs":[],"name":"FunctionIsImmutable","type":"error"},{"inputs":[],"name":"IncorrectFacetCutAction","type":"error"},{"inputs":[],"name":"InitReverted","type":"error"},{"inputs":[],"name":"InitZeroButCalldataNotEmpty","type":"error"},{"inputs":[],"name":"NoSelectorsInFace","type":"error"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60806040526040516200203438038062002034833981016040819052620000269162000d95565b6200003c826200015660201b620000ad1760201c565b604080516001808252818301909252600091816020015b60408051606080820183526000808352602083015291810191909152815260200190600190039081620000535750506040805160018082528183019092529192506000919060208083019080368337019050509050631f931c1c60e01b81600081518110620000c657620000c662000dcd565b6001600160e01b031990921660209283029190910182015260408051606081019091526001600160a01b038516815290810160008152602001828152508260008151811062000119576200011962000dcd565b60200260200101819052506200014c82600060405180602001604052806000815250620001da60201b6200014f1760201c565b5050505062000fcc565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c132080546001600160a01b031981166001600160a01b0384811691821790935560405160008051602062002014833981519152939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60005b835181101562000396576000848281518110620001fe57620001fe62000dcd565b60200260200101516020015190506000600281111562000222576200022262000de3565b81600281111562000237576200023762000de3565b0362000295576200028f85838151811062000256576200025662000dcd565b60200260200101516000015186848151811062000277576200027762000dcd565b602002602001015160400151620003e560201b60201c565b6200038c565b6001816002811115620002ac57620002ac62000de3565b0362000304576200028f858381518110620002cb57620002cb62000dcd565b602002602001015160000151868481518110620002ec57620002ec62000dcd565b602002602001015160400151620005c160201b60201c565b60028160028111156200031b576200031b62000de3565b0362000373576200028f8583815181106200033a576200033a62000dcd565b6020026020010151600001518684815181106200035b576200035b62000dcd565b6020026020010151604001516200079560201b60201c565b60405163e548e6b560e01b815260040160405180910390fd5b50600101620001dd565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673838383604051620003cc9392919062000e4d565b60405180910390a1620003e0828262000874565b505050565b805160000362000408576040516307bc559560e41b815260040160405180910390fd5b60006000805160206200201483398151915290506200043283620009a460201b620003301760201c565b156200045157604051636347641d60e11b815260040160405180910390fd5b6001600160a01b0383166000908152600182016020526040812054906001600160601b03821690036200048a576200048a8285620009b1565b60005b8351811015620005ba576000848281518110620004ae57620004ae62000dcd565b6020908102919091018101516001600160e01b03198116600090815286835260409020549092506001600160a01b031690620004f590829062000330620009a4821b17901c565b620005135760405163a023275d60e01b815260040160405180910390fd5b6001600160e01b0319821660008181526020878152604080832080546001600160a01b03908116600160a01b6001600160601b038c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281546001600160a01b0319161790555050600191820191016200048d565b5050505050565b8051600003620005e4576040516307bc559560e41b815260040160405180910390fd5b60006000805160206200201483398151915290506200060e83620009a460201b620003301760201c565b156200062d57604051636347641d60e11b815260040160405180910390fd5b6001600160a01b0383166000908152600182016020526040812054906001600160601b03821690036200066657620006668285620009b1565b60005b8351811015620005ba5760008482815181106200068a576200068a62000dcd565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b039081169087168103620006e15760405163a023275d60e01b815260040160405180910390fd5b620006ee85828462000a04565b6001600160e01b0319821660008181526020878152604080832080546001600160a01b03908116600160a01b6001600160601b038c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281546001600160a01b03191617905550506001918201910162000669565b8051600003620007b8576040516307bc559560e41b815260040160405180910390fd5b6000600080516020620020148339815191529050620007e283620009a460201b620003301760201c565b6200080057604051633ce4ef9160e11b815260040160405180910390fd5b60005b82518110156200086e57600083828151811062000824576200082462000dcd565b6020908102919091018101516001600160e01b031981166000908152918590526040909120549091506001600160a01b03166200086384828462000a04565b505060010162000803565b50505050565b6200088a82620009a460201b620003301760201c565b15620008b557805115620008b1576040516304c08b4360e51b815260040160405180910390fd5b5050565b8051600003620008d85760405163211002b360e11b815260040160405180910390fd5b6001600160a01b0382163014620008f457620008f48262000d54565b600080836001600160a01b03168360405162000911919062000f54565b600060405180830381855af49150503d80600081146200094e576040519150601f19603f3d011682016040523d82523d6000602084013e62000953565b606091505b5091509150816200086e578051156200098b578060405162461bcd60e51b815260040162000982919062000f72565b60405180910390fd5b60405163c53ebed560e01b815260040160405180910390fd5b6001600160a01b03161590565b620009bc8162000d54565b6002820180546001600160a01b0390921660008181526001948501602090815260408220860185905594840183559182529290200180546001600160a01b0319169091179055565b62000a1a82620009a460201b620003301760201c565b1562000a3957604051631535ac5f60e31b815260040160405180910390fd5b306001600160a01b0383160362000a635760405163c3c5ec3760e01b815260040160405180910390fd5b6001600160e01b03198116600090815260208481526040808320546001600160a01b0386168452600180880190935290832054600160a01b9091046001600160601b0316929162000ab49162000f8e565b905080821462000bad576001600160a01b0384166000908152600186016020526040812080548390811062000aed5762000aed62000dcd565b600091825260208083206008830401546001600160a01b038916845260018a019091526040909220805460079092166004026101000a90920460e01b92508291908590811062000b415762000b4162000dcd565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b03199290921682528690526040902080546001600160a01b0316600160a01b6001600160601b038516021790555b6001600160a01b0384166000908152600186016020526040902080548062000bd95762000bd962000fb6565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b03198516825286905260408120819055819003620005ba57600285015460009062000c3f9060019062000f8e565b6001600160a01b038616600090815260018089016020526040909120015490915080821462000cf557600087600201838154811062000c825762000c8262000dcd565b6000918252602090912001546002890180546001600160a01b03909216925082918490811062000cb65762000cb662000dcd565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600189810190925260409020018190555b8660020180548062000d0b5762000d0b62000fb6565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0388168252600189810190915260408220015550505050505050565b803b6000819003620008b1576040516271a80360e91b815260040160405180910390fd5b80516001600160a01b038116811462000d9057600080fd5b919050565b6000806040838503121562000da957600080fd5b62000db48362000d78565b915062000dc46020840162000d78565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60005b8381101562000e1657818101518382015260200162000dfc565b50506000910152565b6000815180845262000e3981602086016020860162000df9565b601f01601f19169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b8481101562000f2257898403607f19018652815180516001600160a01b0316855283810151898601906003811062000ebe57634e487b7160e01b600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b8083101562000f0c5783516001600160e01b031916825292860192600192909201919086019062000ee0565b5097850197955050509082019060010162000e76565b50506001600160a01b038a1690880152868103604088015262000f46818962000e1f565b9a9950505050505050505050565b6000825162000f6881846020870162000df9565b9190910192915050565b60208152600062000f87602083018462000e1f565b9392505050565b8181038181111562000fb057634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052603160045260246000fd5b6110388062000fdc6000396000f3fe60806040523661000b57005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602081905260409091205481906001600160a01b031680610089576040517fa9ad62f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3660008037600080366000845af43d6000803e8080156100a8573d6000f35b3d6000fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c1320805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b038481169182179093556040517fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60005b83518110156102e557600084828151811061016f5761016f610dd8565b60200260200101516020015190506000600281111561019057610190610dee565b8160028111156101a2576101a2610dee565b036101f0576101eb8583815181106101bc576101bc610dd8565b6020026020010151600001518684815181106101da576101da610dd8565b60200260200101516040015161033d565b6102dc565b600181600281111561020457610204610dee565b0361024d576101eb85838151811061021e5761021e610dd8565b60200260200101516000015186848151811061023c5761023c610dd8565b602002602001015160400151610544565b600281600281111561026157610261610dee565b036102aa576101eb85838151811061027b5761027b610dd8565b60200260200101516000015186848151811061029957610299610dd8565b602002602001015160400151610754565b6040517fe548e6b500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600101610152565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67383838360405161031993929190610e72565b60405180910390a161032b8282610845565b505050565b6001600160a01b03161590565b805160000361035f576040516307bc559560e41b815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6001600160a01b0383166103c0576040517fc68ec83a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383166000908152600182016020526040812054906bffffffffffffffffffffffff821690036103fb576103fb82856109bf565b60005b835181101561053d57600084828151811061041b5761041b610dd8565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b03168015610485576040517fa023275d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160e01b0319821660008181526020878152604080832080546001600160a01b03908116600160a01b6bffffffffffffffffffffffff8c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c949094029390931790925593909252879052815473ffffffffffffffffffffffffffffffffffffffff19161790555050600191820191016103fe565b5050505050565b8051600003610566576040516307bc559560e41b815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6001600160a01b0383166105c7576040517fc68ec83a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383166000908152600182016020526040812054906bffffffffffffffffffffffff821690036106025761060282856109bf565b60005b835181101561053d57600084828151811061062257610622610dd8565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b039081169087168103610691576040517fa023275d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61069c858284610a1d565b6001600160e01b0319821660008181526020878152604080832080546001600160a01b03908116600160a01b6bffffffffffffffffffffffff8c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c949094029390931790925593909252879052815473ffffffffffffffffffffffffffffffffffffffff1916179055505060019182019101610605565b8051600003610776576040516307bc559560e41b815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6001600160a01b038316156107d8576040517f79c9df2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b825181101561083f5760008382815181106107f8576107f8610dd8565b6020908102919091018101516001600160e01b031981166000908152918590526040909120549091506001600160a01b0316610835848284610a1d565b50506001016107db565b50505050565b6001600160a01b0382166108905780511561088c576040517f9811686000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b80516000036108cb576040517f4220056600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03821630146108e4576108e482610d9b565b600080836001600160a01b0316836040516108ff9190610f8f565b600060405180830381855af49150503d806000811461093a576040519150601f19603f3d011682016040523d82523d6000602084013e61093f565b606091505b50915091508161083f5780511561098d57806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109849190610fab565b60405180910390fd5b6040517fc53ebed500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109c881610d9b565b6002820180546001600160a01b03909216600081815260019485016020908152604082208601859055948401835591825292902001805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b6001600160a01b038216610a5d576040517fa9ad62f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b306001600160a01b03831603610a9f576040517fc3c5ec3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160e01b03198116600090815260208481526040808320546001600160a01b0386168452600180880190935290832054600160a01b9091046bffffffffffffffffffffffff169291610af391610fc5565b9050808214610bea576001600160a01b03841660009081526001860160205260408120805483908110610b2857610b28610dd8565b600091825260208083206008830401546001600160a01b038916845260018a019091526040909220805460079092166004026101000a90920460e01b925082919085908110610b7957610b79610dd8565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b03199290921682528690526040902080546001600160a01b0316600160a01b6bffffffffffffffffffffffff8516021790555b6001600160a01b03841660009081526001860160205260409020805480610c1357610c13610fec565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319851682528690526040812081905581900361053d576002850154600090610c7690600190610fc5565b6001600160a01b0386166000908152600180890160205260409091200154909150808214610d32576000876002018381548110610cb557610cb5610dd8565b6000918252602090912001546002890180546001600160a01b039092169250829184908110610ce657610ce6610dd8565b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03948516179055929091168152600189810190925260409020018190555b86600201805480610d4557610d45610fec565b600082815260208082208301600019908101805473ffffffffffffffffffffffffffffffffffffffff191690559092019092556001600160a01b0388168252600189810190915260408220015550505050505050565b803b600081900361088c576040517fe350060000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60005b83811015610e1f578181015183820152602001610e07565b50506000910152565b60008151808452610e40816020860160208601610e04565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b84811015610f5f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808a850301865281518885016001600160a01b0382511686528482015160038110610efe57634e487b7160e01b600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b80831015610f4a5783516001600160e01b0319168252928601926001929092019190860190610f20565b50978501979550505090820190600101610e9b565b50506001600160a01b038a16908801528681036040880152610f818189610e28565b9a9950505050505050505050565b60008251610fa1818460208701610e04565b9190910192915050565b602081526000610fbe6020830184610e28565b9392505050565b81810381811115610fe657634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052603160045260246000fdfea264697066735822122082ed162b6b7e9fd1bb0081378860e8843db2400488924cf1ded9a205b2e98a3d64736f6c63430008110033c8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c00000000000000000000000001e6c37a730be3557cff6079f59c6fcf9274b3ba000000000000000000000000c21da2dac6c8cd8d8920cf6751093cd48332575d
Deployed Bytecode
0x60806040523661000b57005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602081905260409091205481906001600160a01b031680610089576040517fa9ad62f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3660008037600080366000845af43d6000803e8080156100a8573d6000f35b3d6000fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c1320805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b038481169182179093556040517fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60005b83518110156102e557600084828151811061016f5761016f610dd8565b60200260200101516020015190506000600281111561019057610190610dee565b8160028111156101a2576101a2610dee565b036101f0576101eb8583815181106101bc576101bc610dd8565b6020026020010151600001518684815181106101da576101da610dd8565b60200260200101516040015161033d565b6102dc565b600181600281111561020457610204610dee565b0361024d576101eb85838151811061021e5761021e610dd8565b60200260200101516000015186848151811061023c5761023c610dd8565b602002602001015160400151610544565b600281600281111561026157610261610dee565b036102aa576101eb85838151811061027b5761027b610dd8565b60200260200101516000015186848151811061029957610299610dd8565b602002602001015160400151610754565b6040517fe548e6b500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600101610152565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67383838360405161031993929190610e72565b60405180910390a161032b8282610845565b505050565b6001600160a01b03161590565b805160000361035f576040516307bc559560e41b815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6001600160a01b0383166103c0576040517fc68ec83a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383166000908152600182016020526040812054906bffffffffffffffffffffffff821690036103fb576103fb82856109bf565b60005b835181101561053d57600084828151811061041b5761041b610dd8565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b03168015610485576040517fa023275d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160e01b0319821660008181526020878152604080832080546001600160a01b03908116600160a01b6bffffffffffffffffffffffff8c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c949094029390931790925593909252879052815473ffffffffffffffffffffffffffffffffffffffff19161790555050600191820191016103fe565b5050505050565b8051600003610566576040516307bc559560e41b815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6001600160a01b0383166105c7576040517fc68ec83a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383166000908152600182016020526040812054906bffffffffffffffffffffffff821690036106025761060282856109bf565b60005b835181101561053d57600084828151811061062257610622610dd8565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b039081169087168103610691576040517fa023275d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61069c858284610a1d565b6001600160e01b0319821660008181526020878152604080832080546001600160a01b03908116600160a01b6bffffffffffffffffffffffff8c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c949094029390931790925593909252879052815473ffffffffffffffffffffffffffffffffffffffff1916179055505060019182019101610605565b8051600003610776576040516307bc559560e41b815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6001600160a01b038316156107d8576040517f79c9df2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b825181101561083f5760008382815181106107f8576107f8610dd8565b6020908102919091018101516001600160e01b031981166000908152918590526040909120549091506001600160a01b0316610835848284610a1d565b50506001016107db565b50505050565b6001600160a01b0382166108905780511561088c576040517f9811686000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b80516000036108cb576040517f4220056600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03821630146108e4576108e482610d9b565b600080836001600160a01b0316836040516108ff9190610f8f565b600060405180830381855af49150503d806000811461093a576040519150601f19603f3d011682016040523d82523d6000602084013e61093f565b606091505b50915091508161083f5780511561098d57806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109849190610fab565b60405180910390fd5b6040517fc53ebed500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109c881610d9b565b6002820180546001600160a01b03909216600081815260019485016020908152604082208601859055948401835591825292902001805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b6001600160a01b038216610a5d576040517fa9ad62f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b306001600160a01b03831603610a9f576040517fc3c5ec3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160e01b03198116600090815260208481526040808320546001600160a01b0386168452600180880190935290832054600160a01b9091046bffffffffffffffffffffffff169291610af391610fc5565b9050808214610bea576001600160a01b03841660009081526001860160205260408120805483908110610b2857610b28610dd8565b600091825260208083206008830401546001600160a01b038916845260018a019091526040909220805460079092166004026101000a90920460e01b925082919085908110610b7957610b79610dd8565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b03199290921682528690526040902080546001600160a01b0316600160a01b6bffffffffffffffffffffffff8516021790555b6001600160a01b03841660009081526001860160205260409020805480610c1357610c13610fec565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319851682528690526040812081905581900361053d576002850154600090610c7690600190610fc5565b6001600160a01b0386166000908152600180890160205260409091200154909150808214610d32576000876002018381548110610cb557610cb5610dd8565b6000918252602090912001546002890180546001600160a01b039092169250829184908110610ce657610ce6610dd8565b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03948516179055929091168152600189810190925260409020018190555b86600201805480610d4557610d45610fec565b600082815260208082208301600019908101805473ffffffffffffffffffffffffffffffffffffffff191690559092019092556001600160a01b0388168252600189810190915260408220015550505050505050565b803b600081900361088c576040517fe350060000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60005b83811015610e1f578181015183820152602001610e07565b50506000910152565b60008151808452610e40816020860160208601610e04565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b84811015610f5f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808a850301865281518885016001600160a01b0382511686528482015160038110610efe57634e487b7160e01b600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b80831015610f4a5783516001600160e01b0319168252928601926001929092019190860190610f20565b50978501979550505090820190600101610e9b565b50506001600160a01b038a16908801528681036040880152610f818189610e28565b9a9950505050505050505050565b60008251610fa1818460208701610e04565b9190910192915050565b602081526000610fbe6020830184610e28565b9392505050565b81810381811115610fe657634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052603160045260246000fdfea264697066735822122082ed162b6b7e9fd1bb0081378860e8843db2400488924cf1ded9a205b2e98a3d64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000001e6c37a730be3557cff6079f59c6fcf9274b3ba000000000000000000000000c21da2dac6c8cd8d8920cf6751093cd48332575d
-----Decoded View---------------
Arg [0] : _contractOwner (address): 0x01E6c37a730be3557CFF6079f59c6Fcf9274b3ba
Arg [1] : _diamondCutFacet (address): 0xc21dA2DAc6c8CD8D8920cf6751093Cd48332575D
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000001e6c37a730be3557cff6079f59c6fcf9274b3ba
Arg [1] : 000000000000000000000000c21da2dac6c8cd8d8920cf6751093cd48332575d
Loading...
Loading
Loading...
Loading
Net Worth in USD
$1.00
Net Worth in ETH
0.000537
Token Allocations
BSC-USD
100.00%
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| BSC | 100.00% | $0.999748 | 0.9988 | $0.9985 |
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.