This file contains 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.16; | |
/// @dev The ETH transfer has failed. | |
error ETHTransferFailed(); | |
/// @dev Sends `amount` (in wei) ETH to `to`. | |
/// Reverts upon failure. | |
function safeTransferETH(address to, uint256 amount) { | |
assembly { |
This file contains 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.4; | |
contract TheGame { | |
// Nothing to see here yet. | |
} |
This file contains 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.4; | |
/// @notice Simple single owner authorization mixin with timer for guardianship. | |
/// @author Zolidity (https://github.com/z0r0z/zolidity/blob/main/src/auth/OwnedWithTimer.sol) | |
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol) | |
contract OwnedWithTimer { | |
/// ----------------------------------------------------------------------- | |
/// Events | |
/// ----------------------------------------------------------------------- |
This file contains 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: GPL-3.0-or-later | |
pragma solidity >=0.8.4; | |
import "https://github.com/Rari-Capital/solmate/src/tokens/ERC721.sol"; | |
import "https://github.com/kalidao/kali-contracts/blob/main/contracts/utils/NFThelper.sol"; | |
/// @notice Minimal ERC-20 interface. | |
interface IERC20minimal { | |
function balanceOf(address account) external view returns (uint256); |
This file contains 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 "@openzeppelin/contracts/interfaces/IERC20.sol"; | |
import "@openzeppelin/contracts/interfaces/IERC721.sol"; | |
import "@openzeppelin/contracts/interfaces/IERC721Receiver.sol"; | |
import "@openzeppelin/contracts/interfaces/IERC1155.sol"; | |
import "@openzeppelin/contracts/interfaces/IERC1155Receiver.sol"; | |
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; |
This file contains 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: AGPL-3.0-only | |
pragma solidity >=0.8.4; | |
import {SafeTransferLib} from "https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol"; | |
/// @notice Subsidized transactions for smart contracts. | |
/// @author z0r0z.eth | |
abstract contract Subsidized { | |
using SafeTransferLib for address; |
This file contains 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: AGPL-3.0-only | |
pragma solidity >=0.8.0; | |
import "https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC1155.sol"; | |
import "https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeCastLib.sol"; | |
/// @notice Compound-like voting extension for ERC1155. | |
/// @author z0r0z.eth | |
abstract contract ERC1155votes is ERC1155 { | |
using SafeCastLib for uint256; |
This file contains 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: AGPL-3.0-only | |
pragma solidity >=0.8.0; | |
import "https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol"; | |
/// @notice 1-of-1 NFT. | |
contract SingleNFT is ERC721 { | |
string internal URI; | |
constructor( |
This file contains 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: AGPL-3.0-only | |
pragma solidity >=0.8.0; | |
import 'https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC1155.sol'; | |
contract TokenWarrant is ERC1155 { | |
mapping(uint256 => string) public metas; | |
function uri(uint256 id) public override view returns (string memory) { | |
return metas[id]; |
This file contains 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: GPL-3.0-or-later | |
pragma solidity >=0.8.0; | |
/// @notice Standard ERC-20 token interface with EIP-2612 {permit} extension. | |
interface IERC20 { | |
/// @dev ERC-20: | |
function allowance(address owner, address spender) external view returns (uint256); | |
function balanceOf(address account) external view returns (uint256); | |
function totalSupply() external view returns (uint256); |