diff --git a/packages/contracts/docs/AddressUpgradeable.md b/packages/contracts/docs/AddressUpgradeable.md new file mode 100644 index 0000000000000..456cdd15df4da --- /dev/null +++ b/packages/contracts/docs/AddressUpgradeable.md @@ -0,0 +1,12 @@ +# AddressUpgradeable + + + + + + + +*Collection of functions related to the address type* + + + diff --git a/packages/contracts/docs/ContextUpgradeable.md b/packages/contracts/docs/ContextUpgradeable.md index 18f33b80f1bc6..ee4e93ff7b715 100644 --- a/packages/contracts/docs/ContextUpgradeable.md +++ b/packages/contracts/docs/ContextUpgradeable.md @@ -9,4 +9,23 @@ *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.* +## Events + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + + diff --git a/packages/contracts/docs/Initializable.md b/packages/contracts/docs/Initializable.md index bc953adafc465..0421ee0059c4b 100644 --- a/packages/contracts/docs/Initializable.md +++ b/packages/contracts/docs/Initializable.md @@ -6,7 +6,26 @@ -*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.* +*This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed behind a proxy. Since proxied contracts do not make use of 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. The initialization functions use a version number. Once a version number is used, it is consumed and cannot be reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in case an upgrade adds a module that needs to be initialized. For example: [.hljs-theme-light.nopadding] ``` contract MyToken is ERC20Upgradeable { function initialize() initializer public { __ERC20_init("MyToken", "MTK"); } } contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { function initializeV2() reinitializer(2) public { __ERC20Permit_init("MyToken"); } } ``` 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. [CAUTION] ==== Avoid leaving a contract uninitialized. An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: [.hljs-theme-light.nopadding] ```* + + +## Events + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + +*Triggered when the contract has been initialized or reinitialized.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | diff --git a/packages/contracts/docs/L1CrossDomainMessenger.md b/packages/contracts/docs/L1CrossDomainMessenger.md index e7ae8abad46f1..d3f86fb39f962 100644 --- a/packages/contracts/docs/L1CrossDomainMessenger.md +++ b/packages/contracts/docs/L1CrossDomainMessenger.md @@ -331,6 +331,22 @@ event FailedRelayedMessage(bytes32 indexed msgHash) |---|---|---| | msgHash `indexed` | bytes32 | undefined | +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + ### MessageAllowed ```solidity diff --git a/packages/contracts/docs/OwnableUpgradeable.md b/packages/contracts/docs/OwnableUpgradeable.md index 53a8b1603ec8b..12a9b6ea85384 100644 --- a/packages/contracts/docs/OwnableUpgradeable.md +++ b/packages/contracts/docs/OwnableUpgradeable.md @@ -58,6 +58,22 @@ function transferOwnership(address newOwner) external nonpayable ## Events +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + ### OwnershipTransferred ```solidity diff --git a/packages/contracts/docs/PausableUpgradeable.md b/packages/contracts/docs/PausableUpgradeable.md index ed2f541504b2f..36c58d67113f5 100644 --- a/packages/contracts/docs/PausableUpgradeable.md +++ b/packages/contracts/docs/PausableUpgradeable.md @@ -31,6 +31,22 @@ function paused() external view returns (bool) ## Events +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + ### Paused ```solidity diff --git a/packages/contracts/docs/ReentrancyGuardUpgradeable.md b/packages/contracts/docs/ReentrancyGuardUpgradeable.md index 6955ca2de5975..bec27dda28f43 100644 --- a/packages/contracts/docs/ReentrancyGuardUpgradeable.md +++ b/packages/contracts/docs/ReentrancyGuardUpgradeable.md @@ -9,4 +9,23 @@ *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].* +## Events + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + +