Created
June 21, 2022 15:23
-
-
Save KiselevMaxim/ef16df34cea79e287b6803a7b89f5c3d to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.2+commit.661d1103.js&optimize=true&runs=1000&gist=
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compiler": { | |
"version": "0.8.2+commit.661d1103" | |
}, | |
"language": "Solidity", | |
"output": { | |
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "_logic", | |
"type": "address" | |
}, | |
{ | |
"internalType": "address", | |
"name": "admin_", | |
"type": "address" | |
}, | |
{ | |
"internalType": "bytes", | |
"name": "_data", | |
"type": "bytes" | |
} | |
], | |
"stateMutability": "payable", | |
"type": "constructor" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": false, | |
"internalType": "address", | |
"name": "previousAdmin", | |
"type": "address" | |
}, | |
{ | |
"indexed": false, | |
"internalType": "address", | |
"name": "newAdmin", | |
"type": "address" | |
} | |
], | |
"name": "AdminChanged", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "beacon", | |
"type": "address" | |
} | |
], | |
"name": "BeaconUpgraded", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "implementation", | |
"type": "address" | |
} | |
], | |
"name": "Upgraded", | |
"type": "event" | |
}, | |
{ | |
"stateMutability": "payable", | |
"type": "fallback" | |
}, | |
{ | |
"inputs": [], | |
"name": "admin", | |
"outputs": [ | |
{ | |
"internalType": "address", | |
"name": "admin_", | |
"type": "address" | |
} | |
], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "newAdmin", | |
"type": "address" | |
} | |
], | |
"name": "changeAdmin", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "implementation", | |
"outputs": [ | |
{ | |
"internalType": "address", | |
"name": "implementation_", | |
"type": "address" | |
} | |
], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "newImplementation", | |
"type": "address" | |
} | |
], | |
"name": "upgradeTo", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "newImplementation", | |
"type": "address" | |
}, | |
{ | |
"internalType": "bytes", | |
"name": "data", | |
"type": "bytes" | |
} | |
], | |
"name": "upgradeToAndCall", | |
"outputs": [], | |
"stateMutability": "payable", | |
"type": "function" | |
}, | |
{ | |
"stateMutability": "payable", | |
"type": "receive" | |
} | |
], | |
"devdoc": { | |
"details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", | |
"kind": "dev", | |
"methods": { | |
"admin()": { | |
"details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" | |
}, | |
"changeAdmin(address)": { | |
"details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." | |
}, | |
"constructor": { | |
"details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." | |
}, | |
"implementation()": { | |
"details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" | |
}, | |
"upgradeTo(address)": { | |
"details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." | |
}, | |
"upgradeToAndCall(address,bytes)": { | |
"details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." | |
} | |
}, | |
"version": 1 | |
}, | |
"userdoc": { | |
"kind": "user", | |
"methods": {}, | |
"version": 1 | |
} | |
}, | |
"settings": { | |
"compilationTarget": { | |
"contracts/TransparentUpgradeableProxy.full.sol": "TransparentUpgradeableProxy" | |
}, | |
"evmVersion": "istanbul", | |
"libraries": {}, | |
"metadata": { | |
"bytecodeHash": "ipfs" | |
}, | |
"optimizer": { | |
"enabled": true, | |
"runs": 1000 | |
}, | |
"remappings": [] | |
}, | |
"sources": { | |
"contracts/TransparentUpgradeableProxy.full.sol": { | |
"keccak256": "0xb4e3460a6b7447e8d705d43d9be37366dc7eafa6d98b00e15a12d6533d7bf0bd", | |
"license": "MIT", | |
"urls": [ | |
"bzz-raw://c40c6d62244968d92b30c315fdabdf9aa04d3892149877ecb1bb15e53c408fda", | |
"dweb:/ipfs/QmcKrY9vNkGr8SsQchBHwPjnCwNb6JdnuaQZSwSCmz4PGG" | |
] | |
} | |
}, | |
"version": 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment