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.23; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/utils/math/SafeMath.sol"; | |
interface IUniswapV2Factory { | |
function createPair(address tokenA, address tokenB) |
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.23; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/utils/math/SafeMath.sol"; | |
interface IUniswapV2Factory { | |
function createPair(address tokenA, address tokenB) |
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.23; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/utils/math/SafeMath.sol"; | |
interface IUniswapV2Factory { | |
function createPair(address tokenA, address tokenB) |
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
// File: @openzeppelin/contracts/utils/Nonces.sol | |
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol) | |
pragma solidity ^0.8.20; | |
/** | |
* @dev Provides tracking nonces for addresses. Nonces will only increment. | |
*/ |
The TokenPresale smart contract facilitates the sale of a specific ERC-20 token at a predetermined rate in exchange for Ether (ETH). It includes features such as pausing, ownership control, and a cap on the total ETH that can be raised during the presale.
token
: The ERC-20 token being sold.rate
: The rate at which tokens are exchanged for ETH, denominated in wei.cap
: The maximum amount of ETH that can be raised during the presale.weiRaised
: Total amount of ETH raised so far.
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
import { percentAmount, generateSigner, signerIdentity, createSignerFromKeypair } from '@metaplex-foundation/umi' | |
import { TokenStandard, createAndMint } from '@metaplex-foundation/mpl-token-metadata' | |
import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'; | |
import { mplCandyMachine } from "@metaplex-foundation/mpl-candy-machine"; | |
import "@solana/web3.js"; | |
import base58 from 'bs58'; | |
import { clusterApiUrl } from '@solana/web3.js'; | |
// CHANGE THESE VALUES |
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.20; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract ContactManager is Ownable { | |
constructor(address initialOwner) Ownable(initialOwner) {} | |
struct User { | |
address userAddress; |
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; | |
/** | |
* @dev Minimal ERC20 interface | |
*/ | |
interface IERC20 { | |
function transferFrom( | |
address sender, | |
address recipient, |
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.19; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract StoryNFT is ERC721URIStorage, Ownable { | |
uint256 private _tokenIds; | |
constructor() ERC721("StoryNFT", "SNFT") Ownable(msg.sender) {} |