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.9; | |
import "@openzeppelin/contracts@4.8.0/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts@4.8.0/access/Ownable.sol"; | |
import "@openzeppelin/contracts@4.8.0/utils/Counters.sol"; | |
contract PreRevealedTokens is ERC721, Ownable { | |
using Counters for Counters.Counter; |
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.9; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
contract MyToken is ERC20 { | |
constructor() ERC20("MyToken", "MTK") { | |
_mint(msg.sender, 10000000 * 10 ** decimals()); | |
} | |
} |
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
<html> | |
<head> | |
<title>Show NFTs</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script> | |
</head> | |
<body> | |
<div id="root"> | |
</div> | |
<script> |
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.13; | |
import {OperatorFilterer} from "./OperatorFilterer.sol"; | |
contract DefaultOperatorFilterer is OperatorFilterer { | |
address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); | |
constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {} | |
} |
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 | |
pragma solidity >=0.7.0 <0.9.0; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
contract Checker { | |
function check(address _token, address user) view public returns (uint256) { | |
return IERC20(_token).balanceOf(user); |
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.7.0 <0.9.0; | |
contract TodoList { | |
struct TodoItem { | |
string task; | |
bool isCompleted; | |
} | |
mapping (uint256 => TodoItem) public list; |
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
const { | |
time, | |
loadFixture, | |
} = require("@nomicfoundation/hardhat-network-helpers"); | |
const { anyValue } = require("@nomicfoundation/hardhat-chai-matchers/withArgs"); | |
const { expect } = require("chai"); | |
describe("Lock", function () { | |
// We define a fixture to reuse the same setup in every test. | |
// We use loadFixture to run this setup once, snapshot that state, |
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; | |
import "@openzeppelin/contracts@4.7.3/token/ERC20/ERC20.sol"; | |
contract MyToken is ERC20 { | |
constructor() ERC20("MyToken", "MTK") { | |
_mint(msg.sender, 10000 * 10 ** decimals()); | |
} | |
} |
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; | |
import "@openzeppelin/contracts/utils/math/SafeMath.sol"; | |
import "@aave/core-v3/contracts/flashloan/base/FlashLoanSimpleReceiverBase.sol"; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
contract SimpleFlashLoan is FlashLoanSimpleReceiverBase { | |
using SafeMath for uint; |
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: CC0-1.0 | |
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "./IERC4907.sol"; | |
contract ERC4907 is ERC721, IERC4907 { | |
struct UserInfo | |
{ | |
address user; // address of user role |
NewerOlder