Module sol_types

Source
Expand description

Solidity types for interacting with contracts Re-export types that are used, sometimes renamed to avoid collision.

TODO: (alex) Due to https://github.com/foundry-rs/foundry/issues/10153, try to re-export the same type from the “youngest” child contract since that is the contract whose functions are being called, thus from whom the rust bindings are expected. E.g. Both PlonkVerifier and LightClient, and LightClientV2 depends on BN254. The inheritance relationship is: BN254 <- PlonkVerifier <- LIghtClient <- LightClientV2 Most of the time, we interact with PlonkVerifier’s function via LightClientV2, thus import BN254.G1Point from bindings::plonkverifierv2. When we need to directly interact with PlonkVerifier’s method, implement stupid plain From<lc2::BN254::G1Point> for pv::BN254::G1Point. If you are lazy, you can even use unsafe memory transmute since they are literally the same representation, duplicated in different modules, thus treated by the rust type systems as distinct types.

Another usage is in the differential testing in Solidity tests. In those cases, the actual types don’t matter, since they will all abi_encode() into the exact same bytes before being communicated over to contract via FFI. Thus using any one of them is fine.

Modules§

ERC1967Proxy
What to re-export, what to hide?
EspToken
What to re-export, what to hide?
FeeContract
What to re-export, what to hide?
LightClient
What to re-export, what to hide?
LightClientMock
What to re-export, what to hide?
LightClientV2
What to re-export, what to hide?
LightClientV2Mock
What to re-export, what to hide?
PlonkVerifier
What to re-export, what to hide?
PlonkVerifierV2
What to re-export, what to hide?
StakeTable
What to re-export, what to hide?
Timelock
What to re-export, what to hide?
lightclientmock
What to re-export, what to hide?
lightclientv2
What to re-export, what to hide?
lightclientv2mock
What to re-export, what to hide?
staketable
What to re-export, what to hide?

Structs§

ChallengesSol
types in src/libraries/PlonkVerifierV2.sol
Deposit
What to re-export, what to hide?
EdOnBN254PointSol
What to re-export, what to hide?
G1PointSol
What to re-export, what to hide?
G2PointSol
What to re-export, what to hide?
LightClientInstance
What to re-export, what to hide?
LightClientStateSol
What to re-export, what to hide?
PlonkProofSol
What to re-export, what to hide?
StakeTableStateSol
What to re-export, what to hide?
TranscriptDataSol
types in src/legacy/Transcript.sol
VerifyingKeySol
What to re-export, what to hide?

Enums§

LightClientErrors
What to re-export, what to hide?