Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contracts/ERC404.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {IERC721Receiver} from "@openzeppelin/contracts/interfaces/IERC721Receiver.sol";
import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/ERC404U16.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {IERC721Receiver} from "@openzeppelin/contracts/interfaces/IERC721Receiver.sol";
import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/ERC404Example.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/ERC404ExampleU16.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/ERC404ExampleUniswapV2.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/ERC404ExampleUniswapV3.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
Expand Down
22 changes: 12 additions & 10 deletions contracts/extensions/ERC404MerkleClaim.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import {IERC404MerkleClaim} from "./IERC404MerkleClaim.sol";
Expand All @@ -20,7 +20,7 @@ abstract contract ERC404MerkleClaim is IERC404MerkleClaim {
bytes32[] memory proof_,
address claimer_,
uint256 value_
) public view returns (bool) {
) public view virtual returns (bool) {
bytes32 leaf = keccak256(
bytes.concat(keccak256(abi.encode(claimer_, value_)))
);
Expand All @@ -30,28 +30,30 @@ abstract contract ERC404MerkleClaim is IERC404MerkleClaim {
return false;
}

// To use, override this function in your contract, call
// super.airdropMint(proof_) within your override function, then mint tokens.
function airdropMint(
// Pass in value_ as the amount of tokens to mint in ERC-20 format (i.e. wei, if using decimals 18).
function airdropMintERC20(
bytes32[] memory proof_,
uint256 value_
) public virtual whenAirdropIsOpen {
// Validate and record the airdrop claim so they can't claim it twice.
_validateAndRecordAirdropClaim(proof_, msg.sender, value_);
// Mint the user's airdrop to them.
_mintERC20(msg.sender, value_);
}

function _setAirdropMerkleRoot(bytes32 airdropMerkleRoot_) internal {
function _setAirdropMerkleRoot(bytes32 airdropMerkleRoot_) internal virtual {
airdropMerkleRoot = airdropMerkleRoot_;
}

function _toggleAirdropIsOpen() internal {
airdropIsOpen = !airdropIsOpen;
function _setAirdropIsOpen(bool state_) internal virtual {
airdropIsOpen = state_;
}

function _validateAndRecordAirdropClaim(
bytes32[] memory proof_,
address claimer_,
uint256 value_
) internal {
) internal virtual {
// Check that the address is eligible.
if (!verifyProof(proof_, claimer_, value_)) {
revert NotEligibleForAirdrop();
Expand Down
4 changes: 2 additions & 2 deletions contracts/extensions/ERC404UniswapV2Exempt.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {ERC404} from "../ERC404.sol";
import {IUniswapV2Router02} from "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/extensions/ERC404UniswapV3Exempt.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {ERC404} from "../ERC404.sol";
import {IPeripheryImmutableState} from "@uniswap/v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol";
Expand Down
6 changes: 3 additions & 3 deletions contracts/extensions/IERC404MerkleClaim.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

interface IERC404MerkleClaim {
error AirdropAlreadyClaimed();
Expand All @@ -12,5 +12,5 @@ interface IERC404MerkleClaim {
uint256 value_
) external view returns (bool);

function airdropMint(bytes32[] memory proof_, uint256 value_) external;
function airdropMintERC20(bytes32[] memory proof_, uint256 value_) external;
}
4 changes: 2 additions & 2 deletions contracts/interfaces/IERC404.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/legacy/ERC404Legacy.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

abstract contract Ownable {
Expand Down
2 changes: 1 addition & 1 deletion contracts/legacy/Pandora.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./ERC404Legacy.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/DoubleEndedQueue.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/DoubleEndedQueue.sol)
// Modified by Pandora Labs to support native uint256 operations
pragma solidity ^0.8.20;
pragma solidity 0.8.24;

/**
* @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/ERC20Events.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
pragma solidity 0.8.24;

library ERC20Events {
event Approval(address indexed owner, address indexed spender, uint256 value);
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/ERC721Events.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
pragma solidity 0.8.24;

library ERC721Events {
event ApprovalForAll(
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/PackedDoubleEndedQueue.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/DoubleEndedQueue.sol)
// Modified by Pandora Labs to support native packed operations
pragma solidity ^0.8.20;
pragma solidity 0.8.24;

/**
* @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/MinimalERC404.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/MockInvalidERC721Receiver.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

contract MockInvalidERC721Receiver {
function wrongSelector() external pure {
Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/MockValidERC721Receiver.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {IERC721Receiver} from "@openzeppelin/contracts/interfaces/IERC721Receiver.sol";

Expand Down
23 changes: 22 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,28 @@ import "@nomicfoundation/hardhat-toolbox"
import "hardhat-gas-reporter"

const config: HardhatUserConfig = {
solidity: { compilers: [{ version: "0.8.20" }, { version: "0.4.18" }] },
solidity: {
compilers: [
{
version: "0.8.24",
settings: {
optimizer: {
enabled: true,
runs: 1_000,
},
},
},
{
version: "0.4.18",
settings: {
optimizer: {
enabled: true,
runs: 1_000,
},
},
},
],
},
gasReporter: {
currency: "USD",
gasPrice: 21,
Expand Down