Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: immrsd <103599616+immrsd@users.noreply.github.com>
  • Loading branch information
andrew-fleming and immrsd authored Dec 18, 2024
1 parent 533f7ba commit 84e3681
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/test_common/src/mocks/erc20.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ pub mod ERC20ReentrantMock {
) {
let mut contract_state = self.get_contract_mut();

if (contract_state.reenter_type.read() == Type::Before) {
if contract_state.reenter_type.read() == Type::Before {
contract_state.reenter_type.write(Type::No);
contract_state.function_call();
}
Expand All @@ -336,7 +336,7 @@ pub mod ERC20ReentrantMock {
) {
let mut contract_state = self.get_contract_mut();

if (contract_state.reenter_type.read() == Type::After) {
if contract_state.reenter_type.read() == Type::After {
contract_state.reenter_type.write(Type::No);
contract_state.function_call();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/token/src/erc20/extensions/erc4626.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub mod erc4626;
pub mod interface;
pub use erc4626::DefaultConfig;

pub use erc4626::DefaultConfig;
pub use erc4626::ERC4626Component;
pub use erc4626::ERC4626DefaultLimits;
pub use erc4626::ERC4626DefaultNoFees;
Expand Down
10 changes: 5 additions & 5 deletions packages/token/src/erc20/extensions/erc4626/erc4626.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/// The drawback of this approach is that the virtual shares do capture (a very small) part of the
/// value being accrued to the vault. Also, if the vault experiences losses and users try to exit
/// the vault, the virtual shares and assets will cause the first exiting user to experience reduced
/// losses to the detriment to the last users who will experience bigger losses.
/// losses to the detriment to the last users who will experience bigger losses.
#[starknet::component]
pub mod ERC4626Component {
use core::num::traits::{Bounded, Pow, Zero};
Expand Down Expand Up @@ -512,6 +512,7 @@ pub mod ERC4626Component {
/// - `ERC20::transfer` must return true.
///
/// Emits two `ERC20::Transfer` events (`ERC20::burn` and `ERC20::transfer`).
///
/// Emits a `Withdraw` event.
fn _withdraw(
ref self: ComponentState<TContractState>,
Expand Down Expand Up @@ -548,7 +549,6 @@ pub mod ERC4626Component {

math::u256_mul_div(
assets,
//total_supply + math::power(10, Immutable::DECIMALS_OFFSET.into()),
total_supply + 10_u256.pow(Immutable::DECIMALS_OFFSET.into()),
self.total_assets() + 1,
rounding,
Expand All @@ -573,9 +573,9 @@ pub mod ERC4626Component {
}
}

///
/// Default (empty) traits
///
//
// Default (empty) traits
//

pub impl ERC4626HooksEmptyImpl<
TContractState,
Expand Down

0 comments on commit 84e3681

Please sign in to comment.