Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix 0.5.3 #155

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions stylus-sdk/src/abi/export/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
//! This module provides functions for code generated by `stylus-sdk-proc` for the `export-abi` command.
//! Most users shouldn't call these.

use alloy_primitives::{Address, FixedBytes, Signed, Uint};
use core::any::TypeId;

use alloy_primitives::{Address, FixedBytes, Signed, Uint};

use crate::abi::Bytes;

/// Represents a unique Solidity Type.
pub struct InnerType {
/// Full interface string.
Expand Down Expand Up @@ -58,7 +61,7 @@ macro_rules! impl_inner {
};
}

impl_inner!(bool u8 u16 u32 u64 u128 i8 i16 i32 i64 i128 String Address);
impl_inner!(bool u8 u16 u32 u64 u128 i8 i16 i32 i64 i128 String Address Bytes);

impl<const B: usize, const L: usize> InnerTypes for Uint<B, L> {}
impl<const B: usize, const L: usize> InnerTypes for Signed<B, L> {}
Expand Down
4 changes: 1 addition & 3 deletions stylus-sdk/src/abi/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ where
#[inline(always)]
fn encode(self) -> ArbResult {
// coerce types into a tuple of at least 1 element
Ok(<(<T as AbiType>::SolType,) as SolType>::abi_encode(
&(self,),
))
Ok(<<T as AbiType>::SolType>::abi_encode(&self))
}
}

Expand Down
2 changes: 1 addition & 1 deletion stylus-sdk/src/storage/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl StorageBytes {
/// Determines the slot and offset for the element at an index.
fn index_slot(&self, index: usize) -> (U256, u8) {
let slot = match self.len() {
33.. => self.base() + U256::from(index / 32),
32.. => self.base() + U256::from(index / 32),
_ => self.root,
};
(slot, (index % 32) as u8)
Expand Down
Loading