编译器
0.8.19+commit.7dd6d404
文件 1 的 8:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 2 的 8:IGT.sol
pragma solidity 0.8.19;
interface IGT
{
function _LiveMintBurn(uint TicketID) external returns (address Recipient);
}
文件 3 的 8:IMP.sol
pragma solidity 0.8.19;
interface IMP
{
function _LiveMintBurn(uint TicketID) external returns (address Recipient, uint ArtistID);
}
文件 4 的 8:IMinter.sol
pragma solidity ^0.8.19;
interface IMinter
{
function purchase(uint256 _projectId) payable external returns (uint tokenID);
function purchaseTo(address _to, uint _projectId) payable external returns (uint tokenID);
function tokenURI(uint256 _tokenId) external view returns (string memory);
function _MintToFactory(uint ProjectID, address To, uint Amount) external;
function _MintToFactory(address To, uint Amount) external;
function purchaseToBatch(address[] memory _to) payable external returns (uint[] memory tokenIDs);
}
文件 5 的 8:LiveMintVenice.sol
pragma solidity 0.8.19;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import { IMinter } from "./IMinter.sol";
import { IMP } from "./IMP.sol";
import { IGT } from "./IGT.sol";
contract LiveMintVenice is Ownable, ReentrancyGuard
{
struct City
{
string _Name;
uint _QRCurrentIndex;
bytes32 _RootEligibility;
bytes32 _RootAmount;
bool _RemoteMintingEnabledCitizens;
}
bytes32 private constant _AUTHORIZED = keccak256("AUTHORIZED");
bytes32 private constant _MINTER_ROLE = keccak256("MINTER_ROLE");
address private constant _DN = 0x00000000000076A84feF008CDAbe6409d2FE638B;
address private constant _GOLDEN_TOKEN = 0x985e1932FFd2aA4bC9cE611DFe12816A248cD2cE;
address private constant _CITIZEN_MINTER = 0xDd06d8483868Cd0C5E69C24eEaA2A5F2bEaFd42b;
address private constant _BRT_MULTISIG = 0xB96E81f80b3AEEf65CB6d0E280b15FD5DBE71937;
address private _FINALE_MINTER = 0x6b611F416C9ef3c704540Ce98CdC05B748Ef7C19;
uint private constant _CCI = 9;
uint private _FMI = 0;
uint public _MaxQRDelegationsPerDay = 25;
bool public _QRDelegationsEnabled = true;
mapping(uint => City) public Cities;
mapping(uint => mapping(address => bool)) public _QRRedeemed;
mapping(uint => mapping(address => uint)) public _QRAllocation;
mapping(uint => mapping(uint => address)) public _BrightListCitizen;
mapping(uint => mapping(uint => bool)) public _MintedCitizen;
mapping(uint => mapping(address => uint)) public _QRsRedeemed;
mapping(uint => uint) public DailyCalls;
mapping(address => bytes32) public Role;
event LiveMintComplete(address Redeemer, uint TicketID, uint TokenID, uint TokenID2);
event LiveMintBatchComplete(address[] Recipients, uint[] TicketIDs, uint[] MintedWorkTokenIDs);
event QRRedeemed(address Redeemer, uint TicketID);
event AuthorizedContract(address NewAddress);
event DeauthorizedContract(address NewAddress);
constructor()
{
Cities[9]._Name = "CryptoVenezians";
Cities[9]._QRCurrentIndex = 1332;
Role[0xe06F5FAE754e81Bc050215fF89B03d9e9FF20700] = _AUTHORIZED;
Role[0x18B7511938FBe2EE08ADf3d4A24edB00A5C9B783] = _AUTHORIZED;
Role[0x1A0a3E3AE390a0710f8A6d00587082273eA8F6C9] = _MINTER_ROLE;
Role[0x4d8013b0c264034CBf22De9DF33e22f58D52F207] = _MINTER_ROLE;
Role[0x4D9A8CF2fE52b8D49C7F7EAA87b2886c2bCB4160] = _MINTER_ROLE;
Role[0x124fd966A0D83aA020D3C54AE2c9f4800b46F460] = _MINTER_ROLE;
Role[0x100469feA90Ac1Fe1073E1B2b5c020A8413635c4] = _MINTER_ROLE;
Role[0x756De4236373fd17652b377315954ca327412bBA] = _MINTER_ROLE;
Role[0xc5Dfba6ef7803665C1BDE478B51Bd7eB257A2Cb9] = _MINTER_ROLE;
Role[0xFBF32b29Bcf8fEe32d43a4Bfd3e7249daec457C0] = _MINTER_ROLE;
Role[0xF2A15A83DEE7f03C70936449037d65a1C100FF27] = _MINTER_ROLE;
Role[0x1D2BAB965a4bB72f177Cd641C7BacF3d8257230D] = _MINTER_ROLE;
Role[0x2e51E8b950D72BDf003b58E357C2BA28FB77c7fB] = _MINTER_ROLE;
Role[0x8a7186dECb91Da854090be8226222eA42c5eeCb6] = _MINTER_ROLE;
_transferOwnership(0xe06F5FAE754e81Bc050215fF89B03d9e9FF20700);
}
function RedeemQR (
bytes32[] calldata ProofEligibility,
bytes32[] calldata ProofAmounts,
address Vault,
uint Amount
) external payable nonReentrant {
address Recipient = msg.sender;
if(Vault != address(0)) { if(IDelegationRegistry(_DN).checkDelegateForAll(msg.sender, Vault)) { Recipient = Vault; } }
readQREligibility(Recipient, ProofEligibility, ProofAmounts, Amount);
_QRsRedeemed[_CCI][Recipient] += Amount;
if(_QRAllocation[_CCI][Recipient] == 0)
{
require(!_QRRedeemed[_CCI][Recipient], "LiveMint: User Has Already Redeemed");
_BrightListCitizen[_CCI][Cities[_CCI]._QRCurrentIndex] = Recipient;
emit QRRedeemed(Recipient, Cities[_CCI]._QRCurrentIndex);
Cities[_CCI]._QRCurrentIndex++;
}
else
{
require (
_QRsRedeemed[_CCI][Recipient] <= _QRAllocation[_CCI][Recipient],
"LiveMint: User Has No Remaining Authorized QRs To Redeem"
);
uint _CurrentQR = Cities[_CCI]._QRCurrentIndex;
uint _Limit = Amount + _CurrentQR;
uint _Counter;
Cities[_CCI]._QRCurrentIndex = _Limit;
for(_CurrentQR; _CurrentQR < _Limit; _CurrentQR++)
{
_BrightListCitizen[_CCI][_CurrentQR] = Recipient;
emit QRRedeemed(Recipient, _CurrentQR);
_Counter++;
}
}
_QRRedeemed[_CCI][Recipient] = true;
}
function RemoteMintCitizens(uint[] calldata TicketIDs) external nonReentrant
{
require(tx.origin == msg.sender, "LiveMint: msg.sender Must Be EOA");
require(Cities[_CCI]._RemoteMintingEnabledCitizens, "LiveMint: Remote Minting Of Citizens Not Active");
address Recipient;
uint MintedWorkTokenID;
uint AdditionalTokenID;
for(uint TicketID; TicketID < TicketIDs.length; TicketID++)
{
require(TicketIDs[TicketID] < 1332, "LiveMint: Invalid Input TicketID, Must Be Golden Token");
require(!_MintedCitizen[_CCI][TicketIDs[TicketID]], "LiveMint: Golden Token Already Minted");
_MintedCitizen[_CCI][TicketIDs[TicketID]] = true;
Recipient = IGT(_GOLDEN_TOKEN)._LiveMintBurn(TicketIDs[TicketID]);
require(Recipient == msg.sender, "LiveMint: msg.sender Is Not Owner Of Golden Token");
MintedWorkTokenID = IMinter(_CITIZEN_MINTER).purchaseTo(Recipient, _CCI);
AdditionalTokenID = IMinter(_FINALE_MINTER).purchaseTo(Recipient, _FMI);
emit LiveMintComplete(Recipient, TicketIDs[TicketID], MintedWorkTokenID, AdditionalTokenID);
}
}
function _LiveMintCitizen(uint[] calldata TicketIDs) external onlyMinter
{
address Recipient;
uint MintedWorkTokenID;
uint AdditionalTokenID;
for(uint TicketID; TicketID < TicketIDs.length; TicketID++)
{
require(!_MintedCitizen[_CCI][TicketIDs[TicketID]], "LiveMint: Golden Token Already Minted");
if(_BrightListCitizen[_CCI][TicketIDs[TicketID]] != address(0)) { Recipient = _BrightListCitizen[_CCI][TicketIDs[TicketID]]; }
else if (TicketIDs[TicketID] < 1332) { Recipient = IGT(_GOLDEN_TOKEN)._LiveMintBurn(TicketIDs[TicketID]); }
else { revert("LiveMint: TicketID Is Not Eligible To Mint Citizen"); }
_MintedCitizen[_CCI][TicketIDs[TicketID]] = true;
MintedWorkTokenID = IMinter(_CITIZEN_MINTER).purchaseTo(Recipient, _CCI);
AdditionalTokenID = IMinter(_FINALE_MINTER).purchaseTo(Recipient, _FMI);
emit LiveMintComplete(Recipient, TicketIDs[TicketID], MintedWorkTokenID, AdditionalTokenID);
}
}
function _LiveMintCitizenBatch(uint[] calldata TicketIDs) external onlyMinter
{
address[] memory Recipients;
uint[] memory MintedWorkTokenIDs;
for(uint TicketID; TicketID < TicketIDs.length; TicketID++)
{
require(!_MintedCitizen[_CCI][TicketIDs[TicketID]], "LiveMint: Golden Token Already Minted");
if(_BrightListCitizen[_CCI][TicketIDs[TicketID]] != address(0)) { Recipients[TicketID] = _BrightListCitizen[_CCI][TicketIDs[TicketID]]; }
else if (TicketIDs[TicketID] < 1332) { Recipients[TicketID] = IGT(_GOLDEN_TOKEN)._LiveMintBurn(TicketIDs[TicketID]); }
else { revert("LiveMint: TicketID Is Not Eligible To Mint Citizen"); }
_MintedCitizen[_CCI][TicketIDs[TicketID]] = true;
}
MintedWorkTokenIDs = IMinter(_FINALE_MINTER).purchaseToBatch(Recipients);
emit LiveMintBatchComplete(Recipients, TicketIDs, MintedWorkTokenIDs);
}
function __DelegateQR (address Recipient) external onlyAdmin
{
require(_QRDelegationsEnabled, "LiveMint: QR Delegations Not Enabled");
uint _DaysElapsed = block.timestamp / 86400;
require(DailyCalls[_DaysElapsed] + 1 <= _MaxQRDelegationsPerDay, "LiveMint: Max Per Day Reached");
require(!_QRRedeemed[_CCI][Recipient], "LiveMint: User Has Already Redeemed");
DailyCalls[_DaysElapsed]++;
_QRRedeemed[_CCI][Recipient] = true;
_BrightListCitizen[_CCI][Cities[_CCI]._QRCurrentIndex] = Recipient;
emit QRRedeemed(Recipient, Cities[_CCI]._QRCurrentIndex);
Cities[_CCI]._QRCurrentIndex++;
}
function __ChangeRootEligibility (bytes32 NewRoot) external onlyAdmin { Cities[_CCI]._RootEligibility = NewRoot; }
function __ChangeRootAmounts (bytes32 NewRoot) external onlyAdmin { Cities[_CCI]._RootAmount = NewRoot; }
function __ChangeRoots (bytes32 EligibilityRoot, bytes32 EligibilityAmount) external onlyAdmin
{
Cities[_CCI]._RootEligibility = EligibilityRoot;
Cities[_CCI]._RootAmount = EligibilityAmount;
}
function __QRAllocationsOverwrite (address[] calldata Addresses, uint[] calldata Amounts) external onlyAdmin
{
require(Addresses.length == Amounts.length, "LiveMint: Input Arrays Must Match");
for(uint x; x < Addresses.length; x++) { _QRAllocation[_CCI][Addresses[x]] = Amounts[x]; }
}
function __QRAllocationsIncrement (address[] calldata Addresses, uint[] calldata Amounts) external onlyAdmin
{
require(Addresses.length == Amounts.length, "LiveMint: Input Arrays Must Match");
for(uint x; x < Addresses.length; x++) { _QRAllocation[_CCI][Addresses[x]] += Amounts[x]; }
}
function __QRAllocationsSetNoShow (uint[] calldata TicketIDs) external onlyAdmin
{
for(uint TicketIndex; TicketIndex < TicketIDs.length; TicketIndex++)
{
require(!_MintedCitizen[_CCI][TicketIDs[TicketIndex]], "LiveMint: Ticket ID Already Minted");
require(TicketIDs[TicketIndex] >= 1332, "LiveMint: Invalid TicketID");
_BrightListCitizen[_CCI][TicketIDs[TicketIndex]] = _BRT_MULTISIG;
}
}
function __FlipRemoteMintingCitizens() external onlyOwner
{
Cities[_CCI]._RemoteMintingEnabledCitizens = !Cities[_CCI]._RemoteMintingEnabledCitizens;
}
function __AddMinter(address Minter) external onlyOwner { Role[Minter] = _MINTER_ROLE; }
function __RemoveMinter(address Minter) external onlyOwner { Role[Minter] = 0x0; }
function __ChangeQRIndex(uint NewIndex) external onlyOwner { Cities[_CCI]._QRCurrentIndex = NewIndex; }
function __ChangeFinaleMinter(address NewMinter) external onlyOwner { _FINALE_MINTER = NewMinter; }
function __ChangeFinaleMinterIndex(uint NewIndex) external onlyOwner { _FMI = NewIndex; }
function __WithdrawETHCall() external onlyOwner
{
(bool success,) = msg.sender.call{value:(address(this).balance)}("");
require(success, "i have failed u anakin");
}
function __WithdrawEther() external onlyOwner { payable(msg.sender).transfer(address(this).balance); }
function __InitTransaction(address[] memory Targets, uint[] memory Values, bytes[] memory Datas) external onlyOwner
{
for(uint x; x < Targets.length; x++)
{
(bool success,) = Targets[x].call{value:(Values[x])}(Datas[x]);
require(success, "i have failed u anakin");
}
}
function ____AddressAuthorize(address NewAddress) external onlyOwner
{
Role[NewAddress] = _AUTHORIZED;
emit AuthorizedContract(NewAddress);
}
function ___DeauthorizeAddress(address NewAddress) external onlyOwner
{
Role[NewAddress] = 0x0;
emit DeauthorizedContract(NewAddress);
}
function readEligibility (
address Recipient,
bytes32[] memory Proof,
bytes32[] memory ProofAmount,
uint Amount
) public view returns (uint ) {
bool Eligible = readQREligibility(Recipient, Proof, ProofAmount, Amount);
uint Allocation = _QRAllocation[_CCI][Recipient];
uint AmountRedeemed = _QRsRedeemed[_CCI][Recipient];
if(Eligible && Allocation > AmountRedeemed) { return Allocation - AmountRedeemed; }
else if (Eligible && Allocation == 0 && AmountRedeemed == 0) { return 1; }
else { return 0; }
}
function readQREligibility (
address Recipient,
bytes32[] memory ProofEligibility,
bytes32[] memory ProofAmount,
uint Amount
) public view returns (bool) {
require(Amount > 0, "LiveMint: QR Redemption Amount Must Be > 0");
bytes32 Leaf = keccak256(abi.encodePacked(Recipient));
bytes32 LeafAmount = keccak256(abi.encodePacked(Recipient, Amount));
require(MerkleProof.verify(ProofEligibility, Cities[_CCI]._RootEligibility, Leaf), "LiveMint: Invalid Merkle Eligibility Proof");
require(MerkleProof.verify(ProofAmount, Cities[_CCI]._RootAmount, LeafAmount), "LiveMint: Invalid Merkle Amount Proof");
return true;
}
function readAmountRedeemed(address Recipient) public view returns(uint) { return _QRsRedeemed[_CCI][Recipient]; }
function readCitizenUnmintedTicketIDs() public view returns(uint[] memory)
{
uint[] memory UnmintedTokenIDs = new uint[](1000);
uint Counter;
uint CityIDBuffer = (_CCI % 6) * 333;
uint _TokenID;
for(uint TokenID; TokenID < 1000; TokenID++)
{
_TokenID = TokenID + CityIDBuffer;
if
(
(!_MintedCitizen[_CCI][_TokenID]
&&
_BrightListCitizen[_CCI][_TokenID] != address(0))
||
(!_MintedCitizen[_CCI][_TokenID] && _TokenID < 1332)
)
{
UnmintedTokenIDs[Counter] = _TokenID;
Counter++;
}
}
uint[] memory FormattedUnMintedTokenIDs = new uint[](Counter);
for(uint Index; Index < Counter; Index++)
{
FormattedUnMintedTokenIDs[Index] = UnmintedTokenIDs[Index];
}
return FormattedUnMintedTokenIDs;
}
function readCitizenMintedTicketIDs(uint CityID) public view returns(uint[] memory)
{
uint[] memory MintedTokenIDs = new uint[](1000);
uint Counter;
uint CityIDBuffer = (CityID % 6) * 333;
uint _TicketID;
for(uint TicketID; TicketID < 1000; TicketID++)
{
_TicketID = TicketID + CityIDBuffer;
if(_MintedCitizen[CityID][_TicketID])
{
MintedTokenIDs[Counter] = _TicketID;
Counter++;
}
}
uint[] memory FormattedMintedTokenIDs = new uint[](Counter);
uint Found;
for(uint FormattedTokenID; FormattedTokenID < Counter; FormattedTokenID++)
{
if(MintedTokenIDs[FormattedTokenID] != 0 || (MintedTokenIDs[FormattedTokenID] == 0 && FormattedTokenID == 0))
{
FormattedMintedTokenIDs[Found] = MintedTokenIDs[FormattedTokenID];
Found++;
}
}
return FormattedMintedTokenIDs;
}
function readCitizenCheckedInTicketIDs() public view returns(uint[] memory TokenIDs)
{
uint[] memory _TokenIDs = new uint[](1000);
uint CityIDBuffer = (_CCI % 6) * 333;
uint _TicketID;
uint Counter;
for(uint TicketID; TicketID < 1000; TicketID++)
{
_TicketID = TicketID + CityIDBuffer;
if(
!_MintedCitizen[_CCI][_TicketID]
&&
_BrightListCitizen[_CCI][_TicketID] != address(0)
)
{
_TokenIDs[Counter] = _TicketID;
Counter++;
}
}
uint[] memory FormattedCheckedInTickets = new uint[](Counter);
uint Found;
for(uint x; x < Counter; x++)
{
if(_TokenIDs[x] != 0 || (_TokenIDs[x] == 0 && x == 0))
{
FormattedCheckedInTickets[Found] = _TokenIDs[x];
Found++;
}
}
return FormattedCheckedInTickets;
}
function readCitizenBrightList(uint CityIndex) public view returns(address[] memory Recipients)
{
address[] memory _Recipients = new address[](1000);
uint Start = (CityIndex % 6) * 333;
for(uint x; x < 1000; x++) { _Recipients[x] = _BrightListCitizen[CityIndex][Start+x]; }
return _Recipients;
}
function readCitizenCity(uint CityIndex) public view returns(City memory) { return Cities[CityIndex]; }
modifier onlyMinter()
{
require(Role[msg.sender] == _MINTER_ROLE, "LiveMint | onlyMinter | Caller Is Not Approved BRT Minter");
_;
}
modifier onlyAdmin()
{
require(Role[msg.sender] == _AUTHORIZED || msg.sender == owner(), "LiveMint | onlyAdmin | Caller Is Not Approved Admin");
_;
}
}
interface IDelegationRegistry
{
function checkDelegateForAll(address delegate, address delegator) external view returns (bool);
}
文件 6 的 8:MerkleProof.sol
pragma solidity ^0.8.0;
library MerkleProof {
function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 proofLen = proof.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
require(proofPos == proofLen, "MerkleProof: invalid multiproof");
unchecked {
return hashes[totalHashes - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 proofLen = proof.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
require(proofPos == proofLen, "MerkleProof: invalid multiproof");
unchecked {
return hashes[totalHashes - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
文件 7 的 8:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 8 的 8:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
}
function _nonReentrantAfter() private {
_status = _NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
{
"compilationTarget": {
"contracts/LiveMintVenice.sol": "LiveMintVenice"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 10000
},
"remappings": [],
"viaIR": true
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"NewAddress","type":"address"}],"name":"AuthorizedContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"NewAddress","type":"address"}],"name":"DeauthorizedContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"Recipients","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"TicketIDs","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"MintedWorkTokenIDs","type":"uint256[]"}],"name":"LiveMintBatchComplete","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"Redeemer","type":"address"},{"indexed":false,"internalType":"uint256","name":"TicketID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"TokenID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"TokenID2","type":"uint256"}],"name":"LiveMintComplete","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"Redeemer","type":"address"},{"indexed":false,"internalType":"uint256","name":"TicketID","type":"uint256"}],"name":"QRRedeemed","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"Cities","outputs":[{"internalType":"string","name":"_Name","type":"string"},{"internalType":"uint256","name":"_QRCurrentIndex","type":"uint256"},{"internalType":"bytes32","name":"_RootEligibility","type":"bytes32"},{"internalType":"bytes32","name":"_RootAmount","type":"bytes32"},{"internalType":"bool","name":"_RemoteMintingEnabledCitizens","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"DailyCalls","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"ProofEligibility","type":"bytes32[]"},{"internalType":"bytes32[]","name":"ProofAmounts","type":"bytes32[]"},{"internalType":"address","name":"Vault","type":"address"},{"internalType":"uint256","name":"Amount","type":"uint256"}],"name":"RedeemQR","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"TicketIDs","type":"uint256[]"}],"name":"RemoteMintCitizens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"Role","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_BrightListCitizen","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"TicketIDs","type":"uint256[]"}],"name":"_LiveMintCitizen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"TicketIDs","type":"uint256[]"}],"name":"_LiveMintCitizenBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"_MaxQRDelegationsPerDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_MintedCitizen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"_QRAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_QRDelegationsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"_QRRedeemed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"_QRsRedeemed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"Minter","type":"address"}],"name":"__AddMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"NewMinter","type":"address"}],"name":"__ChangeFinaleMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"NewIndex","type":"uint256"}],"name":"__ChangeFinaleMinterIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"NewIndex","type":"uint256"}],"name":"__ChangeQRIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"NewRoot","type":"bytes32"}],"name":"__ChangeRootAmounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"NewRoot","type":"bytes32"}],"name":"__ChangeRootEligibility","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"EligibilityRoot","type":"bytes32"},{"internalType":"bytes32","name":"EligibilityAmount","type":"bytes32"}],"name":"__ChangeRoots","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"Recipient","type":"address"}],"name":"__DelegateQR","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"__FlipRemoteMintingCitizens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"Targets","type":"address[]"},{"internalType":"uint256[]","name":"Values","type":"uint256[]"},{"internalType":"bytes[]","name":"Datas","type":"bytes[]"}],"name":"__InitTransaction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"Addresses","type":"address[]"},{"internalType":"uint256[]","name":"Amounts","type":"uint256[]"}],"name":"__QRAllocationsIncrement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"Addresses","type":"address[]"},{"internalType":"uint256[]","name":"Amounts","type":"uint256[]"}],"name":"__QRAllocationsOverwrite","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"TicketIDs","type":"uint256[]"}],"name":"__QRAllocationsSetNoShow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"Minter","type":"address"}],"name":"__RemoveMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"__WithdrawETHCall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"__WithdrawEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"NewAddress","type":"address"}],"name":"___DeauthorizeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"NewAddress","type":"address"}],"name":"____AddressAuthorize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"Recipient","type":"address"}],"name":"readAmountRedeemed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"CityIndex","type":"uint256"}],"name":"readCitizenBrightList","outputs":[{"internalType":"address[]","name":"Recipients","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"readCitizenCheckedInTicketIDs","outputs":[{"internalType":"uint256[]","name":"TokenIDs","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"CityIndex","type":"uint256"}],"name":"readCitizenCity","outputs":[{"components":[{"internalType":"string","name":"_Name","type":"string"},{"internalType":"uint256","name":"_QRCurrentIndex","type":"uint256"},{"internalType":"bytes32","name":"_RootEligibility","type":"bytes32"},{"internalType":"bytes32","name":"_RootAmount","type":"bytes32"},{"internalType":"bool","name":"_RemoteMintingEnabledCitizens","type":"bool"}],"internalType":"struct LiveMintVenice.City","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"CityID","type":"uint256"}],"name":"readCitizenMintedTicketIDs","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"readCitizenUnmintedTicketIDs","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"Recipient","type":"address"},{"internalType":"bytes32[]","name":"Proof","type":"bytes32[]"},{"internalType":"bytes32[]","name":"ProofAmount","type":"bytes32[]"},{"internalType":"uint256","name":"Amount","type":"uint256"}],"name":"readEligibility","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"Recipient","type":"address"},{"internalType":"bytes32[]","name":"ProofEligibility","type":"bytes32[]"},{"internalType":"bytes32[]","name":"ProofAmount","type":"bytes32[]"},{"internalType":"uint256","name":"Amount","type":"uint256"}],"name":"readQREligibility","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]