Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Biggest change in new Alloy versions is to
SolType
:The
SolType
's associatedRustType
must now support the constraint:type RustType: SolTypeValue<Self> + 'static;
As mentioned,
SolTypeValue
is a new replacement for the oldEncodable
trait, and they've made the trait private to prevent custom implementations ofSolType
. This affected our customSolType
sByte
andFixedByte
located in thestylus-sdk/src/abi
folder, making them invalid.FixedBytes
can be safely removed currently, as they fixed the associatedRustType
forsol_data::FixedBytes
to bealloy_primitives::FixedBytes
. Thesol_data::Bytes
type, however, returnsVec<u8>
for itsRustType
, so the bijectivity requirement inAbiType
cannot be satisfied (Vec<u8>
already has anABIType
fromVec<T>
). In this PR I removedBytes
as well, but modified theAbiType
trait to remove the bijective constraint. I don't know if this has implications as now the<<alloy_primitives::Bytes as AbiType>::SolType>::RustType
yields aVec<u8>
(instead ofalloy_primitives::Bytes
as desired).TODO
sol_interface
macro in/stylus-proc/src/calls/mod.rs
.Relevant Release Notes From Alloy
Full release notes here
encode
renamed toencode_sequence
encode_single
renamed toencode
encode
anddecode
functions withabi_
SolType
impl forsol_data::FixedBytes
hasRustType
[u8; N]
RustType
toalloy_primitives::FixedBytes
SolValue
convenience trait foralloy-sol-types
Encodable
an impl detailEncodable
toSolTypeValue
make it clear that it andSolType
should not be implemented manuallySolValue
trait has useful methods fromSolType
&Self::RustType
they take receiverself
SolValue
is implemented for all ABI Rust types and delegates everything toSolTypeEncodable
whenSelf: SolTypeEncodable
TokenType
trait was renamed toToken