Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 2,503 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Unstake | 24385823 | 27 days ago | IN | 0 ETH | 0.00013884 | ||||
| Unstake | 24385819 | 27 days ago | IN | 0 ETH | 0.00013909 | ||||
| Unstake | 24385817 | 27 days ago | IN | 0 ETH | 0.00014012 | ||||
| Unstake | 24385781 | 27 days ago | IN | 0 ETH | 0.00014378 | ||||
| Unstake | 24385776 | 27 days ago | IN | 0 ETH | 0.00014471 | ||||
| Unstake | 24385771 | 27 days ago | IN | 0 ETH | 0.00018568 | ||||
| Unstake | 24385760 | 27 days ago | IN | 0 ETH | 0.00015266 | ||||
| Unstake | 24385748 | 27 days ago | IN | 0 ETH | 0.00016477 | ||||
| Unstake | 24385738 | 27 days ago | IN | 0 ETH | 0.00021572 | ||||
| Unstake | 24287162 | 40 days ago | IN | 0 ETH | 0.00016405 | ||||
| Unstake | 24287159 | 40 days ago | IN | 0 ETH | 0.00011981 | ||||
| Unstake | 24287153 | 40 days ago | IN | 0 ETH | 0.0001549 | ||||
| Unstake | 24098408 | 67 days ago | IN | 0 ETH | 0.00003747 | ||||
| Unstake | 23840158 | 103 days ago | IN | 0 ETH | 0.00012448 | ||||
| Unstake | 23840150 | 103 days ago | IN | 0 ETH | 0.0001249 | ||||
| Unstake | 23840144 | 103 days ago | IN | 0 ETH | 0.00016029 | ||||
| Unstake | 23784237 | 111 days ago | IN | 0 ETH | 0.00019787 | ||||
| Unstake | 23784231 | 111 days ago | IN | 0 ETH | 0.00025201 | ||||
| Unstake | 23784227 | 111 days ago | IN | 0 ETH | 0.000273 | ||||
| Unstake | 23709185 | 121 days ago | IN | 0 ETH | 0.00000141 | ||||
| Unstake | 23556913 | 143 days ago | IN | 0 ETH | 0.00017191 | ||||
| Unstake | 23556909 | 143 days ago | IN | 0 ETH | 0.00016597 | ||||
| Unstake | 23556903 | 143 days ago | IN | 0 ETH | 0.00021874 | ||||
| Unstake | 23556895 | 143 days ago | IN | 0 ETH | 0.00021198 | ||||
| Unstake | 23504805 | 150 days ago | IN | 0 ETH | 0.000066 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ResourceFieldV2
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
////////////////////////////////////////////////////////////////////////////////////////
// //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ██████████████▌ ╟██ ████████████████ j██████████████ //
// ██████████████▌ ╟███ ███████████████ j██████████████ //
// ██████████████▌ ╟███▌ ██████████████ j██████████████ //
// ██████████████▌ ╟████▌ █████████████ j██████████████ //
// ██████████████▌ ╟█████▌ ╙████████████ j██████████████ //
// ██████████████▌ ╟██████▄ ╙███████████ j██████████████ //
// ██████████████▌ ╟███████ ╙██████████ j██████████████ //
// ██████████████▌ ╟████████ ╟█████████ j██████████████ //
// ██████████████▌ ╟█████████ █████████ j██████████████ //
// ██████████████▌ ╟██████████ ████████ j██████████████ //
// ██████████████▌ ╟██████████▌ ███████ j██████████████ //
// ██████████████▌ ╟███████████▌ ██████ j██████████████ //
// ██████████████▌ ╟████████████▄ ╙█████ ,████████████████ //
// ██████████████▌ ╟█████████████ ╙████ ▄██████████████████ //
// ██████████████▌ ╟██████████████ ╙███ ▄████████████████████ //
// ██████████████▌ ╟███████████████ ╟██ ,███████████████████████ //
// ██████████████▌ ,████ ███████████████████████████ //
// ██████████████▌ ▄██████▌ ██████████████████████████ //
// ██████████████▌ ▄█████████▌ █████████████████████████ //
// ██████████████▌ ,█████████████▄ ████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// //
////////////////////////////////////////////////////////////////////////////////////////
import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../resources/IResources.sol";
import "./IResourceFieldV2.sol";
contract ResourceFieldV2 is AdminControl, IResourceFieldV2, IERC721, IERC721Metadata {
using ECDSA for bytes32;
using Strings for uint256;
string constant public override name = "LVCIDIA// Resource Field";
string constant public override symbol = "LRF";
uint256 private constant MAX_UINT96 = 0xFFFFFFFFFFFFFFFFFFFFFFFF;
// Resource contract address
address public immutable RESOURCE_ADDRESS;
// Whether or not contract is enabled
bool private _enabled;
// Validation signing address
address private _signingAddress;
// Message nonces
mapping(bytes32 => bool) private _usedNonces;
// Mapping for staked token info
mapping(address => mapping (uint256 => address)) private _stakeOwner;
// Owner address to balance
mapping(address => uint256) private _stakeBalances;
// Mapping for metadata override
mapping(address => string) private _tokenURIOverride;
constructor(address resourceAddress, address signingAddress) {
RESOURCE_ADDRESS = resourceAddress;
_signingAddress = signingAddress;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(AdminControl, IERC165) returns (bool) {
return
interfaceId == type(IResourceFieldV2).interfaceId ||
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC165).interfaceId ||
AdminControl.supportsInterface(interfaceId);
}
/**
* @dev See {IResourceField-updateSigner}.
*/
function updateSigner(address signingAddress) external override onlyOwner {
_signingAddress = signingAddress;
}
/**
* @dev See {IResourceField-enable}.
*/
function enable() external override onlyOwner {
_enabled = true;
}
/**
* @dev See {IResourceField-disable}.
*/
function disable() external override adminRequired {
_enabled = false;
}
/**
* @dev See {IResourceField-disable}.
*/
function setTokenURIOverride(address contractAddress, string memory uriOverride) external override adminRequired {
_tokenURIOverride[contractAddress] = uriOverride;
}
/**
* @dev See {IResourceField-stakeMultiple}.
*/
function stakeMultiple(address[] calldata tokenAddresses, uint256[] calldata tokenIds, bytes calldata data) external override {
require(tokenAddresses.length == tokenIds.length, "Invalid input");
require(_enabled, "Disabled");
uint256 length = tokenAddresses.length;
for (uint i = 0; i < length;) {
require(tokenIds[i] <= MAX_UINT96, "Invalid tokenId");
IERC721(tokenAddresses[i]).safeTransferFrom(msg.sender, address(this), tokenIds[i], data);
emit Transfer(address(0), msg.sender, _encodeToken(tokenAddresses[i], tokenIds[i]));
unchecked { i++; }
}
_stakeBalances[msg.sender] += length;
}
/**
* @dev See {IResourceField-unstake}.
*/
function unstake(address[] calldata tokenAddresses, uint256[] calldata tokenIds) external override {
require(tokenAddresses.length == tokenIds.length, "Invalid input");
uint256 length = tokenAddresses.length;
for (uint i = 0; i < length;) {
address tokenAddress = tokenAddresses[i];
uint256 tokenId = tokenIds[i];
address ownerAddress = _stakeOwner[tokenAddress][tokenId];
require(ownerAddress == msg.sender, "Cannot unstake token you do not own");
_stakeOwner[tokenAddress][tokenId] = address(0);
IERC721(tokenAddress).transferFrom(address(this), msg.sender, tokenId);
emit Unstake(ownerAddress, tokenAddress, tokenId);
emit Transfer(msg.sender, address(0), _encodeToken(tokenAddress, tokenId));
unchecked { i++; }
}
_stakeBalances[msg.sender] -= length;
}
/**
* @dev See {IResourceField-recover}.
*/
function recover(address tokenAddress, uint256 tokenId, address recipient) external override onlyOwner {
require(_stakeOwner[tokenAddress][tokenId] == address(0), "Cannot recover staked token");
IERC721(tokenAddress).transferFrom(address(this), recipient, tokenId);
}
/**
* @dev See {IResourceField-claimResources}.
*/
function claimResources(uint256[] calldata tokenIds, uint256[] calldata amounts, bytes32 message, bytes calldata signature, bytes32 nonce) external override {
require(_enabled, "Disabled");
// Check signature data
_validateClaimSignature(tokenIds, amounts, message, signature, nonce);
IResources(RESOURCE_ADDRESS).safeBatchTransferFrom(address(this), msg.sender, tokenIds, amounts, "");
emit ClaimResource(nonce, msg.sender, tokenIds, amounts);
}
/**
* @dev See {IResourceField-burnResources}.
*/
function burnResources(uint256[] calldata tokenIds, uint256[] calldata amounts) external override onlyOwner {
IResources(RESOURCE_ADDRESS).burn(address(this), tokenIds, amounts);
}
/**
* Validate claim signature
*/
function _validateClaimSignature(uint256[] calldata tokenIds, uint256[] calldata amounts, bytes32 message, bytes calldata signature, bytes32 nonce) internal virtual {
// Verify nonce usage/re-use
require(!_usedNonces[nonce], "Cannot replay transaction");
// Verify valid message based on input variables
uint256 length = 52+64*tokenIds.length;
bytes32 expectedMessage = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", length.toString(), msg.sender, nonce, tokenIds, amounts));
require(message == expectedMessage, "Malformed message");
// Verify signature was performed by the expected signing address
address signer = message.recover(signature);
require(signer == _signingAddress, "Invalid signature");
_usedNonces[nonce] = true;
}
/**
* @dev See {IResourceField-nonceUsed}.
*/
function nonceUsed(bytes32 nonce) external view override returns (bool) {
return _usedNonces[nonce];
}
/**
* @dev See {IERC721Receiver-onERC721Received}.
*/
function onERC721Received(
address,
address from,
uint256 tokenId,
bytes calldata data
) external override returns (bytes4) {
require(_enabled, "Disabled");
// Check that this is a token that can be staked
require(tokenId <= MAX_UINT96, "Invalid tokenId");
_stakeOwner[msg.sender][tokenId] = from;
emit Stake(from, msg.sender, tokenId, data);
emit Transfer(address(0), from, _encodeToken(msg.sender, tokenId));
_stakeBalances[from] += 1;
return this.onERC721Received.selector;
}
/**
* @dev See {IERC1155Receiver-onERC1155Received}.
*/
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) view public override returns (bytes4) {
require(msg.sender == RESOURCE_ADDRESS, "Only LVCIDIA// RESOURCES accepted");
return this.onERC1155Received.selector;
}
/**
* @dev See {IERC1155Receiver-onERC1155BatchReceived}.
*/
function onERC1155BatchReceived(
address,
address,
uint256[] calldata,
uint256[] calldata,
bytes calldata
) view public override returns (bytes4) {
require(msg.sender == RESOURCE_ADDRESS, "Only LVCIDIA// RESOURCES accepted");
return this.onERC1155BatchReceived.selector;
}
function _encodeToken(address tokenAddress, uint256 tokenId) private pure returns (uint256) {
return uint256(uint160(tokenAddress)) << 96 | uint96(tokenId);
}
function _decodeToken(uint256 token) private pure returns (address tokenAddress, uint256 tokenId) {
tokenAddress = address(uint160(token >> 96));
tokenId = uint96(token);
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address,
address,
uint256
) external pure override {
_transferRevert();
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address,
address,
uint256
) external pure override {
_transferRevert();
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address,
address,
uint256,
bytes memory
) external pure override {
_transferRevert();
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address, uint256) external pure override {
_transferRevert();
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256) external pure override returns (address) {
return address(0);
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address, bool) external pure override {
_transferRevert();
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address, address) external pure override returns (bool) {
return false;
}
function _transferRevert() private pure {
revert("Cannot perform transfers on a non-transferable token");
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 token) external view override returns (address) {
(address tokenAddress, uint256 tokenId) = _decodeToken(token);
address owner = _stakeOwner[tokenAddress][tokenId];
require(owner != address(0), "ERC721: invalid token ID");
return owner;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 token) external view override returns (string memory) {
(address tokenAddress, uint256 tokenId) = _decodeToken(token);
require(_stakeOwner[tokenAddress][tokenId] != address(0), "ERC721: invalid token ID");
string memory uriOverride = _tokenURIOverride[tokenAddress];
if (bytes(uriOverride).length > 0) {
return string(abi.encodePacked(uriOverride, '/', tokenId.toString(), '.json'));
}
return IERC721Metadata(tokenAddress).tokenURI(tokenId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) external view override returns (uint256) {
require(owner != address(0), "ERC721: address zero is not a valid owner");
return _stakeBalances[owner];
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
////////////////////////////////////////////////////////////////////////////////////////
// //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ██████████████▌ ╟██ ████████████████ j██████████████ //
// ██████████████▌ ╟███ ███████████████ j██████████████ //
// ██████████████▌ ╟███▌ ██████████████ j██████████████ //
// ██████████████▌ ╟████▌ █████████████ j██████████████ //
// ██████████████▌ ╟█████▌ ╙████████████ j██████████████ //
// ██████████████▌ ╟██████▄ ╙███████████ j██████████████ //
// ██████████████▌ ╟███████ ╙██████████ j██████████████ //
// ██████████████▌ ╟████████ ╟█████████ j██████████████ //
// ██████████████▌ ╟█████████ █████████ j██████████████ //
// ██████████████▌ ╟██████████ ████████ j██████████████ //
// ██████████████▌ ╟██████████▌ ███████ j██████████████ //
// ██████████████▌ ╟███████████▌ ██████ j██████████████ //
// ██████████████▌ ╟████████████▄ ╙█████ ,████████████████ //
// ██████████████▌ ╟█████████████ ╙████ ▄██████████████████ //
// ██████████████▌ ╟██████████████ ╙███ ▄████████████████████ //
// ██████████████▌ ╟███████████████ ╟██ ,███████████████████████ //
// ██████████████▌ ,████ ███████████████████████████ //
// ██████████████▌ ▄██████▌ ██████████████████████████ //
// ██████████████▌ ▄█████████▌ █████████████████████████ //
// ██████████████▌ ,█████████████▄ ████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// //
////////////////////////////////////////////////////////////////////////////////////////
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
interface IResourceFieldV2 is IERC165, IERC721Receiver, IERC1155Receiver {
event Stake(address ownerAddress, address tokenAddress, uint256 tokenId, bytes data);
event Unstake(address ownerAddress, address tokenAddress, uint256 tokenId);
event ClaimResource(bytes32 nonce, address ownerAddress, uint256[] tokenIds, uint256[] amounts);
/**
* @dev Update the message signer
* Can only be called by the contract owner.
*/
function updateSigner(address signingAddress) external;
/**
* @dev Enable the contract
* Can only be called by the contract owner.
*/
function enable() external;
/**
* @dev Disable the contract
* Can only be called by the contract owner or any admins.
*/
function disable() external;
/**
* @dev Set tokenURI override for a given staked contract
* Can only be called by the contract owner or any admins.
*/
function setTokenURIOverride(address contractAddress, string memory uriOverride) external;
/**
* @dev Claim resources
*/
function claimResources(uint256[] calldata tokenIds, uint256[] calldata amounts, bytes32 message, bytes calldata signature, bytes32 nonce) external;
/**
* @dev Burn resources held by the ResourceField.
* Can only be called by the contract owner.
*/
function burnResources(uint256[] calldata tokenIds, uint256[] calldata amounts) external;
/**
* @dev Stake multiple tokens.
*/
function stakeMultiple(address[] calldata tokenAddresses, uint256[] calldata tokenIds, bytes calldata data) external;
/**
* @dev Unstake token
* Can only unstake tokens that were staked by the requestor.
*/
function unstake(address[] calldata tokenAddresses, uint256[] calldata tokenIds) external;
/**
* @dev Recover token.
* Can only be used to recover a token that was sent in using transferFrom accidentally.
* Can only be called by the contract owner.
*/
function recover(address tokenAddress, uint256 tokenId, address recipient) external;
/**
* @dev Check if nonce has been used
*/
function nonceUsed(bytes32 nonce) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
////////////////////////////////////////////////////////////////////////////////////////
// //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ██████████████▌ ╟██ ████████████████ j██████████████ //
// ██████████████▌ ╟███ ███████████████ j██████████████ //
// ██████████████▌ ╟███▌ ██████████████ j██████████████ //
// ██████████████▌ ╟████▌ █████████████ j██████████████ //
// ██████████████▌ ╟█████▌ ╙████████████ j██████████████ //
// ██████████████▌ ╟██████▄ ╙███████████ j██████████████ //
// ██████████████▌ ╟███████ ╙██████████ j██████████████ //
// ██████████████▌ ╟████████ ╟█████████ j██████████████ //
// ██████████████▌ ╟█████████ █████████ j██████████████ //
// ██████████████▌ ╟██████████ ████████ j██████████████ //
// ██████████████▌ ╟██████████▌ ███████ j██████████████ //
// ██████████████▌ ╟███████████▌ ██████ j██████████████ //
// ██████████████▌ ╟████████████▄ ╙█████ ,████████████████ //
// ██████████████▌ ╟█████████████ ╙████ ▄██████████████████ //
// ██████████████▌ ╟██████████████ ╙███ ▄████████████████████ //
// ██████████████▌ ╟███████████████ ╟██ ,███████████████████████ //
// ██████████████▌ ,████ ███████████████████████████ //
// ██████████████▌ ▄██████▌ ██████████████████████████ //
// ██████████████▌ ▄█████████▌ █████████████████████████ //
// ██████████████▌ ,█████████████▄ ████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// ████████████████████████████████████████████████████████████████████████████████ //
// //
////////////////////////////////////////////////////////////////////////////////////////
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
interface IResources is IERC1155 {
/**
* @dev Mint tokens
*/
function mint(address to, uint256[] memory tokenIds, uint256[] memory amounts) external;
/**
* @dev Set the tokenURI of a token.
*/
function setTokenURI(uint256 tokenId, string calldata uri_) external;
/**
* @dev set the tokenURI of multiple tokens.
*/
function setTokenURIs(uint256[] memory tokenIds, string[] calldata uris) external;
/**
* @dev burn tokens. Can only be called by token owner or approved address.
* On burn, calls back to the registered extension's onBurn method
*/
function burn(address account, uint256[] calldata tokenIds, uint256[] calldata amounts) external;
/**
* @dev Total amount of tokens of resource with a given id.
*/
function totalSupply(uint256 tokenId) external view returns (uint256);
/**
* @dev Total amount of burned tokens of resource with a given id.
*/
function burnedSupply(uint256 tokenId) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed 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] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV // Deprecated in v4.8
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} 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");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
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 {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
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);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
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;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, "\x19Ethereum Signed Message:\n32")
mstore(0x1c, hash)
message := keccak256(0x00, 0x3c)
}
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, "\x19\x01")
mstore(add(ptr, 0x02), domainSeparator)
mstore(add(ptr, 0x22), structHash)
data := keccak256(ptr, 0x42)
}
}
/**
* @dev Returns an Ethereum Signed Data with intended validator, created from a
* `validator` and `data` according to the version 0 of EIP-191.
*
* See {recover}.
*/
function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x00", validator, data));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./IAdminControl.sol";
abstract contract AdminControl is Ownable, IAdminControl, ERC165 {
using EnumerableSet for EnumerableSet.AddressSet;
// Track registered admins
EnumerableSet.AddressSet private _admins;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return interfaceId == type(IAdminControl).interfaceId
|| super.supportsInterface(interfaceId);
}
/**
* @dev Only allows approved admins to call the specified function
*/
modifier adminRequired() {
require(owner() == msg.sender || _admins.contains(msg.sender), "AdminControl: Must be owner or admin");
_;
}
/**
* @dev See {IAdminControl-getAdmins}.
*/
function getAdmins() external view override returns (address[] memory admins) {
admins = new address[](_admins.length());
for (uint i = 0; i < _admins.length(); i++) {
admins[i] = _admins.at(i);
}
return admins;
}
/**
* @dev See {IAdminControl-approveAdmin}.
*/
function approveAdmin(address admin) external override onlyOwner {
if (!_admins.contains(admin)) {
emit AdminApproved(admin, msg.sender);
_admins.add(admin);
}
}
/**
* @dev See {IAdminControl-revokeAdmin}.
*/
function revokeAdmin(address admin) external override onlyOwner {
if (_admins.contains(admin)) {
emit AdminRevoked(admin, msg.sender);
_admins.remove(admin);
}
}
/**
* @dev See {IAdminControl-isAdmin}.
*/
function isAdmin(address admin) public override view returns (bool) {
return (owner() == admin || _admins.contains(admin));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(
address[] calldata accounts,
uint256[] calldata ids
) external view returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/**
* @dev Interface for admin control
*/
interface IAdminControl is IERC165 {
event AdminApproved(address indexed account, address indexed sender);
event AdminRevoked(address indexed account, address indexed sender);
/**
* @dev gets address of all admins
*/
function getAdmins() external view returns (address[] memory);
/**
* @dev add an admin. Can only be called by contract owner.
*/
function approveAdmin(address admin) external;
/**
* @dev remove an admin. Can only be called by contract owner.
*/
function revokeAdmin(address admin) external;
/**
* @dev checks whether or not given address is an admin
* Returns True if they are
*/
function isAdmin(address admin) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```solidity
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableSet.
* ====
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastValue;
// Update the index for the moved value
set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}{
"optimizer": {
"enabled": true,
"runs": 1000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"resourceAddress","type":"address"},{"internalType":"address","name":"signingAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminRevoked","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":false,"internalType":"bytes32","name":"nonce","type":"bytes32"},{"indexed":false,"internalType":"address","name":"ownerAddress","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"ClaimResource","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":"ownerAddress","type":"address"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"Stake","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":"ownerAddress","type":"address"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Unstake","type":"event"},{"inputs":[],"name":"RESOURCE_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"approveAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"burnResources","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes32","name":"message","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes32","name":"nonce","type":"bytes32"}],"name":"claimResources","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAdmins","outputs":[{"internalType":"address[]","name":"admins","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"nonce","type":"bytes32"}],"name":"nonceUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"token","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"recover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"revokeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"string","name":"uriOverride","type":"string"}],"name":"setTokenURIOverride","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokenAddresses","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"stakeMultiple","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":"uint256","name":"token","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokenAddresses","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signingAddress","type":"address"}],"name":"updateSigner","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a06040523480156200001157600080fd5b5060405162002f7438038062002f748339810160408190526200003491620000dc565b6200003f336200006f565b6001600160a01b03918216608052600380549190921661010002610100600160a81b031990911617905562000114565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000d757600080fd5b919050565b60008060408385031215620000f057600080fd5b620000fb83620000bf565b91506200010b60208401620000bf565b90509250929050565b608051612e286200014c6000396000818161025801528181610c9301528181611044015281816115b701526116e10152612e286000f3fe608060405234801561001057600080fd5b50600436106102265760003560e01c806370a082311161012a578063b88d4fde116100bd578063cb97cd8a1161008c578063e985e9c511610071578063e985e9c514610519578063f23a6e611461052f578063f2fde38b1461054257600080fd5b8063cb97cd8a146104f3578063dcd86f3e1461050657600080fd5b8063b88d4fde146104a7578063bc197c81146104ba578063bcca1e04146104cd578063c87b56dd146104e057600080fd5b806395d89b41116100f957806395d89b4114610442578063a22cb4651461047e578063a3907d711461048c578063a7ecd37e1461049457600080fd5b806370a08231146103f5578063715018a6146104165780638da5cb5b1461041e5780638e5116bc1461042f57600080fd5b8063285ecb46116101bd5780633ac4e9351161018c57806361a4422b1161017157806361a4422b146103ac5780636352211e146103cf5780636d73e669146103e257600080fd5b80633ac4e9351461039957806342842e0e1461033057600080fd5b8063285ecb46146103565780632d345670146103695780632f2770db1461037c57806331ae450b1461038457600080fd5b8063095ea7b3116101f9578063095ea7b3146102ef578063150b7a021461030457806323b872dd1461033057806324d7806c1461034357600080fd5b806301ffc9a71461022b578063043bd5ed1461025357806306fdde0314610292578063081812fc146102db575b600080fd5b61023e61023936600461213e565b610555565b60405190151581526020015b60405180910390f35b61027a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161024a565b6102ce6040518060400160405280601881526020017f4c5643494449412f2f205265736f75726365204669656c64000000000000000081525081565b60405161024a919061218c565b61027a6102e93660046121bf565b50600090565b6103026102fd3660046121f4565b6105e8565b005b610317610312366004612260565b6105f4565b6040516001600160e01b0319909116815260200161024a565b61030261033e3660046122cf565b6107c6565b61023e61035136600461230b565b6107d3565b61030261036436600461236b565b61080c565b61030261037736600461230b565b610a79565b610302610ad5565b61038c610b67565b60405161024a9190612405565b6103026103a7366004612452565b610c16565b61023e6103ba3660046121bf565b60009081526004602052604090205460ff1690565b61027a6103dd3660046121bf565b610d4f565b6103026103f036600461230b565b610ddd565b61040861040336600461230b565b610e35565b60405190815260200161024a565b610302610ecf565b6000546001600160a01b031661027a565b61030261043d3660046124fd565b610ee3565b6102ce6040518060400160405280600381526020017f4c5246000000000000000000000000000000000000000000000000000000000081525081565b6103026102fd366004612539565b610302610fcb565b6103026104a236600461230b565b610fe2565b6103026104b5366004612622565b611029565b6103176104c836600461269e565b611037565b6103026104db366004612759565b6110e9565b6102ce6104ee3660046121bf565b61138c565b610302610501366004612759565b61157f565b6103026105143660046127c5565b61162c565b61023e610527366004612827565b600092915050565b61031761053d36600461285a565b6116d4565b61030261055036600461230b565b611784565b60006001600160e01b031982167f7db114800000000000000000000000000000000000000000000000000000000014806105b857506001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000145b806105d357506001600160e01b031982166301ffc9a760e01b145b806105e257506105e282611811565b92915050565b6105f061185f565b5050565b60035460009060ff166106395760405162461bcd60e51b8152602060048201526008602482015267111a5cd8589b195960c21b60448201526064015b60405180910390fd5b6bffffffffffffffffffffffff8411156106955760405162461bcd60e51b815260206004820152600f60248201527f496e76616c696420746f6b656e496400000000000000000000000000000000006044820152606401610630565b33600081815260056020908152604080832088845290915290819020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038916179055517f0956338b00ab275fa76c175d99d04b91c295a1b6b2d9ab590efcd95095fbb1379161070c918891908890889088906128c0565b60405180910390a16bffffffffffffffffffffffff193360601b166bffffffffffffffffffffffff8516176040516001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46001600160a01b038516600090815260066020526040812080546001929061079690849061292a565b909155507f150b7a0200000000000000000000000000000000000000000000000000000000979650505050505050565b6107ce61185f565b505050565b6000816001600160a01b03166107f16000546001600160a01b031690565b6001600160a01b031614806105e257506105e26001836118cd565b84831461084b5760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b6044820152606401610630565b60035460ff166108885760405162461bcd60e51b8152602060048201526008602482015267111a5cd8589b195960c21b6044820152606401610630565b8460005b81811015610a4b576bffffffffffffffffffffffff8686838181106108b3576108b361293d565b9050602002013511156109085760405162461bcd60e51b815260206004820152600f60248201527f496e76616c696420746f6b656e496400000000000000000000000000000000006044820152606401610630565b87878281811061091a5761091a61293d565b905060200201602081019061092f919061230b565b6001600160a01b031663b88d4fde33308989868181106109515761095161293d565b9050602002013588886040518663ffffffff1660e01b815260040161097a9594939291906128c0565b600060405180830381600087803b15801561099457600080fd5b505af11580156109a8573d6000803e3d6000fd5b50505050610a168888838181106109c1576109c161293d565b90506020020160208101906109d6919061230b565b8787848181106109e8576109e861293d565b905060200201356bffffffffffffffffffffffff1660609190911b6bffffffffffffffffffffffff19161790565b60405133906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a460010161088c565b503360009081526006602052604081208054839290610a6b90849061292a565b909155505050505050505050565b610a816118f2565b610a8c6001826118cd565b15610ad25760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a36105f060018261194c565b50565b33610ae86000546001600160a01b031690565b6001600160a01b03161480610b035750610b036001336118cd565b610b5b5760405162461bcd60e51b8152602060048201526024808201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616044820152633236b4b760e11b6064820152608401610630565b6003805460ff19169055565b6060610b736001611961565b67ffffffffffffffff811115610b8b57610b8b612575565b604051908082528060200260200182016040528015610bb4578160200160208202803683370190505b50905060005b610bc46001611961565b811015610c1257610bd660018261196b565b828281518110610be857610be861293d565b6001600160a01b039092166020928302919091019091015280610c0a81612953565b915050610bba565b5090565b60035460ff16610c535760405162461bcd60e51b8152602060048201526008602482015267111a5cd8589b195960c21b6044820152606401610630565b610c638888888888888888611977565b6040517f2eb2c2d60000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632eb2c2d690610cd290309033908d908d908d908d906004016129b7565b600060405180830381600087803b158015610cec57600080fd5b505af1158015610d00573d6000803e3d6000fd5b505050507f31c3a3da4902702c2c271431c1c6125fc4d0b714b0b12f0da763381539e7748381338a8a8a8a604051610d3d96959493929190612a16565b60405180910390a15050505050505050565b606081901c60008181526005602090815260408083206bffffffffffffffffffffffff861680855292528220549192916001600160a01b031680610dd55760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610630565b949350505050565b610de56118f2565b610df06001826118cd565b610ad25760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a36105f0600182611b4c565b60006001600160a01b038216610eb35760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610630565b506001600160a01b031660009081526006602052604090205490565b610ed76118f2565b610ee16000611b61565b565b610eeb6118f2565b6001600160a01b0383811660009081526005602090815260408083208684529091529020541615610f5e5760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f74207265636f766572207374616b656420746f6b656e00000000006044820152606401610630565b6040516323b872dd60e01b81523060048201526001600160a01b038281166024830152604482018490528416906323b872dd90606401600060405180830381600087803b158015610fae57600080fd5b505af1158015610fc2573d6000803e3d6000fd5b50505050505050565b610fd36118f2565b6003805460ff19166001179055565b610fea6118f2565b600380546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b61103161185f565b50505050565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110bb5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79204c5643494449412f2f205245534f555243455320616363657074656044820152601960fa1b6064820152608401610630565b507fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b8281146111285760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b6044820152606401610630565b8260005b818110156113605760008686838181106111485761114861293d565b905060200201602081019061115d919061230b565b905060008585848181106111735761117361293d565b6001600160a01b03808616600090815260056020908152604080832094820296909601358083529390529390932054909350909116905033811461121f5760405162461bcd60e51b815260206004820152602360248201527f43616e6e6f7420756e7374616b6520746f6b656e20796f7520646f206e6f742060448201527f6f776e00000000000000000000000000000000000000000000000000000000006064820152608401610630565b6001600160a01b038316600081815260056020908152604080832086845290915290819020805473ffffffffffffffffffffffffffffffffffffffff19169055516323b872dd60e01b8152306004820152336024820152604481018490526323b872dd90606401600060405180830381600087803b1580156112a057600080fd5b505af11580156112b4573d6000803e3d6000fd5b5050604080516001600160a01b038086168252871660208201529081018590527f390b1276974b9463e5d66ab10df69b6f3d7b930eb066a0e66df327edd2cc811c9250606001905060405180910390a16bffffffffffffffffffffffff19606084901b166bffffffffffffffffffffffff83161760405160009033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a450505060010161112c565b503360009081526006602052604081208054839290611380908490612a5f565b90915550505050505050565b606081811c60008181526005602090815260408083206bffffffffffffffffffffffff87168085529252909120546001600160a01b031661140f5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610630565b6001600160a01b0382166000908152600760205260408120805461143290612a72565b80601f016020809104026020016040519081016040528092919081815260200182805461145e90612a72565b80156114ab5780601f10611480576101008083540402835291602001916114ab565b820191906000526020600020905b81548152906001019060200180831161148e57829003601f168201915b505050505090506000815111156114f057806114c683611bbe565b6040516020016114d7929190612aac565b6040516020818303038152906040529350505050919050565b6040517fc87b56dd000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0384169063c87b56dd90602401600060405180830381865afa15801561154e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115769190810190612b2e565b95945050505050565b6115876118f2565b6040517f3db0f8ab0000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690633db0f8ab906115f49030908890889088908890600401612b9c565b600060405180830381600087803b15801561160e57600080fd5b505af1158015611622573d6000803e3d6000fd5b5050505050505050565b3361163f6000546001600160a01b031690565b6001600160a01b0316148061165a575061165a6001336118cd565b6116b25760405162461bcd60e51b8152602060048201526024808201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616044820152633236b4b760e11b6064820152608401610630565b6001600160a01b03821660009081526007602052604090206107ce8282612c2c565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146117585760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79204c5643494449412f2f205245534f555243455320616363657074656044820152601960fa1b6064820152608401610630565b507ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b61178c6118f2565b6001600160a01b0381166118085760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610630565b610ad281611b61565b60006001600160e01b031982167f553e757e0000000000000000000000000000000000000000000000000000000014806105e257506301ffc9a760e01b6001600160e01b03198316146105e2565b60405162461bcd60e51b815260206004820152603460248201527f43616e6e6f7420706572666f726d207472616e7366657273206f6e2061206e6f60448201527f6e2d7472616e7366657261626c6520746f6b656e0000000000000000000000006064820152608401610630565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b6000546001600160a01b03163314610ee15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610630565b60006118eb836001600160a01b038416611c5e565b60006105e2825490565b60006118eb8383611d51565b60008181526004602052604090205460ff16156119d65760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f74207265706c6179207472616e73616374696f6e000000000000006044820152606401610630565b60006119e3886040612cec565b6119ee90603461292a565b905060006119fb82611bbe565b33848c8c8c8c604051602001611a179796959493929190612d45565b604051602081830303815290604052805190602001209050808614611a7e5760405162461bcd60e51b815260206004820152601160248201527f4d616c666f726d6564206d6573736167650000000000000000000000000000006044820152606401610630565b6000611ac286868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b93925050611d7b9050565b6003549091506001600160a01b038083166101009092041614611b275760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610630565b5050506000908152600460205260409020805460ff1916600117905550505050505050565b60006118eb836001600160a01b038416611d9f565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60606000611bcb83611dee565b600101905060008167ffffffffffffffff811115611beb57611beb612575565b6040519080825280601f01601f191660200182016040528015611c15576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084611c1f57509392505050565b60008181526001830160205260408120548015611d47576000611c82600183612a5f565b8554909150600090611c9690600190612a5f565b9050818114611cfb576000866000018281548110611cb657611cb661293d565b9060005260206000200154905080876000018481548110611cd957611cd961293d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611d0c57611d0c612dc6565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105e2565b60009150506105e2565b6000826000018281548110611d6857611d6861293d565b9060005260206000200154905092915050565b6000806000611d8a8585611ed0565b91509150611d9781611f15565b509392505050565b6000818152600183016020526040812054611de6575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105e2565b5060006105e2565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611e37577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310611e63576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611e8157662386f26fc10000830492506010015b6305f5e1008310611e99576305f5e100830492506008015b6127108310611ead57612710830492506004015b60648310611ebf576064830492506002015b600a83106105e25760010192915050565b6000808251604103611f065760208301516040840151606085015160001a611efa8782858561207a565b94509450505050611f0e565b506000905060025b9250929050565b6000816004811115611f2957611f29612ddc565b03611f315750565b6001816004811115611f4557611f45612ddc565b03611f925760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610630565b6002816004811115611fa657611fa6612ddc565b03611ff35760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610630565b600381600481111561200757612007612ddc565b03610ad25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610630565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156120b15750600090506003612135565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612105573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661212e57600060019250925050612135565b9150600090505b94509492505050565b60006020828403121561215057600080fd5b81356001600160e01b0319811681146118eb57600080fd5b60005b8381101561218357818101518382015260200161216b565b50506000910152565b60208152600082518060208401526121ab816040850160208701612168565b601f01601f19169190910160400192915050565b6000602082840312156121d157600080fd5b5035919050565b80356001600160a01b03811681146121ef57600080fd5b919050565b6000806040838503121561220757600080fd5b612210836121d8565b946020939093013593505050565b60008083601f84011261223057600080fd5b50813567ffffffffffffffff81111561224857600080fd5b602083019150836020828501011115611f0e57600080fd5b60008060008060006080868803121561227857600080fd5b612281866121d8565b945061228f602087016121d8565b935060408601359250606086013567ffffffffffffffff8111156122b257600080fd5b6122be8882890161221e565b969995985093965092949392505050565b6000806000606084860312156122e457600080fd5b6122ed846121d8565b92506122fb602085016121d8565b9150604084013590509250925092565b60006020828403121561231d57600080fd5b6118eb826121d8565b60008083601f84011261233857600080fd5b50813567ffffffffffffffff81111561235057600080fd5b6020830191508360208260051b8501011115611f0e57600080fd5b6000806000806000806060878903121561238457600080fd5b863567ffffffffffffffff8082111561239c57600080fd5b6123a88a838b01612326565b909850965060208901359150808211156123c157600080fd5b6123cd8a838b01612326565b909650945060408901359150808211156123e657600080fd5b506123f389828a0161221e565b979a9699509497509295939492505050565b6020808252825182820181905260009190848201906040850190845b818110156124465783516001600160a01b031683529284019291840191600101612421565b50909695505050505050565b60008060008060008060008060a0898b03121561246e57600080fd5b883567ffffffffffffffff8082111561248657600080fd5b6124928c838d01612326565b909a50985060208b01359150808211156124ab57600080fd5b6124b78c838d01612326565b909850965060408b0135955060608b01359150808211156124d757600080fd5b506124e48b828c0161221e565b999c989b50969995989497949560800135949350505050565b60008060006060848603121561251257600080fd5b61251b846121d8565b925060208401359150612530604085016121d8565b90509250925092565b6000806040838503121561254c57600080fd5b612555836121d8565b91506020830135801515811461256a57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156125b4576125b4612575565b604052919050565b600067ffffffffffffffff8211156125d6576125d6612575565b50601f01601f191660200190565b60006125f76125f2846125bc565b61258b565b905082815283838301111561260b57600080fd5b828260208301376000602084830101529392505050565b6000806000806080858703121561263857600080fd5b612641856121d8565b935061264f602086016121d8565b925060408501359150606085013567ffffffffffffffff81111561267257600080fd5b8501601f8101871361268357600080fd5b612692878235602084016125e4565b91505092959194509250565b60008060008060008060008060a0898b0312156126ba57600080fd5b6126c3896121d8565b97506126d160208a016121d8565b9650604089013567ffffffffffffffff808211156126ee57600080fd5b6126fa8c838d01612326565b909850965060608b013591508082111561271357600080fd5b61271f8c838d01612326565b909650945060808b013591508082111561273857600080fd5b506127458b828c0161221e565b999c989b5096995094979396929594505050565b6000806000806040858703121561276f57600080fd5b843567ffffffffffffffff8082111561278757600080fd5b61279388838901612326565b909650945060208701359150808211156127ac57600080fd5b506127b987828801612326565b95989497509550505050565b600080604083850312156127d857600080fd5b6127e1836121d8565b9150602083013567ffffffffffffffff8111156127fd57600080fd5b8301601f8101851361280e57600080fd5b61281d858235602084016125e4565b9150509250929050565b6000806040838503121561283a57600080fd5b612843836121d8565b9150612851602084016121d8565b90509250929050565b60008060008060008060a0878903121561287357600080fd5b61287c876121d8565b955061288a602088016121d8565b94506040870135935060608701359250608087013567ffffffffffffffff8111156128b457600080fd5b6123f389828a0161221e565b60006001600160a01b03808816835280871660208401525084604083015260806060830152826080830152828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156105e2576105e2612914565b634e487b7160e01b600052603260045260246000fd5b60006001820161296557612965612914565b5060010190565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561299e57600080fd5b8260051b80836020870137939093016020019392505050565b60006001600160a01b03808916835280881660208401525060a060408301526129e460a08301868861296c565b82810360608401526129f781858761296c565b8381036080909401939093525050600081526020019695505050505050565b8681526001600160a01b0386166020820152608060408201526000612a3f60808301868861296c565b8281036060840152612a5281858761296c565b9998505050505050505050565b818103818111156105e2576105e2612914565b600181811c90821680612a8657607f821691505b602082108103612aa657634e487b7160e01b600052602260045260246000fd5b50919050565b60008351612abe818460208801612168565b7f2f000000000000000000000000000000000000000000000000000000000000009083019081528351612af8816001840160208801612168565b7f2e6a736f6e00000000000000000000000000000000000000000000000000000060019290910191820152600601949350505050565b600060208284031215612b4057600080fd5b815167ffffffffffffffff811115612b5757600080fd5b8201601f81018413612b6857600080fd5b8051612b766125f2826125bc565b818152856020838501011115612b8b57600080fd5b611576826020830160208601612168565b6001600160a01b0386168152606060208201526000612bbf60608301868861296c565b8281036040840152612bd281858761296c565b98975050505050505050565b601f8211156107ce57600081815260208120601f850160051c81016020861015612c055750805b601f850160051c820191505b81811015612c2457828155600101612c11565b505050505050565b815167ffffffffffffffff811115612c4657612c46612575565b612c5a81612c548454612a72565b84612bde565b602080601f831160018114612c8f5760008415612c775750858301515b600019600386901b1c1916600185901b178555612c24565b600085815260208120601f198616915b82811015612cbe57888601518255948401946001909101908401612c9f565b5085821015612cdc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820281158282048414176105e2576105e2612914565b60007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612d3257600080fd5b8260051b80838637939093019392505050565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008851612d7d81601a850160208d01612168565b80830190506bffffffffffffffffffffffff198960601b16601a82015287602e820152612db8612db1604e8301888a612d03565b8587612d03565b9a9950505050505050505050565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220f8d83ca57daa91e20dc28480317f50dbf8e1d95c6718f26831363402bafdbdc864736f6c6343000812003300000000000000000000000097a20815a061eae224c4fdf3109731f73743db73000000000000000000000000679b437657763825f834d24fe6894ee1762c72cc
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102265760003560e01c806370a082311161012a578063b88d4fde116100bd578063cb97cd8a1161008c578063e985e9c511610071578063e985e9c514610519578063f23a6e611461052f578063f2fde38b1461054257600080fd5b8063cb97cd8a146104f3578063dcd86f3e1461050657600080fd5b8063b88d4fde146104a7578063bc197c81146104ba578063bcca1e04146104cd578063c87b56dd146104e057600080fd5b806395d89b41116100f957806395d89b4114610442578063a22cb4651461047e578063a3907d711461048c578063a7ecd37e1461049457600080fd5b806370a08231146103f5578063715018a6146104165780638da5cb5b1461041e5780638e5116bc1461042f57600080fd5b8063285ecb46116101bd5780633ac4e9351161018c57806361a4422b1161017157806361a4422b146103ac5780636352211e146103cf5780636d73e669146103e257600080fd5b80633ac4e9351461039957806342842e0e1461033057600080fd5b8063285ecb46146103565780632d345670146103695780632f2770db1461037c57806331ae450b1461038457600080fd5b8063095ea7b3116101f9578063095ea7b3146102ef578063150b7a021461030457806323b872dd1461033057806324d7806c1461034357600080fd5b806301ffc9a71461022b578063043bd5ed1461025357806306fdde0314610292578063081812fc146102db575b600080fd5b61023e61023936600461213e565b610555565b60405190151581526020015b60405180910390f35b61027a7f00000000000000000000000097a20815a061eae224c4fdf3109731f73743db7381565b6040516001600160a01b03909116815260200161024a565b6102ce6040518060400160405280601881526020017f4c5643494449412f2f205265736f75726365204669656c64000000000000000081525081565b60405161024a919061218c565b61027a6102e93660046121bf565b50600090565b6103026102fd3660046121f4565b6105e8565b005b610317610312366004612260565b6105f4565b6040516001600160e01b0319909116815260200161024a565b61030261033e3660046122cf565b6107c6565b61023e61035136600461230b565b6107d3565b61030261036436600461236b565b61080c565b61030261037736600461230b565b610a79565b610302610ad5565b61038c610b67565b60405161024a9190612405565b6103026103a7366004612452565b610c16565b61023e6103ba3660046121bf565b60009081526004602052604090205460ff1690565b61027a6103dd3660046121bf565b610d4f565b6103026103f036600461230b565b610ddd565b61040861040336600461230b565b610e35565b60405190815260200161024a565b610302610ecf565b6000546001600160a01b031661027a565b61030261043d3660046124fd565b610ee3565b6102ce6040518060400160405280600381526020017f4c5246000000000000000000000000000000000000000000000000000000000081525081565b6103026102fd366004612539565b610302610fcb565b6103026104a236600461230b565b610fe2565b6103026104b5366004612622565b611029565b6103176104c836600461269e565b611037565b6103026104db366004612759565b6110e9565b6102ce6104ee3660046121bf565b61138c565b610302610501366004612759565b61157f565b6103026105143660046127c5565b61162c565b61023e610527366004612827565b600092915050565b61031761053d36600461285a565b6116d4565b61030261055036600461230b565b611784565b60006001600160e01b031982167f7db114800000000000000000000000000000000000000000000000000000000014806105b857506001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000145b806105d357506001600160e01b031982166301ffc9a760e01b145b806105e257506105e282611811565b92915050565b6105f061185f565b5050565b60035460009060ff166106395760405162461bcd60e51b8152602060048201526008602482015267111a5cd8589b195960c21b60448201526064015b60405180910390fd5b6bffffffffffffffffffffffff8411156106955760405162461bcd60e51b815260206004820152600f60248201527f496e76616c696420746f6b656e496400000000000000000000000000000000006044820152606401610630565b33600081815260056020908152604080832088845290915290819020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038916179055517f0956338b00ab275fa76c175d99d04b91c295a1b6b2d9ab590efcd95095fbb1379161070c918891908890889088906128c0565b60405180910390a16bffffffffffffffffffffffff193360601b166bffffffffffffffffffffffff8516176040516001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46001600160a01b038516600090815260066020526040812080546001929061079690849061292a565b909155507f150b7a0200000000000000000000000000000000000000000000000000000000979650505050505050565b6107ce61185f565b505050565b6000816001600160a01b03166107f16000546001600160a01b031690565b6001600160a01b031614806105e257506105e26001836118cd565b84831461084b5760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b6044820152606401610630565b60035460ff166108885760405162461bcd60e51b8152602060048201526008602482015267111a5cd8589b195960c21b6044820152606401610630565b8460005b81811015610a4b576bffffffffffffffffffffffff8686838181106108b3576108b361293d565b9050602002013511156109085760405162461bcd60e51b815260206004820152600f60248201527f496e76616c696420746f6b656e496400000000000000000000000000000000006044820152606401610630565b87878281811061091a5761091a61293d565b905060200201602081019061092f919061230b565b6001600160a01b031663b88d4fde33308989868181106109515761095161293d565b9050602002013588886040518663ffffffff1660e01b815260040161097a9594939291906128c0565b600060405180830381600087803b15801561099457600080fd5b505af11580156109a8573d6000803e3d6000fd5b50505050610a168888838181106109c1576109c161293d565b90506020020160208101906109d6919061230b565b8787848181106109e8576109e861293d565b905060200201356bffffffffffffffffffffffff1660609190911b6bffffffffffffffffffffffff19161790565b60405133906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a460010161088c565b503360009081526006602052604081208054839290610a6b90849061292a565b909155505050505050505050565b610a816118f2565b610a8c6001826118cd565b15610ad25760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a36105f060018261194c565b50565b33610ae86000546001600160a01b031690565b6001600160a01b03161480610b035750610b036001336118cd565b610b5b5760405162461bcd60e51b8152602060048201526024808201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616044820152633236b4b760e11b6064820152608401610630565b6003805460ff19169055565b6060610b736001611961565b67ffffffffffffffff811115610b8b57610b8b612575565b604051908082528060200260200182016040528015610bb4578160200160208202803683370190505b50905060005b610bc46001611961565b811015610c1257610bd660018261196b565b828281518110610be857610be861293d565b6001600160a01b039092166020928302919091019091015280610c0a81612953565b915050610bba565b5090565b60035460ff16610c535760405162461bcd60e51b8152602060048201526008602482015267111a5cd8589b195960c21b6044820152606401610630565b610c638888888888888888611977565b6040517f2eb2c2d60000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000097a20815a061eae224c4fdf3109731f73743db731690632eb2c2d690610cd290309033908d908d908d908d906004016129b7565b600060405180830381600087803b158015610cec57600080fd5b505af1158015610d00573d6000803e3d6000fd5b505050507f31c3a3da4902702c2c271431c1c6125fc4d0b714b0b12f0da763381539e7748381338a8a8a8a604051610d3d96959493929190612a16565b60405180910390a15050505050505050565b606081901c60008181526005602090815260408083206bffffffffffffffffffffffff861680855292528220549192916001600160a01b031680610dd55760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610630565b949350505050565b610de56118f2565b610df06001826118cd565b610ad25760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a36105f0600182611b4c565b60006001600160a01b038216610eb35760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610630565b506001600160a01b031660009081526006602052604090205490565b610ed76118f2565b610ee16000611b61565b565b610eeb6118f2565b6001600160a01b0383811660009081526005602090815260408083208684529091529020541615610f5e5760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f74207265636f766572207374616b656420746f6b656e00000000006044820152606401610630565b6040516323b872dd60e01b81523060048201526001600160a01b038281166024830152604482018490528416906323b872dd90606401600060405180830381600087803b158015610fae57600080fd5b505af1158015610fc2573d6000803e3d6000fd5b50505050505050565b610fd36118f2565b6003805460ff19166001179055565b610fea6118f2565b600380546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b61103161185f565b50505050565b6000336001600160a01b037f00000000000000000000000097a20815a061eae224c4fdf3109731f73743db7316146110bb5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79204c5643494449412f2f205245534f555243455320616363657074656044820152601960fa1b6064820152608401610630565b507fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b8281146111285760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b6044820152606401610630565b8260005b818110156113605760008686838181106111485761114861293d565b905060200201602081019061115d919061230b565b905060008585848181106111735761117361293d565b6001600160a01b03808616600090815260056020908152604080832094820296909601358083529390529390932054909350909116905033811461121f5760405162461bcd60e51b815260206004820152602360248201527f43616e6e6f7420756e7374616b6520746f6b656e20796f7520646f206e6f742060448201527f6f776e00000000000000000000000000000000000000000000000000000000006064820152608401610630565b6001600160a01b038316600081815260056020908152604080832086845290915290819020805473ffffffffffffffffffffffffffffffffffffffff19169055516323b872dd60e01b8152306004820152336024820152604481018490526323b872dd90606401600060405180830381600087803b1580156112a057600080fd5b505af11580156112b4573d6000803e3d6000fd5b5050604080516001600160a01b038086168252871660208201529081018590527f390b1276974b9463e5d66ab10df69b6f3d7b930eb066a0e66df327edd2cc811c9250606001905060405180910390a16bffffffffffffffffffffffff19606084901b166bffffffffffffffffffffffff83161760405160009033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a450505060010161112c565b503360009081526006602052604081208054839290611380908490612a5f565b90915550505050505050565b606081811c60008181526005602090815260408083206bffffffffffffffffffffffff87168085529252909120546001600160a01b031661140f5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610630565b6001600160a01b0382166000908152600760205260408120805461143290612a72565b80601f016020809104026020016040519081016040528092919081815260200182805461145e90612a72565b80156114ab5780601f10611480576101008083540402835291602001916114ab565b820191906000526020600020905b81548152906001019060200180831161148e57829003601f168201915b505050505090506000815111156114f057806114c683611bbe565b6040516020016114d7929190612aac565b6040516020818303038152906040529350505050919050565b6040517fc87b56dd000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0384169063c87b56dd90602401600060405180830381865afa15801561154e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115769190810190612b2e565b95945050505050565b6115876118f2565b6040517f3db0f8ab0000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000097a20815a061eae224c4fdf3109731f73743db731690633db0f8ab906115f49030908890889088908890600401612b9c565b600060405180830381600087803b15801561160e57600080fd5b505af1158015611622573d6000803e3d6000fd5b5050505050505050565b3361163f6000546001600160a01b031690565b6001600160a01b0316148061165a575061165a6001336118cd565b6116b25760405162461bcd60e51b8152602060048201526024808201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616044820152633236b4b760e11b6064820152608401610630565b6001600160a01b03821660009081526007602052604090206107ce8282612c2c565b6000336001600160a01b037f00000000000000000000000097a20815a061eae224c4fdf3109731f73743db7316146117585760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79204c5643494449412f2f205245534f555243455320616363657074656044820152601960fa1b6064820152608401610630565b507ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b61178c6118f2565b6001600160a01b0381166118085760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610630565b610ad281611b61565b60006001600160e01b031982167f553e757e0000000000000000000000000000000000000000000000000000000014806105e257506301ffc9a760e01b6001600160e01b03198316146105e2565b60405162461bcd60e51b815260206004820152603460248201527f43616e6e6f7420706572666f726d207472616e7366657273206f6e2061206e6f60448201527f6e2d7472616e7366657261626c6520746f6b656e0000000000000000000000006064820152608401610630565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b6000546001600160a01b03163314610ee15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610630565b60006118eb836001600160a01b038416611c5e565b60006105e2825490565b60006118eb8383611d51565b60008181526004602052604090205460ff16156119d65760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f74207265706c6179207472616e73616374696f6e000000000000006044820152606401610630565b60006119e3886040612cec565b6119ee90603461292a565b905060006119fb82611bbe565b33848c8c8c8c604051602001611a179796959493929190612d45565b604051602081830303815290604052805190602001209050808614611a7e5760405162461bcd60e51b815260206004820152601160248201527f4d616c666f726d6564206d6573736167650000000000000000000000000000006044820152606401610630565b6000611ac286868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b93925050611d7b9050565b6003549091506001600160a01b038083166101009092041614611b275760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610630565b5050506000908152600460205260409020805460ff1916600117905550505050505050565b60006118eb836001600160a01b038416611d9f565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60606000611bcb83611dee565b600101905060008167ffffffffffffffff811115611beb57611beb612575565b6040519080825280601f01601f191660200182016040528015611c15576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084611c1f57509392505050565b60008181526001830160205260408120548015611d47576000611c82600183612a5f565b8554909150600090611c9690600190612a5f565b9050818114611cfb576000866000018281548110611cb657611cb661293d565b9060005260206000200154905080876000018481548110611cd957611cd961293d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611d0c57611d0c612dc6565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105e2565b60009150506105e2565b6000826000018281548110611d6857611d6861293d565b9060005260206000200154905092915050565b6000806000611d8a8585611ed0565b91509150611d9781611f15565b509392505050565b6000818152600183016020526040812054611de6575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105e2565b5060006105e2565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611e37577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310611e63576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611e8157662386f26fc10000830492506010015b6305f5e1008310611e99576305f5e100830492506008015b6127108310611ead57612710830492506004015b60648310611ebf576064830492506002015b600a83106105e25760010192915050565b6000808251604103611f065760208301516040840151606085015160001a611efa8782858561207a565b94509450505050611f0e565b506000905060025b9250929050565b6000816004811115611f2957611f29612ddc565b03611f315750565b6001816004811115611f4557611f45612ddc565b03611f925760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610630565b6002816004811115611fa657611fa6612ddc565b03611ff35760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610630565b600381600481111561200757612007612ddc565b03610ad25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610630565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156120b15750600090506003612135565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612105573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661212e57600060019250925050612135565b9150600090505b94509492505050565b60006020828403121561215057600080fd5b81356001600160e01b0319811681146118eb57600080fd5b60005b8381101561218357818101518382015260200161216b565b50506000910152565b60208152600082518060208401526121ab816040850160208701612168565b601f01601f19169190910160400192915050565b6000602082840312156121d157600080fd5b5035919050565b80356001600160a01b03811681146121ef57600080fd5b919050565b6000806040838503121561220757600080fd5b612210836121d8565b946020939093013593505050565b60008083601f84011261223057600080fd5b50813567ffffffffffffffff81111561224857600080fd5b602083019150836020828501011115611f0e57600080fd5b60008060008060006080868803121561227857600080fd5b612281866121d8565b945061228f602087016121d8565b935060408601359250606086013567ffffffffffffffff8111156122b257600080fd5b6122be8882890161221e565b969995985093965092949392505050565b6000806000606084860312156122e457600080fd5b6122ed846121d8565b92506122fb602085016121d8565b9150604084013590509250925092565b60006020828403121561231d57600080fd5b6118eb826121d8565b60008083601f84011261233857600080fd5b50813567ffffffffffffffff81111561235057600080fd5b6020830191508360208260051b8501011115611f0e57600080fd5b6000806000806000806060878903121561238457600080fd5b863567ffffffffffffffff8082111561239c57600080fd5b6123a88a838b01612326565b909850965060208901359150808211156123c157600080fd5b6123cd8a838b01612326565b909650945060408901359150808211156123e657600080fd5b506123f389828a0161221e565b979a9699509497509295939492505050565b6020808252825182820181905260009190848201906040850190845b818110156124465783516001600160a01b031683529284019291840191600101612421565b50909695505050505050565b60008060008060008060008060a0898b03121561246e57600080fd5b883567ffffffffffffffff8082111561248657600080fd5b6124928c838d01612326565b909a50985060208b01359150808211156124ab57600080fd5b6124b78c838d01612326565b909850965060408b0135955060608b01359150808211156124d757600080fd5b506124e48b828c0161221e565b999c989b50969995989497949560800135949350505050565b60008060006060848603121561251257600080fd5b61251b846121d8565b925060208401359150612530604085016121d8565b90509250925092565b6000806040838503121561254c57600080fd5b612555836121d8565b91506020830135801515811461256a57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156125b4576125b4612575565b604052919050565b600067ffffffffffffffff8211156125d6576125d6612575565b50601f01601f191660200190565b60006125f76125f2846125bc565b61258b565b905082815283838301111561260b57600080fd5b828260208301376000602084830101529392505050565b6000806000806080858703121561263857600080fd5b612641856121d8565b935061264f602086016121d8565b925060408501359150606085013567ffffffffffffffff81111561267257600080fd5b8501601f8101871361268357600080fd5b612692878235602084016125e4565b91505092959194509250565b60008060008060008060008060a0898b0312156126ba57600080fd5b6126c3896121d8565b97506126d160208a016121d8565b9650604089013567ffffffffffffffff808211156126ee57600080fd5b6126fa8c838d01612326565b909850965060608b013591508082111561271357600080fd5b61271f8c838d01612326565b909650945060808b013591508082111561273857600080fd5b506127458b828c0161221e565b999c989b5096995094979396929594505050565b6000806000806040858703121561276f57600080fd5b843567ffffffffffffffff8082111561278757600080fd5b61279388838901612326565b909650945060208701359150808211156127ac57600080fd5b506127b987828801612326565b95989497509550505050565b600080604083850312156127d857600080fd5b6127e1836121d8565b9150602083013567ffffffffffffffff8111156127fd57600080fd5b8301601f8101851361280e57600080fd5b61281d858235602084016125e4565b9150509250929050565b6000806040838503121561283a57600080fd5b612843836121d8565b9150612851602084016121d8565b90509250929050565b60008060008060008060a0878903121561287357600080fd5b61287c876121d8565b955061288a602088016121d8565b94506040870135935060608701359250608087013567ffffffffffffffff8111156128b457600080fd5b6123f389828a0161221e565b60006001600160a01b03808816835280871660208401525084604083015260806060830152826080830152828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156105e2576105e2612914565b634e487b7160e01b600052603260045260246000fd5b60006001820161296557612965612914565b5060010190565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561299e57600080fd5b8260051b80836020870137939093016020019392505050565b60006001600160a01b03808916835280881660208401525060a060408301526129e460a08301868861296c565b82810360608401526129f781858761296c565b8381036080909401939093525050600081526020019695505050505050565b8681526001600160a01b0386166020820152608060408201526000612a3f60808301868861296c565b8281036060840152612a5281858761296c565b9998505050505050505050565b818103818111156105e2576105e2612914565b600181811c90821680612a8657607f821691505b602082108103612aa657634e487b7160e01b600052602260045260246000fd5b50919050565b60008351612abe818460208801612168565b7f2f000000000000000000000000000000000000000000000000000000000000009083019081528351612af8816001840160208801612168565b7f2e6a736f6e00000000000000000000000000000000000000000000000000000060019290910191820152600601949350505050565b600060208284031215612b4057600080fd5b815167ffffffffffffffff811115612b5757600080fd5b8201601f81018413612b6857600080fd5b8051612b766125f2826125bc565b818152856020838501011115612b8b57600080fd5b611576826020830160208601612168565b6001600160a01b0386168152606060208201526000612bbf60608301868861296c565b8281036040840152612bd281858761296c565b98975050505050505050565b601f8211156107ce57600081815260208120601f850160051c81016020861015612c055750805b601f850160051c820191505b81811015612c2457828155600101612c11565b505050505050565b815167ffffffffffffffff811115612c4657612c46612575565b612c5a81612c548454612a72565b84612bde565b602080601f831160018114612c8f5760008415612c775750858301515b600019600386901b1c1916600185901b178555612c24565b600085815260208120601f198616915b82811015612cbe57888601518255948401946001909101908401612c9f565b5085821015612cdc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820281158282048414176105e2576105e2612914565b60007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612d3257600080fd5b8260051b80838637939093019392505050565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008851612d7d81601a850160208d01612168565b80830190506bffffffffffffffffffffffff198960601b16601a82015287602e820152612db8612db1604e8301888a612d03565b8587612d03565b9a9950505050505050505050565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220f8d83ca57daa91e20dc28480317f50dbf8e1d95c6718f26831363402bafdbdc864736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000097a20815a061eae224c4fdf3109731f73743db73000000000000000000000000679b437657763825f834d24fe6894ee1762c72cc
-----Decoded View---------------
Arg [0] : resourceAddress (address): 0x97A20815a061EaE224c4fdF3109731f73743db73
Arg [1] : signingAddress (address): 0x679B437657763825F834D24Fe6894EE1762c72Cc
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000097a20815a061eae224c4fdf3109731f73743db73
Arg [1] : 000000000000000000000000679b437657763825f834d24fe6894ee1762c72cc
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.