Update docs
This commit is contained in:
@ -100,10 +100,22 @@
|
||||
:xref-Clones-cloneDeterministic-address-bytes32-uint256-: xref:proxy.adoc#Clones-cloneDeterministic-address-bytes32-uint256-
|
||||
:xref-Clones-predictDeterministicAddress-address-bytes32-address-: xref:proxy.adoc#Clones-predictDeterministicAddress-address-bytes32-address-
|
||||
:xref-Clones-predictDeterministicAddress-address-bytes32-: xref:proxy.adoc#Clones-predictDeterministicAddress-address-bytes32-
|
||||
:xref-Clones-cloneWithImmutableArgs-address-bytes-: xref:proxy.adoc#Clones-cloneWithImmutableArgs-address-bytes-
|
||||
:xref-Clones-cloneWithImmutableArgs-address-bytes-uint256-: xref:proxy.adoc#Clones-cloneWithImmutableArgs-address-bytes-uint256-
|
||||
:xref-Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-: xref:proxy.adoc#Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-
|
||||
:xref-Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-uint256-: xref:proxy.adoc#Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-uint256-
|
||||
:xref-Clones-predictDeterministicAddressWithImmutableArgs-address-bytes-bytes32-address-: xref:proxy.adoc#Clones-predictDeterministicAddressWithImmutableArgs-address-bytes-bytes32-address-
|
||||
:xref-Clones-predictDeterministicAddressWithImmutableArgs-address-bytes-bytes32-: xref:proxy.adoc#Clones-predictDeterministicAddressWithImmutableArgs-address-bytes-bytes32-
|
||||
:xref-Clones-fetchCloneArgs-address-: xref:proxy.adoc#Clones-fetchCloneArgs-address-
|
||||
:xref-Clones-CloneArgumentsTooLong--: xref:proxy.adoc#Clones-CloneArgumentsTooLong--
|
||||
:xref-Clones-clone-address-: xref:proxy.adoc#Clones-clone-address-
|
||||
:xref-Clones-cloneDeterministic-address-bytes32-: xref:proxy.adoc#Clones-cloneDeterministic-address-bytes32-
|
||||
:Clones-cloneDeterministic: pass:normal[xref:proxy.adoc#Clones-cloneDeterministic-address-bytes32-uint256-[`Clones.cloneDeterministic`]]
|
||||
:Clones-cloneDeterministic: pass:normal[xref:proxy.adoc#Clones-cloneDeterministic-address-bytes32-uint256-[`Clones.cloneDeterministic`]]
|
||||
:xref-Clones-cloneWithImmutableArgs-address-bytes-: xref:proxy.adoc#Clones-cloneWithImmutableArgs-address-bytes-
|
||||
:xref-Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-: xref:proxy.adoc#Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-
|
||||
:Clones-cloneDeterministicWithImmutableArgs: pass:normal[xref:proxy.adoc#Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-uint256-[`Clones.cloneDeterministicWithImmutableArgs`]]
|
||||
:Clones-cloneDeterministicWithImmutableArgs: pass:normal[xref:proxy.adoc#Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-uint256-[`Clones.cloneDeterministicWithImmutableArgs`]]
|
||||
:ERC1967Proxy-constructor: pass:normal[xref:proxy.adoc#ERC1967Proxy-constructor-address-bytes-[`ERC1967Proxy.constructor`]]
|
||||
:xref-Initializable-initializer--: xref:proxy.adoc#Initializable-initializer--
|
||||
:xref-Initializable-reinitializer-uint64-: xref:proxy.adoc#Initializable-reinitializer-uint64-
|
||||
@ -188,7 +200,7 @@ The current implementation of this security mechanism uses https://eips.ethereum
|
||||
|
||||
[.contract]
|
||||
[[Proxy]]
|
||||
=== `++Proxy++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.1.0/contracts/proxy/Proxy.sol[{github-icon},role=heading-link]
|
||||
=== `++Proxy++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/proxy/Proxy.sol[{github-icon},role=heading-link]
|
||||
|
||||
[.hljs-theme-light.nopadding]
|
||||
```solidity
|
||||
@ -251,7 +263,7 @@ function in the contract matches the call data.
|
||||
|
||||
[.contract]
|
||||
[[ERC1967Proxy]]
|
||||
=== `++ERC1967Proxy++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.1.0/contracts/proxy/ERC1967/ERC1967Proxy.sol[{github-icon},role=heading-link]
|
||||
=== `++ERC1967Proxy++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/proxy/ERC1967/ERC1967Proxy.sol[{github-icon},role=heading-link]
|
||||
|
||||
[.hljs-theme-light.nopadding]
|
||||
```solidity
|
||||
@ -316,7 +328,7 @@ the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
|
||||
|
||||
[.contract]
|
||||
[[ERC1967Utils]]
|
||||
=== `++ERC1967Utils++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.1.0/contracts/proxy/ERC1967/ERC1967Utils.sol[{github-icon},role=heading-link]
|
||||
=== `++ERC1967Utils++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/proxy/ERC1967/ERC1967Utils.sol[{github-icon},role=heading-link]
|
||||
|
||||
[.hljs-theme-light.nopadding]
|
||||
```solidity
|
||||
@ -465,7 +477,7 @@ This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
|
||||
|
||||
[.contract]
|
||||
[[TransparentUpgradeableProxy]]
|
||||
=== `++TransparentUpgradeableProxy++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.1.0/contracts/proxy/transparent/TransparentUpgradeableProxy.sol[{github-icon},role=heading-link]
|
||||
=== `++TransparentUpgradeableProxy++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/proxy/transparent/TransparentUpgradeableProxy.sol[{github-icon},role=heading-link]
|
||||
|
||||
[.hljs-theme-light.nopadding]
|
||||
```solidity
|
||||
@ -574,7 +586,7 @@ The proxy caller is the current admin, and can't fallback to the proxy target.
|
||||
|
||||
[.contract]
|
||||
[[ProxyAdmin]]
|
||||
=== `++ProxyAdmin++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.1.0/contracts/proxy/transparent/ProxyAdmin.sol[{github-icon},role=heading-link]
|
||||
=== `++ProxyAdmin++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/proxy/transparent/ProxyAdmin.sol[{github-icon},role=heading-link]
|
||||
|
||||
[.hljs-theme-light.nopadding]
|
||||
```solidity
|
||||
@ -659,7 +671,7 @@ during an upgrade.
|
||||
|
||||
[.contract]
|
||||
[[BeaconProxy]]
|
||||
=== `++BeaconProxy++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.1.0/contracts/proxy/beacon/BeaconProxy.sol[{github-icon},role=heading-link]
|
||||
=== `++BeaconProxy++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/proxy/beacon/BeaconProxy.sol[{github-icon},role=heading-link]
|
||||
|
||||
[.hljs-theme-light.nopadding]
|
||||
```solidity
|
||||
@ -724,7 +736,7 @@ Returns the beacon.
|
||||
|
||||
[.contract]
|
||||
[[IBeacon]]
|
||||
=== `++IBeacon++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.1.0/contracts/proxy/beacon/IBeacon.sol[{github-icon},role=heading-link]
|
||||
=== `++IBeacon++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/proxy/beacon/IBeacon.sol[{github-icon},role=heading-link]
|
||||
|
||||
[.hljs-theme-light.nopadding]
|
||||
```solidity
|
||||
@ -756,7 +768,7 @@ Must return an address that can be used as a delegate call target.
|
||||
|
||||
[.contract]
|
||||
[[UpgradeableBeacon]]
|
||||
=== `++UpgradeableBeacon++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.1.0/contracts/proxy/beacon/UpgradeableBeacon.sol[{github-icon},role=heading-link]
|
||||
=== `++UpgradeableBeacon++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/proxy/beacon/UpgradeableBeacon.sol[{github-icon},role=heading-link]
|
||||
|
||||
[.hljs-theme-light.nopadding]
|
||||
```solidity
|
||||
@ -856,16 +868,24 @@ The `implementation` of the beacon is invalid.
|
||||
|
||||
== Minimal Clones
|
||||
|
||||
:CloneArgumentsTooLong: pass:normal[xref:#Clones-CloneArgumentsTooLong--[`++CloneArgumentsTooLong++`]]
|
||||
:clone: pass:normal[xref:#Clones-clone-address-[`++clone++`]]
|
||||
:clone: pass:normal[xref:#Clones-clone-address-uint256-[`++clone++`]]
|
||||
:cloneDeterministic: pass:normal[xref:#Clones-cloneDeterministic-address-bytes32-[`++cloneDeterministic++`]]
|
||||
:cloneDeterministic: pass:normal[xref:#Clones-cloneDeterministic-address-bytes32-uint256-[`++cloneDeterministic++`]]
|
||||
:predictDeterministicAddress: pass:normal[xref:#Clones-predictDeterministicAddress-address-bytes32-address-[`++predictDeterministicAddress++`]]
|
||||
:predictDeterministicAddress: pass:normal[xref:#Clones-predictDeterministicAddress-address-bytes32-[`++predictDeterministicAddress++`]]
|
||||
:cloneWithImmutableArgs: pass:normal[xref:#Clones-cloneWithImmutableArgs-address-bytes-[`++cloneWithImmutableArgs++`]]
|
||||
:cloneWithImmutableArgs: pass:normal[xref:#Clones-cloneWithImmutableArgs-address-bytes-uint256-[`++cloneWithImmutableArgs++`]]
|
||||
:cloneDeterministicWithImmutableArgs: pass:normal[xref:#Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-[`++cloneDeterministicWithImmutableArgs++`]]
|
||||
:cloneDeterministicWithImmutableArgs: pass:normal[xref:#Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-uint256-[`++cloneDeterministicWithImmutableArgs++`]]
|
||||
:predictDeterministicAddressWithImmutableArgs: pass:normal[xref:#Clones-predictDeterministicAddressWithImmutableArgs-address-bytes-bytes32-address-[`++predictDeterministicAddressWithImmutableArgs++`]]
|
||||
:predictDeterministicAddressWithImmutableArgs: pass:normal[xref:#Clones-predictDeterministicAddressWithImmutableArgs-address-bytes-bytes32-[`++predictDeterministicAddressWithImmutableArgs++`]]
|
||||
:fetchCloneArgs: pass:normal[xref:#Clones-fetchCloneArgs-address-[`++fetchCloneArgs++`]]
|
||||
|
||||
[.contract]
|
||||
[[Clones]]
|
||||
=== `++Clones++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.1.0/contracts/proxy/Clones.sol[{github-icon},role=heading-link]
|
||||
=== `++Clones++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/proxy/Clones.sol[{github-icon},role=heading-link]
|
||||
|
||||
[.hljs-theme-light.nopadding]
|
||||
```solidity
|
||||
@ -891,6 +911,20 @@ deterministic method.
|
||||
* {xref-Clones-cloneDeterministic-address-bytes32-uint256-}[`++cloneDeterministic(implementation, salt, value)++`]
|
||||
* {xref-Clones-predictDeterministicAddress-address-bytes32-address-}[`++predictDeterministicAddress(implementation, salt, deployer)++`]
|
||||
* {xref-Clones-predictDeterministicAddress-address-bytes32-}[`++predictDeterministicAddress(implementation, salt)++`]
|
||||
* {xref-Clones-cloneWithImmutableArgs-address-bytes-}[`++cloneWithImmutableArgs(implementation, args)++`]
|
||||
* {xref-Clones-cloneWithImmutableArgs-address-bytes-uint256-}[`++cloneWithImmutableArgs(implementation, args, value)++`]
|
||||
* {xref-Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-}[`++cloneDeterministicWithImmutableArgs(implementation, args, salt)++`]
|
||||
* {xref-Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-uint256-}[`++cloneDeterministicWithImmutableArgs(implementation, args, salt, value)++`]
|
||||
* {xref-Clones-predictDeterministicAddressWithImmutableArgs-address-bytes-bytes32-address-}[`++predictDeterministicAddressWithImmutableArgs(implementation, args, salt, deployer)++`]
|
||||
* {xref-Clones-predictDeterministicAddressWithImmutableArgs-address-bytes-bytes32-}[`++predictDeterministicAddressWithImmutableArgs(implementation, args, salt)++`]
|
||||
* {xref-Clones-fetchCloneArgs-address-}[`++fetchCloneArgs(instance)++`]
|
||||
|
||||
--
|
||||
|
||||
[.contract-index]
|
||||
.Errors
|
||||
--
|
||||
* {xref-Clones-CloneArgumentsTooLong--}[`++CloneArgumentsTooLong()++`]
|
||||
|
||||
--
|
||||
|
||||
@ -919,7 +953,7 @@ to always have enough balance for new deployments. Consider exposing this functi
|
||||
Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
|
||||
|
||||
This function uses the create2 opcode and a `salt` to deterministically deploy
|
||||
the clone. Using the same `implementation` and `salt` multiple time will revert, since
|
||||
the clone. Using the same `implementation` and `salt` multiple times will revert, since
|
||||
the clones cannot be deployed twice at the same address.
|
||||
|
||||
[.contract-item]
|
||||
@ -944,6 +978,78 @@ Computes the address of a clone deployed using {Clones-cloneDeterministic}.
|
||||
|
||||
Computes the address of a clone deployed using {Clones-cloneDeterministic}.
|
||||
|
||||
[.contract-item]
|
||||
[[Clones-cloneWithImmutableArgs-address-bytes-]]
|
||||
==== `[.contract-item-name]#++cloneWithImmutableArgs++#++(address implementation, bytes args) → address instance++` [.item-kind]#internal#
|
||||
|
||||
Deploys and returns the address of a clone that mimics the behavior of `implementation` with custom
|
||||
immutable arguments. These are provided through `args` and cannot be changed after deployment. To
|
||||
access the arguments within the implementation, use {fetchCloneArgs}.
|
||||
|
||||
This function uses the create opcode, which should never revert.
|
||||
|
||||
[.contract-item]
|
||||
[[Clones-cloneWithImmutableArgs-address-bytes-uint256-]]
|
||||
==== `[.contract-item-name]#++cloneWithImmutableArgs++#++(address implementation, bytes args, uint256 value) → address instance++` [.item-kind]#internal#
|
||||
|
||||
Same as {xref-Clones-cloneWithImmutableArgs-address-bytes-}[cloneWithImmutableArgs], but with a `value`
|
||||
parameter to send native currency to the new contract.
|
||||
|
||||
NOTE: Using a non-zero value at creation will require the contract using this function (e.g. a factory)
|
||||
to always have enough balance for new deployments. Consider exposing this function under a payable method.
|
||||
|
||||
[.contract-item]
|
||||
[[Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-]]
|
||||
==== `[.contract-item-name]#++cloneDeterministicWithImmutableArgs++#++(address implementation, bytes args, bytes32 salt) → address instance++` [.item-kind]#internal#
|
||||
|
||||
Deploys and returns the address of a clone that mimics the behaviour of `implementation` with custom
|
||||
immutable arguments. These are provided through `args` and cannot be changed after deployment. To
|
||||
access the arguments within the implementation, use {fetchCloneArgs}.
|
||||
|
||||
This function uses the create2 opcode and a `salt` to deterministically deploy the clone. Using the same
|
||||
`implementation`, `args` and `salt` multiple times will revert, since the clones cannot be deployed twice
|
||||
at the same address.
|
||||
|
||||
[.contract-item]
|
||||
[[Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-uint256-]]
|
||||
==== `[.contract-item-name]#++cloneDeterministicWithImmutableArgs++#++(address implementation, bytes args, bytes32 salt, uint256 value) → address instance++` [.item-kind]#internal#
|
||||
|
||||
Same as {xref-Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-}[cloneDeterministicWithImmutableArgs],
|
||||
but with a `value` parameter to send native currency to the new contract.
|
||||
|
||||
NOTE: Using a non-zero value at creation will require the contract using this function (e.g. a factory)
|
||||
to always have enough balance for new deployments. Consider exposing this function under a payable method.
|
||||
|
||||
[.contract-item]
|
||||
[[Clones-predictDeterministicAddressWithImmutableArgs-address-bytes-bytes32-address-]]
|
||||
==== `[.contract-item-name]#++predictDeterministicAddressWithImmutableArgs++#++(address implementation, bytes args, bytes32 salt, address deployer) → address predicted++` [.item-kind]#internal#
|
||||
|
||||
Computes the address of a clone deployed using {Clones-cloneDeterministicWithImmutableArgs}.
|
||||
|
||||
[.contract-item]
|
||||
[[Clones-predictDeterministicAddressWithImmutableArgs-address-bytes-bytes32-]]
|
||||
==== `[.contract-item-name]#++predictDeterministicAddressWithImmutableArgs++#++(address implementation, bytes args, bytes32 salt) → address predicted++` [.item-kind]#internal#
|
||||
|
||||
Computes the address of a clone deployed using {Clones-cloneDeterministicWithImmutableArgs}.
|
||||
|
||||
[.contract-item]
|
||||
[[Clones-fetchCloneArgs-address-]]
|
||||
==== `[.contract-item-name]#++fetchCloneArgs++#++(address instance) → bytes++` [.item-kind]#internal#
|
||||
|
||||
Get the immutable args attached to a clone.
|
||||
|
||||
- If `instance` is a clone that was deployed using `clone` or `cloneDeterministic`, this
|
||||
function will return an empty array.
|
||||
- If `instance` is a clone that was deployed using `cloneWithImmutableArgs` or
|
||||
`cloneDeterministicWithImmutableArgs`, this function will return the args array used at
|
||||
creation.
|
||||
- If `instance` is NOT a clone deployed using this library, the behavior is undefined. This
|
||||
function should only be used to check addresses that are known to be clones.
|
||||
|
||||
[.contract-item]
|
||||
[[Clones-CloneArgumentsTooLong--]]
|
||||
==== `[.contract-item-name]#++CloneArgumentsTooLong++#++()++` [.item-kind]#error#
|
||||
|
||||
== Utils
|
||||
|
||||
:InitializableStorage: pass:normal[xref:#Initializable-InitializableStorage[`++InitializableStorage++`]]
|
||||
@ -960,7 +1066,7 @@ Computes the address of a clone deployed using {Clones-cloneDeterministic}.
|
||||
|
||||
[.contract]
|
||||
[[Initializable]]
|
||||
=== `++Initializable++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.1.0/contracts/proxy/utils/Initializable.sol[{github-icon},role=heading-link]
|
||||
=== `++Initializable++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/proxy/utils/Initializable.sol[{github-icon},role=heading-link]
|
||||
|
||||
[.hljs-theme-light.nopadding]
|
||||
```solidity
|
||||
@ -1150,7 +1256,7 @@ The contract is not initializing.
|
||||
|
||||
[.contract]
|
||||
[[UUPSUpgradeable]]
|
||||
=== `++UUPSUpgradeable++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.1.0/contracts/proxy/utils/UUPSUpgradeable.sol[{github-icon},role=heading-link]
|
||||
=== `++UUPSUpgradeable++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/proxy/utils/UUPSUpgradeable.sol[{github-icon},role=heading-link]
|
||||
|
||||
[.hljs-theme-light.nopadding]
|
||||
```solidity
|
||||
|
||||
Reference in New Issue
Block a user