Commit 9036a066 authored by Indeavr's avatar Indeavr

refac (docs): latest mds

parent a7cf8e67
......@@ -6,15 +6,7 @@
*Collection of functions related to the address type*
......@@ -2,27 +2,18 @@
> AddressDictator
*The AddressDictator (glory to Arstotzka) is a contract that allows us to safely manipulate many different addresses in the AddressManager without transferring ownership of the AddressManager to a hot wallet or hardware wallet.*
## Methods
### finalOwner
```solidity
function finalOwner() external view returns (address)
```
......@@ -30,27 +21,16 @@ function finalOwner() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### getNamedAddresses
```solidity
function getNamedAddresses() external view returns (struct AddressDictator.NamedAddress[])
```
Returns the full namedAddresses array.
......@@ -58,27 +38,16 @@ Returns the full namedAddresses array.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | AddressDictator.NamedAddress[] | undefined
### manager
```solidity
function manager() external view returns (contract Lib_AddressManager)
```
......@@ -86,27 +55,16 @@ function manager() external view returns (contract Lib_AddressManager)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract Lib_AddressManager | undefined
### returnOwnership
```solidity
function returnOwnership() external nonpayable
```
Transfers ownership of this contract to the finalOwner. Only callable by the Final Owner, which is intended to be our multisig. This function shouldn't be necessary, but it gives a sense of reassurance that we can recover if something really surprising goes wrong.
......@@ -114,17 +72,10 @@ Transfers ownership of this contract to the finalOwner. Only callable by the Fin
### setAddresses
```solidity
function setAddresses() external nonpayable
```
Called to finalize the transfer, this function is callable by anyone, but will only result in an upgrade if this contract is the owner Address Manager.
......@@ -135,11 +86,3 @@ Called to finalize the transfer, this function is callable by anyone, but will o
......@@ -2,64 +2,40 @@
> BondManager
*This contract is, for now, a stub of the "real" BondManager that does nothing but allow the "OVM_Proposer" to submit state root batches.*
## Methods
### isCollateralized
```solidity
function isCollateralized(address _who) external view returns (bool)
```
Checks whether a given address is properly collateralized and can perform actions within the system.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _who | address | Address to check.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | true if the address is properly collateralized, false otherwise.
### libAddressManager
```solidity
function libAddressManager() external view returns (contract Lib_AddressManager)
```
......@@ -67,61 +43,34 @@ function libAddressManager() external view returns (contract Lib_AddressManager)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract Lib_AddressManager | undefined
### resolve
```solidity
function resolve(string _name) external view returns (address)
```
Resolves the address associated with a given name.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | Name to resolve an address for.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address associated with the given name.
......@@ -2,27 +2,18 @@
> CanonicalTransactionChain
*The Canonical Transaction Chain (CTC) contract is an append-only log of transactions which must be applied to the rollup state. It defines the ordering of rollup transactions by writing them to the 'CTC:batches' instance of the Chain Storage Container. The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the Sequencer will eventually append it to the rollup state.*
## Methods
### MAX_ROLLUP_TX_SIZE
```solidity
function MAX_ROLLUP_TX_SIZE() external view returns (uint256)
```
......@@ -30,27 +21,16 @@ function MAX_ROLLUP_TX_SIZE() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### MIN_ROLLUP_TX_GAS
```solidity
function MIN_ROLLUP_TX_GAS() external view returns (uint256)
```
......@@ -58,45 +38,27 @@ function MIN_ROLLUP_TX_GAS() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### appendSequencerBatch
```solidity
function appendSequencerBatch() external nonpayable
```
Allows the sequencer to append a batch of transactions.
*This function uses a custom encoding scheme for efficiency reasons. .param _shouldStartAtElement Specific batch we expect to start appending to. .param _totalElementsToAppend Total number of batch elements we expect to append. .param _contexts Array of batch contexts. .param _transactionDataFields Array of raw transaction data.*
### batches
```solidity
function batches() external view returns (contract IChainStorageContainer)
```
Accesses the batch storage container.
......@@ -104,60 +66,34 @@ Accesses the batch storage container.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract IChainStorageContainer | Reference to the batch storage container.
### enqueue
```solidity
function enqueue(address _target, uint256 _gasLimit, bytes _data) external nonpayable
```
Adds a transaction to the queue.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _target | address | Target L2 contract to send the transaction to.
| _gasLimit | uint256 | Gas limit for the enqueued L2 transaction.
| _data | bytes | Transaction data.
### enqueueGasCost
```solidity
function enqueueGasCost() external view returns (uint256)
```
......@@ -165,27 +101,16 @@ function enqueueGasCost() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### enqueueL2GasPrepaid
```solidity
function enqueueL2GasPrepaid() external view returns (uint256)
```
......@@ -193,27 +118,16 @@ function enqueueL2GasPrepaid() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### getLastBlockNumber
```solidity
function getLastBlockNumber() external view returns (uint40)
```
Returns the blocknumber of the last transaction.
......@@ -221,27 +135,16 @@ Returns the blocknumber of the last transaction.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint40 | Blocknumber for the last transaction.
### getLastTimestamp
```solidity
function getLastTimestamp() external view returns (uint40)
```
Returns the timestamp of the last transaction.
......@@ -249,27 +152,16 @@ Returns the timestamp of the last transaction.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint40 | Timestamp for the last transaction.
### getNextQueueIndex
```solidity
function getNextQueueIndex() external view returns (uint40)
```
Returns the index of the next element to be enqueued.
......@@ -277,27 +169,16 @@ Returns the index of the next element to be enqueued.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint40 | Index for the next queue element.
### getNumPendingQueueElements
```solidity
function getNumPendingQueueElements() external view returns (uint40)
```
Get the number of queue elements which have not yet been included.
......@@ -305,64 +186,38 @@ Get the number of queue elements which have not yet been included.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint40 | Number of pending queue elements.
### getQueueElement
```solidity
function getQueueElement(uint256 _index) external view returns (struct Lib_OVMCodec.QueueElement _element)
```
Gets the queue element at a particular index.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _index | uint256 | Index of the queue element to access.
#### Returns
| Name | Type | Description |
|---|---|---|
| _element | Lib_OVMCodec.QueueElement | Queue element at the given index.
### getQueueLength
```solidity
function getQueueLength() external view returns (uint40)
```
Retrieves the length of the queue, including both pending and canonical transactions.
......@@ -370,27 +225,16 @@ Retrieves the length of the queue, including both pending and canonical transact
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint40 | Length of the queue.
### getTotalBatches
```solidity
function getTotalBatches() external view returns (uint256 _totalBatches)
```
Retrieves the total number of batches submitted.
......@@ -398,27 +242,16 @@ Retrieves the total number of batches submitted.
#### Returns
| Name | Type | Description |
|---|---|---|
| _totalBatches | uint256 | Total submitted batches.
### getTotalElements
```solidity
function getTotalElements() external view returns (uint256 _totalElements)
```
Retrieves the total number of elements submitted.
......@@ -426,27 +259,16 @@ Retrieves the total number of elements submitted.
#### Returns
| Name | Type | Description |
|---|---|---|
| _totalElements | uint256 | Total submitted elements.
### l2GasDiscountDivisor
```solidity
function l2GasDiscountDivisor() external view returns (uint256)
```
......@@ -454,27 +276,16 @@ function l2GasDiscountDivisor() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### libAddressManager
```solidity
function libAddressManager() external view returns (contract Lib_AddressManager)
```
......@@ -482,27 +293,16 @@ function libAddressManager() external view returns (contract Lib_AddressManager)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract Lib_AddressManager | undefined
### maxTransactionGasLimit
```solidity
function maxTransactionGasLimit() external view returns (uint256)
```
......@@ -510,251 +310,149 @@ function maxTransactionGasLimit() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### resolve
```solidity
function resolve(string _name) external view returns (address)
```
Resolves the address associated with a given name.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | Name to resolve an address for.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address associated with the given name.
### setGasParams
```solidity
function setGasParams(uint256 _l2GasDiscountDivisor, uint256 _enqueueGasCost) external nonpayable
```
Allows the Burn Admin to update the parameters which determine the amount of gas to burn. The value of enqueueL2GasPrepaid is immediately updated as well.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l2GasDiscountDivisor | uint256 | undefined
| _enqueueGasCost | uint256 | undefined
## Events
### L2GasParamsUpdated
```solidity
event L2GasParamsUpdated(uint256 l2GasDiscountDivisor, uint256 enqueueGasCost, uint256 enqueueL2GasPrepaid)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| l2GasDiscountDivisor | uint256 | undefined |
| enqueueGasCost | uint256 | undefined |
| enqueueL2GasPrepaid | uint256 | undefined |
### QueueBatchAppended
```solidity
event QueueBatchAppended(uint256 _startingQueueIndex, uint256 _numQueueElements, uint256 _totalElements)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _startingQueueIndex | uint256 | undefined |
| _numQueueElements | uint256 | undefined |
| _totalElements | uint256 | undefined |
### SequencerBatchAppended
```solidity
event SequencerBatchAppended(uint256 _startingQueueIndex, uint256 _numQueueElements, uint256 _totalElements)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _startingQueueIndex | uint256 | undefined |
| _numQueueElements | uint256 | undefined |
| _totalElements | uint256 | undefined |
### TransactionBatchAppended
```solidity
event TransactionBatchAppended(uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _batchIndex `indexed` | uint256 | undefined |
| _batchRoot | bytes32 | undefined |
| _batchSize | uint256 | undefined |
| _prevTotalElements | uint256 | undefined |
| _extraData | bytes | undefined |
### TransactionEnqueued
```solidity
event TransactionEnqueued(address indexed _l1TxOrigin, address indexed _target, uint256 _gasLimit, bytes _data, uint256 indexed _queueIndex, uint256 _timestamp)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1TxOrigin `indexed` | address | undefined |
| _target `indexed` | address | undefined |
| _gasLimit | uint256 | undefined |
| _data | bytes | undefined |
| _queueIndex `indexed` | uint256 | undefined |
| _timestamp | uint256 | undefined |
......@@ -2,63 +2,21 @@
> ChainStorageContainer
*The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain*
## Methods
### deleteElementsAfterInclusive
```solidity
function deleteElementsAfterInclusive(uint256 _index, bytes27 _globalMetadata) external nonpayable
```
Removes all objects after and including a given index. Also allows setting the global metadata field.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _index | uint256 | Object index to delete from.
| _globalMetadata | bytes27 | New global metadata for the container.
### deleteElementsAfterInclusive
```solidity
function deleteElementsAfterInclusive(uint256 _index) external nonpayable
```
Removes all objects after and including a given index.
Removes all objects after and including a given index. Also allows setting the global metadata field.
......@@ -66,57 +24,34 @@ Removes all objects after and including a given index.
| Name | Type | Description |
|---|---|---|
| _index | uint256 | Object index to delete from.
### get
```solidity
function get(uint256 _index) external view returns (bytes32)
```
Retrieves an object from the container.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _index | uint256 | Index of the particular object to access.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | 32 byte object value.
### getGlobalMetadata
```solidity
function getGlobalMetadata() external view returns (bytes27)
```
Retrieves the container's global metadata field.
......@@ -124,27 +59,16 @@ Retrieves the container's global metadata field.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes27 | Container global metadata field.
### length
```solidity
function length() external view returns (uint256)
```
Retrieves the number of objects stored in the container.
......@@ -152,27 +76,16 @@ Retrieves the number of objects stored in the container.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | Number of objects in the container.
### libAddressManager
```solidity
function libAddressManager() external view returns (contract Lib_AddressManager)
```
......@@ -180,27 +93,16 @@ function libAddressManager() external view returns (contract Lib_AddressManager)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract Lib_AddressManager | undefined
### owner
```solidity
function owner() external view returns (string)
```
......@@ -208,63 +110,19 @@ function owner() external view returns (string)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined
### push
```solidity
function push(bytes32 _object, bytes27 _globalMetadata) external nonpayable
```
Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the "length" storage slot anyway, which also contains the global metadata (it's an optimization).
#### Parameters
| Name | Type | Description |
|---|---|---|
| _object | bytes32 | A 32 byte value to insert into the container.
| _globalMetadata | bytes27 | New global metadata for the container.
### push
```solidity
function push(bytes32 _object) external nonpayable
```
Pushes an object into the container.
Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the "length" storage slot anyway, which also contains the global metadata (it's an optimization).
......@@ -272,81 +130,46 @@ Pushes an object into the container.
| Name | Type | Description |
|---|---|---|
| _object | bytes32 | A 32 byte value to insert into the container.
### resolve
```solidity
function resolve(string _name) external view returns (address)
```
Resolves the address associated with a given name.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | Name to resolve an address for.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address associated with the given name.
### setGlobalMetadata
```solidity
function setGlobalMetadata(bytes27 _globalMetadata) external nonpayable
```
Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _globalMetadata | bytes27 | New global metadata to set.
......@@ -2,27 +2,18 @@
> ChugSplashDictator
*Like the AddressDictator, but specifically for the Proxy__OVM_L1StandardBridge. We're working on a generalized version of this but this is good enough for the moment.*
## Methods
### bridgeSlotKey
```solidity
function bridgeSlotKey() external view returns (bytes32)
```
......@@ -30,27 +21,16 @@ function bridgeSlotKey() external view returns (bytes32)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
### bridgeSlotVal
```solidity
function bridgeSlotVal() external view returns (bytes32)
```
......@@ -58,27 +38,16 @@ function bridgeSlotVal() external view returns (bytes32)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
### codeHash
```solidity
function codeHash() external view returns (bytes32)
```
......@@ -86,54 +55,32 @@ function codeHash() external view returns (bytes32)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
### doActions
```solidity
function doActions(bytes _code) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _code | bytes | undefined
### finalOwner
```solidity
function finalOwner() external view returns (address)
```
......@@ -141,27 +88,16 @@ function finalOwner() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### isUpgrading
```solidity
function isUpgrading() external view returns (bool)
```
......@@ -169,27 +105,16 @@ function isUpgrading() external view returns (bool)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### messengerSlotKey
```solidity
function messengerSlotKey() external view returns (bytes32)
```
......@@ -197,27 +122,16 @@ function messengerSlotKey() external view returns (bytes32)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
### messengerSlotVal
```solidity
function messengerSlotVal() external view returns (bytes32)
```
......@@ -225,27 +139,16 @@ function messengerSlotVal() external view returns (bytes32)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
### returnOwnership
```solidity
function returnOwnership() external nonpayable
```
Transfers ownership of this contract to the finalOwner. Only callable by the finalOwner, which is intended to be our multisig. This function shouldn't be necessary, but it gives a sense of reassurance that we can recover if something really surprising goes wrong.
......@@ -253,17 +156,10 @@ Transfers ownership of this contract to the finalOwner. Only callable by the fin
### target
```solidity
function target() external view returns (contract L1ChugSplashProxy)
```
......@@ -271,24 +167,12 @@ function target() external view returns (contract L1ChugSplashProxy)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract L1ChugSplashProxy | undefined
......@@ -6,15 +6,7 @@
*Provides information about the current execution context, including the sender of the transaction and its data. While these are generally available via msg.sender and msg.data, they should not be accessed in such a direct manner, since when dealing with meta-transactions the account sending and paying for execution may not be the actual sender (as far as an application is concerned). This contract is only required for intermediate, library-like contracts.*
......@@ -6,15 +6,7 @@
*Provides information about the current execution context, including the sender of the transaction and its data. While these are generally available via msg.sender and msg.data, they should not be accessed in such a direct manner, since when dealing with meta-transactions the account sending and paying for execution may not be the actual sender (as far as an application is concerned). This contract is only required for intermediate, library-like contracts.*
......@@ -2,27 +2,18 @@
> CrossDomainEnabled
*Helper contract for contracts performing cross-domain communications Compiler used: defined by inheriting contract*
## Methods
### messenger
```solidity
function messenger() external view returns (address)
```
......@@ -30,24 +21,12 @@ function messenger() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
......@@ -6,15 +6,7 @@
*Library used to query support of an interface declared via {IERC165}. Note that these functions return the actual result of the query: they do not `revert` if an interface is not supported. It is up to the caller to decide what to do in these cases.*
......@@ -6,475 +6,278 @@
*Implementation of the {IERC20} interface. This implementation is agnostic to the way tokens are created. This means that a supply mechanism has to be added in a derived contract using {_mint}. For a generic mechanism see {ERC20PresetMinterPauser}. TIP: For a detailed writeup see our guide https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How to implement supply mechanisms]. We have followed general OpenZeppelin Contracts guidelines: functions revert instead returning `false` on failure. This behavior is nonetheless conventional and does not conflict with the expectations of ERC20 applications. Additionally, an {Approval} event is emitted on calls to {transferFrom}. This allows applications to reconstruct the allowance for all accounts just by listening to said events. Other implementations of the EIP may not emit these events, as it isn't required by the specification. Finally, the non-standard {decreaseAllowance} and {increaseAllowance} functions have been added to mitigate the well-known issues around setting allowances. See {IERC20-approve}.*
## Methods
### allowance
```solidity
function allowance(address owner, address spender) external view returns (uint256)
```
*See {IERC20-allowance}.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | undefined
| spender | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### approve
```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```
*See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### balanceOf
```solidity
function balanceOf(address account) external view returns (uint256)
```
*See {IERC20-balanceOf}.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### decimals
```solidity
function decimals() external view returns (uint8)
```
*Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint8 | undefined
### decreaseAllowance
```solidity
function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool)
```
*Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| subtractedValue | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### increaseAllowance
```solidity
function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool)
```
*Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| addedValue | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### name
```solidity
function name() external view returns (string)
```
*Returns the name of the token.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined
### symbol
```solidity
function symbol() external view returns (string)
```
*Returns the symbol of the token, usually a shorter version of the name.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined
### totalSupply
```solidity
function totalSupply() external view returns (uint256)
```
*See {IERC20-totalSupply}.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### transfer
```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```
*See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### transferFrom
```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```
*See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for ``sender``'s tokens of at least `amount`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| sender | address | undefined
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
## Events
### Approval
```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner `indexed` | address | undefined |
| spender `indexed` | address | undefined |
| value | uint256 | undefined |
### Transfer
```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| from `indexed` | address | undefined |
| to `indexed` | address | undefined |
| value | uint256 | undefined |
......@@ -2,61 +2,36 @@
> IBondManager
## Methods
### isCollateralized
```solidity
function isCollateralized(address _who) external view returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _who | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
......@@ -2,45 +2,29 @@
> ICanonicalTransactionChain
## Methods
### appendSequencerBatch
```solidity
function appendSequencerBatch() external nonpayable
```
Allows the sequencer to append a batch of transactions.
*This function uses a custom encoding scheme for efficiency reasons. .param _shouldStartAtElement Specific batch we expect to start appending to. .param _totalElementsToAppend Total number of batch elements we expect to append. .param _contexts Array of batch contexts. .param _transactionDataFields Array of raw transaction data.*
### batches
```solidity
function batches() external view returns (contract IChainStorageContainer)
```
Accesses the batch storage container.
......@@ -48,60 +32,34 @@ Accesses the batch storage container.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract IChainStorageContainer | Reference to the batch storage container.
### enqueue
```solidity
function enqueue(address _target, uint256 _gasLimit, bytes _data) external nonpayable
```
Adds a transaction to the queue.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _target | address | Target contract to send the transaction to.
| _gasLimit | uint256 | Gas limit for the given transaction.
| _data | bytes | Transaction data.
### getLastBlockNumber
```solidity
function getLastBlockNumber() external view returns (uint40)
```
Returns the blocknumber of the last transaction.
......@@ -109,27 +67,16 @@ Returns the blocknumber of the last transaction.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint40 | Blocknumber for the last transaction.
### getLastTimestamp
```solidity
function getLastTimestamp() external view returns (uint40)
```
Returns the timestamp of the last transaction.
......@@ -137,27 +84,16 @@ Returns the timestamp of the last transaction.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint40 | Timestamp for the last transaction.
### getNextQueueIndex
```solidity
function getNextQueueIndex() external view returns (uint40)
```
Returns the index of the next element to be enqueued.
......@@ -165,27 +101,16 @@ Returns the index of the next element to be enqueued.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint40 | Index for the next queue element.
### getNumPendingQueueElements
```solidity
function getNumPendingQueueElements() external view returns (uint40)
```
Get the number of queue elements which have not yet been included.
......@@ -193,64 +118,38 @@ Get the number of queue elements which have not yet been included.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint40 | Number of pending queue elements.
### getQueueElement
```solidity
function getQueueElement(uint256 _index) external view returns (struct Lib_OVMCodec.QueueElement _element)
```
Gets the queue element at a particular index.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _index | uint256 | Index of the queue element to access.
#### Returns
| Name | Type | Description |
|---|---|---|
| _element | Lib_OVMCodec.QueueElement | Queue element at the given index.
### getQueueLength
```solidity
function getQueueLength() external view returns (uint40)
```
Retrieves the length of the queue, including both pending and canonical transactions.
......@@ -258,27 +157,16 @@ Retrieves the length of the queue, including both pending and canonical transact
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint40 | Length of the queue.
### getTotalBatches
```solidity
function getTotalBatches() external view returns (uint256 _totalBatches)
```
Retrieves the total number of batches submitted.
......@@ -286,27 +174,16 @@ Retrieves the total number of batches submitted.
#### Returns
| Name | Type | Description |
|---|---|---|
| _totalBatches | uint256 | Total submitted batches.
### getTotalElements
```solidity
function getTotalElements() external view returns (uint256 _totalElements)
```
Retrieves the total number of elements submitted.
......@@ -314,214 +191,127 @@ Retrieves the total number of elements submitted.
#### Returns
| Name | Type | Description |
|---|---|---|
| _totalElements | uint256 | Total submitted elements.
### setGasParams
```solidity
function setGasParams(uint256 _l2GasDiscountDivisor, uint256 _enqueueGasCost) external nonpayable
```
Allows the Burn Admin to update the parameters which determine the amount of gas to burn. The value of enqueueL2GasPrepaid is immediately updated as well.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l2GasDiscountDivisor | uint256 | undefined
| _enqueueGasCost | uint256 | undefined
## Events
### L2GasParamsUpdated
```solidity
event L2GasParamsUpdated(uint256 l2GasDiscountDivisor, uint256 enqueueGasCost, uint256 enqueueL2GasPrepaid)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| l2GasDiscountDivisor | uint256 | undefined |
| enqueueGasCost | uint256 | undefined |
| enqueueL2GasPrepaid | uint256 | undefined |
### QueueBatchAppended
```solidity
event QueueBatchAppended(uint256 _startingQueueIndex, uint256 _numQueueElements, uint256 _totalElements)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _startingQueueIndex | uint256 | undefined |
| _numQueueElements | uint256 | undefined |
| _totalElements | uint256 | undefined |
### SequencerBatchAppended
```solidity
event SequencerBatchAppended(uint256 _startingQueueIndex, uint256 _numQueueElements, uint256 _totalElements)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _startingQueueIndex | uint256 | undefined |
| _numQueueElements | uint256 | undefined |
| _totalElements | uint256 | undefined |
### TransactionBatchAppended
```solidity
event TransactionBatchAppended(uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _batchIndex `indexed` | uint256 | undefined |
| _batchRoot | bytes32 | undefined |
| _batchSize | uint256 | undefined |
| _prevTotalElements | uint256 | undefined |
| _extraData | bytes | undefined |
### TransactionEnqueued
```solidity
event TransactionEnqueued(address indexed _l1TxOrigin, address indexed _target, uint256 _gasLimit, bytes _data, uint256 indexed _queueIndex, uint256 _timestamp)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1TxOrigin `indexed` | address | undefined |
| _target `indexed` | address | undefined |
| _gasLimit | uint256 | undefined |
| _data | bytes | undefined |
| _queueIndex `indexed` | uint256 | undefined |
| _timestamp | uint256 | undefined |
......@@ -2,63 +2,21 @@
> IChainStorageContainer
## Methods
### deleteElementsAfterInclusive
```solidity
function deleteElementsAfterInclusive(uint256 _index, bytes27 _globalMetadata) external nonpayable
```
Removes all objects after and including a given index. Also allows setting the global metadata field.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _index | uint256 | Object index to delete from.
| _globalMetadata | bytes27 | New global metadata for the container.
### deleteElementsAfterInclusive
```solidity
function deleteElementsAfterInclusive(uint256 _index) external nonpayable
```
Removes all objects after and including a given index.
Removes all objects after and including a given index. Also allows setting the global metadata field.
......@@ -66,57 +24,34 @@ Removes all objects after and including a given index.
| Name | Type | Description |
|---|---|---|
| _index | uint256 | Object index to delete from.
### get
```solidity
function get(uint256 _index) external view returns (bytes32)
```
Retrieves an object from the container.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _index | uint256 | Index of the particular object to access.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | 32 byte object value.
### getGlobalMetadata
```solidity
function getGlobalMetadata() external view returns (bytes27)
```
Retrieves the container's global metadata field.
......@@ -124,27 +59,16 @@ Retrieves the container's global metadata field.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes27 | Container global metadata field.
### length
```solidity
function length() external view returns (uint256)
```
Retrieves the number of objects stored in the container.
......@@ -152,63 +76,19 @@ Retrieves the number of objects stored in the container.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | Number of objects in the container.
### push
```solidity
function push(bytes32 _object, bytes27 _globalMetadata) external nonpayable
```
Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the "length" storage slot anyway, which also contains the global metadata (it's an optimization).
#### Parameters
| Name | Type | Description |
|---|---|---|
| _object | bytes32 | A 32 byte value to insert into the container.
| _globalMetadata | bytes27 | New global metadata for the container.
### push
```solidity
function push(bytes32 _object) external nonpayable
```
Pushes an object into the container.
Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the "length" storage slot anyway, which also contains the global metadata (it's an optimization).
......@@ -216,44 +96,24 @@ Pushes an object into the container.
| Name | Type | Description |
|---|---|---|
| _object | bytes32 | A 32 byte value to insert into the container.
### setGlobalMetadata
```solidity
function setGlobalMetadata(bytes27 _globalMetadata) external nonpayable
```
Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _globalMetadata | bytes27 | New global metadata to set.
......@@ -2,60 +2,36 @@
> ICrossDomainMessenger
## Methods
### sendMessage
```solidity
function sendMessage(address _target, bytes _message, uint32 _gasLimit) external nonpayable
```
Sends a cross domain message to the target messenger.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _target | address | Target contract address.
| _message | bytes | Message to send to the target.
| _gasLimit | uint32 | Gas limit for the provided message.
### xDomainMessageSender
```solidity
function xDomainMessageSender() external view returns (address)
```
......@@ -63,112 +39,67 @@ function xDomainMessageSender() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
## Events
### FailedRelayedMessage
```solidity
event FailedRelayedMessage(bytes32 indexed msgHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| msgHash `indexed` | bytes32 | undefined |
### RelayedMessage
```solidity
event RelayedMessage(bytes32 indexed msgHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| msgHash `indexed` | bytes32 | undefined |
### SentMessage
```solidity
event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| target `indexed` | address | undefined |
| sender | address | undefined |
| message | bytes | undefined |
| messageNonce | uint256 | undefined |
| gasLimit | uint256 | undefined |
......@@ -6,57 +6,32 @@
*Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.*
## Methods
### supportsInterface
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool)
```
*Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| interfaceId | bytes4 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
......@@ -6,311 +6,181 @@
*Interface of the ERC20 standard as defined in the EIP.*
## Methods
### allowance
```solidity
function allowance(address owner, address spender) external view returns (uint256)
```
*Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | undefined
| spender | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### approve
```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```
*Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### balanceOf
```solidity
function balanceOf(address account) external view returns (uint256)
```
*Returns the amount of tokens owned by `account`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### totalSupply
```solidity
function totalSupply() external view returns (uint256)
```
*Returns the amount of tokens in existence.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### transfer
```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```
*Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### transferFrom
```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```
*Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| sender | address | undefined
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
## Events
### Approval
```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```
*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner `indexed` | address | undefined |
| spender `indexed` | address | undefined |
| value | uint256 | undefined |
### Transfer
```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```
*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| from `indexed` | address | undefined |
| to `indexed` | address | undefined |
| value | uint256 | undefined |
......@@ -6,395 +6,232 @@
*Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._*
## Methods
### allowance
```solidity
function allowance(address owner, address spender) external view returns (uint256)
```
*Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | undefined
| spender | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### approve
```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```
*Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### balanceOf
```solidity
function balanceOf(address account) external view returns (uint256)
```
*Returns the amount of tokens owned by `account`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### decimals
```solidity
function decimals() external view returns (uint8)
```
*Returns the decimals places of the token.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint8 | undefined
### name
```solidity
function name() external view returns (string)
```
*Returns the name of the token.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined
### symbol
```solidity
function symbol() external view returns (string)
```
*Returns the symbol of the token.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined
### totalSupply
```solidity
function totalSupply() external view returns (uint256)
```
*Returns the amount of tokens in existence.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### transfer
```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```
*Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### transferFrom
```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```
*Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| sender | address | undefined
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
## Events
### Approval
```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner `indexed` | address | undefined |
| spender `indexed` | address | undefined |
| value | uint256 | undefined |
### Transfer
```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| from `indexed` | address | undefined |
| to `indexed` | address | undefined |
| value | uint256 | undefined |
......@@ -2,33 +2,21 @@
> IL1CrossDomainMessenger
## Methods
### relayMessage
```solidity
function relayMessage(address _target, address _sender, bytes _message, uint256 _messageNonce, IL1CrossDomainMessenger.L2MessageInclusionProof _proof) external nonpayable
```
Relays a cross domain message to a contract.
......@@ -36,107 +24,55 @@ function relayMessage(address _target, address _sender, bytes _message, uint256
| Name | Type | Description |
|---|---|---|
| _target | address | undefined
| _sender | address | undefined
| _message | bytes | undefined
| _messageNonce | uint256 | undefined
| _proof | IL1CrossDomainMessenger.L2MessageInclusionProof | undefined
| _target | address | Target contract address.
| _sender | address | Message sender address.
| _message | bytes | Message to send to the target.
| _messageNonce | uint256 | Nonce for the provided message.
| _proof | IL1CrossDomainMessenger.L2MessageInclusionProof | Inclusion proof for the given message.
### replayMessage
```solidity
function replayMessage(address _target, address _sender, bytes _message, uint256 _queueIndex, uint32 _oldGasLimit, uint32 _newGasLimit) external nonpayable
```
Replays a cross domain message to the target messenger.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _target | address | Target contract address.
| _sender | address | Original sender address.
| _message | bytes | Message to send to the target.
| _queueIndex | uint256 | CTC Queue index for the message to replay.
| _oldGasLimit | uint32 | Original gas limit used to send the message.
| _newGasLimit | uint32 | New gas limit to be used for this message.
### sendMessage
```solidity
function sendMessage(address _target, bytes _message, uint32 _gasLimit) external nonpayable
```
Sends a cross domain message to the target messenger.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _target | address | Target contract address.
| _message | bytes | Message to send to the target.
| _gasLimit | uint32 | Gas limit for the provided message.
### xDomainMessageSender
```solidity
function xDomainMessageSender() external view returns (address)
```
......@@ -144,112 +80,67 @@ function xDomainMessageSender() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
## Events
### FailedRelayedMessage
```solidity
event FailedRelayedMessage(bytes32 indexed msgHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| msgHash `indexed` | bytes32 | undefined |
### RelayedMessage
```solidity
event RelayedMessage(bytes32 indexed msgHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| msgHash `indexed` | bytes32 | undefined |
### SentMessage
```solidity
event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| target `indexed` | address | undefined |
| sender | address | undefined |
| message | bytes | undefined |
| messageNonce | uint256 | undefined |
| gasLimit | uint256 | undefined |
......@@ -2,250 +2,138 @@
> IL1ERC20Bridge
## Methods
### depositERC20
```solidity
function depositERC20(address _l1Token, address _l2Token, uint256 _amount, uint32 _l2Gas, bytes _data) external nonpayable
```
*deposit an amount of the ERC20 to the caller's balance on L2.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address of the L1 ERC20 we are depositing
| _l2Token | address | Address of the L1 respective L2 ERC20
| _amount | uint256 | Amount of the ERC20 to deposit
| _l2Gas | uint32 | Gas limit required to complete the deposit on L2.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### depositERC20To
```solidity
function depositERC20To(address _l1Token, address _l2Token, address _to, uint256 _amount, uint32 _l2Gas, bytes _data) external nonpayable
```
*deposit an amount of ERC20 to a recipient's balance on L2.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address of the L1 ERC20 we are depositing
| _l2Token | address | Address of the L1 respective L2 ERC20
| _to | address | L2 address to credit the withdrawal to.
| _amount | uint256 | Amount of the ERC20 to deposit.
| _l2Gas | uint32 | Gas limit required to complete the deposit on L2.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### finalizeERC20Withdrawal
```solidity
function finalizeERC20Withdrawal(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _data) external nonpayable
```
*Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the L1 ERC20 token. This call will fail if the initialized withdrawal from L2 has not been finalized.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address of L1 token to finalizeWithdrawal for.
| _l2Token | address | Address of L2 token where withdrawal was initiated.
| _from | address | L2 address initiating the transfer.
| _to | address | L1 address to credit the withdrawal to.
| _amount | uint256 | Amount of the ERC20 to deposit.
| _data | bytes | Data provided by the sender on L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### l2TokenBridge
```solidity
function l2TokenBridge() external nonpayable returns (address)
```
*get the address of the corresponding L2 bridge contract.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address of the corresponding L2 bridge contract.
## Events
### ERC20DepositInitiated
```solidity
event ERC20DepositInitiated(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
### ERC20WithdrawalFinalized
```solidity
event ERC20WithdrawalFinalized(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
......@@ -2,411 +2,230 @@
> IL1StandardBridge
## Methods
### depositERC20
```solidity
function depositERC20(address _l1Token, address _l2Token, uint256 _amount, uint32 _l2Gas, bytes _data) external nonpayable
```
*deposit an amount of the ERC20 to the caller's balance on L2.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address of the L1 ERC20 we are depositing
| _l2Token | address | Address of the L1 respective L2 ERC20
| _amount | uint256 | Amount of the ERC20 to deposit
| _l2Gas | uint32 | Gas limit required to complete the deposit on L2.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### depositERC20To
```solidity
function depositERC20To(address _l1Token, address _l2Token, address _to, uint256 _amount, uint32 _l2Gas, bytes _data) external nonpayable
```
*deposit an amount of ERC20 to a recipient's balance on L2.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address of the L1 ERC20 we are depositing
| _l2Token | address | Address of the L1 respective L2 ERC20
| _to | address | L2 address to credit the withdrawal to.
| _amount | uint256 | Amount of the ERC20 to deposit.
| _l2Gas | uint32 | Gas limit required to complete the deposit on L2.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### depositETH
```solidity
function depositETH(uint32 _l2Gas, bytes _data) external payable
```
*Deposit an amount of the ETH to the caller's balance on L2.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l2Gas | uint32 | Gas limit required to complete the deposit on L2.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### depositETHTo
```solidity
function depositETHTo(address _to, uint32 _l2Gas, bytes _data) external payable
```
*Deposit an amount of ETH to a recipient's balance on L2.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | L2 address to credit the withdrawal to.
| _l2Gas | uint32 | Gas limit required to complete the deposit on L2.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### finalizeERC20Withdrawal
```solidity
function finalizeERC20Withdrawal(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _data) external nonpayable
```
*Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the L1 ERC20 token. This call will fail if the initialized withdrawal from L2 has not been finalized.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address of L1 token to finalizeWithdrawal for.
| _l2Token | address | Address of L2 token where withdrawal was initiated.
| _from | address | L2 address initiating the transfer.
| _to | address | L1 address to credit the withdrawal to.
| _amount | uint256 | Amount of the ERC20 to deposit.
| _data | bytes | Data provided by the sender on L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### finalizeETHWithdrawal
```solidity
function finalizeETHWithdrawal(address _from, address _to, uint256 _amount, bytes _data) external nonpayable
```
*Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the L1 ETH token. Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _from | address | L2 address initiating the transfer.
| _to | address | L1 address to credit the withdrawal to.
| _amount | uint256 | Amount of the ERC20 to deposit.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### l2TokenBridge
```solidity
function l2TokenBridge() external nonpayable returns (address)
```
*get the address of the corresponding L2 bridge contract.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address of the corresponding L2 bridge contract.
## Events
### ERC20DepositInitiated
```solidity
event ERC20DepositInitiated(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
### ERC20WithdrawalFinalized
```solidity
event ERC20WithdrawalFinalized(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
### ETHDepositInitiated
```solidity
event ETHDepositInitiated(address indexed _from, address indexed _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _from `indexed` | address | undefined |
| _to `indexed` | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
### ETHWithdrawalFinalized
```solidity
event ETHWithdrawalFinalized(address indexed _from, address indexed _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _from `indexed` | address | undefined |
| _to `indexed` | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
......@@ -2,96 +2,55 @@
> IL2CrossDomainMessenger
## Methods
### relayMessage
```solidity
function relayMessage(address _target, address _sender, bytes _message, uint256 _messageNonce) external nonpayable
```
Relays a cross domain message to a contract.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _target | address | Target contract address.
| _sender | address | Message sender address.
| _message | bytes | Message to send to the target.
| _messageNonce | uint256 | Nonce for the provided message.
### sendMessage
```solidity
function sendMessage(address _target, bytes _message, uint32 _gasLimit) external nonpayable
```
Sends a cross domain message to the target messenger.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _target | address | Target contract address.
| _message | bytes | Message to send to the target.
| _gasLimit | uint32 | Gas limit for the provided message.
### xDomainMessageSender
```solidity
function xDomainMessageSender() external view returns (address)
```
......@@ -99,112 +58,67 @@ function xDomainMessageSender() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
## Events
### FailedRelayedMessage
```solidity
event FailedRelayedMessage(bytes32 indexed msgHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| msgHash `indexed` | bytes32 | undefined |
### RelayedMessage
```solidity
event RelayedMessage(bytes32 indexed msgHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| msgHash `indexed` | bytes32 | undefined |
### SentMessage
```solidity
event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| target `indexed` | address | undefined |
| sender | address | undefined |
| message | bytes | undefined |
| messageNonce | uint256 | undefined |
| gasLimit | uint256 | undefined |
......@@ -2,279 +2,157 @@
> IL2ERC20Bridge
## Methods
### finalizeDeposit
```solidity
function finalizeDeposit(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _data) external nonpayable
```
*Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this L2 token. This call will fail if it did not originate from a corresponding deposit in L1StandardTokenBridge.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address for the l1 token this is called with
| _l2Token | address | Address for the l2 token this is called with
| _from | address | Account to pull the deposit from on L2.
| _to | address | Address to receive the withdrawal at
| _amount | uint256 | Amount of the token to withdraw
| _data | bytes | Data provider by the sender on L1. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### l1TokenBridge
```solidity
function l1TokenBridge() external nonpayable returns (address)
```
*get the address of the corresponding L1 bridge contract.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address of the corresponding L1 bridge contract.
### withdraw
```solidity
function withdraw(address _l2Token, uint256 _amount, uint32 _l1Gas, bytes _data) external nonpayable
```
*initiate a withdraw of some tokens to the caller's account on L1*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l2Token | address | Address of L2 token where withdrawal was initiated.
| _amount | uint256 | Amount of the token to withdraw. param _l1Gas Unused, but included for potential forward compatibility considerations.
| _l1Gas | uint32 | undefined
| _data | bytes | Optional data to forward to L1. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### withdrawTo
```solidity
function withdrawTo(address _l2Token, address _to, uint256 _amount, uint32 _l1Gas, bytes _data) external nonpayable
```
*initiate a withdraw of some token to a recipient's account on L1.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l2Token | address | Address of L2 token where withdrawal is initiated.
| _to | address | L1 adress to credit the withdrawal to.
| _amount | uint256 | Amount of the token to withdraw. param _l1Gas Unused, but included for potential forward compatibility considerations.
| _l1Gas | uint32 | undefined
| _data | bytes | Optional data to forward to L1. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
## Events
### DepositFailed
```solidity
event DepositFailed(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
### DepositFinalized
```solidity
event DepositFinalized(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
### WithdrawalInitiated
```solidity
event WithdrawalInitiated(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
......@@ -8,168 +8,97 @@
## Methods
### allowance
```solidity
function allowance(address owner, address spender) external view returns (uint256)
```
*Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | undefined
| spender | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### approve
```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```
*Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### balanceOf
```solidity
function balanceOf(address account) external view returns (uint256)
```
*Returns the amount of tokens owned by `account`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### burn
```solidity
function burn(address _from, uint256 _amount) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _from | address | undefined
| _amount | uint256 | undefined
### l1Token
```solidity
function l1Token() external nonpayable returns (address)
```
......@@ -177,319 +106,188 @@ function l1Token() external nonpayable returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### mint
```solidity
function mint(address _to, uint256 _amount) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | undefined
| _amount | uint256 | undefined
### supportsInterface
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool)
```
*Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| interfaceId | bytes4 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### totalSupply
```solidity
function totalSupply() external view returns (uint256)
```
*Returns the amount of tokens in existence.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### transfer
```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```
*Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### transferFrom
```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```
*Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| sender | address | undefined
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
## Events
### Approval
```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner `indexed` | address | undefined |
| spender `indexed` | address | undefined |
| value | uint256 | undefined |
### Burn
```solidity
event Burn(address indexed _account, uint256 _amount)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _account `indexed` | address | undefined |
| _amount | uint256 | undefined |
### Mint
```solidity
event Mint(address indexed _account, uint256 _amount)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _account `indexed` | address | undefined |
| _amount | uint256 | undefined |
### Transfer
```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| from `indexed` | address | undefined |
| to `indexed` | address | undefined |
| value | uint256 | undefined |
......@@ -2,63 +2,38 @@
> IStateCommitmentChain
## Methods
### appendStateBatch
```solidity
function appendStateBatch(bytes32[] _batch, uint256 _shouldStartAtElement) external nonpayable
```
Appends a batch of state roots to the chain.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _batch | bytes32[] | Batch of state roots.
| _shouldStartAtElement | uint256 | Index of the element at which this batch should start.
### deleteStateBatch
```solidity
function deleteStateBatch(Lib_OVMCodec.ChainBatchHeader _batchHeader) external nonpayable
```
Deletes all state roots after (and including) a given batch.
......@@ -66,20 +41,12 @@ function deleteStateBatch(Lib_OVMCodec.ChainBatchHeader _batchHeader) external n
| Name | Type | Description |
|---|---|---|
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | undefined
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | Header of the batch to start deleting from.
### getLastSequencerTimestamp
```solidity
function getLastSequencerTimestamp() external view returns (uint256 _lastSequencerTimestamp)
```
Retrieves the timestamp of the last batch submitted by the sequencer.
......@@ -87,27 +54,16 @@ Retrieves the timestamp of the last batch submitted by the sequencer.
#### Returns
| Name | Type | Description |
|---|---|---|
| _lastSequencerTimestamp | uint256 | Last sequencer batch timestamp.
### getTotalBatches
```solidity
function getTotalBatches() external view returns (uint256 _totalBatches)
```
Retrieves the total number of batches submitted.
......@@ -115,27 +71,16 @@ Retrieves the total number of batches submitted.
#### Returns
| Name | Type | Description |
|---|---|---|
| _totalBatches | uint256 | Total submitted batches.
### getTotalElements
```solidity
function getTotalElements() external view returns (uint256 _totalElements)
```
Retrieves the total number of elements submitted.
......@@ -143,33 +88,19 @@ Retrieves the total number of elements submitted.
#### Returns
| Name | Type | Description |
|---|---|---|
| _totalElements | uint256 | Total submitted elements.
### insideFraudProofWindow
```solidity
function insideFraudProofWindow(Lib_OVMCodec.ChainBatchHeader _batchHeader) external view returns (bool _inside)
```
Checks whether a given batch is still inside its fraud proof window.
......@@ -177,36 +108,21 @@ function insideFraudProofWindow(Lib_OVMCodec.ChainBatchHeader _batchHeader) exte
| Name | Type | Description |
|---|---|---|
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | undefined
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | Header of the batch to check.
#### Returns
| Name | Type | Description |
|---|---|---|
| _inside | bool | undefined
| _inside | bool | Whether or not the batch is inside the fraud proof window.
### verifyStateCommitment
```solidity
function verifyStateCommitment(bytes32 _element, Lib_OVMCodec.ChainBatchHeader _batchHeader, Lib_OVMCodec.ChainInclusionProof _proof) external view returns (bool _verified)
```
Verifies a batch inclusion proof.
......@@ -214,98 +130,56 @@ function verifyStateCommitment(bytes32 _element, Lib_OVMCodec.ChainBatchHeader _
| Name | Type | Description |
|---|---|---|
| _element | bytes32 | undefined
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | undefined
| _proof | Lib_OVMCodec.ChainInclusionProof | undefined
| _element | bytes32 | Hash of the element to verify a proof for.
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | Header of the batch in which the element was included.
| _proof | Lib_OVMCodec.ChainInclusionProof | Merkle inclusion proof for the element.
#### Returns
| Name | Type | Description |
|---|---|---|
| _verified | bool | undefined
## Events
### StateBatchAppended
```solidity
event StateBatchAppended(uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _batchIndex `indexed` | uint256 | undefined |
| _batchRoot | bytes32 | undefined |
| _batchSize | uint256 | undefined |
| _prevTotalElements | uint256 | undefined |
| _extraData | bytes | undefined |
### StateBatchDeleted
```solidity
event StateBatchDeleted(uint256 indexed _batchIndex, bytes32 _batchRoot)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _batchIndex `indexed` | uint256 | undefined |
| _batchRoot | bytes32 | undefined |
......@@ -6,15 +6,7 @@
*This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.*
......@@ -2,27 +2,18 @@
> L1ChugSplashProxy
*Basic ChugSplash proxy contract for L1. Very close to being a normal proxy but has added functions `setCode` and `setStorage` for changing the code or storage of the contract. Nifty! Note for future developers: do NOT make anything in this contract 'public' unless you know what you're doing. Anything public can potentially have a function signature that conflicts with a signature attached to the implementation contract. Public functions SHOULD always have the 'proxyCallIfNotOwner' modifier unless there's some *really* good reason not to have that modifier. And there almost certainly is not a good reason to not have that modifier. Beware!*
## Methods
### getImplementation
```solidity
function getImplementation() external nonpayable returns (address)
```
Queries the implementation address. Can only be called by the owner OR by making an eth_call and setting the "from" address to address(0).
......@@ -30,27 +21,16 @@ Queries the implementation address. Can only be called by the owner OR by making
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Implementation address.
### getOwner
```solidity
function getOwner() external nonpayable returns (address)
```
Queries the owner of the proxy contract. Can only be called by the owner OR by making an eth_call and setting the "from" address to address(0).
......@@ -58,108 +38,61 @@ Queries the owner of the proxy contract. Can only be called by the owner OR by m
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Owner address.
### setCode
```solidity
function setCode(bytes _code) external nonpayable
```
Sets the code that should be running behind this proxy. Note that this scheme is a bit different from the standard proxy scheme where one would typically deploy the code separately and then set the implementation address. We're doing it this way because it gives us a lot more freedom on the client side. Can only be triggered by the contract owner.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _code | bytes | New contract code to run inside this contract.
### setOwner
```solidity
function setOwner(address _owner) external nonpayable
```
Changes the owner of the proxy contract. Only callable by the owner.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _owner | address | New owner of the proxy contract.
### setStorage
```solidity
function setStorage(bytes32 _key, bytes32 _value) external nonpayable
```
Modifies some storage slot within the proxy contract. Gives us a lot of power to perform upgrades in a more transparent way. Only callable by the owner.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _key | bytes32 | Storage key to modify.
| _value | bytes32 | New value for the storage key.
......@@ -2,145 +2,88 @@
> L1CrossDomainMessenger
*The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 epoch gas limit, it can be resubmitted via this contract's replay function.*
## Methods
### allowMessage
```solidity
function allowMessage(bytes32 _xDomainCalldataHash) external nonpayable
```
Allow a message.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _xDomainCalldataHash | bytes32 | Hash of the message to block.
### blockMessage
```solidity
function blockMessage(bytes32 _xDomainCalldataHash) external nonpayable
```
Block a message.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _xDomainCalldataHash | bytes32 | Hash of the message to block.
### blockedMessages
```solidity
function blockedMessages(bytes32) external view returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### initialize
```solidity
function initialize(address _libAddressManager) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _libAddressManager | address | Address of the Address Manager.
### libAddressManager
```solidity
function libAddressManager() external view returns (contract Lib_AddressManager)
```
......@@ -148,55 +91,33 @@ function libAddressManager() external view returns (contract Lib_AddressManager)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract Lib_AddressManager | undefined
### owner
```solidity
function owner() external view returns (address)
```
*Returns the address of the current owner.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### pause
```solidity
function pause() external nonpayable
```
Pause relaying.
......@@ -204,51 +125,30 @@ Pause relaying.
### paused
```solidity
function paused() external view returns (bool)
```
*Returns true if the contract is paused, and false otherwise.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### relayMessage
```solidity
function relayMessage(address _target, address _sender, bytes _message, uint256 _messageNonce, IL1CrossDomainMessenger.L2MessageInclusionProof _proof) external nonpayable
```
Relays a cross domain message to a contract.
......@@ -256,263 +156,148 @@ function relayMessage(address _target, address _sender, bytes _message, uint256
| Name | Type | Description |
|---|---|---|
| _target | address | undefined
| _sender | address | undefined
| _message | bytes | undefined
| _messageNonce | uint256 | undefined
| _proof | IL1CrossDomainMessenger.L2MessageInclusionProof | undefined
| _target | address | Target contract address.
| _sender | address | Message sender address.
| _message | bytes | Message to send to the target.
| _messageNonce | uint256 | Nonce for the provided message.
| _proof | IL1CrossDomainMessenger.L2MessageInclusionProof | Inclusion proof for the given message.
### relayedMessages
```solidity
function relayedMessages(bytes32) external view returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### renounceOwnership
```solidity
function renounceOwnership() external nonpayable
```
*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*
### replayMessage
```solidity
function replayMessage(address _target, address _sender, bytes _message, uint256 _queueIndex, uint32 _oldGasLimit, uint32 _newGasLimit) external nonpayable
```
Replays a cross domain message to the target messenger.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _target | address | Target contract address.
| _sender | address | Original sender address.
| _message | bytes | Message to send to the target.
| _queueIndex | uint256 | CTC Queue index for the message to replay.
| _oldGasLimit | uint32 | Original gas limit used to send the message.
| _newGasLimit | uint32 | New gas limit to be used for this message.
### resolve
```solidity
function resolve(string _name) external view returns (address)
```
Resolves the address associated with a given name.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | Name to resolve an address for.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address associated with the given name.
### sendMessage
```solidity
function sendMessage(address _target, bytes _message, uint32 _gasLimit) external nonpayable
```
Sends a cross domain message to the target messenger.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _target | address | Target contract address.
| _message | bytes | Message to send to the target.
| _gasLimit | uint32 | Gas limit for the provided message.
### successfulMessages
```solidity
function successfulMessages(bytes32) external view returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### transferOwnership
```solidity
function transferOwnership(address newOwner) external nonpayable
```
*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| newOwner | address | undefined
### xDomainMessageSender
```solidity
function xDomainMessageSender() external view returns (address)
```
......@@ -520,239 +305,148 @@ function xDomainMessageSender() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
## Events
### FailedRelayedMessage
```solidity
event FailedRelayedMessage(bytes32 indexed msgHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| msgHash `indexed` | bytes32 | undefined |
### MessageAllowed
```solidity
event MessageAllowed(bytes32 indexed _xDomainCalldataHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _xDomainCalldataHash `indexed` | bytes32 | undefined |
### MessageBlocked
```solidity
event MessageBlocked(bytes32 indexed _xDomainCalldataHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _xDomainCalldataHash `indexed` | bytes32 | undefined |
### OwnershipTransferred
```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| previousOwner `indexed` | address | undefined |
| newOwner `indexed` | address | undefined |
### Paused
```solidity
event Paused(address account)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined |
### RelayedMessage
```solidity
event RelayedMessage(bytes32 indexed msgHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| msgHash `indexed` | bytes32 | undefined |
### SentMessage
```solidity
event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| target `indexed` | address | undefined |
| sender | address | undefined |
| message | bytes | undefined |
| messageNonce | uint256 | undefined |
| gasLimit | uint256 | undefined |
### Unpaused
```solidity
event Unpaused(address account)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined |
......@@ -2,365 +2,202 @@
> L1StandardBridge
*The L1 ETH and ERC20 Bridge is a contract which stores deposited L1 funds and standard tokens that are in use on L2. It synchronizes a corresponding L2 Bridge, informing it of deposits and listening to it for newly finalized withdrawals.*
## Methods
### depositERC20
```solidity
function depositERC20(address _l1Token, address _l2Token, uint256 _amount, uint32 _l2Gas, bytes _data) external nonpayable
```
*deposit an amount of the ERC20 to the caller's balance on L2.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address of the L1 ERC20 we are depositing
| _l2Token | address | Address of the L1 respective L2 ERC20
| _amount | uint256 | Amount of the ERC20 to deposit
| _l2Gas | uint32 | Gas limit required to complete the deposit on L2.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### depositERC20To
```solidity
function depositERC20To(address _l1Token, address _l2Token, address _to, uint256 _amount, uint32 _l2Gas, bytes _data) external nonpayable
```
*deposit an amount of ERC20 to a recipient's balance on L2.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address of the L1 ERC20 we are depositing
| _l2Token | address | Address of the L1 respective L2 ERC20
| _to | address | L2 address to credit the withdrawal to.
| _amount | uint256 | Amount of the ERC20 to deposit.
| _l2Gas | uint32 | Gas limit required to complete the deposit on L2.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### depositETH
```solidity
function depositETH(uint32 _l2Gas, bytes _data) external payable
```
*Deposit an amount of the ETH to the caller's balance on L2.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l2Gas | uint32 | Gas limit required to complete the deposit on L2.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### depositETHTo
```solidity
function depositETHTo(address _to, uint32 _l2Gas, bytes _data) external payable
```
*Deposit an amount of ETH to a recipient's balance on L2.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | L2 address to credit the withdrawal to.
| _l2Gas | uint32 | Gas limit required to complete the deposit on L2.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### deposits
```solidity
function deposits(address, address) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
| _1 | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### donateETH
```solidity
function donateETH() external payable
```
*Adds ETH balance to the account. This is meant to allow for ETH to be migrated from an old gateway to a new gateway. NOTE: This is left for one upgrade only so we are able to receive the migrated ETH from the old contract*
### finalizeERC20Withdrawal
```solidity
function finalizeERC20Withdrawal(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _data) external nonpayable
```
*Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the L1 ERC20 token. This call will fail if the initialized withdrawal from L2 has not been finalized.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address of L1 token to finalizeWithdrawal for.
| _l2Token | address | Address of L2 token where withdrawal was initiated.
| _from | address | L2 address initiating the transfer.
| _to | address | L1 address to credit the withdrawal to.
| _amount | uint256 | Amount of the ERC20 to deposit.
| _data | bytes | Data provided by the sender on L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### finalizeETHWithdrawal
```solidity
function finalizeETHWithdrawal(address _from, address _to, uint256 _amount, bytes _data) external nonpayable
```
*Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the L1 ETH token. Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _from | address | L2 address initiating the transfer.
| _to | address | L1 address to credit the withdrawal to.
| _amount | uint256 | Amount of the ERC20 to deposit.
| _data | bytes | Optional data to forward to L2. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### initialize
```solidity
function initialize(address _l1messenger, address _l2TokenBridge) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1messenger | address | L1 Messenger address being used for cross-chain communications.
| _l2TokenBridge | address | L2 standard bridge address.
### l2TokenBridge
```solidity
function l2TokenBridge() external view returns (address)
```
*get the address of the corresponding L2 bridge contract.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address of the corresponding L2 bridge contract.
### messenger
```solidity
function messenger() external view returns (address)
```
......@@ -368,161 +205,95 @@ function messenger() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
## Events
### ERC20DepositInitiated
```solidity
event ERC20DepositInitiated(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
### ERC20WithdrawalFinalized
```solidity
event ERC20WithdrawalFinalized(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
### ETHDepositInitiated
```solidity
event ETHDepositInitiated(address indexed _from, address indexed _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _from `indexed` | address | undefined |
| _to `indexed` | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
### ETHWithdrawalFinalized
```solidity
event ETHWithdrawalFinalized(address indexed _from, address indexed _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _from `indexed` | address | undefined |
| _to `indexed` | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
......@@ -2,27 +2,18 @@
> L2CrossDomainMessenger
*The L2 Cross Domain Messenger contract sends messages from L2 to L1, and is the entry point for L2 messages sent via the L1 Cross Domain Messenger.*
## Methods
### l1CrossDomainMessenger
```solidity
function l1CrossDomainMessenger() external view returns (address)
```
......@@ -30,27 +21,16 @@ function l1CrossDomainMessenger() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### messageNonce
```solidity
function messageNonce() external view returns (uint256)
```
......@@ -58,207 +38,119 @@ function messageNonce() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### relayMessage
```solidity
function relayMessage(address _target, address _sender, bytes _message, uint256 _messageNonce) external nonpayable
```
Relays a cross domain message to a contract.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _target | address | Target contract address.
| _sender | address | Message sender address.
| _message | bytes | Message to send to the target.
| _messageNonce | uint256 | Nonce for the provided message.
### relayedMessages
```solidity
function relayedMessages(bytes32) external view returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### sendMessage
```solidity
function sendMessage(address _target, bytes _message, uint32 _gasLimit) external nonpayable
```
Sends a cross domain message to the target messenger.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _target | address | Target contract address.
| _message | bytes | Message to send to the target.
| _gasLimit | uint32 | Gas limit for the provided message.
### sentMessages
```solidity
function sentMessages(bytes32) external view returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### successfulMessages
```solidity
function successfulMessages(bytes32) external view returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### xDomainMessageSender
```solidity
function xDomainMessageSender() external view returns (address)
```
......@@ -266,112 +158,67 @@ function xDomainMessageSender() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
## Events
### FailedRelayedMessage
```solidity
event FailedRelayedMessage(bytes32 indexed msgHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| msgHash `indexed` | bytes32 | undefined |
### RelayedMessage
```solidity
event RelayedMessage(bytes32 indexed msgHash)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| msgHash `indexed` | bytes32 | undefined |
### SentMessage
```solidity
event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| target `indexed` | address | undefined |
| sender | address | undefined |
| message | bytes | undefined |
| messageNonce | uint256 | undefined |
| gasLimit | uint256 | undefined |
......@@ -2,97 +2,56 @@
> L2StandardBridge
*The L2 Standard bridge is a contract which works together with the L1 Standard bridge to enable ETH and ERC20 transitions between L1 and L2. This contract acts as a minter for new tokens when it hears about deposits into the L1 Standard bridge. This contract also acts as a burner of the tokens intended for withdrawal, informing the L1 bridge to release L1 funds.*
## Methods
### finalizeDeposit
```solidity
function finalizeDeposit(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _data) external nonpayable
```
*Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this L2 token. This call will fail if it did not originate from a corresponding deposit in L1StandardTokenBridge.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address for the l1 token this is called with
| _l2Token | address | Address for the l2 token this is called with
| _from | address | Account to pull the deposit from on L2.
| _to | address | Address to receive the withdrawal at
| _amount | uint256 | Amount of the token to withdraw
| _data | bytes | Data provider by the sender on L1. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### l1TokenBridge
```solidity
function l1TokenBridge() external view returns (address)
```
*get the address of the corresponding L1 bridge contract.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address of the corresponding L1 bridge contract.
### messenger
```solidity
function messenger() external view returns (address)
```
......@@ -100,209 +59,117 @@ function messenger() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### withdraw
```solidity
function withdraw(address _l2Token, uint256 _amount, uint32 _l1Gas, bytes _data) external nonpayable
```
*initiate a withdraw of some tokens to the caller's account on L1*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l2Token | address | Address of L2 token where withdrawal was initiated.
| _amount | uint256 | Amount of the token to withdraw. param _l1Gas Unused, but included for potential forward compatibility considerations.
| _l1Gas | uint32 | undefined
| _data | bytes | Optional data to forward to L1. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
### withdrawTo
```solidity
function withdrawTo(address _l2Token, address _to, uint256 _amount, uint32 _l1Gas, bytes _data) external nonpayable
```
*initiate a withdraw of some token to a recipient's account on L1.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l2Token | address | Address of L2 token where withdrawal is initiated.
| _to | address | L1 adress to credit the withdrawal to.
| _amount | uint256 | Amount of the token to withdraw. param _l1Gas Unused, but included for potential forward compatibility considerations.
| _l1Gas | uint32 | undefined
| _data | bytes | Optional data to forward to L1. This data is provided solely as a convenience for external contracts. Aside from enforcing a maximum length, these contracts provide no guarantees about its content.
## Events
### DepositFailed
```solidity
event DepositFailed(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
### DepositFinalized
```solidity
event DepositFinalized(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
### WithdrawalInitiated
```solidity
event WithdrawalInitiated(address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
| _from `indexed` | address | undefined |
| _to | address | undefined |
| _amount | uint256 | undefined |
| _data | bytes | undefined |
......@@ -8,276 +8,160 @@
## Methods
### allowance
```solidity
function allowance(address owner, address spender) external view returns (uint256)
```
*See {IERC20-allowance}.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | undefined
| spender | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### approve
```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```
*See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### balanceOf
```solidity
function balanceOf(address account) external view returns (uint256)
```
*See {IERC20-balanceOf}.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### burn
```solidity
function burn(address _from, uint256 _amount) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _from | address | undefined
| _amount | uint256 | undefined
### decimals
```solidity
function decimals() external view returns (uint8)
```
*Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint8 | undefined
### decreaseAllowance
```solidity
function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool)
```
*Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| subtractedValue | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### increaseAllowance
```solidity
function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool)
```
*Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| addedValue | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### l1Token
```solidity
function l1Token() external view returns (address)
```
......@@ -285,27 +169,16 @@ function l1Token() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### l2Bridge
```solidity
function l2Bridge() external view returns (address)
```
......@@ -313,375 +186,222 @@ function l2Bridge() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### mint
```solidity
function mint(address _to, uint256 _amount) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | undefined
| _amount | uint256 | undefined
### name
```solidity
function name() external view returns (string)
```
*Returns the name of the token.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined
### supportsInterface
```solidity
function supportsInterface(bytes4 _interfaceId) external pure returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _interfaceId | bytes4 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### symbol
```solidity
function symbol() external view returns (string)
```
*Returns the symbol of the token, usually a shorter version of the name.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined
### totalSupply
```solidity
function totalSupply() external view returns (uint256)
```
*See {IERC20-totalSupply}.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### transfer
```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```
*See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### transferFrom
```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```
*See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for ``sender``'s tokens of at least `amount`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| sender | address | undefined
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
## Events
### Approval
```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner `indexed` | address | undefined |
| spender `indexed` | address | undefined |
| value | uint256 | undefined |
### Burn
```solidity
event Burn(address indexed _account, uint256 _amount)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _account `indexed` | address | undefined |
| _amount | uint256 | undefined |
### Mint
```solidity
event Mint(address indexed _account, uint256 _amount)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _account `indexed` | address | undefined |
| _amount | uint256 | undefined |
### Transfer
```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| from `indexed` | address | undefined |
| to `indexed` | address | undefined |
| value | uint256 | undefined |
......@@ -2,89 +2,52 @@
> L2StandardTokenFactory
*Factory contract for creating standard L2 token representations of L1 ERC20s compatible with and working on the standard bridge.*
## Methods
### createStandardL2Token
```solidity
function createStandardL2Token(address _l1Token, string _name, string _symbol) external nonpayable
```
*Creates an instance of the standard ERC20 token on L2.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token | address | Address of the corresponding L1 token.
| _name | string | ERC20 name.
| _symbol | string | ERC20 symbol.
## Events
### StandardL2TokenCreated
```solidity
event StandardL2TokenCreated(address indexed _l1Token, address indexed _l2Token)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _l1Token `indexed` | address | undefined |
| _l2Token `indexed` | address | undefined |
......@@ -2,225 +2,135 @@
> Lib_AddressManager
## Methods
### getAddress
```solidity
function getAddress(string _name) external view returns (address)
```
Retrieves the address associated with a given name.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | Name to retrieve an address for.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address associated with the given name.
### owner
```solidity
function owner() external view returns (address)
```
*Returns the address of the current owner.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### renounceOwnership
```solidity
function renounceOwnership() external nonpayable
```
*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*
### setAddress
```solidity
function setAddress(string _name, address _address) external nonpayable
```
Changes the address associated with a particular name.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | String name to associate an address with.
| _address | address | Address to associate with the name.
### transferOwnership
```solidity
function transferOwnership(address newOwner) external nonpayable
```
*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| newOwner | address | undefined
## Events
### AddressSet
```solidity
event AddressSet(string indexed _name, address _newAddress, address _oldAddress)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _name `indexed` | string | undefined |
| _newAddress | address | undefined |
| _oldAddress | address | undefined |
### OwnershipTransferred
```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| previousOwner `indexed` | address | undefined |
| newOwner `indexed` | address | undefined |
......@@ -2,27 +2,18 @@
> Lib_AddressResolver
## Methods
### libAddressManager
```solidity
function libAddressManager() external view returns (contract Lib_AddressManager)
```
......@@ -30,61 +21,34 @@ function libAddressManager() external view returns (contract Lib_AddressManager)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract Lib_AddressManager | undefined
### resolve
```solidity
function resolve(string _name) external view returns (address)
```
Resolves the address associated with a given name.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | Name to resolve an address for.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address associated with the given name.
......@@ -2,19 +2,11 @@
> Lib_Buffer
*This library implements a bytes32 storage array with some additional gas-optimized functionality. In particular, it encodes its length as a uint40, and tightly packs this with an overwritable "extra data" field so we can store more information with a single SSTORE.*
......@@ -2,8 +2,6 @@
> Lib_Byte32Utils
......@@ -12,9 +10,3 @@
......@@ -2,8 +2,6 @@
> Lib_BytesUtils
......@@ -12,9 +10,3 @@
......@@ -2,8 +2,6 @@
> Lib_CrossDomainUtils
......@@ -12,9 +10,3 @@
......@@ -2,8 +2,6 @@
> Lib_DefaultValues
......@@ -12,9 +10,3 @@
# Lib_MerkleTree
*River Keefer*
> Lib_MerkleTree
......@@ -12,9 +10,3 @@
......@@ -2,8 +2,6 @@
> Lib_MerkleTrie
......@@ -12,9 +10,3 @@
......@@ -2,8 +2,6 @@
> Lib_OVMCodec
......@@ -12,9 +10,3 @@
......@@ -2,8 +2,6 @@
> Lib_PredeployAddresses
......@@ -12,9 +10,3 @@
......@@ -2,19 +2,11 @@
> Lib_RLPReader
*Adapted from "RLPReader" by Hamdi Allam (hamdi.allam97@gmail.com).*
# Lib_RLPWriter
*Bakaoh (with modifications)*
> Lib_RLPWriter
......@@ -12,9 +10,3 @@
......@@ -2,8 +2,6 @@
> Lib_ResolvedDelegateProxy
......@@ -12,9 +10,3 @@
......@@ -2,8 +2,6 @@
> Lib_SecureMerkleTrie
......@@ -12,9 +10,3 @@
......@@ -2,27 +2,18 @@
> OVM_DeployerWhitelist
*The Deployer Whitelist is a temporary predeploy used to provide additional safety during the initial phases of our mainnet roll out. It is owned by the Optimism team, and defines accounts which are allowed to deploy contracts on Layer2. The Execution Manager will only allow an ovmCREATE or ovmCREATE2 operation to proceed if the deployer's address whitelisted.*
## Methods
### enableArbitraryContractDeployment
```solidity
function enableArbitraryContractDeployment() external nonpayable
```
Permanently enables arbitrary contract deployment and deletes the owner.
......@@ -30,54 +21,32 @@ Permanently enables arbitrary contract deployment and deletes the owner.
### isDeployerAllowed
```solidity
function isDeployerAllowed(address _deployer) external view returns (bool)
```
Checks whether an address is allowed to deploy contracts.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _deployer | address | Address to check.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | _allowed Whether or not the address can deploy contracts.
### owner
```solidity
function owner() external view returns (address)
```
......@@ -85,202 +54,120 @@ function owner() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### setOwner
```solidity
function setOwner(address _owner) external nonpayable
```
Updates the owner of this contract.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _owner | address | Address of the new owner.
### setWhitelistedDeployer
```solidity
function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external nonpayable
```
Adds or removes an address from the deployment whitelist.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _deployer | address | Address to update permissions for.
| _isWhitelisted | bool | Whether or not the address is whitelisted.
### whitelist
```solidity
function whitelist(address) external view returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
## Events
### OwnerChanged
```solidity
event OwnerChanged(address oldOwner, address newOwner)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| oldOwner | address | undefined |
| newOwner | address | undefined |
### WhitelistDisabled
```solidity
event WhitelistDisabled(address oldOwner)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| oldOwner | address | undefined |
### WhitelistStatusChanged
```solidity
event WhitelistStatusChanged(address deployer, bool whitelisted)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| deployer | address | undefined |
| whitelisted | bool | undefined |
......@@ -2,282 +2,166 @@
> OVM_ETH
*The ETH predeploy provides an ERC20 interface for ETH deposited to Layer 2. Note that unlike on Layer 1, Layer 2 accounts do not have a balance field.*
## Methods
### allowance
```solidity
function allowance(address owner, address spender) external view returns (uint256)
```
*See {IERC20-allowance}.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | undefined
| spender | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### approve
```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```
*Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### balanceOf
```solidity
function balanceOf(address account) external view returns (uint256)
```
*See {IERC20-balanceOf}.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### burn
```solidity
function burn(address _from, uint256 _amount) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _from | address | undefined
| _amount | uint256 | undefined
### decimals
```solidity
function decimals() external view returns (uint8)
```
*Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint8 | undefined
### decreaseAllowance
```solidity
function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool)
```
*Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| subtractedValue | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### increaseAllowance
```solidity
function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool)
```
*Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | undefined
| addedValue | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### l1Token
```solidity
function l1Token() external view returns (address)
```
......@@ -285,27 +169,16 @@ function l1Token() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### l2Bridge
```solidity
function l2Bridge() external view returns (address)
```
......@@ -313,375 +186,222 @@ function l2Bridge() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### mint
```solidity
function mint(address _to, uint256 _amount) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | undefined
| _amount | uint256 | undefined
### name
```solidity
function name() external view returns (string)
```
*Returns the name of the token.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined
### supportsInterface
```solidity
function supportsInterface(bytes4 _interfaceId) external pure returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _interfaceId | bytes4 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### symbol
```solidity
function symbol() external view returns (string)
```
*Returns the symbol of the token, usually a shorter version of the name.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined
### totalSupply
```solidity
function totalSupply() external view returns (uint256)
```
*See {IERC20-totalSupply}.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### transfer
```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```
*Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### transferFrom
```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```
*Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| sender | address | undefined
| recipient | address | undefined
| amount | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
## Events
### Approval
```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| owner `indexed` | address | undefined |
| spender `indexed` | address | undefined |
| value | uint256 | undefined |
### Burn
```solidity
event Burn(address indexed _account, uint256 _amount)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _account `indexed` | address | undefined |
| _amount | uint256 | undefined |
### Mint
```solidity
event Mint(address indexed _account, uint256 _amount)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _account `indexed` | address | undefined |
| _amount | uint256 | undefined |
### Transfer
```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| from `indexed` | address | undefined |
| to `indexed` | address | undefined |
| value | uint256 | undefined |
......@@ -2,27 +2,18 @@
> OVM_GasPriceOracle
*This contract exposes the current l2 gas price, a measure of how congested the network currently is. This measure is used by the Sequencer to determine what fee to charge for transactions. When the system is more congested, the l2 gas price will increase and fees will also increase as a result. All public variables are set while generating the initial L2 state. The constructor doesn't run in practice as the L2 state generation script uses the deployed bytecode instead of running the initcode.*
## Methods
### decimals
```solidity
function decimals() external view returns (uint256)
```
......@@ -30,27 +21,16 @@ function decimals() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### gasPrice
```solidity
function gasPrice() external view returns (uint256)
```
......@@ -58,101 +38,60 @@ function gasPrice() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### getL1Fee
```solidity
function getL1Fee(bytes _data) external view returns (uint256)
```
Computes the L1 portion of the fee based on the size of the RLP encoded tx and the current l1BaseFee
#### Parameters
| Name | Type | Description |
|---|---|---|
| _data | bytes | Unsigned RLP encoded tx, 6 elements
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | L1 fee that should be paid for the tx
### getL1GasUsed
```solidity
function getL1GasUsed(bytes _data) external view returns (uint256)
```
Computes the amount of L1 gas used for a transaction The overhead represents the per batch gas overhead of posting both transaction and state roots to L1 given larger batch sizes. 4 gas for 0 byte https://github.com/ethereum/go-ethereum/blob/9ada4a2e2c415e6b0b51c50e901336872e028872/params/protocol_params.go#L33 16 gas for non zero byte https://github.com/ethereum/go-ethereum/blob/9ada4a2e2c415e6b0b51c50e901336872e028872/params/protocol_params.go#L87 This will need to be updated if calldata gas prices change Account for the transaction being unsigned Padding is added to account for lack of signature on transaction 1 byte for RLP V prefix 1 byte for V 1 byte for RLP R prefix 32 bytes for R 1 byte for RLP S prefix 32 bytes for S Total: 68 bytes of padding
#### Parameters
| Name | Type | Description |
|---|---|---|
| _data | bytes | Unsigned RLP encoded tx, 6 elements
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | Amount of L1 gas used for a transaction
### l1BaseFee
```solidity
function l1BaseFee() external view returns (uint256)
```
......@@ -160,27 +99,16 @@ function l1BaseFee() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### overhead
```solidity
function overhead() external view returns (uint256)
```
......@@ -188,73 +116,44 @@ function overhead() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### owner
```solidity
function owner() external view returns (address)
```
*Returns the address of the current owner.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### renounceOwnership
```solidity
function renounceOwnership() external nonpayable
```
*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*
### scalar
```solidity
function scalar() external view returns (uint256)
```
......@@ -262,343 +161,208 @@ function scalar() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### setDecimals
```solidity
function setDecimals(uint256 _decimals) external nonpayable
```
Allows the owner to modify the decimals.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _decimals | uint256 | New decimals
### setGasPrice
```solidity
function setGasPrice(uint256 _gasPrice) external nonpayable
```
Allows the owner to modify the l2 gas price.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _gasPrice | uint256 | New l2 gas price.
### setL1BaseFee
```solidity
function setL1BaseFee(uint256 _baseFee) external nonpayable
```
Allows the owner to modify the l1 base fee.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _baseFee | uint256 | New l1 base fee
### setOverhead
```solidity
function setOverhead(uint256 _overhead) external nonpayable
```
Allows the owner to modify the overhead.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _overhead | uint256 | New overhead
### setScalar
```solidity
function setScalar(uint256 _scalar) external nonpayable
```
Allows the owner to modify the scalar.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _scalar | uint256 | New scalar
### transferOwnership
```solidity
function transferOwnership(address newOwner) external nonpayable
```
*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| newOwner | address | undefined
## Events
### DecimalsUpdated
```solidity
event DecimalsUpdated(uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### GasPriceUpdated
```solidity
event GasPriceUpdated(uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### L1BaseFeeUpdated
```solidity
event L1BaseFeeUpdated(uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### OverheadUpdated
```solidity
event OverheadUpdated(uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### OwnershipTransferred
```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| previousOwner `indexed` | address | undefined |
| newOwner `indexed` | address | undefined |
### ScalarUpdated
```solidity
event ScalarUpdated(uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
......@@ -2,122 +2,73 @@
> OVM_L2ToL1MessagePasser
*The L2 to L1 Message Passer is a utility contract which facilitate an L1 proof of the of a message on L2. The L1 Cross Domain Messenger performs this proof in its _verifyStorageProof function, which verifies the existence of the transaction hash in this contract's `sentMessages` mapping.*
## Methods
### passMessageToL1
```solidity
function passMessageToL1(bytes _message) external nonpayable
```
Passes a message to L1.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _message | bytes | Message to pass to L1.
### sentMessages
```solidity
function sentMessages(bytes32) external view returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
## Events
### L2ToL1Message
```solidity
event L2ToL1Message(uint256 _nonce, address _sender, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _nonce | uint256 | undefined |
| _sender | address | undefined |
| _data | bytes | undefined |
......@@ -2,27 +2,18 @@
> OVM_SequencerFeeVault
*Simple holding contract for fees paid to the Sequencer. Likely to be replaced in the future but "good enough for now".*
## Methods
### MIN_WITHDRAWAL_AMOUNT
```solidity
function MIN_WITHDRAWAL_AMOUNT() external view returns (uint256)
```
......@@ -30,27 +21,16 @@ function MIN_WITHDRAWAL_AMOUNT() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### l1FeeWallet
```solidity
function l1FeeWallet() external view returns (address)
```
......@@ -58,27 +38,16 @@ function l1FeeWallet() external view returns (address)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### withdraw
```solidity
function withdraw() external nonpayable
```
......@@ -89,11 +58,3 @@ function withdraw() external nonpayable
......@@ -6,125 +6,74 @@
*Contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. By default, the owner account will be the one that deploys the contract. This can later be changed with {transferOwnership}. This module is used through inheritance. It will make available the modifier `onlyOwner`, which can be applied to your functions to restrict their use to the owner.*
## Methods
### owner
```solidity
function owner() external view returns (address)
```
*Returns the address of the current owner.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### renounceOwnership
```solidity
function renounceOwnership() external nonpayable
```
*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*
### transferOwnership
```solidity
function transferOwnership(address newOwner) external nonpayable
```
*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| newOwner | address | undefined
## Events
### OwnershipTransferred
```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| previousOwner `indexed` | address | undefined |
| newOwner `indexed` | address | undefined |
......@@ -6,125 +6,74 @@
*Contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. By default, the owner account will be the one that deploys the contract. This can later be changed with {transferOwnership}. This module is used through inheritance. It will make available the modifier `onlyOwner`, which can be applied to your functions to restrict their use to the owner.*
## Methods
### owner
```solidity
function owner() external view returns (address)
```
*Returns the address of the current owner.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
### renounceOwnership
```solidity
function renounceOwnership() external nonpayable
```
*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*
### transferOwnership
```solidity
function transferOwnership(address newOwner) external nonpayable
```
*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| newOwner | address | undefined
## Events
### OwnershipTransferred
```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| previousOwner `indexed` | address | undefined |
| newOwner `indexed` | address | undefined |
......@@ -6,103 +6,62 @@
*Contract module which allows children to implement an emergency stop mechanism that can be triggered by an authorized account. This module is used through inheritance. It will make available the modifiers `whenNotPaused` and `whenPaused`, which can be applied to the functions of your contract. Note that they will not be pausable by simply including this module, only once the modifiers are put in place.*
## Methods
### paused
```solidity
function paused() external view returns (bool)
```
*Returns true if the contract is paused, and false otherwise.*
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
## Events
### Paused
```solidity
event Paused(address account)
```
*Emitted when the pause is triggered by `account`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined |
### Unpaused
```solidity
event Unpaused(address account)
```
*Emitted when the pause is lifted by `account`.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined |
......@@ -6,15 +6,7 @@
*Contract module that helps prevent reentrant calls to a function. Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier available, which can be applied to functions to make sure there are no nested (reentrant) calls to them. Note that because there is a single `nonReentrant` guard, functions marked as `nonReentrant` may not call one another. This can be worked around by making those functions `private`, and then adding `external` `nonReentrant` entry points to them. TIP: If you would like to learn more about reentrancy and alternative ways to protect against it, check out our blog post https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].*
......@@ -2,19 +2,11 @@
> SafeERC20
*Wrappers around ERC20 operations that throw on failure (when the token contract returns false). Tokens that return no value (and instead revert or throw on failure) are also supported, non-reverting calls are assumed to be successful. To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, which allows you to call the safe operations as `token.safeTransfer(...)`, etc.*
......@@ -2,27 +2,18 @@
> StateCommitmentChain
*The State Commitment Chain (SCC) contract contains a list of proposed state roots which Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC). Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique state root calculated off-chain by applying the canonical transactions one by one.*
## Methods
### FRAUD_PROOF_WINDOW
```solidity
function FRAUD_PROOF_WINDOW() external view returns (uint256)
```
......@@ -30,27 +21,16 @@ function FRAUD_PROOF_WINDOW() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### SEQUENCER_PUBLISH_WINDOW
```solidity
function SEQUENCER_PUBLISH_WINDOW() external view returns (uint256)
```
......@@ -58,57 +38,33 @@ function SEQUENCER_PUBLISH_WINDOW() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### appendStateBatch
```solidity
function appendStateBatch(bytes32[] _batch, uint256 _shouldStartAtElement) external nonpayable
```
Appends a batch of state roots to the chain.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _batch | bytes32[] | Batch of state roots.
| _shouldStartAtElement | uint256 | Index of the element at which this batch should start.
### batches
```solidity
function batches() external view returns (contract IChainStorageContainer)
```
Accesses the batch storage container.
......@@ -116,33 +72,19 @@ Accesses the batch storage container.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract IChainStorageContainer | Reference to the batch storage container.
### deleteStateBatch
```solidity
function deleteStateBatch(Lib_OVMCodec.ChainBatchHeader _batchHeader) external nonpayable
```
Deletes all state roots after (and including) a given batch.
......@@ -150,20 +92,12 @@ function deleteStateBatch(Lib_OVMCodec.ChainBatchHeader _batchHeader) external n
| Name | Type | Description |
|---|---|---|
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | undefined
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | Header of the batch to start deleting from.
### getLastSequencerTimestamp
```solidity
function getLastSequencerTimestamp() external view returns (uint256 _lastSequencerTimestamp)
```
Retrieves the timestamp of the last batch submitted by the sequencer.
......@@ -171,27 +105,16 @@ Retrieves the timestamp of the last batch submitted by the sequencer.
#### Returns
| Name | Type | Description |
|---|---|---|
| _lastSequencerTimestamp | uint256 | Last sequencer batch timestamp.
### getTotalBatches
```solidity
function getTotalBatches() external view returns (uint256 _totalBatches)
```
Retrieves the total number of batches submitted.
......@@ -199,27 +122,16 @@ Retrieves the total number of batches submitted.
#### Returns
| Name | Type | Description |
|---|---|---|
| _totalBatches | uint256 | Total submitted batches.
### getTotalElements
```solidity
function getTotalElements() external view returns (uint256 _totalElements)
```
Retrieves the total number of elements submitted.
......@@ -227,33 +139,19 @@ Retrieves the total number of elements submitted.
#### Returns
| Name | Type | Description |
|---|---|---|
| _totalElements | uint256 | Total submitted elements.
### insideFraudProofWindow
```solidity
function insideFraudProofWindow(Lib_OVMCodec.ChainBatchHeader _batchHeader) external view returns (bool _inside)
```
Checks whether a given batch is still inside its fraud proof window.
......@@ -261,30 +159,18 @@ function insideFraudProofWindow(Lib_OVMCodec.ChainBatchHeader _batchHeader) exte
| Name | Type | Description |
|---|---|---|
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | undefined
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | Header of the batch to check.
#### Returns
| Name | Type | Description |
|---|---|---|
| _inside | bool | undefined
| _inside | bool | Whether or not the batch is inside the fraud proof window.
### libAddressManager
```solidity
function libAddressManager() external view returns (contract Lib_AddressManager)
```
......@@ -292,70 +178,41 @@ function libAddressManager() external view returns (contract Lib_AddressManager)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract Lib_AddressManager | undefined
### resolve
```solidity
function resolve(string _name) external view returns (address)
```
Resolves the address associated with a given name.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | Name to resolve an address for.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | Address associated with the given name.
### verifyStateCommitment
```solidity
function verifyStateCommitment(bytes32 _element, Lib_OVMCodec.ChainBatchHeader _batchHeader, Lib_OVMCodec.ChainInclusionProof _proof) external view returns (bool)
```
Verifies a batch inclusion proof.
......@@ -363,98 +220,56 @@ function verifyStateCommitment(bytes32 _element, Lib_OVMCodec.ChainBatchHeader _
| Name | Type | Description |
|---|---|---|
| _element | bytes32 | undefined
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | undefined
| _proof | Lib_OVMCodec.ChainInclusionProof | undefined
| _element | bytes32 | Hash of the element to verify a proof for.
| _batchHeader | Lib_OVMCodec.ChainBatchHeader | Header of the batch in which the element was included.
| _proof | Lib_OVMCodec.ChainInclusionProof | Merkle inclusion proof for the element.
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
## Events
### StateBatchAppended
```solidity
event StateBatchAppended(uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _batchIndex `indexed` | uint256 | undefined |
| _batchRoot | bytes32 | undefined |
| _batchSize | uint256 | undefined |
| _prevTotalElements | uint256 | undefined |
| _extraData | bytes | undefined |
### StateBatchDeleted
```solidity
event StateBatchDeleted(uint256 indexed _batchIndex, bytes32 _batchRoot)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _batchIndex `indexed` | uint256 | undefined |
| _batchRoot | bytes32 | undefined |
......@@ -8,138 +8,80 @@
## Methods
### allowance
```solidity
function allowance(address, address) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
| _1 | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### approve
```solidity
function approve(address guy, uint256 wad) external nonpayable returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| guy | address | undefined
| wad | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### balanceOf
```solidity
function balanceOf(address) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### decimals
```solidity
function decimals() external view returns (uint8)
```
......@@ -147,27 +89,16 @@ function decimals() external view returns (uint8)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint8 | undefined
### deposit
```solidity
function deposit() external payable
```
......@@ -175,17 +106,10 @@ function deposit() external payable
### name
```solidity
function name() external view returns (string)
```
......@@ -193,27 +117,16 @@ function name() external view returns (string)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined
### symbol
```solidity
function symbol() external view returns (string)
```
......@@ -221,27 +134,16 @@ function symbol() external view returns (string)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined
### totalSupply
```solidity
function totalSupply() external view returns (uint256)
```
......@@ -249,251 +151,148 @@ function totalSupply() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
### transfer
```solidity
function transfer(address dst, uint256 wad) external nonpayable returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| dst | address | undefined
| wad | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### transferFrom
```solidity
function transferFrom(address src, address dst, uint256 wad) external nonpayable returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| src | address | undefined
| dst | address | undefined
| wad | uint256 | undefined
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
### withdraw
```solidity
function withdraw(uint256 wad) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| wad | uint256 | undefined
## Events
### Approval
```solidity
event Approval(address indexed src, address indexed guy, uint256 wad)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| src `indexed` | address | undefined |
| guy `indexed` | address | undefined |
| wad | uint256 | undefined |
### Deposit
```solidity
event Deposit(address indexed dst, uint256 wad)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| dst `indexed` | address | undefined |
| wad | uint256 | undefined |
### Transfer
```solidity
event Transfer(address indexed src, address indexed dst, uint256 wad)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| src `indexed` | address | undefined |
| dst `indexed` | address | undefined |
| wad | uint256 | undefined |
### Withdrawal
```solidity
event Withdrawal(address indexed src, uint256 wad)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| src `indexed` | address | undefined |
| wad | uint256 | undefined |
......@@ -2,27 +2,18 @@
> iL1ChugSplashDeployer
## Methods
### isUpgrading
```solidity
function isUpgrading() external view returns (bool)
```
......@@ -30,24 +21,12 @@ function isUpgrading() external view returns (bool)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined
......@@ -2,27 +2,18 @@
> iOVM_L1BlockNumber
## Methods
### getL1BlockNumber
```solidity
function getL1BlockNumber() external view returns (uint256)
```
......@@ -30,24 +21,12 @@ function getL1BlockNumber() external view returns (uint256)
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined
......@@ -2,85 +2,51 @@
> iOVM_L2ToL1MessagePasser
## Methods
### passMessageToL1
```solidity
function passMessageToL1(bytes _message) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _message | bytes | undefined
## Events
### L2ToL1Message
```solidity
event L2ToL1Message(uint256 _nonce, address _sender, bytes _data)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _nonce | uint256 | undefined |
| _sender | address | undefined |
| _data | bytes | undefined |
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment