Hello. I am wondering if nested structs are considered a good or a bad practise in Solidity and what are the pros/cons.
For example, which way of OfferCore struct is better?
struct OfferCore {
address seller;
//
address sourceToken;
uint256 sourceAmount;
uint16 sourceChain;
//
address targetToken;
uint256 targetAmount;
uint16 targetChain;
//
address targetOtcMarket;
//
uint48 createdAt; // not necessary
//
bool canceled;
}
OR
struct OfferToken {
address token;
uint256 amount;
uint16 chain;
}
struct OfferCore {
address seller;
//
OfferToken sourceToken;
OfferToken targetToken;
//
address targetOtcMarket;
//
uint48 createdAt; // not necessary
//
bool canceled;
}