Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| 0x60a06040 | 15169583 | 1288 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
SharedStorefrontLazyMintAdapter
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import { IERC1155 } from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
/**
* @author emo.eth
* @title SharedStorefrontLazyMintAdapter
* @notice SharedStorefrontLazymintAdapter is a stub of an ERC1155 token,
* which acts as a safe proxy for lazily minting tokens from the
* the underlying Shared Storefront.
* The lazy minting functionality of the original Shared Storefront
* was built with the assumption that every user would have their own
* individual Wyvern-style proxy, which makes an exchange with
* a global proxy like Seaport unsafe to add as a shared proxy.
* This adapter contract performs the necessary check that lazily
* minted tokens are being spent from their creators' address, relying
* on the invariant that Seaport will never transfer tokens from an
* account that has not signed a valid order.
*/
contract SharedStorefrontLazyMintAdapter {
IERC1155 immutable ssfToken;
address private constant SEAPORT =
0x00000000006c3852cbEf3e08E8dF289169EdE581;
address private constant CONDUIT =
0x1E0049783F008A0085193E00003D00cd54003c71;
error InsufficientBalance();
error UnauthorizedCaller();
modifier onlySeaportOrConduit() {
if (msg.sender != CONDUIT && msg.sender != SEAPORT) {
revert UnauthorizedCaller();
}
_;
}
modifier onlyCreatorLazyMint(
address from,
uint256 tokenId,
uint256 amount
) {
// get balance of spender - this will return current balance
// plus remaining supply if spender is the creator
// (or this contract itself - which should never be possible,
// as Seaport will only spend from accts that have signed a valid order)
uint256 fromBalance = ssfToken.balanceOf(from, tokenId);
// if insufficient balance, revert
if (fromBalance < amount) {
revert InsufficientBalance();
}
_;
}
/// @dev parameterless constructor allows us to CREATE2 this contract at the same address on each network
constructor() {
// can't set immutables within an if statement; use temp var
address tokenAddress;
uint256 chainId = block.chainid;
// use chainId to get network SSF address
if (chainId == 4) {
// rinkeby SSF
tokenAddress = 0x88B48F654c30e99bc2e4A1559b4Dcf1aD93FA656;
} else if (chainId == 137 || chainId == 80001) {
// polygon + mumbai SSF
tokenAddress = 0x2953399124F0cBB46d2CbACD8A89cF0599974963;
} else {
// mainnet SSF
tokenAddress = 0x495f947276749Ce646f68AC8c248420045cb7b5e;
}
ssfToken = IERC1155(tokenAddress);
}
/**
* @notice stub method that performs two checks before calling real SSF safeTransferFrom
* 1. check that the caller is a valid proxy (Seaport or OpenSea conduit)
* 2. check that the token spender owns enough tokens, or is the creator of
* the token and not all tokens have been minted yet
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
uint256 amount,
bytes memory
) public onlySeaportOrConduit onlyCreatorLazyMint(from, tokenId, amount) {
// Seaport 1.1 always calls safeTransferFrom with empty data
ssfToken.safeTransferFrom(from, to, tokenId, amount, "");
}
/**
* @notice pass-through balanceOf method to the SSF for backwards-compatibility with seaport-js
* @param owner address to check balance of
* @param tokenId id to check balance of
* @return uint256 balance of tokenId for owner
*/
function balanceOf(address owner, uint256 tokenId)
public
view
returns (uint256)
{
return ssfToken.balanceOf(owner, tokenId);
}
/**
* @notice stub isApprovedForAll method for backwards-compatibility with seaport-js
* @param operator address to check approval of
* @return bool if operator is Conduit or Seaport
*/
function isApprovedForAll(address, address operator)
public
pure
returns (bool)
{
return operator == CONDUIT || operator == SEAPORT;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"@openzeppelin/=lib/openzeppelin-contracts/",
"@rari-capital/solmate/=lib/solmate/",
"ds-test/=lib/solmate/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"solmate/=lib/solmate/src/",
"ssf-test/=foundry/test/",
"ssf/=contracts/",
"src/=src/",
"foundry/=foundry/",
"script/=script/"
],
"optimizer": {
"enabled": true,
"runs": 1000000
},
"metadata": {
"bytecodeHash": "ipfs"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"UnauthorizedCaller","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a060405234801561001057600080fd5b506000466004819003610039577388b48f654c30e99bc2e4a1559b4dcf1ad93fa6569150610083565b806089148061004a57508062013881145b1561006b57732953399124f0cbb46d2cbacd8a89cf05999749639150610083565b73495f947276749ce646f68ac8c248420045cb7b5e91505b506001600160a01b03166080526080516106056100b86000396000818160f101528181610287015261039601526106056000f3fe608060405234801561001057600080fd5b50600436106100405760003560e01c8062fdd58e14610045578063e985e9c51461006b578063f242432a1461008e575b600080fd5b610058610053366004610426565b6100a3565b6040519081526020015b60405180910390f35b61007e610079366004610450565b610164565b6040519015158152602001610062565b6100a161009c3660046104b2565b6101c9565b005b6040517efdd58e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390526000917f00000000000000000000000000000000000000000000000000000000000000009091169062fdd58e90604401602060405180830381865afa158015610139573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015d91906105b6565b9392505050565b600073ffffffffffffffffffffffffffffffffffffffff8216731e0049783f008a0085193e00003d00cd54003c71148061015d575073ffffffffffffffffffffffffffffffffffffffff82166e6c3852cbef3e08e8df289169ede58114905092915050565b33731e0049783f008a0085193e00003d00cd54003c71148015906101fc5750336e6c3852cbef3e08e8df289169ede58114155b15610233576040517f5c427cd900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517efdd58e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8087166004830152602482018590528691859185916000917f0000000000000000000000000000000000000000000000000000000000000000169062fdd58e90604401602060405180830381865afa1580156102cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f191906105b6565b90508181101561032d576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ff242432a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a811660048301528981166024830152604482018990526064820188905260a06084830152600060a48301527f0000000000000000000000000000000000000000000000000000000000000000169063f242432a9060c401600060405180830381600087803b1580156103da57600080fd5b505af11580156103ee573d6000803e3d6000fd5b50505050505050505050505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461042157600080fd5b919050565b6000806040838503121561043957600080fd5b610442836103fd565b946020939093013593505050565b6000806040838503121561046357600080fd5b61046c836103fd565b915061047a602084016103fd565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080600080600060a086880312156104ca57600080fd5b6104d3866103fd565b94506104e1602087016103fd565b93506040860135925060608601359150608086013567ffffffffffffffff8082111561050c57600080fd5b818801915088601f83011261052057600080fd5b81358181111561053257610532610483565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561057857610578610483565b816040528281528b602084870101111561059157600080fd5b8260208601602083013760006020848301015280955050505050509295509295909350565b6000602082840312156105c857600080fd5b505191905056fea2646970667358221220fa3e973cf13506d3fea9b4d8de8c462f687122448e9d83079438e44ff341b29b64736f6c634300080f0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100405760003560e01c8062fdd58e14610045578063e985e9c51461006b578063f242432a1461008e575b600080fd5b610058610053366004610426565b6100a3565b6040519081526020015b60405180910390f35b61007e610079366004610450565b610164565b6040519015158152602001610062565b6100a161009c3660046104b2565b6101c9565b005b6040517efdd58e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390526000917f000000000000000000000000495f947276749ce646f68ac8c248420045cb7b5e9091169062fdd58e90604401602060405180830381865afa158015610139573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015d91906105b6565b9392505050565b600073ffffffffffffffffffffffffffffffffffffffff8216731e0049783f008a0085193e00003d00cd54003c71148061015d575073ffffffffffffffffffffffffffffffffffffffff82166e6c3852cbef3e08e8df289169ede58114905092915050565b33731e0049783f008a0085193e00003d00cd54003c71148015906101fc5750336e6c3852cbef3e08e8df289169ede58114155b15610233576040517f5c427cd900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517efdd58e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8087166004830152602482018590528691859185916000917f000000000000000000000000495f947276749ce646f68ac8c248420045cb7b5e169062fdd58e90604401602060405180830381865afa1580156102cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f191906105b6565b90508181101561032d576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ff242432a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a811660048301528981166024830152604482018990526064820188905260a06084830152600060a48301527f000000000000000000000000495f947276749ce646f68ac8c248420045cb7b5e169063f242432a9060c401600060405180830381600087803b1580156103da57600080fd5b505af11580156103ee573d6000803e3d6000fd5b50505050505050505050505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461042157600080fd5b919050565b6000806040838503121561043957600080fd5b610442836103fd565b946020939093013593505050565b6000806040838503121561046357600080fd5b61046c836103fd565b915061047a602084016103fd565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080600080600060a086880312156104ca57600080fd5b6104d3866103fd565b94506104e1602087016103fd565b93506040860135925060608601359150608086013567ffffffffffffffff8082111561050c57600080fd5b818801915088601f83011261052057600080fd5b81358181111561053257610532610483565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561057857610578610483565b816040528281528b602084870101111561059157600080fd5b8260208601602083013760006020848301015280955050505050509295509295909350565b6000602082840312156105c857600080fd5b505191905056fea2646970667358221220fa3e973cf13506d3fea9b4d8de8c462f687122448e9d83079438e44ff341b29b64736f6c634300080f0033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.