Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
[evm] Added ERC721 and ERC1155 Move contracts to the hardhat project (#…
Browse files Browse the repository at this point in the history
…52)

- Added the Move contracts ERC721Mock and ERC1155Mock
- Added the Solidity contracts ERC721Mock_Sol and ERC1155Mock_Sol
- Checked that they all passed the Openzepplin testsuite

- Ignored .js files in the broken link test
  • Loading branch information
junkil-park authored Apr 18, 2022
1 parent 5d600b7 commit 87e5ad7
Show file tree
Hide file tree
Showing 15 changed files with 3,312 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,6 @@ jobs:
- name: Run Checks
run: |
gem install awesome_bot
# Don't look in git or target dirs. Don't check png, bib, tex, or shell files
# Don't look in git or target dirs. Don't check png, bib, tex, js, or shell files
# We allow links to be redirects, allow duplicates, and we also allow Too Many Requests (429) errors
find . -not \( -path "./.git*" -prune \) -not \( -path "./target" -prune \) -type f -not -name "*.png" -not -name "*.sh" -not -name "*.bib" -not -name "*.tex" -not -name "hardhat.config.js" | while read arg; do awesome_bot --allow-redirect --allow-dupe --allow 429 --skip-save-results $arg; done
find . -not \( -path "./.git*" -prune \) -not \( -path "./target" -prune \) -type f -not -name "*.png" -not -name "*.sh" -not -name "*.bib" -not -name "*.tex" -not -name "*.js" | while read arg; do awesome_bot --allow-redirect --allow-dupe --allow 429 --skip-save-results $arg; done
11 changes: 11 additions & 0 deletions language/evm/hardhat-examples/contracts/ERC1155Mock/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "ERC1155Mock"
version = "0.0.0"

[addresses]
Std = "0x1"
Evm = "0x2"

[dependencies]
EvmStdlib = { local = "../../../stdlib" }
MoveStdlib = { local = "../../../../move-stdlib" }

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions language/evm/hardhat-examples/contracts/ERC1155Mock_Sol.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";

/**
* @title ERC1155Mock
* This mock just publicizes internal functions for testing purposes
*/
contract ERC1155Mock_Sol is ERC1155 {
constructor(string memory uri) ERC1155(uri) {}

function setURI(string memory newuri) public {
_setURI(newuri);
}

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

function mintBatch(
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) public {
_mintBatch(to, ids, values, data);
}

function burn(
address owner,
uint256 id,
uint256 value
) public {
_burn(owner, id, value);
}

function burnBatch(
address owner,
uint256[] memory ids,
uint256[] memory values
) public {
_burnBatch(owner, ids, values);
}
}
11 changes: 11 additions & 0 deletions language/evm/hardhat-examples/contracts/ERC721Mock/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "ERC721Mock"
version = "0.0.0"

[addresses]
Std = "0x1"
Evm = "0x2"

[dependencies]
EvmStdlib = { local = "../../../stdlib" }
MoveStdlib = { local = "../../../../move-stdlib" }
Loading

0 comments on commit 87e5ad7

Please sign in to comment.