From c24bec705d3267f891ab5384bff071ac4b66908d Mon Sep 17 00:00:00 2001 From: Angry Coding Date: Mon, 23 Dec 2024 08:41:21 +0000 Subject: [PATCH] chore:exported erc4262 example --- contracts/src/token/erc20/extensions/mod.rs | 1 + examples/erc4262/src/lib.rs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/contracts/src/token/erc20/extensions/mod.rs b/contracts/src/token/erc20/extensions/mod.rs index aced02c59..af9835a44 100644 --- a/contracts/src/token/erc20/extensions/mod.rs +++ b/contracts/src/token/erc20/extensions/mod.rs @@ -9,3 +9,4 @@ pub use burnable::IErc20Burnable; pub use capped::Capped; pub use metadata::{Erc20Metadata, IErc20Metadata}; pub use permit::Erc20Permit; +pub use erc4626::{Erc4626,IERC4626}; diff --git a/examples/erc4262/src/lib.rs b/examples/erc4262/src/lib.rs index 332675f0e..5a3b59355 100644 --- a/examples/erc4262/src/lib.rs +++ b/examples/erc4262/src/lib.rs @@ -1,18 +1,35 @@ #![cfg_attr(not(test), no_main)] extern crate alloc; +use core::borrow; + use alloc::vec::Vec; use alloy_primitives::{Address, U256}; use stylus_sdk::prelude::{entrypoint, public, storage}; +use openzeppelin_stylus::{ + token::erc20::{ + extensions::{ Erc20Metadata,Erc4626, IERC4626}, + Erc20, IErc20, + }, + utils::{introspection::erc165::IErc165, Pausable}, +}; + #[entrypoint] #[storage] struct Erc4262xample { + #[borrow] + pub erc20: Erc20, + #[borrow] + pub metadata: Erc20Metadata, + #[borrow] + pub erc4626: Erc4626, } #[public] +#[inherit(Erc20, Erc20Metadata, Erc4626)] impl Erc4262xample { // Add token minting feature. }