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§
- ERC1967
Proxy - What to re-export, what to hide?
- EspToken
- What to re-export, what to hide?
- FeeContract
- What to re-export, what to hide?
- Light
Client - What to re-export, what to hide?
- Light
Client Mock - What to re-export, what to hide?
- Light
Client V2 - What to re-export, what to hide?
- Light
Client V2Mock - What to re-export, what to hide?
- Plonk
Verifier - What to re-export, what to hide?
- Plonk
Verifier V2 - What to re-export, what to hide?
- Stake
Table - 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§
- Challenges
Sol - types in src/libraries/PlonkVerifierV2.sol
- Deposit
- What to re-export, what to hide?
- EdOnB
N254 Point Sol - What to re-export, what to hide?
- G1Point
Sol - What to re-export, what to hide?
- G2Point
Sol - What to re-export, what to hide?
- Light
Client Instance - What to re-export, what to hide?
- Light
Client State Sol - What to re-export, what to hide?
- Plonk
Proof Sol - What to re-export, what to hide?
- Stake
Table State Sol - What to re-export, what to hide?
- Transcript
Data Sol - types in src/legacy/Transcript.sol
- Verifying
KeySol - What to re-export, what to hide?
Enums§
- Light
Client Errors - What to re-export, what to hide?