You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"If the struct type references other struct types (and these in turn reference even more struct types), then the set of referenced struct types is collected, sorted by name and appended to the encoding. An example encoding is Transaction(Person from,Person to,Asset tx)Asset(address token,uint256 amount)Person(address wallet,string name)."
use alloy_sol_types::sol;
sol! {
/// @dev generic order information/// should be included as the first field in any concrete order typesstruct OrderInfo {
// The address of the reactor that this order is targeting// Note that this must be included in every order so the swapper// signature commits to the specific reactor that they trust to fill their order properlyaddress reactor;
// The address of the user which created the order// Note that this must be included so that order hashes are unique by swapperaddress swapper;
// The nonce of the order, allowing for signature replay protection and cancellationuint256 nonce;
// The timestamp after which this order is no longer validuint256 deadline;
// Custom validation contractaddress additionalValidationContract;
// Encoded validation params for additionalValidationContractbytes additionalValidationData;
}
/// @dev An amount of output tokens that decreases linearly over timestruct DutchOutput {
// The ERC20 token address (or native ETH address)address token;
// The amount of tokens at the start of the time perioduint256 startAmount;
// The amount of tokens at the end of the time perioduint256 endAmount;
// The address who must receive the tokens to satisfy the orderaddress recipient;
}
/// @dev An amount of input tokens that increases linearly over timestruct DutchInput {
// The ERC20 token addressaddress token;
// The amount of tokens at the start of the time perioduint256 startAmount;
// The amount of tokens at the end of the time perioduint256 endAmount;
}
struct ExclusiveDutchOrder {
// generic order information
OrderInfo info;
// The time at which the DutchOutputs start decayinguint256 decayStartTime;
// The time at which price becomes staticuint256 decayEndTime;
// The address who has exclusive rights to the order until decayStartTimeaddress exclusiveFiller;
// The amount in bps that a non-exclusive filler needs to improve the outputs by to be able to fill the orderuint256 exclusivityOverrideBps;
// The tokens that the swapper will provide when settling the order
DutchInput input;
// The tokens that must be received to satisfy the order
DutchOutput[] outputs;
}
}
also some other things being pushed, not really sure what thats about, heres the expansion for OrderInfo which in comparison doesnt have any nested structs
Component
sol-type
What version of Alloy are you on?
├── alloy-sol-types v0.2.0 │ ├── alloy-primitives v0.2.0 │ ├── alloy-sol-macro v0.2.0 (proc-macro)
Operating System
macOS (Apple Silicon)
Describe the bug
according to eip712
"If the struct type references other struct types (and these in turn reference even more struct types), then the set of referenced struct types is collected, sorted by name and appended to the encoding. An example encoding is
Transaction(Person from,Person to,Asset tx)Asset(address token,uint256 amount)Person(address wallet,string name).
"using cargo expand we see that
So in words, an
OrderInfo
may be appended beforeDutchInput
orDutchOutput
which would violate eip712 rulesThe text was updated successfully, but these errors were encountered: