PrelodeBurnRedeemer Contract

Verifies Merkle proofs of PRELODE burns on Solana and distributes LODE to claimants on Ethereum.

Constructor

constructor(address initialOwner, address _lodeToken)
ParameterDescription
initialOwnerContract owner (typically a multisig)
_lodeTokenLODE token address (immutable after deployment)
Default exchange rate: 1e12 (1 PRELODE with 6 decimals = 1 LODE with 18 decimals).

Core Functions

claimLode

function claimLode(bytes32[] calldata proof, uint256 totalPrelodeBurned) external nonReentrant
Claim LODE based on PRELODE burned on Solana. Uses delta claiming — only the unclaimed portion is transferred.
ParameterDescription
proofMerkle proof for (msg.sender, totalPrelodeBurned)
totalPrelodeBurnedCumulative raw PRELODE burned (6 decimals)
Merkle leaf format (OZ-compatible double-hashed):
keccak256(bytes.concat(keccak256(abi.encode(evmAddress, totalPrelodeBurned))))

Admin Functions

setMerkleRoot

function setMerkleRoot(bytes32 _root) external onlyOwner
Post a new snapshot root. Called by the snapshot service after reading Solana burn state. Root cannot be zero.

setExchangeRate

function setExchangeRate(uint256 _rate) external onlyOwner
Change the PRELODE-to-LODE conversion rate. Bounded to [1, 1e18]. Only affects unclaimed burns.

withdrawLode

function withdrawLode(uint256 amount) external onlyOwner nonReentrant
Emergency withdrawal of LODE from the contract.

View Functions

FunctionReturns
lodeToken()LODE token address (immutable)
merkleRoot()Current Merkle root
exchangeRate()Current exchange rate
claimedPrelode(address)Cumulative raw PRELODE already redeemed by user

Events

EventEmitted When
MerkleRootUpdated(bytes32)New Merkle root posted
ExchangeRateUpdated(uint256)Exchange rate changed
LodeClaimed(address, uint256, uint256)User claims LODE
LodeWithdrawn(address, uint256)Owner withdraws LODE