编译器
0.8.13+commit.abaa5c0e
文件 1 的 26:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 26:AwakeningAbility.sol
pragma solidity ^0.8.12;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
abstract contract AwakeningAbility is Ownable, ERC721 {
error TokenAwakening();
error AwakeningLocked();
error CallerNotOwner();
error CallerNotOwnerNorApproved();
event AwakeningLockUpdated(bool unlocked);
event AwakeningStarted(uint256 indexed tokenId, address indexed owner);
event AwakeningStopped(uint256 indexed tokenId, address indexed owner);
event AwakeningInterrupted(uint256 indexed tokenId, address indexed owner);
event AwakeningTransfer(address indexed from, address indexed to, uint256 indexed tokenId);
bool public isAwakeningUnlocked;
bool private isAwakeningTransferAllowed;
mapping(uint256 => bool) public awakeningState;
function unlockAwakening(bool unlocked) external onlyOwner {
isAwakeningUnlocked = unlocked;
emit AwakeningLockUpdated(unlocked);
}
function interruptAwakening(uint256[] calldata tokenIds) external onlyOwner {
uint256 size = tokenIds.length;
for (uint256 i = 0; i < size; i++) {
uint256 tokenId = tokenIds[i];
if (awakeningState[tokenId]) {
awakeningState[tokenId] = false;
address owner = ownerOf(tokenId);
emit AwakeningStopped(tokenId, owner);
emit AwakeningInterrupted(tokenId, owner);
}
}
}
function setAwakeningState(uint256[] calldata tokenIds, bool state) external {
uint256 size = tokenIds.length;
for (uint256 i = 0; i < size; i++) {
uint256 tokenId = tokenIds[i];
if (!_isApprovedOrOwner(_msgSender(), tokenId)) {
revert CallerNotOwnerNorApproved();
}
bool currentState = awakeningState[tokenId];
if (currentState && !state) {
awakeningState[tokenId] = false;
emit AwakeningStopped(tokenId, ownerOf(tokenId));
} else if (!currentState && state) {
if (!isAwakeningUnlocked) {
revert AwakeningLocked();
}
awakeningState[tokenId] = true;
emit AwakeningStarted(tokenId, ownerOf(tokenId));
}
}
}
function safeTransferWhileAwakening(address from, address to, uint256 tokenId) public {
if (ownerOf(tokenId) != _msgSender()) {
revert CallerNotOwner();
}
isAwakeningTransferAllowed = true;
safeTransferFrom(from, to, tokenId);
isAwakeningTransferAllowed = false;
if (awakeningState[tokenId]) {
emit AwakeningTransfer(from, to, tokenId);
}
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override {
if (awakeningState[tokenId] && !isAwakeningTransferAllowed) {
revert TokenAwakening();
}
super._beforeTokenTransfer(from, to, tokenId);
}
}
文件 3 的 26: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;
}
}
文件 4 的 26:ECDSA.sol
pragma solidity ^0.8.0;
import "../Strings.sol";
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return;
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else if (signature.length == 64) {
bytes32 r;
bytes32 vs;
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
文件 5 的 26:ERC165.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 6 的 26:ERC721.sol
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
function _baseURI() internal view virtual returns (string memory) {
return "";
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
文件 7 的 26:ERC721CrossChain.sol
pragma solidity ^0.8.12;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import { INFTBridge } from "../../NFTBridge/interfaces/INFTBridge.sol";
contract ERC721CrossChain is Ownable, ERC721 {
error CallerNotNFTBridge();
error CrossChainBridgeNotEnabled();
error CrossChainCallerNotOwner();
error CrossChainToZeroAddress();
event NFTBridgeUpdated(address);
address public nftBridge;
constructor(string memory name, string memory symbol) ERC721(name, symbol) {}
modifier onlyNftBridge() {
if (nftBridge == address(0)) {
revert CrossChainBridgeNotEnabled();
}
if (_msgSender() != nftBridge) {
revert CallerNotNFTBridge();
}
_;
}
modifier crossChainEnabled() {
if (nftBridge == address(0)) {
revert CrossChainBridgeNotEnabled();
}
_;
}
function setNFTBridge(address bridge) external onlyOwner {
nftBridge = bridge;
emit NFTBridgeUpdated(bridge);
}
function crossChain(uint64 chainId, uint256 tokenId, address receiver) public payable crossChainEnabled {
if (_msgSender() != ownerOf(tokenId)) {
revert CrossChainCallerNotOwner();
}
if (receiver == address(0)) {
revert CrossChainToZeroAddress();
}
string memory uri = tokenURI(tokenId);
_burn(tokenId);
INFTBridge(nftBridge).sendMsg{value: msg.value}(
chainId,
_msgSender(),
receiver,
tokenId,
uri
);
}
function crossChain(uint64 chainId, uint256 tokenId, bytes calldata receiver) public payable crossChainEnabled {
if (_msgSender() != ownerOf(tokenId)) {
revert CrossChainCallerNotOwner();
}
string memory uri = tokenURI(tokenId);
_burn(tokenId);
INFTBridge(nftBridge).sendMsg{value: msg.value}(
chainId,
_msgSender(),
receiver,
tokenId,
uri
);
}
function totalFee(uint64 chainId, uint256 tokenId) external view crossChainEnabled returns (uint256) {
return INFTBridge(nftBridge).totalFee(chainId, address(this), tokenId);
}
function bridgeMint(address to, uint256 tokenId, string memory ) external onlyNftBridge {
_safeMint(to, tokenId);
}
}
文件 8 的 26:ERC721Pausable.sol
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "../../../security/Pausable.sol";
abstract contract ERC721Pausable is ERC721, Pausable {
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
require(!paused(), "ERC721Pausable: token transfer while paused");
}
}
文件 9 的 26:ERC721Queryable.sol
pragma solidity ^0.8.12;
import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
abstract contract ERC721Queryable is ERC721 {
error OwnerIndexOutOfBounds();
error OwnerIndexNotExist();
uint256 public mintedAmount;
uint256 private immutable collectionSize;
constructor(uint256 size) {
collectionSize = size;
}
function totalSupply() public view returns (uint256) {
return mintedAmount;
}
function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
if (index >= balanceOf(owner)) {
revert OwnerIndexOutOfBounds();
}
uint256 currentIndex = 0;
unchecked {
for (uint256 tokenId = 0; tokenId < collectionSize; tokenId++) {
if (_exists(tokenId) && owner == ownerOf(tokenId)) {
if (currentIndex == index) {
return tokenId;
}
currentIndex++;
}
}
}
revert OwnerIndexNotExist();
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
mintedAmount += 1;
}
if (to == address(0)) {
mintedAmount -= 1;
}
}
}
文件 10 的 26:ElectricSheep.sol
pragma solidity ^0.8.12;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
import { ERC721Pausable } from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol";
import { ERC721CrossChain, ERC721 } from "./ERC721/ERC721CrossChain.sol";
import { ERC721Queryable } from "./ERC721/ERC721Queryable.sol";
import { SalePhaseConfiguration } from "./lib/SalePhaseConfiguration.sol";
import { SignatureVerifier } from "./lib/SignatureVerifier.sol";
import { VRFIntegration } from "./lib/VRFIntegration.sol";
import { Withdrawable } from "./lib/Withdrawable.sol";
import { AwakeningAbility } from "./lib/AwakeningAbility.sol";
contract ElectricSheep is
Ownable,
ERC721Pausable,
ERC721Queryable,
ERC721CrossChain,
SignatureVerifier,
Withdrawable,
SalePhaseConfiguration,
VRFIntegration,
AwakeningAbility
{
error InsufficientPayment();
error InsufficientContractBalance();
error ExceedMaxMintQuantity();
error ExceedMintQuota();
error InvalidMintQuota();
error CallerNotUser();
error MintZeroQuantity();
error SetRefundVaultToZeroAddress();
error RefundNotEnabled();
error RefundFailed();
event ProvenanceUpdated(string provenance);
event Refunded(address from, address to, uint256 tokenId);
event RefundConfigUpdated(RefundConfig config);
struct CurrentMintedAmount {
uint64 builderMint;
uint64 allowlist;
uint64 publicSale;
uint64 team;
}
struct RefundConfig {
bool enabled;
uint256 price;
address vault;
}
uint256 public constant COLLECTION_SIZE = 10000;
uint256 public constant TEAM_MINT_MAX = 200;
CurrentMintedAmount public currentMintedAmount;
uint256 public nextTokenId = 0;
uint256 public tokenStartingOffset;
string public tokenBaseURI;
string public provenance;
RefundConfig public refundConfig;
mapping(address => uint256) public builderMintedPerAddress;
mapping(address => uint256) public allowlistMintedPerAddress;
mapping(address => uint256) public publicSaleMintedPerAddress;
constructor(
string memory name,
string memory symbol,
address coordinator,
bytes32 keyHash,
uint64 subscriptionId
)
ERC721Queryable(COLLECTION_SIZE)
ERC721CrossChain(name, symbol)
SignatureVerifier(name, "1")
VRFIntegration(coordinator, keyHash, subscriptionId)
{}
modifier callerIsUser() {
if (tx.origin != _msgSender()) {
revert CallerNotUser();
}
_;
}
modifier checkMintQuantityCommon(uint256 quantity) {
if (quantity == 0) {
revert MintZeroQuantity();
}
if (nextTokenId + quantity > COLLECTION_SIZE) {
revert ExceedMaxMintQuantity();
}
_;
}
function builderMint(uint256 quantity, uint256 quota, bytes calldata signature)
external
payable
callerIsUser
whenBuilderMintActive
checkMintQuantityCommon(quantity)
verifyBuilderMint(quota, signature)
{
if (currentMintedAmount.builderMint + quantity > builderMintMaxAmount) {
revert ExceedMaxMintQuantity();
}
address sender = _msgSender();
if (quota == 0 || quota > builderMintMaxPerAddress) {
revert InvalidMintQuota();
}
if (builderMintedPerAddress[sender] + quantity > quota) {
revert ExceedMintQuota();
}
if (msg.value < quantity * builderMintPrice) {
revert InsufficientPayment();
}
builderMintedPerAddress[sender] += quantity;
currentMintedAmount.builderMint += uint64(quantity);
for (uint256 i = 0; i < quantity; i++) {
_safeMint(sender, nextTokenId++);
}
}
function allowlistMint(uint256 quantity, uint256 quota, bytes calldata signature)
external
payable
callerIsUser
whenAllowlistActive
checkMintQuantityCommon(quantity)
verifyAllowlist(quota, signature)
{
if (currentMintedAmount.allowlist + quantity > allowlistMaxAmount) {
revert ExceedMaxMintQuantity();
}
address sender = _msgSender();
if (quota == 0 || quota > allowlistMaxMintPerAddress) {
revert InvalidMintQuota();
}
if (allowlistMintedPerAddress[sender] + quantity > quota) {
revert ExceedMintQuota();
}
if (msg.value < quantity * allowlistPrice) {
revert InsufficientPayment();
}
allowlistMintedPerAddress[sender] += quantity;
currentMintedAmount.allowlist += uint64(quantity);
for (uint256 i = 0; i < quantity; i++) {
_safeMint(sender, nextTokenId++);
}
}
function publicSaleMint(uint256 quantity, bytes calldata signature)
external
payable
callerIsUser
whenPublicSaleActive
checkMintQuantityCommon(quantity)
verifyPublicSale(quantity, signature)
{
if (currentMintedAmount.publicSale + quantity > publicSaleMaxAmount) {
revert ExceedMaxMintQuantity();
}
address sender = _msgSender();
if (publicSaleMintedPerAddress[sender] + quantity > publicSaleMaxMintPerAddress) {
revert ExceedMintQuota();
}
if (msg.value < quantity * publicSalePrice) {
revert InsufficientPayment();
}
publicSaleMintedPerAddress[sender] += quantity;
currentMintedAmount.publicSale += uint64(quantity);
for (uint256 i = 0; i < quantity; i++) {
_safeMint(sender, nextTokenId++);
}
}
function teamMint(address to, uint256 quantity) external onlyOwner checkMintQuantityCommon(quantity) {
if (currentMintedAmount.team + quantity > TEAM_MINT_MAX) {
revert ExceedMaxMintQuantity();
}
currentMintedAmount.team += uint64(quantity);
for (uint256 i = 0; i < quantity; i++) {
_safeMint(to, nextTokenId++);
}
}
function refund(uint256 tokenId) external callerIsUser nonReentrant {
if (!isRefundEnabled()) {
revert RefundNotEnabled();
}
if (address(this).balance < refundConfig.price) {
revert InsufficientContractBalance();
}
address from = _msgSender();
address to = refundConfig.vault;
if (ownerOf(tokenId) != from) {
revert CallerNotOwner();
}
safeTransferFrom(from, to, tokenId);
emit Refunded(from, to, tokenId);
(bool success, ) = from.call{value: refundConfig.price}("");
if (!success) {
revert RefundFailed();
}
}
function setTokenBaseURI(string memory uri) external onlyOwner {
tokenBaseURI = uri;
}
function setProvenance(string memory provenance_) external onlyOwner {
provenance = provenance_;
emit ProvenanceUpdated(provenance);
}
function emergencyPause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
function setRefundConfig(RefundConfig calldata config) external onlyOwner {
if (config.vault == address(0)) {
revert SetRefundVaultToZeroAddress();
}
refundConfig = config;
emit RefundConfigUpdated(config);
}
function isRefundEnabled() public view returns (bool) {
return refundConfig.enabled && refundConfig.price > 0 && refundConfig.vault != address(0);
}
function afterRandomSeedSettled(uint256 seed) internal override {
uint256 fixedTokens = 3;
tokenStartingOffset = (seed % (COLLECTION_SIZE - fixedTokens - 1)) + 1;
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal override(ERC721, ERC721Pausable, ERC721Queryable, AwakeningAbility) {
super._beforeTokenTransfer(from, to, tokenId);
}
function _baseURI() internal view override returns (string memory) {
return tokenBaseURI;
}
}
文件 11 的 26:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 12 的 26:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 13 的 26:IERC721Metadata.sol
pragma solidity ^0.8.0;
import "../IERC721.sol";
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
文件 14 的 26:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 15 的 26:INFTBridge.sol
pragma solidity ^0.8.12;
interface INFTBridge {
function sendMsg(
uint64 chainId,
address sender,
address receiver,
uint256 tokenId,
string calldata uri
) external payable;
function sendMsg(
uint64 chainId,
address sender,
bytes calldata receiver,
uint256 tokenId,
string calldata uri
) external payable;
function totalFee(
uint64 chainId,
address nft,
uint256 tokenId
) external view returns (uint256);
}
文件 16 的 26: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());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
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);
}
}
文件 17 的 26:Pausable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Pausable is Context {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor() {
_paused = false;
}
function paused() public view virtual returns (bool) {
return _paused;
}
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
文件 18 的 26: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() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 19 的 26:SalePhaseConfiguration.sol
pragma solidity ^0.8.12;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
contract SalePhaseConfiguration is Ownable {
error BuilderMintNotActive();
error PublicSaleNotActive();
error AllowlistNotActive();
error SaleAlreadyStarted();
event BuilderMintStarted(uint256 price, uint256 amount);
event BuilderMintStopped();
event AllowlistStarted(uint256 price, uint256 amount);
event AllowlistStopped();
event PublicSaleStarted(uint256 price, uint256 amount);
event PublicSaleStopped();
bool public builderMintActive;
bool public allowlistActive;
bool public publicSaleActive;
uint256 public builderMintPrice;
uint256 public builderMintMaxPerAddress;
uint256 public builderMintMaxAmount;
uint256 public allowlistPrice;
uint256 public allowlistMaxMintPerAddress;
uint256 public allowlistMaxAmount;
uint256 public publicSalePrice;
uint256 public publicSaleMaxMintPerAddress;
uint256 public publicSaleMaxAmount;
modifier whenAllowlistActive() {
if (!allowlistActive) {
revert AllowlistNotActive();
}
_;
}
modifier whenPublicSaleActive() {
if (!publicSaleActive) {
revert PublicSaleNotActive();
}
_;
}
modifier whenBuilderMintActive() {
if (!builderMintActive) {
revert BuilderMintNotActive();
}
_;
}
function startBuilderMint(
uint256 price,
uint256 maxMintPerAddress,
uint256 maxAmount
) external onlyOwner {
if (builderMintActive) {
revert SaleAlreadyStarted();
}
builderMintPrice = price;
builderMintMaxPerAddress = maxMintPerAddress;
builderMintMaxAmount = maxAmount;
builderMintActive = true;
emit BuilderMintStarted(price, maxAmount);
}
function stopBuilderMint() external onlyOwner {
builderMintActive = false;
emit BuilderMintStopped();
}
function startAllowlist(
uint256 price,
uint256 maxMintPerAddress,
uint256 maxAmount
) external onlyOwner {
if (allowlistActive) {
revert SaleAlreadyStarted();
}
allowlistPrice = price;
allowlistMaxMintPerAddress = maxMintPerAddress;
allowlistMaxAmount = maxAmount;
allowlistActive = true;
emit AllowlistStarted(price, maxAmount);
}
function stopAllowlist() external onlyOwner {
allowlistActive = false;
emit AllowlistStopped();
}
function startPublicSale(
uint256 price,
uint256 maxMintPerAddress,
uint256 maxAmount
) external onlyOwner {
if (publicSaleActive) {
revert SaleAlreadyStarted();
}
publicSalePrice = price;
publicSaleMaxMintPerAddress = maxMintPerAddress;
publicSaleMaxAmount = maxAmount;
publicSaleActive = true;
emit PublicSaleStarted(price, maxAmount);
}
function stopPublicSale() external onlyOwner {
publicSaleActive = false;
emit PublicSaleStopped();
}
}
文件 20 的 26:SignatureVerifier.sol
pragma solidity ^0.8.12;
import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import { EIP712 } from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
contract SignatureVerifier is Ownable, EIP712 {
using ECDSA for bytes32;
error InvalidSignature();
error VerificationKeyNotSet();
struct VerificationKey {
address allowlist;
address publicSale;
address builderMint;
}
VerificationKey public verificationKey;
bytes32 public constant ALLOWLIST_TYPEHASH = keccak256("Allowlist(address wallet,uint256 quota)");
bytes32 public constant PUBLIC_SALE_TYPEHASH = keccak256("PubSale(address wallet,uint256 quantity)");
bytes32 public constant BUILDER_MINT_TYPEHASH = keccak256("BuilderMint(address wallet,uint256 quota)");
constructor(string memory name, string memory version) EIP712(name, version) {}
modifier verifyAllowlist(uint256 quota, bytes calldata signature) {
if (verificationKey.allowlist == address(0)) {
revert VerificationKeyNotSet();
}
if (getAllowlistRecoverAddress(quota, signature) != verificationKey.allowlist) {
revert InvalidSignature();
}
_;
}
modifier verifyPublicSale(uint256 quantity, bytes calldata signature) {
if (verificationKey.publicSale == address(0)) {
revert VerificationKeyNotSet();
}
if (getPublicSaleRecoverAddress(quantity, signature) != verificationKey.publicSale) {
revert InvalidSignature();
}
_;
}
modifier verifyBuilderMint(uint256 quota, bytes calldata signature) {
if (verificationKey.builderMint == address(0)) {
revert VerificationKeyNotSet();
}
if (getBuilderMintRecoverAddress(quota, signature) != verificationKey.builderMint) {
revert InvalidSignature();
}
_;
}
function setSignatureVerificationKey(
address keyForAllowlist,
address keyForPublicSale,
address keyForBuilderMint
) external onlyOwner {
verificationKey.allowlist = keyForAllowlist;
verificationKey.publicSale = keyForPublicSale;
verificationKey.builderMint = keyForBuilderMint;
}
function getAllowlistRecoverAddress(uint256 quota, bytes calldata signature) internal view returns (address) {
bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(ALLOWLIST_TYPEHASH, _msgSender(), quota)));
return ECDSA.recover(digest, signature);
}
function getPublicSaleRecoverAddress(uint256 quantity, bytes calldata signature) internal view returns (address) {
bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(PUBLIC_SALE_TYPEHASH, _msgSender(), quantity)));
return ECDSA.recover(digest, signature);
}
function getBuilderMintRecoverAddress(uint256 quantity, bytes calldata signature) internal view returns (address) {
bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(BUILDER_MINT_TYPEHASH, _msgSender(), quantity)));
return ECDSA.recover(digest, signature);
}
}
文件 21 的 26:Strings.sol
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
文件 22 的 26:VRFConsumerBaseV2.sol
pragma solidity ^0.8.4;
abstract contract VRFConsumerBaseV2 {
error OnlyCoordinatorCanFulfill(address have, address want);
address private immutable vrfCoordinator;
constructor(address _vrfCoordinator) {
vrfCoordinator = _vrfCoordinator;
}
function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;
function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
if (msg.sender != vrfCoordinator) {
revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);
}
fulfillRandomWords(requestId, randomWords);
}
}
文件 23 的 26:VRFCoordinatorV2Interface.sol
pragma solidity ^0.8.0;
interface VRFCoordinatorV2Interface {
function getRequestConfig()
external
view
returns (
uint16,
uint32,
bytes32[] memory
);
function requestRandomWords(
bytes32 keyHash,
uint64 subId,
uint16 minimumRequestConfirmations,
uint32 callbackGasLimit,
uint32 numWords
) external returns (uint256 requestId);
function createSubscription() external returns (uint64 subId);
function getSubscription(uint64 subId)
external
view
returns (
uint96 balance,
uint64 reqCount,
address owner,
address[] memory consumers
);
function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;
function acceptSubscriptionOwnerTransfer(uint64 subId) external;
function addConsumer(uint64 subId, address consumer) external;
function removeConsumer(uint64 subId, address consumer) external;
function cancelSubscription(uint64 subId, address to) external;
}
文件 24 的 26:VRFIntegration.sol
pragma solidity ^0.8.12;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { VRFConsumerBaseV2 } from "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import { VRFCoordinatorV2Interface } from "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
contract VRFIntegration is Ownable, VRFConsumerBaseV2 {
error RandomSeedAlreadySettled();
event RandomSeedSettled(uint256 requestId, uint256 seed);
event RandomSeedManuallySettled(uint256 seed);
VRFCoordinatorV2Interface public immutable vrfCoordinator;
uint64 public immutable vrfSubscriptionId;
bytes32 public immutable vrfKeyHash;
uint32 public vrfCallbackGasLimit = 200000;
bool public randomSeedSettled = false;
uint256 public randomSeed;
constructor(
address coordinator,
bytes32 keyHash,
uint64 subscriptionId
) VRFConsumerBaseV2(coordinator) {
vrfCoordinator = VRFCoordinatorV2Interface(coordinator);
vrfSubscriptionId = subscriptionId;
vrfKeyHash = keyHash;
}
function fulfillRandomWords(
uint256 requestId,
uint256[] memory randomWords
) internal override {
if (!randomSeedSettled) {
randomSeedSettled = true;
uint256 seed = randomWords[0];
randomSeed = seed;
emit RandomSeedSettled(requestId, seed);
afterRandomSeedSettled(seed);
}
}
function requestRandomWords() external onlyOwner {
if (randomSeedSettled) {
revert RandomSeedAlreadySettled();
}
uint16 requestConfirmations = 3;
uint16 numWords = 1;
vrfCoordinator.requestRandomWords(
vrfKeyHash,
vrfSubscriptionId,
requestConfirmations,
vrfCallbackGasLimit,
numWords
);
}
function emergencySetRandomSeed(uint256 seed) external onlyOwner {
randomSeedSettled = true;
randomSeed = seed;
emit RandomSeedManuallySettled(seed);
afterRandomSeedSettled(seed);
}
function setVRFCallbackGasLimit(uint32 gasLimit) external onlyOwner {
vrfCallbackGasLimit = gasLimit;
}
function afterRandomSeedSettled(uint256 seed) internal virtual {}
}
文件 25 的 26:Withdrawable.sol
pragma solidity ^0.8.12;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract Withdrawable is Ownable, ReentrancyGuard {
error WithdrawFailed();
event Withdraw(address account, uint256 amount);
function withdrawAll() external onlyOwner nonReentrant {
uint256 balance = address(this).balance;
emit Withdraw(_msgSender(), balance);
(bool success, ) = _msgSender().call{value: balance}("");
if (!success) {
revert WithdrawFailed();
}
}
}
文件 26 的 26:draft-EIP712.sol
pragma solidity ^0.8.0;
import "./ECDSA.sol";
abstract contract EIP712 {
bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
uint256 private immutable _CACHED_CHAIN_ID;
address private immutable _CACHED_THIS;
bytes32 private immutable _HASHED_NAME;
bytes32 private immutable _HASHED_VERSION;
bytes32 private immutable _TYPE_HASH;
constructor(string memory name, string memory version) {
bytes32 hashedName = keccak256(bytes(name));
bytes32 hashedVersion = keccak256(bytes(version));
bytes32 typeHash = keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
);
_HASHED_NAME = hashedName;
_HASHED_VERSION = hashedVersion;
_CACHED_CHAIN_ID = block.chainid;
_CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
_CACHED_THIS = address(this);
_TYPE_HASH = typeHash;
}
function _domainSeparatorV4() internal view returns (bytes32) {
if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
return _CACHED_DOMAIN_SEPARATOR;
} else {
return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
}
}
function _buildDomainSeparator(
bytes32 typeHash,
bytes32 nameHash,
bytes32 versionHash
) private view returns (bytes32) {
return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
}
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
}
}
{
"compilationTarget": {
"contracts/NFT/ElectricSheep.sol": "ElectricSheep"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"coordinator","type":"address"},{"internalType":"bytes32","name":"keyHash","type":"bytes32"},{"internalType":"uint64","name":"subscriptionId","type":"uint64"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AllowlistNotActive","type":"error"},{"inputs":[],"name":"AwakeningLocked","type":"error"},{"inputs":[],"name":"BuilderMintNotActive","type":"error"},{"inputs":[],"name":"CallerNotNFTBridge","type":"error"},{"inputs":[],"name":"CallerNotOwner","type":"error"},{"inputs":[],"name":"CallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"CallerNotUser","type":"error"},{"inputs":[],"name":"CrossChainBridgeNotEnabled","type":"error"},{"inputs":[],"name":"CrossChainCallerNotOwner","type":"error"},{"inputs":[],"name":"CrossChainToZeroAddress","type":"error"},{"inputs":[],"name":"ExceedMaxMintQuantity","type":"error"},{"inputs":[],"name":"ExceedMintQuota","type":"error"},{"inputs":[],"name":"InsufficientContractBalance","type":"error"},{"inputs":[],"name":"InsufficientPayment","type":"error"},{"inputs":[],"name":"InvalidMintQuota","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"inputs":[],"name":"OwnerIndexNotExist","type":"error"},{"inputs":[],"name":"OwnerIndexOutOfBounds","type":"error"},{"inputs":[],"name":"PublicSaleNotActive","type":"error"},{"inputs":[],"name":"RandomSeedAlreadySettled","type":"error"},{"inputs":[],"name":"RefundFailed","type":"error"},{"inputs":[],"name":"RefundNotEnabled","type":"error"},{"inputs":[],"name":"SaleAlreadyStarted","type":"error"},{"inputs":[],"name":"SetRefundVaultToZeroAddress","type":"error"},{"inputs":[],"name":"TokenAwakening","type":"error"},{"inputs":[],"name":"VerificationKeyNotSet","type":"error"},{"inputs":[],"name":"WithdrawFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AllowlistStarted","type":"event"},{"anonymous":false,"inputs":[],"name":"AllowlistStopped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"AwakeningInterrupted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"unlocked","type":"bool"}],"name":"AwakeningLockUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"AwakeningStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"AwakeningStopped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"AwakeningTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BuilderMintStarted","type":"event"},{"anonymous":false,"inputs":[],"name":"BuilderMintStopped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"","type":"address"}],"name":"NFTBridgeUpdated","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":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"provenance","type":"string"}],"name":"ProvenanceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PublicSaleStarted","type":"event"},{"anonymous":false,"inputs":[],"name":"PublicSaleStopped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"seed","type":"uint256"}],"name":"RandomSeedManuallySettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"seed","type":"uint256"}],"name":"RandomSeedSettled","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"address","name":"vault","type":"address"}],"indexed":false,"internalType":"struct ElectricSheep.RefundConfig","name":"config","type":"tuple"}],"name":"RefundConfigUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Refunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"ALLOWLIST_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BUILDER_MINT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COLLECTION_SIZE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUBLIC_SALE_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TEAM_MINT_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistMaxAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistMaxMintPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"quota","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"allowlistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowlistMintedPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"awakeningState","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"","type":"string"}],"name":"bridgeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"quota","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"builderMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"builderMintActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"builderMintMaxAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"builderMintMaxPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"builderMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"builderMintedPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainId","type":"uint64"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"receiver","type":"bytes"}],"name":"crossChain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainId","type":"uint64"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"crossChain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"currentMintedAmount","outputs":[{"internalType":"uint64","name":"builderMint","type":"uint64"},{"internalType":"uint64","name":"allowlist","type":"uint64"},{"internalType":"uint64","name":"publicSale","type":"uint64"},{"internalType":"uint64","name":"team","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"seed","type":"uint256"}],"name":"emergencySetRandomSeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"interruptAwakening","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isAwakeningUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRefundEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftBridge","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provenance","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleMaxAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleMaxMintPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"publicSaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"publicSaleMintedPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSalePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomSeed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomSeedSettled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"refundConfig","outputs":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"address","name":"vault","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferWhileAwakening","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bool","name":"state","type":"bool"}],"name":"setAwakeningState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bridge","type":"address"}],"name":"setNFTBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"provenance_","type":"string"}],"name":"setProvenance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"address","name":"vault","type":"address"}],"internalType":"struct ElectricSheep.RefundConfig","name":"config","type":"tuple"}],"name":"setRefundConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"keyForAllowlist","type":"address"},{"internalType":"address","name":"keyForPublicSale","type":"address"},{"internalType":"address","name":"keyForBuilderMint","type":"address"}],"name":"setSignatureVerificationKey","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setTokenBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"gasLimit","type":"uint32"}],"name":"setVRFCallbackGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxMintPerAddress","type":"uint256"},{"internalType":"uint256","name":"maxAmount","type":"uint256"}],"name":"startAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxMintPerAddress","type":"uint256"},{"internalType":"uint256","name":"maxAmount","type":"uint256"}],"name":"startBuilderMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxMintPerAddress","type":"uint256"},{"internalType":"uint256","name":"maxAmount","type":"uint256"}],"name":"startPublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopBuilderMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopPublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"teamMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenBaseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenStartingOffset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainId","type":"uint64"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"totalFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"unlocked","type":"bool"}],"name":"unlockAwakening","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"verificationKey","outputs":[{"internalType":"address","name":"allowlist","type":"address"},{"internalType":"address","name":"publicSale","type":"address"},{"internalType":"address","name":"builderMint","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfCallbackGasLimit","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfCoordinator","outputs":[{"internalType":"contract VRFCoordinatorV2Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfSubscriptionId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]