Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,102 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Start Skull Alch... | 16425066 | 745 days ago | IN | 0 ETH | 0.00238953 | ||||
Check Alchemy | 15644036 | 854 days ago | IN | 0 ETH | 0.0009043 | ||||
Start Skull Alch... | 15636925 | 855 days ago | IN | 0 ETH | 0.0013886 | ||||
Check Alchemy | 15509086 | 874 days ago | IN | 0 ETH | 0.0010777 | ||||
Start Skull Alch... | 15477167 | 879 days ago | IN | 0 ETH | 0.00171284 | ||||
Check Alchemy | 15457994 | 882 days ago | IN | 0 ETH | 0.00083809 | ||||
Start Skull Alch... | 15454203 | 882 days ago | IN | 0 ETH | 0.00478172 | ||||
Check Alchemy | 15450783 | 883 days ago | IN | 0 ETH | 0.00074448 | ||||
Start Skull Alch... | 15443492 | 884 days ago | IN | 0 ETH | 0.00496111 | ||||
Check Alchemy | 15443449 | 884 days ago | IN | 0 ETH | 0.00326084 | ||||
Start Skull Alch... | 15440989 | 885 days ago | IN | 0 ETH | 0.00671064 | ||||
Check Alchemy | 15440941 | 885 days ago | IN | 0 ETH | 0.00395136 | ||||
Check Alchemy | 15440764 | 885 days ago | IN | 0 ETH | 0.00158486 | ||||
Start Skull Alch... | 15437389 | 885 days ago | IN | 0 ETH | 0.00188513 | ||||
Check Alchemy | 15437382 | 885 days ago | IN | 0 ETH | 0.00090012 | ||||
Start Skull Alch... | 15435164 | 885 days ago | IN | 0 ETH | 0.00312146 | ||||
Check Alchemy | 15435162 | 885 days ago | IN | 0 ETH | 0.00153948 | ||||
Start Skull Alch... | 15435144 | 885 days ago | IN | 0 ETH | 0.00432269 | ||||
Check Alchemy | 15434425 | 886 days ago | IN | 0 ETH | 0.00215285 | ||||
Check Alchemy | 15434393 | 886 days ago | IN | 0 ETH | 0.00168345 | ||||
Start Skull Alch... | 15431108 | 886 days ago | IN | 0 ETH | 0.00230455 | ||||
Start Skull Alch... | 15429777 | 886 days ago | IN | 0 ETH | 0.00250506 | ||||
Start Skull Alch... | 15415829 | 889 days ago | IN | 0 ETH | 0.00440502 | ||||
Start Skull Alch... | 15412231 | 889 days ago | IN | 0 ETH | 0.00160009 | ||||
Check Alchemy | 15412200 | 889 days ago | IN | 0 ETH | 0.00084019 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
SkullAlchemy
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import './IWizMagic.sol'; import './Elixir.sol'; import './FullSkull.sol'; contract SkullAlchemy is Ownable, ReentrancyGuard, Pausable { event SkullAlchemyStarted(address owner, uint256 tokenId, uint256 numElixirs); event SkullUpgradeSuccess(address owner, uint256 originalTokenId, uint256 upgradedTokenId); event SkullUpgradeFail(address owner, uint256 tokenId); struct SkullInWaiting { address owner; uint256 tokenId; uint256 start; uint256 index; uint256 numElixirs; } event WizMinted(uint256 quantity, address to); IWizMagic private _wizMagicContract; Elixir private _elixirContract; FullSkull private _fullSkullContract; mapping(address => SkullInWaiting) private _skullInWaitingMap; address private _materialBank; uint256 private _uncommonProbability = 4; uint256 private _rareProbability = 6; uint256 private _epicProbability = 16; uint256 private _legendaryProbability = 156; uint256 private _maxLegendaries = 10; uint256 private _numLegendaries = 0; constructor(address fullSkullAddress, address elixirAddress, address wizMagicAddress) { _pause(); _wizMagicContract = IWizMagic(wizMagicAddress); _elixirContract = Elixir(elixirAddress); _fullSkullContract = FullSkull(fullSkullAddress); _materialBank = _msgSender(); } function startSkullAlchemy(uint256 skullId, uint256 numElixirs) external nonReentrant whenNotPaused { require(_skullInWaitingMap[_msgSender()].start == 0, 'Already have skull pending alchemy'); require(_elixirContract.balanceOf(_msgSender()) >= numElixirs*(10**18), 'Not enough elixirs'); require(_fullSkullContract.balanceOf(_msgSender(), skullId) > 0, 'Does not have skull to alchemy'); require(skullId < 4, 'Already maximum level reached'); if (skullId == 3) { require(_numLegendaries < _maxLegendaries, 'Max number of legendaries reached'); } uint256 index = _wizMagicContract.getIndex(); _skullInWaitingMap[_msgSender()] = SkullInWaiting({ owner: _msgSender(), tokenId: skullId, start: block.timestamp, index: index, numElixirs: numElixirs }); _elixirContract.transferFrom(_msgSender(), _materialBank, numElixirs*(10**18)); _fullSkullContract.burn(_msgSender(), skullId, 1); emit SkullAlchemyStarted(_msgSender(), skullId, numElixirs); } function checkAlchemy() external nonReentrant whenNotPaused { SkullInWaiting memory skullInWaiting = _skullInWaitingMap[_msgSender()]; require(skullInWaiting.owner == _msgSender(), 'Owner does not own SkullInWaiting object'); uint256 rand = _wizMagicContract.getRand(skullInWaiting.index); uint256 numElixirs = skullInWaiting.numElixirs; uint256 currSkullId = skullInWaiting.tokenId; uint256 elixirsUsed = 0; for (uint i = 0; i < numElixirs; i++) { uint256 newRand = _wizMagicContract.getAnotherRand(rand + i); if (currSkullId == 0) { if (newRand % _uncommonProbability == 0) { emit SkullUpgradeSuccess(_msgSender(), 0, 1); currSkullId = 1; } else { emit SkullUpgradeFail(_msgSender(), 0); } } else if (currSkullId == 1) { if (newRand % _rareProbability == 0) { emit SkullUpgradeSuccess(_msgSender(), 1, 2); currSkullId = 2; } else { emit SkullUpgradeFail(_msgSender(), 1); } } else if (currSkullId == 2) { if (newRand % _epicProbability == 0) { emit SkullUpgradeSuccess(_msgSender(), 2, 3); currSkullId = 3; } else { emit SkullUpgradeFail(_msgSender(), 2); } } else if (currSkullId == 3) { if (_numLegendaries >= _maxLegendaries) { break; } if (newRand % _legendaryProbability == 0) { emit SkullUpgradeSuccess(_msgSender(), 3, 4); currSkullId = 4; _numLegendaries += 1; } else { emit SkullUpgradeFail(_msgSender(), 3); } } else if (currSkullId == 4) { break; } elixirsUsed += 1; } uint256 elixirLeft = numElixirs - elixirsUsed; if (elixirLeft > 0) { _elixirContract.transferFrom(_materialBank, _msgSender(), elixirLeft*(10**18)); } _fullSkullContract.mint(_msgSender(), currSkullId, 1, "0x0"); delete _skullInWaitingMap[_msgSender()]; } function getSkullInWaiting(address owner) public view returns (SkullInWaiting memory) { return _skullInWaitingMap[owner]; } function setBank(address bankAddress) public onlyOwner { _materialBank = bankAddress; } function setUncommonProbability(uint256 newProbability) public onlyOwner { _uncommonProbability = newProbability; } function setRareProbability(uint256 newProbability) public onlyOwner { _rareProbability = newProbability; } function setEpicProbability(uint256 newProbability) public onlyOwner { _epicProbability = newProbability; } function setLegendaryProbability(uint256 newProbability) public onlyOwner { _legendaryProbability = newProbability; } function setMaxLegendaries(uint256 newMax) public onlyOwner { _maxLegendaries = newMax; } function pause() public onlyOwner { _pause(); } function unpause() public onlyOwner { _unpause(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IWizMagic { function getIndex() external view returns (uint256); function getRand(uint256 index) external view returns (uint256); function getAnotherRand(uint256 firstRand) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC1155/ERC1155.sol'; import '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol'; import '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; contract FullSkull is Ownable, ERC1155Pausable, ERC1155Burnable { using Strings for uint256; mapping(address => bool) private altarOfSacrifice; constructor(string memory a) ERC1155(a) {} function mint(address to, uint256 id, uint256 amount, bytes memory data) public onlyAltars { _mint(to, id, amount, data); } function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual override(ERC1155, ERC1155Pausable) { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); } function pause() public onlyOwner { _pause(); } function unpause() public onlyOwner { _unpause(); } function addAltar(address a) public onlyOwner { altarOfSacrifice[a] = true; } function removeAltar(address a) public onlyOwner { altarOfSacrifice[a] = false; } modifier onlyAltars() { require(altarOfSacrifice[_msgSender()], 'Not an altar of sacrifice'); _; } function isApprovedForAll(address account, address operator) public override view returns (bool) { if (altarOfSacrifice[operator]) { return true; } return super.isApprovedForAll(account, operator); } function setURI(string memory newURI) public onlyOwner { _setURI(newURI); } function uri(uint256 tokenId) public view override returns (string memory) { string memory baseURI = super.uri(0); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ''; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; contract Elixir is Ownable, ERC20 { bool public transferable = false; uint256 public constant MAX_INT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; bool public saleOpen = false; mapping(address => bool) private _elixirMerchant; constructor() ERC20('Elixir', 'ELX') {} function mint(address to, uint256 quantity) external payable { if (_msgSender() != owner()) { require(saleOpen, "Sale has not started"); if (quantity == 1) { require(msg.value == 0.039 ether, "Not enough eth for elixir"); _mint(to, 1e18); } else if (quantity == 5) { require(msg.value == 0.195 ether, "Not enough eth for elixir"); _mint(to, 6*1e18); } else if (quantity == 10) { require(msg.value == 0.39 ether, "Not enough eth for elixir"); _mint(to, 13*1e18); } } else { _mint(to, quantity*1e18); } } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); if (!_elixirMerchant[_msgSender()]) { uint256 currentAllowance = allowance(sender, _msgSender()); require(currentAllowance >= amount, 'Transfer amount exceeds allowance'); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } } return true; } function burn(address _owner, uint256 _amount) external onlyElixirMerchant { _burn(_owner, _amount); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual override { if (_msgSender() != owner() && !_elixirMerchant[_msgSender()] && from != address(0)) { require(transferable, 'Cannot transfer if false'); } super._beforeTokenTransfer(from, to, amount); } function allowance(address owner, address spender) public view override returns (uint256) { if (_elixirMerchant[spender]) { return MAX_INT; } return super.allowance(owner, spender); } function addElixirMerchant(address elixirMerchant) public onlyOwner { _elixirMerchant[elixirMerchant] = true; } function removeElixirMerchant(address elixirMerchant) public onlyOwner { _elixirMerchant[elixirMerchant] = false; } function setTransferable(bool _transferable) public onlyOwner { transferable = _transferable; } function setSale(bool hasSaleStarted) public onlyOwner { saleOpen = hasSaleStarted; } function withdraw() public onlyOwner { payable(msg.sender).transfer(address(this).balance); } modifier onlyElixirMerchant() { require(_elixirMerchant[_msgSender()], 'Caller is not an elixir merchant'); _; } }
// 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 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/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// 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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; import "../../../security/Pausable.sol"; /** * @dev ERC1155 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. * * _Available since v3.1._ */ abstract contract ERC1155Pausable is ERC1155, Pausable { /** * @dev See {ERC1155-_beforeTokenTransfer}. * * Requirements: * * - the contract must not be paused. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); require(!paused(), "ERC1155Pausable: token transfer while paused"); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155Burnable is ERC1155 { function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burnBatch(account, ids, values); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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. 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. 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 v4.4.1 (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 be 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 v4.4.1 (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `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 memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - 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[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * 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 _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing 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); } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"fullSkullAddress","type":"address"},{"internalType":"address","name":"elixirAddress","type":"address"},{"internalType":"address","name":"wizMagicAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numElixirs","type":"uint256"}],"name":"SkullAlchemyStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"SkullUpgradeFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"originalTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"upgradedTokenId","type":"uint256"}],"name":"SkullUpgradeSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"WizMinted","type":"event"},{"inputs":[],"name":"checkAlchemy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getSkullInWaiting","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"numElixirs","type":"uint256"}],"internalType":"struct SkullAlchemy.SkullInWaiting","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bankAddress","type":"address"}],"name":"setBank","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newProbability","type":"uint256"}],"name":"setEpicProbability","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newProbability","type":"uint256"}],"name":"setLegendaryProbability","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMax","type":"uint256"}],"name":"setMaxLegendaries","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newProbability","type":"uint256"}],"name":"setRareProbability","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newProbability","type":"uint256"}],"name":"setUncommonProbability","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"skullId","type":"uint256"},{"internalType":"uint256","name":"numElixirs","type":"uint256"}],"name":"startSkullAlchemy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052600460075560066008556010600955609c600a55600a600b556000600c553480156200002f57600080fd5b5060405162001730380380620017308339810160408190526200005291620001dc565b6200005d33620000d1565b600180556002805460ff191690556200007562000121565b600280546001600160a01b0392831661010002610100600160a81b0319909116179055600380549282166001600160a01b0319938416179055600480549390911692821692909217909155600680549091163317905562000226565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60025460ff16156200016c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640160405180910390fd5b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258620001a23390565b6040516001600160a01b03909116815260200160405180910390a1565b80516001600160a01b0381168114620001d757600080fd5b919050565b600080600060608486031215620001f257600080fd5b620001fd84620001bf565b92506200020d60208501620001bf565b91506200021d60408501620001bf565b90509250925092565b6114fa80620002366000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a6303b4b11610066578063a6303b4b146101f7578063a8909ef91461020a578063f2fde38b1461021d578063fc8e2c9a1461023057600080fd5b8063715018a6146101c457806373c4d636146101cc5780638456cb59146101d45780638da5cb5b146101dc57600080fd5b806345e5f320116100d357806345e5f3201461012a57806347506bd11461013d5780635c975abb1461015057806368fe65fd1461016b57600080fd5b8063090d23b9146100fa5780632564ae111461010f5780633f4ba83a14610122575b600080fd5b61010d6101083660046112bd565b610243565b005b61010d61011d36600461130f565b610298565b61010d6102c7565b61010d61013836600461130f565b6102fb565b61010d61014b36600461130f565b61032a565b60025460ff1660405190151581526020015b60405180910390f35b61017e6101793660046112bd565b610359565b604051610162919081516001600160a01b031681526020808301519082015260408083015190820152606080830151908201526080918201519181019190915260a00190565b61010d6103ef565b61010d610423565b61010d610a6e565b6000546040516001600160a01b039091168152602001610162565b61010d610205366004611341565b610aa0565b61010d61021836600461130f565b611089565b61010d61022b3660046112bd565b6110b8565b61010d61023e36600461130f565b611153565b6000546001600160a01b031633146102765760405162461bcd60e51b815260040161026d906113ae565b60405180910390fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146102c25760405162461bcd60e51b815260040161026d906113ae565b600855565b6000546001600160a01b031633146102f15760405162461bcd60e51b815260040161026d906113ae565b6102f9611182565b565b6000546001600160a01b031633146103255760405162461bcd60e51b815260040161026d906113ae565b600755565b6000546001600160a01b031633146103545760405162461bcd60e51b815260040161026d906113ae565b600b55565b6103946040518060a0016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081525090565b506001600160a01b03908116600090815260056020908152604091829020825160a081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260040154608082015290565b6000546001600160a01b031633146104195760405162461bcd60e51b815260040161026d906113ae565b6102f96000611215565b600260015414156104765760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161026d565b600260015561048760025460ff1690565b156104a45760405162461bcd60e51b815260040161026d90611384565b33600081815260056020908152604091829020825160a08101845281546001600160a01b0316808252600183015493820193909352600282015493810193909352600381015460608401526004015460808301529091146105585760405162461bcd60e51b815260206004820152602860248201527f4f776e657220646f6573206e6f74206f776e20536b756c6c496e57616974696e60448201526719c81bd89a9958dd60c21b606482015260840161026d565b6002546060820151604051635e5201b760e01b8152600481019190915260009161010090046001600160a01b031690635e5201b79060240160206040518083038186803b1580156105a857600080fd5b505afa1580156105bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e09190611328565b60808301516020840151919250906000805b838110156108b45760025460009061010090046001600160a01b031663dee7c46a61061d84896113e3565b6040518263ffffffff1660e01b815260040161063b91815260200190565b60206040518083038186803b15801561065357600080fd5b505afa158015610667573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068b9190611328565b9050836107045760075461069f908261144c565b6106d7576000805160206114a583398151915233600060016040516106c693929190611363565b60405180910390a160019350610893565b604080513381526000602082015260008051602061148583398151915291015b60405180910390a1610893565b83600114156107765760085461071a908261144c565b610752576000805160206114a5833981519152336001600260405161074193929190611363565b60405180910390a160029350610893565b604080513381526001602082015260008051602061148583398151915291016106f7565b83600214156107e85760095461078c908261144c565b6107c4576000805160206114a583398151915233600260036040516107b393929190611363565b60405180910390a160039350610893565b604080513381526002602082015260008051602061148583398151915291016106f7565b836003141561088457600b54600c541061080257506108b4565b600a5461080f908261144c565b610860576000805160206114a5833981519152336003600460405161083693929190611363565b60405180910390a1600493506001600c600082825461085591906113e3565b909155506108939050565b604080513381526003602082015260008051602061148583398151915291016106f7565b836004141561089357506108b4565b61089e6001846113e3565b92505080806108ac90611431565b9150506105f2565b5060006108c1828561141a565b9050801561097e576003546006546001600160a01b03918216916323b872dd9116336108f585670de0b6b3a76400006113fb565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b15801561094457600080fd5b505af1158015610958573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097c91906112ed565b505b6004546001600160a01b031663731133e9336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018690526001604482015260806064820152600360848201526203078360ec1b60a482015260c401600060405180830381600087803b1580156109f957600080fd5b505af1158015610a0d573d6000803e3d6000fd5b5050505060056000610a1c3390565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b0319168155600180820183905560028201839055600382018390556004909101919091558055505050505050565b6000546001600160a01b03163314610a985760405162461bcd60e51b815260040161026d906113ae565b6102f9611265565b60026001541415610af35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161026d565b6002600155610b0460025460ff1690565b15610b215760405162461bcd60e51b815260040161026d90611384565b3360009081526005602052604090206002015415610b8c5760405162461bcd60e51b815260206004820152602260248201527f416c7265616479206861766520736b756c6c2070656e64696e6720616c6368656044820152616d7960f01b606482015260840161026d565b610b9e81670de0b6b3a76400006113fb565b6003546001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b158015610bef57600080fd5b505afa158015610c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c279190611328565b1015610c6a5760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f75676820656c697869727360701b604482015260640161026d565b6004546000906001600160a01b031662fdd58e336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024810186905260440160206040518083038186803b158015610cc457600080fd5b505afa158015610cd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfc9190611328565b11610d495760405162461bcd60e51b815260206004820152601e60248201527f446f6573206e6f74206861766520736b756c6c20746f20616c6368656d790000604482015260640161026d565b60048210610d995760405162461bcd60e51b815260206004820152601d60248201527f416c7265616479206d6178696d756d206c6576656c2072656163686564000000604482015260640161026d565b8160031415610dff57600b54600c5410610dff5760405162461bcd60e51b815260206004820152602160248201527f4d6178206e756d626572206f66206c6567656e646172696573207265616368656044820152601960fa1b606482015260840161026d565b6000600260019054906101000a90046001600160a01b03166001600160a01b03166381045ead6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4f57600080fd5b505afa158015610e63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e879190611328565b90506040518060a00160405280610e9b3390565b6001600160a01b031681526020018481526020014281526020018281526020018381525060056000610eca3390565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191690831617815592840151600184015590830151600283015560608301516003808401919091556080909301516004909201919091559054166323b872dd336006546001600160a01b0316610f5286670de0b6b3a76400006113fb565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b158015610fa157600080fd5b505af1158015610fb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd991906112ed565b506004546001600160a01b031663f5298aca338560016040518463ffffffff1660e01b815260040161100d93929190611363565b600060405180830381600087803b15801561102757600080fd5b505af115801561103b573d6000803e3d6000fd5b505050507f5cfe123e05201e626768421cb8b2657f57687160b674e267cfe6fbe8f6b9d6e36110673390565b848460405161107893929190611363565b60405180910390a150506001805550565b6000546001600160a01b031633146110b35760405162461bcd60e51b815260040161026d906113ae565b600955565b6000546001600160a01b031633146110e25760405162461bcd60e51b815260040161026d906113ae565b6001600160a01b0381166111475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161026d565b61115081611215565b50565b6000546001600160a01b0316331461117d5760405162461bcd60e51b815260040161026d906113ae565b600a55565b60025460ff166111cb5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161026d565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60025460ff16156112885760405162461bcd60e51b815260040161026d90611384565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586111f83390565b6000602082840312156112cf57600080fd5b81356001600160a01b03811681146112e657600080fd5b9392505050565b6000602082840312156112ff57600080fd5b815180151581146112e657600080fd5b60006020828403121561132157600080fd5b5035919050565b60006020828403121561133a57600080fd5b5051919050565b6000806040838503121561135457600080fd5b50508035926020909101359150565b6001600160a01b039390931683526020830191909152604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156113f6576113f661146e565b500190565b60008160001904831182151516156114155761141561146e565b500290565b60008282101561142c5761142c61146e565b500390565b60006000198214156114455761144561146e565b5060010190565b60008261146957634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052601160045260246000fdfee239ebc8d4be74580e4440d96b5995e00546292f1fc0e6c0e681134e7f19f88b0969b18f8e26cce33b4173dea53a34f89fbbc9945f9229a2f3193d176406397ba2646970667358221220e26d9cb5889f0045357c9c9537b2df37176c0cc4d2530c00d7b8f2eb22a9625964736f6c6343000807003300000000000000000000000073161a3ff526eee0d24c37ca69678aaa8e14f34400000000000000000000000064724942c63041498afb2bc8f9149e1ea0aa053c000000000000000000000000ce2846b6684501c0645858d285c5a3bfc21a824f
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a6303b4b11610066578063a6303b4b146101f7578063a8909ef91461020a578063f2fde38b1461021d578063fc8e2c9a1461023057600080fd5b8063715018a6146101c457806373c4d636146101cc5780638456cb59146101d45780638da5cb5b146101dc57600080fd5b806345e5f320116100d357806345e5f3201461012a57806347506bd11461013d5780635c975abb1461015057806368fe65fd1461016b57600080fd5b8063090d23b9146100fa5780632564ae111461010f5780633f4ba83a14610122575b600080fd5b61010d6101083660046112bd565b610243565b005b61010d61011d36600461130f565b610298565b61010d6102c7565b61010d61013836600461130f565b6102fb565b61010d61014b36600461130f565b61032a565b60025460ff1660405190151581526020015b60405180910390f35b61017e6101793660046112bd565b610359565b604051610162919081516001600160a01b031681526020808301519082015260408083015190820152606080830151908201526080918201519181019190915260a00190565b61010d6103ef565b61010d610423565b61010d610a6e565b6000546040516001600160a01b039091168152602001610162565b61010d610205366004611341565b610aa0565b61010d61021836600461130f565b611089565b61010d61022b3660046112bd565b6110b8565b61010d61023e36600461130f565b611153565b6000546001600160a01b031633146102765760405162461bcd60e51b815260040161026d906113ae565b60405180910390fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146102c25760405162461bcd60e51b815260040161026d906113ae565b600855565b6000546001600160a01b031633146102f15760405162461bcd60e51b815260040161026d906113ae565b6102f9611182565b565b6000546001600160a01b031633146103255760405162461bcd60e51b815260040161026d906113ae565b600755565b6000546001600160a01b031633146103545760405162461bcd60e51b815260040161026d906113ae565b600b55565b6103946040518060a0016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081525090565b506001600160a01b03908116600090815260056020908152604091829020825160a081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260040154608082015290565b6000546001600160a01b031633146104195760405162461bcd60e51b815260040161026d906113ae565b6102f96000611215565b600260015414156104765760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161026d565b600260015561048760025460ff1690565b156104a45760405162461bcd60e51b815260040161026d90611384565b33600081815260056020908152604091829020825160a08101845281546001600160a01b0316808252600183015493820193909352600282015493810193909352600381015460608401526004015460808301529091146105585760405162461bcd60e51b815260206004820152602860248201527f4f776e657220646f6573206e6f74206f776e20536b756c6c496e57616974696e60448201526719c81bd89a9958dd60c21b606482015260840161026d565b6002546060820151604051635e5201b760e01b8152600481019190915260009161010090046001600160a01b031690635e5201b79060240160206040518083038186803b1580156105a857600080fd5b505afa1580156105bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e09190611328565b60808301516020840151919250906000805b838110156108b45760025460009061010090046001600160a01b031663dee7c46a61061d84896113e3565b6040518263ffffffff1660e01b815260040161063b91815260200190565b60206040518083038186803b15801561065357600080fd5b505afa158015610667573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068b9190611328565b9050836107045760075461069f908261144c565b6106d7576000805160206114a583398151915233600060016040516106c693929190611363565b60405180910390a160019350610893565b604080513381526000602082015260008051602061148583398151915291015b60405180910390a1610893565b83600114156107765760085461071a908261144c565b610752576000805160206114a5833981519152336001600260405161074193929190611363565b60405180910390a160029350610893565b604080513381526001602082015260008051602061148583398151915291016106f7565b83600214156107e85760095461078c908261144c565b6107c4576000805160206114a583398151915233600260036040516107b393929190611363565b60405180910390a160039350610893565b604080513381526002602082015260008051602061148583398151915291016106f7565b836003141561088457600b54600c541061080257506108b4565b600a5461080f908261144c565b610860576000805160206114a5833981519152336003600460405161083693929190611363565b60405180910390a1600493506001600c600082825461085591906113e3565b909155506108939050565b604080513381526003602082015260008051602061148583398151915291016106f7565b836004141561089357506108b4565b61089e6001846113e3565b92505080806108ac90611431565b9150506105f2565b5060006108c1828561141a565b9050801561097e576003546006546001600160a01b03918216916323b872dd9116336108f585670de0b6b3a76400006113fb565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b15801561094457600080fd5b505af1158015610958573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097c91906112ed565b505b6004546001600160a01b031663731133e9336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018690526001604482015260806064820152600360848201526203078360ec1b60a482015260c401600060405180830381600087803b1580156109f957600080fd5b505af1158015610a0d573d6000803e3d6000fd5b5050505060056000610a1c3390565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b0319168155600180820183905560028201839055600382018390556004909101919091558055505050505050565b6000546001600160a01b03163314610a985760405162461bcd60e51b815260040161026d906113ae565b6102f9611265565b60026001541415610af35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161026d565b6002600155610b0460025460ff1690565b15610b215760405162461bcd60e51b815260040161026d90611384565b3360009081526005602052604090206002015415610b8c5760405162461bcd60e51b815260206004820152602260248201527f416c7265616479206861766520736b756c6c2070656e64696e6720616c6368656044820152616d7960f01b606482015260840161026d565b610b9e81670de0b6b3a76400006113fb565b6003546001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b158015610bef57600080fd5b505afa158015610c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c279190611328565b1015610c6a5760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f75676820656c697869727360701b604482015260640161026d565b6004546000906001600160a01b031662fdd58e336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024810186905260440160206040518083038186803b158015610cc457600080fd5b505afa158015610cd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfc9190611328565b11610d495760405162461bcd60e51b815260206004820152601e60248201527f446f6573206e6f74206861766520736b756c6c20746f20616c6368656d790000604482015260640161026d565b60048210610d995760405162461bcd60e51b815260206004820152601d60248201527f416c7265616479206d6178696d756d206c6576656c2072656163686564000000604482015260640161026d565b8160031415610dff57600b54600c5410610dff5760405162461bcd60e51b815260206004820152602160248201527f4d6178206e756d626572206f66206c6567656e646172696573207265616368656044820152601960fa1b606482015260840161026d565b6000600260019054906101000a90046001600160a01b03166001600160a01b03166381045ead6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4f57600080fd5b505afa158015610e63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e879190611328565b90506040518060a00160405280610e9b3390565b6001600160a01b031681526020018481526020014281526020018281526020018381525060056000610eca3390565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191690831617815592840151600184015590830151600283015560608301516003808401919091556080909301516004909201919091559054166323b872dd336006546001600160a01b0316610f5286670de0b6b3a76400006113fb565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b158015610fa157600080fd5b505af1158015610fb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd991906112ed565b506004546001600160a01b031663f5298aca338560016040518463ffffffff1660e01b815260040161100d93929190611363565b600060405180830381600087803b15801561102757600080fd5b505af115801561103b573d6000803e3d6000fd5b505050507f5cfe123e05201e626768421cb8b2657f57687160b674e267cfe6fbe8f6b9d6e36110673390565b848460405161107893929190611363565b60405180910390a150506001805550565b6000546001600160a01b031633146110b35760405162461bcd60e51b815260040161026d906113ae565b600955565b6000546001600160a01b031633146110e25760405162461bcd60e51b815260040161026d906113ae565b6001600160a01b0381166111475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161026d565b61115081611215565b50565b6000546001600160a01b0316331461117d5760405162461bcd60e51b815260040161026d906113ae565b600a55565b60025460ff166111cb5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161026d565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60025460ff16156112885760405162461bcd60e51b815260040161026d90611384565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586111f83390565b6000602082840312156112cf57600080fd5b81356001600160a01b03811681146112e657600080fd5b9392505050565b6000602082840312156112ff57600080fd5b815180151581146112e657600080fd5b60006020828403121561132157600080fd5b5035919050565b60006020828403121561133a57600080fd5b5051919050565b6000806040838503121561135457600080fd5b50508035926020909101359150565b6001600160a01b039390931683526020830191909152604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156113f6576113f661146e565b500190565b60008160001904831182151516156114155761141561146e565b500290565b60008282101561142c5761142c61146e565b500390565b60006000198214156114455761144561146e565b5060010190565b60008261146957634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052601160045260246000fdfee239ebc8d4be74580e4440d96b5995e00546292f1fc0e6c0e681134e7f19f88b0969b18f8e26cce33b4173dea53a34f89fbbc9945f9229a2f3193d176406397ba2646970667358221220e26d9cb5889f0045357c9c9537b2df37176c0cc4d2530c00d7b8f2eb22a9625964736f6c63430008070033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000073161a3ff526eee0d24c37ca69678aaa8e14f34400000000000000000000000064724942c63041498afb2bc8f9149e1ea0aa053c000000000000000000000000ce2846b6684501c0645858d285c5a3bfc21a824f
-----Decoded View---------------
Arg [0] : fullSkullAddress (address): 0x73161A3Ff526eEE0d24C37cA69678aaa8e14F344
Arg [1] : elixirAddress (address): 0x64724942C63041498AFB2bC8F9149E1EA0Aa053c
Arg [2] : wizMagicAddress (address): 0xce2846b6684501C0645858D285C5a3bfC21A824f
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000073161a3ff526eee0d24c37ca69678aaa8e14f344
Arg [1] : 00000000000000000000000064724942c63041498afb2bc8f9149e1ea0aa053c
Arg [2] : 000000000000000000000000ce2846b6684501c0645858d285c5a3bfc21a824f
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.