Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
91f16a7e
Unverified
Commit
91f16a7e
authored
Sep 03, 2020
by
Francisco Giordano
Committed by
GitHub
Sep 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt proxies to Contracts conventions (#2345)
parent
6bc2ae37
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
Initializable.sol
contracts/proxy/Initializable.sol
+1
-1
Proxy.sol
contracts/proxy/Proxy.sol
+3
-3
TransparentUpgradeableProxy.sol
contracts/proxy/TransparentUpgradeableProxy.sol
+4
-4
UpgradeableProxy.sol
contracts/proxy/UpgradeableProxy.sol
+1
-1
No files found.
contracts/proxy/Initializable.sol
View file @
91f16a7e
...
...
@@ -15,7 +15,7 @@ pragma solidity >=0.4.24 <0.7.0;
* 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.
*/
contract Initializable {
abstract
contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
...
...
contracts/proxy/Proxy.sol
View file @
91f16a7e
...
...
@@ -52,7 +52,7 @@ abstract contract Proxy {
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _fallback() internal {
_
will
Fallback();
_
before
Fallback();
_delegate(_implementation());
}
...
...
@@ -76,8 +76,8 @@ abstract contract Proxy {
* @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
* call, or as part of the Solidity `fallback` or `receive` functions.
*
* If overriden should call `super._
will
Fallback()`.
* If overriden should call `super._
before
Fallback()`.
*/
function _
will
Fallback() internal virtual {
function _
before
Fallback() internal virtual {
}
}
contracts/proxy/TransparentUpgradeableProxy.sol
View file @
91f16a7e
...
...
@@ -134,7 +134,7 @@ contract TransparentUpgradeableProxy is UpgradeableProxy {
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin)
internal
{
function _setAdmin(address newAdmin)
private
{
bytes32 slot = _ADMIN_SLOT;
// solhint-disable-next-line no-inline-assembly
...
...
@@ -144,10 +144,10 @@ contract TransparentUpgradeableProxy is UpgradeableProxy {
}
/**
* @dev Makes sure the admin cannot access the fallback function. See {Proxy-_
will
Fallback}.
* @dev Makes sure the admin cannot access the fallback function. See {Proxy-_
before
Fallback}.
*/
function _
will
Fallback() internal override virtual {
function _
before
Fallback() internal override virtual {
require(msg.sender != _admin(), "TransparentUpgradeableProxy: admin cannot fallback to proxy target");
super._
will
Fallback();
super._
before
Fallback();
}
}
contracts/proxy/UpgradeableProxy.sol
View file @
91f16a7e
...
...
@@ -67,7 +67,7 @@ contract UpgradeableProxy is Proxy {
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation)
internal
{
function _setImplementation(address newImplementation)
private
{
require(Address.isContract(newImplementation), "UpgradeableProxy: new implementation is not a contract");
bytes32 slot = _IMPLEMENTATION_SLOT;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment