This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| import {IERC20Metadata} from "@openzeppelin/contracts/interfaces/IERC20Metadata.sol"; | |
| import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | |
| import {LibNativeTransfer} from "./LibNativeTransfer.sol"; | |
| type Currency is address; | |
| using {eq as ==} for Currency global; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.17; | |
| import {AccessControlEnumerable} from "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; | |
| import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; | |
| import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol"; | |
| import {BitMaps} from "@openzeppelin/contracts/utils/structs/BitMaps.sol"; | |
| import {LibSubString} from "./LibSubString.sol"; | |
| contract NameCheckerMap is Initializable, AccessControlEnumerable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.17; | |
| import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; | |
| library LibSubString { | |
| struct WordRange { | |
| uint8 min; | |
| uint8 max; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.17; | |
| contract ExhaustGas { | |
| uint256 val; | |
| function exhaustivelyConsumeAllGas() external pure { | |
| assembly { | |
| revert(0, 1000000) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.21; | |
| import {ERC1155Supply} from "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; | |
| import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; | |
| interface IERC1155Enumerable { | |
| function getTokenCount() external view returns (uint256); | |
| function getTokenOfOwnerCount(address account) external view returns (uint256); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) | |
| pragma solidity ^0.8.20; | |
| /** | |
| * @dev External interface of AccessControl declared to support ERC165 detection. | |
| */ | |
| interface IAccessControl { | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| contract Concatenation { | |
| function randomizeAddress(uint256 seed, uint256 amount) external pure returns (address[] memory addrs) { | |
| addrs = new address[](amount); | |
| for (uint256 i; i < amount; ) { | |
| addrs[i] = address(ripemd160(abi.encode(seed, i))); | |
| unchecked { | |
| ++i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Import contract factory generated from `hardhat compile` with typechain | |
| import { IERC165__factory, IERC2981__factory } from '@custom-types/contracts' | |
| import { ethers } from 'hardhat' | |
| import { utils } from 'ethers' | |
| const getInterfaceID = (contractInterface: utils.Interface) => { | |
| let interfaceID = ethers.constants.Zero; | |
| const functions: string[] = Object.keys(contractInterface.functions); | |
| for (let i = 0; i < functions.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.5.17; | |
| import {IKatanaRouter} from "./IKatanaRouter.sol"; | |
| import {SafeMath} from "../libraries/SafeMath.sol"; | |
| import {ErrorHandler} from "../libraries/ErrorHandler.sol"; | |
| import {TransferHelper} from "../libraries/TransferHelper.sol"; | |
| contract AffiliateRouterV2 { | |
| using SafeMath for uint256; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity 0.8.17; | |
| contract PieceCombiner { | |
| uint256 public constant NUM_RARITIES = 4; | |
| uint256 public constant NUM_ATTRIBUTES = 4; | |
| mapping(address => uint8[NUM_RARITIES]) public attributeBitMap; | |
| mapping(address => mapping(uint8 => uint256[][])) public collectibles; | |
| mapping(address => uint8[NUM_RARITIES][NUM_ATTRIBUTES]) public collectibleCounter; |
NewerOlder