From 65fc97f3b22c10d8b38d0d6eb092653e967dbbea Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Mon, 25 Mar 2024 14:01:26 +0400 Subject: [PATCH] add erc721 feature and module --- contracts/Cargo.toml | 1 + contracts/src/erc20/mod.rs | 4 ++-- contracts/src/erc721/mod.rs | 1 + contracts/src/lib.rs | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 contracts/src/erc721/mod.rs diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 1018f5b7..2dea9934 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -21,6 +21,7 @@ wavm-shims = { path = "../lib/wavm-shims" } [features] default = [] erc20 = [] +erc721 = [] [lib] # The Stylus team sets new crates with the following types: diff --git a/contracts/src/erc20/mod.rs b/contracts/src/erc20/mod.rs index fbe50152..3508d09b 100644 --- a/contracts/src/erc20/mod.rs +++ b/contracts/src/erc20/mod.rs @@ -343,8 +343,6 @@ impl ERC20 { #[cfg(test)] mod tests { - #[allow(unused_imports)] - use crate::test_utils; use alloy_primitives::{address, Address, U256}; use stylus_sdk::{ msg, @@ -352,6 +350,8 @@ mod tests { }; use crate::erc20::{Error, ERC20}; + #[allow(unused_imports)] + use crate::test_utils; impl Default for ERC20 { fn default() -> Self { diff --git a/contracts/src/erc721/mod.rs b/contracts/src/erc721/mod.rs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/contracts/src/erc721/mod.rs @@ -0,0 +1 @@ + diff --git a/contracts/src/lib.rs b/contracts/src/lib.rs index 11950c1b..b978eba9 100644 --- a/contracts/src/lib.rs +++ b/contracts/src/lib.rs @@ -9,6 +9,8 @@ static ALLOC: mini_alloc::MiniAlloc = mini_alloc::MiniAlloc::INIT; #[cfg(any(test, erc20))] pub mod erc20; +#[cfg(any(test, erc721))] +pub mod erc721; #[cfg(test)] mod test_utils;