Skip to content

Commit

Permalink
turn contracts into crate
Browse files Browse the repository at this point in the history
  • Loading branch information
qalisander committed Mar 25, 2024
1 parent 6ad9e1f commit c6c784b
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 891 deletions.
85 changes: 39 additions & 46 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["contracts/*", "lib/*"]
members = ["contracts", "lib/*"]
# Explicitly set the resolver to version 2, which is the default for packages
# with edition >= 2021.
# https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html
Expand Down
6 changes: 3 additions & 3 deletions contracts/token/Cargo.toml → contracts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "token"
name = "contracts"
categories = ["no-std", "wasm"]
description = "Token Standards for Stylus"
description = "Contracts for Stylus"
edition.workspace = true
keywords.workspace = true
license.workspace = true
Expand All @@ -16,7 +16,7 @@ stylus-proc = { version = "0.4.3", default-features = false }
mini-alloc = "0.4.2"

[dev-dependencies]
test-utils = { path = "../test-utils" }
wavm-shims = { path = "../lib/wavm-shims" }

[features]
default = []
Expand Down
1 change: 1 addition & 0 deletions contracts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Contracts
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,13 @@ impl ERC20 {

#[cfg(test)]
mod tests {
#[allow(unused_imports)]
use crate::test_utils;
use alloy_primitives::{address, Address, U256};
use stylus_sdk::{
msg,
storage::{StorageMap, StorageType, StorageU256},
};
#[allow(unused_imports)]
use test_utils::*;

use crate::erc20::{Error, ERC20};

Expand Down
7 changes: 6 additions & 1 deletion contracts/token/src/lib.rs → contracts/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![doc = include_str!("../README.md")]
#![doc = include_str!("../../README.md")]
#![warn(missing_docs, unreachable_pub, rust_2021_compatibility)]
#![warn(clippy::all, clippy::pedantic)]
#![cfg_attr(not(test), no_std, no_main)]
Expand All @@ -9,6 +9,11 @@ static ALLOC: mini_alloc::MiniAlloc = mini_alloc::MiniAlloc::INIT;

#[cfg(any(test, erc20))]
pub mod erc20;
#[cfg(test)]
mod test_utils;

#[cfg(test)]
extern crate std;

#[cfg(not(any(test, target_arch = "wasm32-unknown-unknown")))]
#[panic_handler]
Expand Down
File renamed without changes.
12 changes: 0 additions & 12 deletions contracts/test-utils/Cargo.toml

This file was deleted.

Loading

0 comments on commit c6c784b

Please sign in to comment.