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/ErrorsPlay.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
import "./utils/UiProjectStamp.sol";
contract ErrorsPlay is UiProjectStamp {
uint256 public quota;
uint256 public used;
error OverQuota(uint256 want, uint256 left);
event QuotaSet(uint256 q);
event Consumed(uint256 amount, uint256 used);
constructor(bytes32 u) UiProjectStamp(u) {}
function setQuota(uint256 q) external { quota=q; emit QuotaSet(q); }
function consume(uint256 a) external { if (used + a > quota) revert OverQuota(a, quota - used); used+=a; emit Consumed(a, used); }
}
"
},
"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);
}
}
"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "cancun",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}}
Submitted on: 2025-09-30 10:11:32
Comments
Log in to comment.
No comments yet.