Description:
Smart contract deployed on Ethereum with Factory features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"contracts/utils/UiProjectStamp.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
abstract contract UiProjectStamp {
bytes32 private immutable _BUILD_HASH;
uint48 private immutable _BUILT_AT;
uint16 private immutable _VARIANT;
constructor(bytes32 uiLabelHash_) {
bytes32 w = keccak256(abi.encode(block.chainid, msg.sender, uiLabelHash_));
_BUILD_HASH = keccak256(abi.encode(w, address(this)));
_BUILT_AT = uint48(block.timestamp);
_VARIANT = uint16(uint256(_BUILD_HASH));
}
function project() public view returns (bytes32 buildHash, uint48 builtAt, uint16 variant) {
return (_BUILD_HASH, _BUILT_AT, _VARIANT);
}
}
"
},
"contracts/VendorMinimal.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
import "./utils/UiProjectStamp.sol";
contract VendorMinimal is UiProjectStamp {
struct Sku{ string name; address owner; bool sold; }
Sku[] public skus;
event SkuAdded(uint256 id, string name);
event SkuBought(uint256 id, address buyer);
constructor(bytes32 u) UiProjectStamp(u) {}
function addSku(string calldata n) external returns(uint256 id){ skus.push(Sku(n,address(0),false)); id=skus.length-1; emit SkuAdded(id,n); }
function buySku(uint256 id) external { require(id<skus.length,"bad id"); require(!skus[id].sold,"sold"); skus[id].sold=true; skus[id].owner=msg.sender; emit SkuBought(id,msg.sender); }
}
"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "cancun",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}}
Submitted on: 2025-09-30 10:11:57
Comments
Log in to comment.
No comments yet.