diff --git a/packages/website/docs/smart-contracts/L1/LibData.md b/packages/website/docs/smart-contracts/L1/LibData.md new file mode 100644 index 00000000000..03dcd6c5dac --- /dev/null +++ b/packages/website/docs/smart-contracts/L1/LibData.md @@ -0,0 +1,105 @@ +## LibData + +### BlockMetadata + +```solidity +struct BlockMetadata { + uint256 id; + uint256 l1Height; + bytes32 l1Hash; + address beneficiary; + bytes32 txListHash; + bytes32 mixHash; + bytes extraData; + uint64 gasLimit; + uint64 timestamp; + uint64 commitHeight; + uint64 commitSlot; +} +``` + +### ProposedBlock + +```solidity +struct ProposedBlock { + bytes32 metaHash; + address proposer; + uint64 proposedAt; +} +``` + +### ForkChoice + +```solidity +struct ForkChoice { + bytes32 blockHash; + uint64 provenAt; + address[] provers; +} +``` + +### State + +```solidity +struct State { + mapping(uint256 => bytes32) l2Hashes; + mapping(uint256 => struct LibData.ProposedBlock) proposedBlocks; + mapping(uint256 => mapping(bytes32 => struct LibData.ForkChoice)) forkChoices; + mapping(address => mapping(uint256 => bytes32)) commits; + uint64 genesisHeight; + uint64 genesisTimestamp; + uint64 __reservedA1; + uint64 statusBits; + uint64 nextBlockId; + uint64 lastProposedAt; + uint64 avgBlockTime; + uint64 __avgGasLimit; + uint64 latestVerifiedHeight; + uint64 latestVerifiedId; + uint64 avgProofTime; + uint64 __reservedC1; + uint256[42] __gap; +} +``` + +### TentativeState + +```solidity +struct TentativeState { + mapping(address => bool) proposers; + mapping(address => bool) provers; + bool whitelistProposers; + bool whitelistProvers; + uint256[46] __gap; +} +``` + +### saveProposedBlock + +```solidity +function saveProposedBlock(struct LibData.State state, uint256 id, struct LibData.ProposedBlock blk) internal +``` + +### getProposedBlock + +```solidity +function getProposedBlock(struct LibData.State state, uint256 id) internal view returns (struct LibData.ProposedBlock) +``` + +### getL2BlockHash + +```solidity +function getL2BlockHash(struct LibData.State state, uint256 number) internal view returns (bytes32) +``` + +### getStateVariables + +```solidity +function getStateVariables(struct LibData.State state) internal view returns (uint64 genesisHeight, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 nextBlockId) +``` + +### hashMetadata + +```solidity +function hashMetadata(struct LibData.BlockMetadata meta) internal pure returns (bytes32) +``` diff --git a/packages/website/docs/smart-contracts/L1/TaikoL1.md b/packages/website/docs/smart-contracts/L1/TaikoL1.md index a351c69e3f3..34624912bb2 100644 --- a/packages/website/docs/smart-contracts/L1/TaikoL1.md +++ b/packages/website/docs/smart-contracts/L1/TaikoL1.md @@ -12,6 +12,12 @@ struct LibData.State state struct LibData.TentativeState tentative ``` +### \_\_gap + +```solidity +uint256[50] __gap +``` + ### init ```solidity diff --git a/packages/website/docs/smart-contracts/L1/TkoToken.md b/packages/website/docs/smart-contracts/L1/TkoToken.md index 147dcf27b1d..d71fc1fb008 100644 --- a/packages/website/docs/smart-contracts/L1/TkoToken.md +++ b/packages/website/docs/smart-contracts/L1/TkoToken.md @@ -2,6 +2,11 @@ _This is Taiko's governance and fee token._ +### \_\_gap + +```solidity +uint256[50] __gap +``` ### Mint diff --git a/packages/website/docs/smart-contracts/L2/TaikoL2.md b/packages/website/docs/smart-contracts/L2/TaikoL2.md index da9d73373af..bf7ed0351ec 100644 --- a/packages/website/docs/smart-contracts/L2/TaikoL2.md +++ b/packages/website/docs/smart-contracts/L2/TaikoL2.md @@ -24,6 +24,12 @@ bytes32 publicInputHash bytes32 latestSyncedHeader ``` +### \_\_gap + +```solidity +uint256[46] __gap +``` + ### BlockInvalidated ```solidity @@ -95,3 +101,15 @@ function getBlockHash(uint256 number) public view returns (bytes32) ```solidity function getConstants() public pure returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256) ``` + +### \_checkPublicInputs + +```solidity +function _checkPublicInputs() private +``` + +### \_hashPublicInputs + +```solidity +function _hashPublicInputs(uint256 chainId, uint256 number, uint256 baseFee, bytes32[255] ancestors) private pure returns (bytes32) +``` diff --git a/packages/website/docs/smart-contracts/bridge/Bridge.md b/packages/website/docs/smart-contracts/bridge/Bridge.md index 21277f48c92..e463d1da05b 100644 --- a/packages/website/docs/smart-contracts/bridge/Bridge.md +++ b/packages/website/docs/smart-contracts/bridge/Bridge.md @@ -11,6 +11,12 @@ _The code hash for the same address on L1 and L2 may be different._ struct LibBridgeData.State state ``` +### \_\_gap + +```solidity +uint256[50] __gap +``` + ### MessageStatusChanged ```solidity diff --git a/packages/website/docs/smart-contracts/bridge/BridgedERC20.md b/packages/website/docs/smart-contracts/bridge/BridgedERC20.md index 9c16648f21b..c5d8c9767d8 100644 --- a/packages/website/docs/smart-contracts/bridge/BridgedERC20.md +++ b/packages/website/docs/smart-contracts/bridge/BridgedERC20.md @@ -12,6 +12,12 @@ address srcToken uint256 srcChainId ``` +### \_\_gap + +```solidity +uint256[48] __gap +``` + ### BridgeMint ```solidity diff --git a/packages/website/docs/smart-contracts/bridge/IBridge.md b/packages/website/docs/smart-contracts/bridge/IBridge.md index a1a9788f19b..5997fc2ddb3 100644 --- a/packages/website/docs/smart-contracts/bridge/IBridge.md +++ b/packages/website/docs/smart-contracts/bridge/IBridge.md @@ -22,7 +22,6 @@ struct Message { bytes data; string memo; } - ``` ### Context @@ -33,7 +32,6 @@ struct Context { address sender; uint256 srcChainId; } - ``` ### SignalSent diff --git a/packages/website/docs/smart-contracts/bridge/TokenVault.md b/packages/website/docs/smart-contracts/bridge/TokenVault.md index 8841d2e771e..932372872c3 100644 --- a/packages/website/docs/smart-contracts/bridge/TokenVault.md +++ b/packages/website/docs/smart-contracts/bridge/TokenVault.md @@ -14,7 +14,6 @@ struct CanonicalERC20 { string symbol; string name; } - ``` ### isBridgedToken