Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WETH, ERC721, ERC1155 support #44

Merged
merged 4 commits into from
Sep 11, 2023
Merged
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
5 changes: 5 additions & 0 deletions .changeset/smooth-dodos-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"reverse-mirage": patch
---

Support weth, erc1155, erc721
24 changes: 24 additions & 0 deletions contracts/src/ERC1155.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {solmateERC1155} from "./solmateERC1155.sol";

contract ERC1155 is solmateERC1155 {
string private baseURI;

constructor(string memory _baseURI) {
baseURI = _baseURI;
}

function mint(address to, uint256 id, uint256 amount, bytes memory data) external {
_mint(to, id, amount, data);
}

function burn(address from, uint256 id, uint256 amount) external {
_burn(from, id, amount);
}

function uri(uint256) public view virtual override returns (string memory) {
return baseURI;
}
}
26 changes: 26 additions & 0 deletions contracts/src/ERC721.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {solmateERC721} from "./solmateERC721.sol";

contract ERC721 is solmateERC721 {
string private baseTokenURI;

constructor(string memory _name, string memory _symbol, string memory _baseTokenURI)
solmateERC721(_name, _symbol)
{
baseTokenURI = _baseTokenURI;
}

function mint(address to, uint256 id) external {
_mint(to, id);
}

function burn(uint256 id) external {
_burn(id);
}

function tokenURI(uint256) public view virtual override returns (string memory) {
return baseTokenURI;
}
}
22 changes: 22 additions & 0 deletions contracts/src/ERC721MaxBalance.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {solmateERC721} from "./solmateERC721.sol";

contract ERC721MaxBalance is solmateERC721 {
string private baseTokenURI;

constructor(string memory _name, string memory _symbol, string memory _baseTokenURI)
solmateERC721(_name, _symbol)
{
baseTokenURI = _baseTokenURI;
}

function tokenURI(uint256) public view virtual override returns (string memory) {
return baseTokenURI;
}

function balanceOf(address) public view virtual override returns (uint256) {
return 2 ** 53;
}
}
Loading