Transaction Hash:
Block:
14208743 at Feb-15-2022 05:02:56 AM +UTC
Transaction Fee:
0.004148171904585888 ETH
$10.38
Gas Used:
97,563 Gas / 42.517879776 Gwei
Emitted Events:
16 |
AdminUpgradeabilityProxy.0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62( 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62, 0x000000000000000000000000a9d2249a479a6a3cd75575b55eb84784437d055a, 0x0000000000000000000000000000000000000000000000000000000000000000, 0x000000000000000000000000a9d2249a479a6a3cd75575b55eb84784437d055a, 0000000000000000000000000000000000000000000000000000000000000000, 0000000000000000000000000000000000000000000000000000000000000001 )
|
Account State Difference:
Address | Before | After | State Difference | ||
---|---|---|---|---|---|
0x09ab1303...240c70294
Miner
| (Minerall Pool) | 72.649002445422506067 Eth | 72.649246352922506067 Eth | 0.0002439075 | |
0xA9D2249A...4437d055a |
0.014156577273529052 Eth
Nonce: 76
|
0.010008405368943164 Eth
Nonce: 77
| 0.004148171904585888 | ||
0xd0aaFdC6...446c7300f |
Execution Trace
AdminUpgradeabilityProxy.21201425( )

GalakticGadgets.purchaseWithCredits( gadgetIds=[0], amounts=[1], signature=0xE0BAF24B88FDDEC1E85B2563235C937C3BB4875DF64281EAAF7141CD7553F1E2647A053656BDB31AEC2BE3AF5B1697054055B8D423E9681B8D8662A39671394A1C, credits=1 )
-
Null: 0x000...002.00000000( )
-
Null: 0x000...001.a346fecf( )
-
File 1 of 2: AdminUpgradeabilityProxy
File 2 of 2: GalakticGadgets
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import './UpgradeabilityProxy.sol'; /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } } // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import './Proxy.sol'; import '@openzeppelin/contracts/utils/Address.sol'; /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } // SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <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; // solhint-disable-next-line no-inline-assembly 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"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
File 2 of 2: GalakticGadgets
/** ________ .__ __ __ .__ ________ / _____/_____ | | _____ | | ___/ |_|__| ____ / _____/_____ ____ ____ / \\ ___\\__ \\ | | \\__ \\ | |/ /\\ __\\ |/ ___\\ / \\ ___\\__ \\ / \\ / ___\\ \\ \\_\\ \\/ __ \\| |__/ __ \\| < | | | \\ \\___ \\ \\_\\ \\/ __ \\| | \\/ /_/ > \\______ (____ /____(____ /__|_ \\ |__| |__|\\___ > \\______ (____ /___| /\\___ / \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\//_____/ Art By: Community Members and Prints by Chris Dyer Contract By: Travis Delly */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // Openzep import '@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155SupplyUpgradeable.sol'; import './Helpers/Base.sol'; import 'hardhat/console.sol'; contract GalakticGadgets is GalakticBase, ERC1155SupplyUpgradeable { /** ===== STRUCTS ==== */ struct Gadget { // 1 string name; string ipfsMetadataHash; // 1 uint128 mintPrice; uint64 id; uint64 maxSupply; // 1 uint8 mintPriceGG; bool mintableGG; bool mintable; } /** ===== VARIABLES ==== */ string public name_; string public symbol_; uint256 counter; mapping(uint256 => Gadget) public gadgets; mapping(address => uint256) public usedCredits; /** ===== INITIALIZE ==== */ function initialize(string memory _name, string memory _symbol) public initializer { __ERC1155_init('ipfs://'); __GalakticBase_init(); name_ = _name; symbol_ = _symbol; } /** @dev contract name */ function name() public view returns (string memory) { return name_; } /** @dev contract symbol */ function symbol() public view returns (string memory) { return symbol_; } /** * @notice adds a new gadget */ function addGadget( string memory _name, string memory _ipfsMetadataHash, uint128 _mintPrice, uint8 _mintPriceGG, uint64 _maxSupply, bool _mintableGG, bool _mintable ) public onlyOwner { Gadget storage util = gadgets[counter]; util.id = uint64(counter); util.ipfsMetadataHash = _ipfsMetadataHash; util.name = _name; util.mintPrice = _mintPrice; util.mintPriceGG = _mintPriceGG; util.maxSupply = _maxSupply; util.mintableGG = _mintableGG; util.mintable = _mintable; counter++; } /** * @notice edit an existing gadget */ function editGadget( string memory _name, string memory _ipfsMetadataHash, uint128 _mintPrice, uint8 _mintPriceGG, uint64 _maxSupply, bool _mintableGG, bool _mintable, uint256 _idx ) external onlyOwner { require(exists(_idx), 'EditGadget: Gadget does not exist'); gadgets[_idx].ipfsMetadataHash = _ipfsMetadataHash; gadgets[_idx].mintPrice = _mintPrice; gadgets[_idx].mintPriceGG = _mintPriceGG; gadgets[_idx].maxSupply = _maxSupply; gadgets[_idx].name = _name; gadgets[_idx].mintableGG = _mintableGG; gadgets[_idx].mintable = _mintable; } /** * @notice make gadget mintable */ function updateMintable(uint256[] calldata _idx, bool[] calldata _mintable) external onlyOwner { for (uint256 i = 0; i < _idx.length; i++) { gadgets[_idx[i]].mintable = _mintable[i]; } } /** * @notice make gadget mintable */ function updateMintableGG( uint256[] calldata _idx, bool[] calldata _mintable ) external onlyOwner { for (uint256 i = 0; i < _idx.length; i++) { gadgets[_idx[i]].mintableGG = _mintable[i]; } } /** * @notice mint gadget tokens * * @param gadgetIdx the gadget id to mint * @param amount the amount of tokens to mint */ function mint( uint256 gadgetIdx, uint256 amount, address to ) external onlyOwner { require(exists(gadgetIdx), 'Mint: Gadget does not exist'); require( totalSupply(gadgetIdx) + amount <= gadgets[gadgetIdx].maxSupply, 'Mint: Max supply reached' ); _mint(to, gadgetIdx, amount, ''); } /** * @notice mint gadget tokens * * @param gadgetIdx the gadget id to mint * @param amount the amount of tokens to mint */ function bulkMint( uint256 gadgetIdx, uint256 amount, address[] calldata to ) external onlyOwner { require(exists(gadgetIdx), 'Mint: Gadget does not exist'); for (uint256 i = 0; i < to.length; i++) { require(gadgets[gadgetIdx].mintable, 'Gadget is not mintable'); require( totalSupply(gadgetIdx) + amount <= gadgets[gadgetIdx].maxSupply, 'Mint: Max supply reached' ); _mint(to[i], gadgetIdx, amount, ''); } } /** @dev purchase gadgets using credits @param gadgetIds {uint256[]} id's to mint @param amounts {uint256[]} amounts to mint for each id @param signature {bytes} messagehash @param credits {uint256} # of credits from messagehash */ function purchaseWithCredits( uint256[] calldata gadgetIds, uint256[] calldata amounts, bytes memory signature, uint256 credits ) external whenNotPaused { // Ensure whitelist bytes32 messageHash = sha256(abi.encode(msg.sender, credits)); require( ECDSAUpgradeable.recover(messageHash, signature) == owner, 'Mint: Invalid Signature, are you whitelisted bud?' ); for (uint256 i = 0; i < gadgetIds.length; i++) { uint256 id = gadgetIds[i]; uint256 amount = amounts[i]; require( gadgets[id].mintableGG, 'Gadget is not mintable with credits' ); require( totalSupply(id) + amount <= gadgets[id].maxSupply, 'Mint: Max supply reached' ); usedCredits[msg.sender] += amount * gadgets[id].mintPriceGG; require( usedCredits[msg.sender] <= credits, 'Over Purchased, Chose less items.' ); _mint(msg.sender, id, amount, ''); } } /** @dev purchase gadgets @param gadgetIds {uint256[]} id's to mint @param amounts {uint256[]} amounts to mint for each id */ function purchase(uint256[] calldata gadgetIds, uint256[] calldata amounts) external payable whenNotPaused { uint256 cost = 0; for (uint256 i = 0; i < gadgetIds.length; i++) { uint256 id = gadgetIds[i]; uint256 amount = amounts[i]; require(gadgets[id].mintable, 'Gadget is not mintable with ETH'); require( totalSupply(id) + amount <= gadgets[id].maxSupply, 'Mint: Max supply reached' ); cost += gadgets[id].mintPrice * amount; _mint(msg.sender, id, amount, ''); } require( msg.value >= cost, "Mint: Insufficient ETH amount, don't cheap out on us!" ); } /** * @notice Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address to) external onlyOwner { uint256 balance = address(this).balance; payable(to).transfer(balance); } /** * @notice return total supply for all existing gadgets */ function totalSupplyAll() external view returns (uint256[] memory) { uint256[] memory result = new uint256[](counter); for (uint256 i; i < counter; i++) { result[i] = totalSupply(i); } return result; } /** * @notice gets habitatgadgets */ function getGadgets() external view returns (Gadget[] memory) { Gadget[] memory _utils = new Gadget[](counter); for (uint256 i = 0; i < counter; i++) { _utils[i] = gadgets[i]; } return _utils; } /** @notice get current idx */ function getCurrentCounter() external view returns (uint256) { return counter; } /** * @notice indicates weither any token exist with a given id, or not */ function exists(uint256 id) public view override returns (bool) { return gadgets[id].maxSupply > 0; } /** * @notice returns the metadata uri for a given id * * @param _id the gadget id to return metadata for */ function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), 'URI: nonexistent token'); return string( abi.encodePacked(super.uri(_id), gadgets[_id].ipfsMetadataHash) ); } } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\\x19Ethereum Signed Message:\ 32", hash)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\\x19\\x01", domainSeparator, structHash)); } } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC1155Upgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev Extension of ERC1155 that adds tracking of total supply per id. * * Useful for scenarios where Fungible and Non-fungible tokens have to be * clearly identified. Note: While a totalSupply of 1 might mean the * corresponding is an NFT, there is no guarantees that no other token with the * same id are not going to be minted. */ abstract contract ERC1155SupplyUpgradeable is Initializable, ERC1155Upgradeable { function __ERC1155Supply_init() internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC1155Supply_init_unchained(); } function __ERC1155Supply_init_unchained() internal initializer { } mapping(uint256 => uint256) private _totalSupply; /** * @dev Total amount of tokens in with a given id. */ function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } /** * @dev Indicates weither any token exist with a given id, or not. */ function exists(uint256 id) public view virtual returns (bool) { return ERC1155SupplyUpgradeable.totalSupply(id) > 0; } /** * @dev See {ERC1155-_mint}. */ function _mint( address account, uint256 id, uint256 amount, bytes memory data ) internal virtual override { super._mint(account, id, amount, data); _totalSupply[id] += amount; } /** * @dev See {ERC1155-_mintBatch}. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._mintBatch(to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] += amounts[i]; } } /** * @dev See {ERC1155-_burn}. */ function _burn( address account, uint256 id, uint256 amount ) internal virtual override { super._burn(account, id, amount); _totalSupply[id] -= amount; } /** * @dev See {ERC1155-_burnBatch}. */ function _burnBatch( address account, uint256[] memory ids, uint256[] memory amounts ) internal virtual override { super._burnBatch(account, ids, amounts); for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] -= amounts[i]; } } uint256[49] private __gap; } // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.0; import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol'; contract GalakticBase is Initializable { bool public paused; address public owner; mapping(address => bool) public pausers; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); event PauseChanged(address indexed by, bool indexed paused); /** ======== MODIFIERS ======== */ /** @notice modifier for owner only calls */ modifier onlyOwner() { require(owner == msg.sender, 'Ownable: caller is not the owner'); _; } /** @notice pause toggler */ modifier onlyPauseToggler() { require( owner == msg.sender || pausers[msg.sender], 'Ownable: caller is not the owner' ); _; } /** @notice modifier for pausing contracts */ modifier whenNotPaused() { require( !paused || owner == msg.sender || pausers[msg.sender], 'Feature is paused' ); _; } /** ======== INITALIZE ======== */ function __GalakticBase_init() internal initializer { owner = msg.sender; paused = false; } /** ======== OWNERSHIP FUNCTIONS ======== */ /** * @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); } /** ===== PAUSER FUNCTIONS ========== */ /** @dev allow owner to add or remove pausers */ function setPauser(address _pauser, bool _allowed) external onlyOwner { pausers[_pauser] = _allowed; } /** @notice toggle pause on and off */ function setPause(bool _paused) external onlyPauseToggler { paused = _paused; emit PauseChanged(msg.sender, _paused); } } // SPDX-License-Identifier: MIT pragma solidity >= 0.4.22 <0.9.0; library console { \taddress constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); \tfunction _sendLogPayload(bytes memory payload) private view { \t\tuint256 payloadLength = payload.length; \t\taddress consoleAddress = CONSOLE_ADDRESS; \t\tassembly { \t\t\tlet payloadStart := add(payload, 32) \t\t\tlet r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) \t\t} \t} \tfunction log() internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log()")); \t} \tfunction logInt(int p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(int)", p0)); \t} \tfunction logUint(uint p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); \t} \tfunction logString(string memory p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string)", p0)); \t} \tfunction logBool(bool p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); \t} \tfunction logAddress(address p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address)", p0)); \t} \tfunction logBytes(bytes memory p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); \t} \tfunction logBytes1(bytes1 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); \t} \tfunction logBytes2(bytes2 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); \t} \tfunction logBytes3(bytes3 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); \t} \tfunction logBytes4(bytes4 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); \t} \tfunction logBytes5(bytes5 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); \t} \tfunction logBytes6(bytes6 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); \t} \tfunction logBytes7(bytes7 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); \t} \tfunction logBytes8(bytes8 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); \t} \tfunction logBytes9(bytes9 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); \t} \tfunction logBytes10(bytes10 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); \t} \tfunction logBytes11(bytes11 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); \t} \tfunction logBytes12(bytes12 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); \t} \tfunction logBytes13(bytes13 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); \t} \tfunction logBytes14(bytes14 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); \t} \tfunction logBytes15(bytes15 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); \t} \tfunction logBytes16(bytes16 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); \t} \tfunction logBytes17(bytes17 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); \t} \tfunction logBytes18(bytes18 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); \t} \tfunction logBytes19(bytes19 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); \t} \tfunction logBytes20(bytes20 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); \t} \tfunction logBytes21(bytes21 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); \t} \tfunction logBytes22(bytes22 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); \t} \tfunction logBytes23(bytes23 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); \t} \tfunction logBytes24(bytes24 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); \t} \tfunction logBytes25(bytes25 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); \t} \tfunction logBytes26(bytes26 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); \t} \tfunction logBytes27(bytes27 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); \t} \tfunction logBytes28(bytes28 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); \t} \tfunction logBytes29(bytes29 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); \t} \tfunction logBytes30(bytes30 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); \t} \tfunction logBytes31(bytes31 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); \t} \tfunction logBytes32(bytes32 p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); \t} \tfunction log(uint p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); \t} \tfunction log(string memory p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string)", p0)); \t} \tfunction log(bool p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); \t} \tfunction log(address p0) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address)", p0)); \t} \tfunction log(uint p0, uint p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1)); \t} \tfunction log(uint p0, string memory p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1)); \t} \tfunction log(uint p0, bool p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1)); \t} \tfunction log(uint p0, address p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1)); \t} \tfunction log(string memory p0, uint p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1)); \t} \tfunction log(string memory p0, string memory p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); \t} \tfunction log(string memory p0, bool p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); \t} \tfunction log(string memory p0, address p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); \t} \tfunction log(bool p0, uint p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1)); \t} \tfunction log(bool p0, string memory p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); \t} \tfunction log(bool p0, bool p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); \t} \tfunction log(bool p0, address p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); \t} \tfunction log(address p0, uint p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1)); \t} \tfunction log(address p0, string memory p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); \t} \tfunction log(address p0, bool p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); \t} \tfunction log(address p0, address p1) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); \t} \tfunction log(uint p0, uint p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2)); \t} \tfunction log(uint p0, uint p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2)); \t} \tfunction log(uint p0, uint p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2)); \t} \tfunction log(uint p0, uint p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2)); \t} \tfunction log(uint p0, string memory p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2)); \t} \tfunction log(uint p0, string memory p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2)); \t} \tfunction log(uint p0, string memory p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2)); \t} \tfunction log(uint p0, string memory p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2)); \t} \tfunction log(uint p0, bool p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2)); \t} \tfunction log(uint p0, bool p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2)); \t} \tfunction log(uint p0, bool p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2)); \t} \tfunction log(uint p0, bool p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2)); \t} \tfunction log(uint p0, address p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2)); \t} \tfunction log(uint p0, address p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2)); \t} \tfunction log(uint p0, address p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2)); \t} \tfunction log(uint p0, address p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2)); \t} \tfunction log(string memory p0, uint p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2)); \t} \tfunction log(string memory p0, uint p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2)); \t} \tfunction log(string memory p0, uint p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2)); \t} \tfunction log(string memory p0, uint p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2)); \t} \tfunction log(string memory p0, string memory p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2)); \t} \tfunction log(string memory p0, string memory p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); \t} \tfunction log(string memory p0, string memory p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); \t} \tfunction log(string memory p0, string memory p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); \t} \tfunction log(string memory p0, bool p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2)); \t} \tfunction log(string memory p0, bool p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); \t} \tfunction log(string memory p0, bool p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); \t} \tfunction log(string memory p0, bool p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); \t} \tfunction log(string memory p0, address p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2)); \t} \tfunction log(string memory p0, address p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); \t} \tfunction log(string memory p0, address p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); \t} \tfunction log(string memory p0, address p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); \t} \tfunction log(bool p0, uint p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2)); \t} \tfunction log(bool p0, uint p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2)); \t} \tfunction log(bool p0, uint p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2)); \t} \tfunction log(bool p0, uint p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2)); \t} \tfunction log(bool p0, string memory p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2)); \t} \tfunction log(bool p0, string memory p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); \t} \tfunction log(bool p0, string memory p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); \t} \tfunction log(bool p0, string memory p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); \t} \tfunction log(bool p0, bool p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2)); \t} \tfunction log(bool p0, bool p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); \t} \tfunction log(bool p0, bool p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); \t} \tfunction log(bool p0, bool p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); \t} \tfunction log(bool p0, address p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2)); \t} \tfunction log(bool p0, address p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); \t} \tfunction log(bool p0, address p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); \t} \tfunction log(bool p0, address p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); \t} \tfunction log(address p0, uint p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2)); \t} \tfunction log(address p0, uint p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2)); \t} \tfunction log(address p0, uint p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2)); \t} \tfunction log(address p0, uint p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2)); \t} \tfunction log(address p0, string memory p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2)); \t} \tfunction log(address p0, string memory p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); \t} \tfunction log(address p0, string memory p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); \t} \tfunction log(address p0, string memory p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); \t} \tfunction log(address p0, bool p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2)); \t} \tfunction log(address p0, bool p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); \t} \tfunction log(address p0, bool p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); \t} \tfunction log(address p0, bool p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); \t} \tfunction log(address p0, address p1, uint p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2)); \t} \tfunction log(address p0, address p1, string memory p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); \t} \tfunction log(address p0, address p1, bool p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); \t} \tfunction log(address p0, address p1, address p2) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); \t} \tfunction log(uint p0, uint p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, uint p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, string memory p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, bool p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(uint p0, address p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, uint p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, string memory p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, bool p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(string memory p0, address p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, uint p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, string memory p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, bool p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(bool p0, address p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, uint p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, string memory p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, bool p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, uint p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, uint p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, uint p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, uint p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, string memory p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, string memory p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, string memory p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, string memory p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, bool p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, bool p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, bool p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, bool p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, address p2, uint p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, address p2, string memory p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, address p2, bool p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); \t} \tfunction log(address p0, address p1, address p2, address p3) internal view { \t\t_sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); \t} } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC1155Upgradeable.sol"; import "./IERC1155ReceiverUpgradeable.sol"; import "./extensions/IERC1155MetadataURIUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable { using AddressUpgradeable 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}. */ function __ERC1155_init(string memory uri_) internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC1155_init_unchained(uri_); } function __ERC1155_init_unchained(string memory uri_) internal initializer { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC1155Upgradeable).interfaceId || interfaceId == type(IERC1155MetadataURIUpgradeable).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 { require(_msgSender() != operator, "ERC1155: setting approval status for self"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_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 `account`. * * Emits a {TransferSingle} event. * * Requirements: * * - `account` cannot be the zero address. * - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address account, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(account != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][account] += amount; emit TransferSingle(operator, address(0), account, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), account, 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 `account` * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens of token type `id`. */ function _burn( address account, uint256 id, uint256 amount ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 accountBalance = _balances[id][account]; require(accountBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][account] = accountBalance - amount; } emit TransferSingle(operator, account, 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 account, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, account, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 accountBalance = _balances[id][account]; require(accountBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][account] = accountBalance - amount; } } emit TransferBatch(operator, account, address(0), ids, amounts); } /** * @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 IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155ReceiverUpgradeable.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 IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155ReceiverUpgradeable.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; } uint256[47] private __gap; } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.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 IERC1155Upgradeable is IERC165Upgradeable { /** * @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 pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155ReceiverUpgradeable is IERC165Upgradeable { /** @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 pragma solidity ^0.8.0; import "../IERC1155Upgradeable.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 IERC1155MetadataURIUpgradeable is IERC1155Upgradeable { /** * @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 pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @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 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 pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal initializer { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal initializer { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } uint256[50] private __gap; } // SPDX-License-Identifier: MIT 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 IERC165Upgradeable { /** * @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); }