From 5b1c2aa13d838665599555ac00dd58b32185e0b9 Mon Sep 17 00:00:00 2001 From: dillon Date: Fri, 23 Oct 2020 20:21:39 -0500 Subject: [PATCH 1/7] Updated function organization comment style --- contracts/DelegateCallProxyManyToOne.sol | 6 +++--- contracts/DelegateCallProxyOneToOne.sol | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/DelegateCallProxyManyToOne.sol b/contracts/DelegateCallProxyManyToOne.sol index b20f87b..c626c6f 100644 --- a/contracts/DelegateCallProxyManyToOne.sol +++ b/contracts/DelegateCallProxyManyToOne.sol @@ -18,12 +18,12 @@ import { Proxy } from "@openzeppelin/contracts/proxy/Proxy.sol"; * this safety check before updating the implementation on the holder. */ contract DelegateCallProxyManyToOne is Proxy { -/* --- Constants --- */ +/* ========== Constants ========== */ // Address that stores the implementation address. address internal immutable _implementationHolder; -/* --- Constructor --- */ +/* ========== Constructor ========== */ constructor() public { // Calls the sender rather than receiving the address in the constructor @@ -31,7 +31,7 @@ contract DelegateCallProxyManyToOne is Proxy { _implementationHolder = ProxyDeployer(msg.sender).getImplementationHolder(); } -/* --- Internal Overrides --- */ +/* ========== Internal Overrides ========== */ /** * @dev Queries the implementation address from the implementation holder. diff --git a/contracts/DelegateCallProxyOneToOne.sol b/contracts/DelegateCallProxyOneToOne.sol index f92e55c..7771d5a 100644 --- a/contracts/DelegateCallProxyOneToOne.sol +++ b/contracts/DelegateCallProxyOneToOne.sol @@ -23,15 +23,15 @@ import { Proxy } from "@openzeppelin/contracts/proxy/Proxy.sol"; * The manager must perform this safety check. */ contract DelegateCallProxyOneToOne is Proxy { -/* --- Constants --- */ +/* ========== Constants ========== */ address internal immutable _manager; -/* --- Constructor --- */ +/* ========== Constructor ========== */ constructor() public { _manager = msg.sender ; } -/* --- Internal Overrides --- */ +/* ========== Internal Overrides ========== */ /** * @dev Reads the implementation address from storage. From cda22754764a73d90dc4146f17f61eeef0d1c800 Mon Sep 17 00:00:00 2001 From: dillon Date: Fri, 23 Oct 2020 20:22:20 -0500 Subject: [PATCH 2/7] Less strict solidity version for CodeHashes.sol --- contracts/CodeHashes.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/CodeHashes.sol b/contracts/CodeHashes.sol index b1edfd6..fd48bcd 100644 --- a/contracts/CodeHashes.sol +++ b/contracts/CodeHashes.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity =0.6.12; +pragma solidity ^0.6.0; /** @@ -8,7 +8,7 @@ pragma solidity =0.6.12; * values when they import the salt library. */ library CodeHashes { - bytes32 internal constant ONE_TO_ONE_CODEHASH = 0x980843d7182154db438d410718903ca4c4116c8f430643d49eb654ed1776ed41; - bytes32 internal constant MANY_TO_ONE_CODEHASH = 0xb4e09618634e1d4fad81090ab8fb8259b749a9202aa02d7720af654b9b4ca17b; + bytes32 internal constant ONE_TO_ONE_CODEHASH = 0xdf533b6e999d326280ce88ca39ea2eddf95ed96f6c153ed5642d9b0a95dba4a2; + bytes32 internal constant MANY_TO_ONE_CODEHASH = 0x8fb4522edc5e0645a7ae5cfdbfe3b34d4a14de9e0279b74da795856b5ef4f1e6; bytes32 internal constant IMPLEMENTATION_HOLDER_CODEHASH = 0xfc7aed17e5c5d36a15e443235cb9c59bae4a013202cde6ab3e657fa1176d7f3e; } \ No newline at end of file From 00ee96d8811d551b4c72bb150d3f275b86a2810a Mon Sep 17 00:00:00 2001 From: dillon Date: Fri, 23 Oct 2020 20:22:36 -0500 Subject: [PATCH 3/7] Less strict solidity version for CodeHashes.sol --- scripts/write-code-hashes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/write-code-hashes.js b/scripts/write-code-hashes.js index 74a6719..be57570 100644 --- a/scripts/write-code-hashes.js +++ b/scripts/write-code-hashes.js @@ -19,7 +19,7 @@ import { DelegateCallProxyOneToOne } from "./DelegateCallProxyOneToOne.sol"; ` : ''; const CodeHashesLibrary = `// SPDX-License-Identifier: GPL-3.0 -pragma solidity =0.6.12; +pragma solidity ^0.6.0; ${imports} /** From baffae2832536f1065f90a00f7aba035739f8d7f Mon Sep 17 00:00:00 2001 From: dillon Date: Fri, 23 Oct 2020 20:23:16 -0500 Subject: [PATCH 4/7] Cleaned up deploy script a bit --- deploy/1_deploy.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/deploy/1_deploy.js b/deploy/1_deploy.js index 6dc2dc3..7d3db23 100644 --- a/deploy/1_deploy.js +++ b/deploy/1_deploy.js @@ -14,14 +14,11 @@ const logger = { module.exports = async ({ deployments, - getChainId, - getNamedAccounts, - ethers + getNamedAccounts }) => { const { save } = deployments; const { deployer } = await getNamedAccounts(); - // For some reason the contractName field wasn't properly being saved to deployments. const deploy = async (name, contractName, opts) => { logger.info(`Deploying ${contractName} [${name}]`); const deployment = await deployments.deploy(name, { @@ -34,8 +31,6 @@ module.exports = async ({ return deployment; }; - logger.info('Executing deployment script.'); - await deploy('DelegateCallProxyManager', 'proxyManager', { from: deployer, gas: 4000000, From 67296e3055c01a9b7ff2ce20fed7ded6fe11de71 Mon Sep 17 00:00:00 2001 From: dillon Date: Fri, 23 Oct 2020 20:24:08 -0500 Subject: [PATCH 5/7] Added developer notes to README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0830dde..81b01d8 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ Smart contracts for upgradeable proxies. npm install --save @indexed-finance/proxies ``` +**Notes for developers** + +If you deploy a new version of `DelegateCallProxyManager.sol` without using the artifact in /artifacts (handled automatically by buidler), your local build may result in different bytecode. If that happens, the code hashes in `CodeHashes.sol` will be incorrect and the proxy address derivation functions will not work. Either use the already built artifacts in the package or replace the codehashes with the new values. See: [script for generating the CodeHashes contract](./scripts/write-code-hashes.js) + ## Test ``` From 6e6863a15cf3aac9e47556084728f3719aa646b4 Mon Sep 17 00:00:00 2001 From: dillon Date: Fri, 23 Oct 2020 20:27:33 -0500 Subject: [PATCH 6/7] Updated rinkeby deployment --- .../rinkeby/DelegateCallProxyManager.json | 255 ++++++++++++++---- deployments/rinkeby/proxyManager.json | 255 ++++++++++++++---- ...39f2f7ceafbd68a1e6b5b75539fd97bf62e4.json} | 26 +- 3 files changed, 430 insertions(+), 106 deletions(-) rename deployments/rinkeby/solcInputs/{0x77b59efc8347393893a776470c3750c5d736f4c9b50771234cbd2970849fde64.json => 0xd54b2fd043b0d0ad87e570456bf439f2f7ceafbd68a1e6b5b75539fd97bf62e4.json} (67%) diff --git a/deployments/rinkeby/DelegateCallProxyManager.json b/deployments/rinkeby/DelegateCallProxyManager.json index 9316de1..d363a29 100644 --- a/deployments/rinkeby/DelegateCallProxyManager.json +++ b/deployments/rinkeby/DelegateCallProxyManager.json @@ -50,6 +50,19 @@ "name": "ManyToOne_ImplementationCreated", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "implementationID", + "type": "bytes32" + } + ], + "name": "ManyToOne_ImplementationLocked", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -88,6 +101,19 @@ "name": "ManyToOne_ProxyDeployed", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "name": "OneToOne_ImplementationLocked", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -130,13 +156,19 @@ "anonymous": false, "inputs": [ { - "indexed": false, + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], - "name": "OwnerSet", + "name": "OwnershipTransferred", "type": "event" }, { @@ -323,15 +355,40 @@ "type": "function" }, { - "inputs": [], - "name": "getOwner", - "outputs": [ + "inputs": [ { "internalType": "address", - "name": "", + "name": "deployer", "type": "address" } ], + "name": "isApprovedDeployer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "implementationID", + "type": "bytes32" + } + ], + "name": "isImplementationLocked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, @@ -339,11 +396,11 @@ "inputs": [ { "internalType": "address", - "name": "deployer", + "name": "proxyAddress", "type": "address" } ], - "name": "isApprovedDeployer", + "name": "isImplementationLocked", "outputs": [ { "internalType": "bool", @@ -354,6 +411,52 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "implementationID", + "type": "bytes32" + } + ], + "name": "lockImplementationManyToOne", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "name": "lockImplementationOneToOne", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -407,11 +510,11 @@ "inputs": [ { "internalType": "address", - "name": "owner", + "name": "newOwner", "type": "address" } ], - "name": "setOwner", + "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -420,26 +523,42 @@ "receipt": { "to": null, "from": "0x8740d0EF44FFd926302E36CfAf7A38e61dAD550e", - "contractAddress": "0x242836cdb4578d4C7ce43E07669cDcDcf9cA7483", - "transactionIndex": 9, - "gasUsed": "1161898", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x9dbedf7c69147707c31f31ed592c47151e9284e4705e27db425ada241fd50548", - "transactionHash": "0x22b481e8e5a819da23bf513b82a5558e013120aed4e5e456d0b92b99204c985b", - "logs": [], - "blockNumber": 7381608, - "cumulativeGasUsed": "2428110", + "contractAddress": "0x68Cf58DD7d90bBcfAc51D52bF5005c202B17974c", + "transactionIndex": 14, + "gasUsed": "1470753", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000001000800000000000000000000000000000000020000000000000000000808000000000000000000000000000000400020000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000800000000000000000000000000000000", + "blockHash": "0x06f9ed5267cb04f36ee6fde154c839fe768264b2407e07f9b2a5da8060549553", + "transactionHash": "0xbd5931a4305ad6197b98fe83bacf1003a793d8f975eb6ecf5f4c8c104d73cfbc", + "logs": [ + { + "transactionIndex": 14, + "blockNumber": 7423024, + "transactionHash": "0xbd5931a4305ad6197b98fe83bacf1003a793d8f975eb6ecf5f4c8c104d73cfbc", + "address": "0x68Cf58DD7d90bBcfAc51D52bF5005c202B17974c", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000008740d0ef44ffd926302e36cfaf7a38e61dad550e" + ], + "data": "0x", + "logIndex": 9, + "blockHash": "0x06f9ed5267cb04f36ee6fde154c839fe768264b2407e07f9b2a5da8060549553" + } + ], + "blockNumber": 7423024, + "cumulativeGasUsed": "2762048", "status": 1, "byzantium": true }, - "address": "0x242836cdb4578d4C7ce43E07669cDcDcf9cA7483", + "address": "0x68Cf58DD7d90bBcfAc51D52bF5005c202B17974c", "args": [], - "solcInputHash": "0x77b59efc8347393893a776470c3750c5d736f4c9b50771234cbd2970849fde64", - "metadata": "{\"compiler\":{\"version\":\"0.6.8+commit.0bbfe453\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"DeploymentApprovalGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"DeploymentApprovalRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ImplementationCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ImplementationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ProxyDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"OneToOne_ImplementationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"OneToOne_ProxyDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnerSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"approveDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"computeHolderAddressManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originator\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"computeProxyAddressManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originator\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"computeProxyAddressOneToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"createManyToOneProxyRelationship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"deployProxyManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"deployProxyOneToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getImplementationHolder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"getImplementationHolder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"isApprovedDeployer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"revokeDeployerApproval\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"setImplementationAddressManyToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"setImplementationAddressOneToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"setOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Contract that manages deployment and upgrades of delegatecall proxies. * An implementation identifier can be created on the proxy manager which is used to specify the logic address for a particular contract type, and to upgrade the implementation as needed. * A one-to-one proxy is a single proxy contract with an upgradeable implementation address. * A many-to-one proxy is a single upgradeable implementation address that may be used by many proxy contracts.\",\"methods\":{\"approveDeployer(address)\":{\"details\":\"Allows `deployer` to deploy many-to-one proxies.\"},\"computeHolderAddressManyToOne(bytes32)\":{\"details\":\"Computes the create2 address of the implementation holder for `implementationID`.\",\"params\":{\"implementationID\":\"The identifier for the contract implementation.\"}},\"computeProxyAddressManyToOne(address,bytes32,bytes32)\":{\"details\":\"Computes the create2 address for a many-to-one proxy for the implementation `implementationID` requested by `originator` using `suppliedSalt`.\",\"params\":{\"implementationID\":\"The identifier for the contract implementation.\",\"originator\":\"Address of the account requesting deployment.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"computeProxyAddressOneToOne(address,bytes32)\":{\"details\":\"Computes the create2 address for a one-to-one proxy requested by `originator` using `suppliedSalt`.\",\"params\":{\"originator\":\"Address of the account requesting deployment.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"createManyToOneProxyRelationship(bytes32,address)\":{\"details\":\"Creates a many-to-one proxy relationship. * Deploys an implementation holder contract which stores the implementation address for many proxies. The implementation address can be updated on the holder to change the runtime code used by all its proxies.\",\"params\":{\"implementation\":\"Address with the runtime code the proxies should use.\",\"implementationID\":\"ID for the implementation, used to identify the proxies that use it. Also used as the salt in the create2 call when deploying the implementation holder contract.\"}},\"deployProxyManyToOne(bytes32,bytes32)\":{\"details\":\"Deploy a proxy with a many-to-one relationship with its implemenation. * The proxy will call the implementation holder for every transaction to determine the address to use in calls.\",\"params\":{\"implementationID\":\"Identifier for the proxy's implementation.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"deployProxyOneToOne(bytes32,address)\":{\"details\":\"Deploy a proxy contract with a one-to-one relationship with its implementation. * The proxy will have its own implementation address which can be updated by the proxy manager.\",\"params\":{\"implementation\":\"Address of the contract with the runtime code that the proxy should use.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"getImplementationHolder()\":{\"details\":\"Queries the temporary storage value `_implementationHolder`. This is used in the constructor of the many-to-one proxy contract so that the create2 address is static (adding constructor arguments would change the codehash) and the implementation holder can be stored as a constant.\"},\"getImplementationHolder(bytes32)\":{\"details\":\"Returns the address of the implementation holder contract for `implementationID`.\"},\"revokeDeployerApproval(address)\":{\"details\":\"Prevents `deployer` from deploying many-to-one proxies.\"},\"setImplementationAddressManyToOne(bytes32,address)\":{\"details\":\"Updates the implementation address for a many-to-one proxy relationship.\",\"params\":{\"implementation\":\"Address with the runtime code the proxies should use.\",\"implementationID\":\"Identifier for the implementation.\"}},\"setImplementationAddressOneToOne(address,address)\":{\"details\":\"Updates the implementation address for a one-to-one proxy. * Note: This could work for many-to-one as well if the caller provides the implementation holder address in place of the proxy address, as they use the same access control and update mechanism.\",\"params\":{\"implementation\":\"Address with the runtime code for the proxy to use.\",\"proxyAddress\":\"Address of the deployed proxy\"}}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"contracts/DelegateCallProxyManager.sol\":\"DelegateCallProxyManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"keccak256\":\"0x302c3404769f7a5a3d68a7035b9ed71a4b1f8a1669afa7895558a11b6accebfa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c413ff3bdda059e93afc96fbcc44c700e5578b7752eb1a3f166dd52d80e27a31\",\"dweb:/ipfs/QmY9xsG9pPtCdwVDWZ58Gmah6dgFBMWTZYQvqLxikKTYdU\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0xf5fa8cbdffa5ef8be49b246b5628facc30b71707e78a45d80d93b64eff3fe390\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://774e78a9ff32792cc95db4d2ceaf3a7965bb7f0bea5e6cb7cff182b450d44b37\",\"dweb:/ipfs/QmRRMC4uj7eAcLW7chynA3sNEYULMFazdLwQHKHQPyzAbA\"]},\"@openzeppelin/contracts/utils/Create2.sol\":{\"keccak256\":\"0x16926b3c19504ea52f73abe41dfa9c1ef9c328d6088b82162d475caecaa47a6d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc578656a08c07f33ecf4a54324bad5f951afdcd990cdab1dcde493d6bb49d9c\",\"dweb:/ipfs/QmbXLJtTaqBg7WwC4p9gsRjA3VEwNwGc6W9afJeAaacF71\"]},\"contracts/DelegateCallProxyManager.sol\":{\"keccak256\":\"0xd431a917a91b1a3017e41aece6f48c87fd0107ce7c615e629d2e589ee30f9611\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://1a349d8e39285c5b6e9916d9985aea6eb097de838ceea922e3de62b1f67454b3\",\"dweb:/ipfs/QmVtXsFDg4ke76oSBeJgvhfRynAvKJJE7NPJw39pjLNZwB\"]},\"contracts/DelegateCallProxyManyToOne.sol\":{\"keccak256\":\"0x5c66e1743cbe75b81bbe28afbfaf9449fff116ec1b23257142c874c5bcb38145\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://c9eb69092d20725d4e7df4206778367a60b7d6b9f6fbc02ee8a3d35fcc31e45f\",\"dweb:/ipfs/QmdJ2fwyFp6bP6VsDaG1WehgZ3Z7kyL2Zw8izscLEc6J2f\"]},\"contracts/DelegateCallProxyOneToOne.sol\":{\"keccak256\":\"0xf53b3eab5905040869620aab77a3b57ff4f9c0eea1c4c4e3be3ff6ff33d330f3\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://b7c075d6175b1f28d39f3459f9a311e5195a6bc4a19f33dc580ec7295f604518\",\"dweb:/ipfs/QmSf6KKjVrCc6MLikYgbx6Pd3wgxztnRBWYmjYtF8kMAL2\"]},\"contracts/ManyToOneImplementationHolder.sol\":{\"keccak256\":\"0xd4494c0c40e500143f1f10f713a25869d9e3cfaff6ef393e4769acb68a0e26cd\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://c41b62221661fd0705c09535b052d7d0ee040062d0798fe601bfe69918fd66f4\",\"dweb:/ipfs/QmPak26ZFQwngHQh449LSg6scUAfL8XPvSwYePSGEAjp9L\"]},\"contracts/Owned.sol\":{\"keccak256\":\"0xf3c02fc9ab55ea71f89816bb782f08b3075d5304d1a53dfc43a0e16bad715b1a\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://51023d3e8aa43481a0d072f677dfae2ff66597608533a6d2ec0dbc9dea0e5662\",\"dweb:/ipfs/QmT579XAaDGfEfKQJe4XjxN1hob7bQGkjoHxeyzPf4MeiX\"]},\"contracts/SaltyLib.sol\":{\"keccak256\":\"0x6758976f7afbcaa4ae63eaa4c07486a441bdc55b86c67ce1f9d7dd34e4e78b3c\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://8a73823874aac91e0d2130b0da61ce67726c8e951e16239d7c0223eb33100f16\",\"dweb:/ipfs/QmWpVSpdD1tgeZkmdiHxhYoU8ZFVb6Yf1HsXQjuwUUtitA\"]},\"contracts/interfaces/IDelegateCallProxyManager.sol\":{\"keccak256\":\"0xb31182461a22068986b28376d337cd5b62045a3626e1df6fe4a8bc4dc5341f65\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6d64b71cd1ca41dca7c17a353c1546c2941b787708da32e4297c10611ff5071c\",\"dweb:/ipfs/Qmexmn1w7wmPgnMLeQCqTThWMZR5kr9whipsct3cEj9gem\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b031916331790556113b3806100326000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063964c406111610097578063db97034011610066578063db97034014610289578063dc7faa07146102af578063dde5c32f146102e9578063f962854214610315576100f5565b8063964c4061146101e2578063c3242d6b1461020e578063d07ad4981461023a578063d083bc861461026c576100f5565b80635b54cf96116100d35780635b54cf96146101695780635e4ccacf1461018f5780636813a3c2146101ac578063893d20e8146101da576100f5565b806313af4035146100fa5780631a5e5bc5146101225780631da0505d14610161575b600080fd5b6101206004803603602081101561011057600080fd5b50356001600160a01b0316610341565b005b6101456004803603604081101561013857600080fd5b5080359060200135610432565b604080516001600160a01b039092168252519081900360200190f35b6101456105ba565b6101206004803603602081101561017f57600080fd5b50356001600160a01b03166105c9565b610145600480360360208110156101a557600080fd5b5035610674565b610120600480360360408110156101c257600080fd5b506001600160a01b03813581169160200135166106b0565b610145610752565b610120600480360360408110156101f857600080fd5b50803590602001356001600160a01b0316610761565b6101206004803603604081101561022457600080fd5b50803590602001356001600160a01b0316610843565b6101456004803603606081101561025057600080fd5b506001600160a01b038135169060208101359060400135610946565b6101456004803603602081101561028257600080fd5b5035610973565b6101206004803603602081101561029f57600080fd5b50356001600160a01b031661098e565b6102d5600480360360208110156102c557600080fd5b50356001600160a01b0316610a35565b604080519115158252519081900360200190f35b610145600480360360408110156102ff57600080fd5b506001600160a01b038135169060200135610a53565b6101456004803603604081101561032b57600080fd5b50803590602001356001600160a01b0316610a7e565b6000546001600160a01b03163314610390576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b0381166103de576040805162461bcd60e51b815260206004820152601060248201526f4552525f4e554c4c5f4144445245535360801b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe29181900360200190a150565b600080546001600160a01b031633148061045b57503360009081526001602052604090205460ff165b61049f576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d054141493d5915160821b604482015290519081900360640190fd5b6000838152600260205260409020546001600160a01b031680610501576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b600061050e338686610b4a565b600380546001600160a01b0319166001600160a01b03851617905560405190915061055c90600090839061054460208201610ec7565b601f1982820381018352601f90910116604052610b92565b600380546001600160a01b0319169055604080518781526001600160a01b038316602082015281519295507f7b2f1f9260fa3ce14c2f36f34469f302e66164e3da9dbff6b24c723bcd39d115929081900390910190a1505092915050565b6003546001600160a01b031690565b6000546001600160a01b03163314610618576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b038116600081815260016020818152604092839020805460ff1916909217909155815192835290517fa8320d9911124be4bd8a47fe086523f921e913be4659887a823d16c1a7c567b39281900390910190a150565b60006106aa826040518060200161068a90610ed4565b6020820181038252601f19601f8201166040525080519060200120610ca3565b92915050565b6000546001600160a01b031633146106ff576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6107098282610cb7565b604080516001600160a01b0380851682528316602082015281517f52f99278569fbf4dd0ee15eb946bc8d758d614d1917ff0faf9b326dd4aada643929181900390910190a15050565b6000546001600160a01b031690565b6000546001600160a01b031633146107b0576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b60006107c86000846040518060200161054490610ed4565b600084815260026020526040902080546001600160a01b0319166001600160a01b03831617905590506107fb8183610cb7565b604080518481526001600160a01b038416602082015281517f06e1ff8de03513a819420b2e2f57764e89938cd88b8769998326edf2703c2338929181900390910190a1505050565b6000546001600160a01b03163314610892576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6000828152600260205260409020546001600160a01b0316806108f4576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6108fe8183610cb7565b604080518481526001600160a01b038416602082015281517f43440a819e0e769fd70fc34ea1c8462915e7170e4396fb7595b450a09d0cdf38929181900390910190a1505050565b600080610954858585610b4a565b905061096a816040518060200161068a90610ec7565b95945050505050565b6000908152600260205260409020546001600160a01b031690565b6000546001600160a01b031633146109dd576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b038116600081815260016020908152604091829020805460ff19169055815192835290517ff0f9ad55989ce899961b5c41524ba369cda0a1fcd9301dd0c868430e69c41b759281900390910190a150565b6001600160a01b031660009081526001602052604090205460ff1690565b600080610a608484610e2c565b9050610a76816040518060200161068a90610ee0565b949350505050565b600080546001600160a01b03163314610ace576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6000610ada3385610e2c565b9050610af26000826040518060200161054490610ee0565b9150610afe8284610cb7565b604080516001600160a01b0380851682528516602082015281517f66708f841fd2ea7b5488d47d39951f9f79cb1033a9c5e0d1e98f76cdb8ba1e88929181900390910190a15092915050565b6040805160609490941b6001600160601b0319166020808601919091526034850193909352605480850192909252805180850390920182526074909301909252815191012090565b60008084471015610bea576040805162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b8251610c3d576040805162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015290519081900360640190fd5b8383516020850187f590506001600160a01b038116610a76576040805162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015290519081900360640190fd5b6000610cb0838330610e6b565b9392505050565b610cc081610ec1565b610d04576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d0d3d395149050d560821b604482015290519081900360640190fd5b6000826001600160a01b03168260405160200180826001600160a01b03166001600160a01b031681526020019150506040516020818303038152906040526040518082805190602001908083835b60208310610d715780518252601f199092019160209182019101610d52565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610dd3576040519150601f19603f3d011682016040523d82523d6000602084013e610dd8565b606091505b5050905080610e27576040805162461bcd60e51b815260206004820152601660248201527511549497d4d15517d05111149154d4d7d4915591549560521b604482015290519081900360640190fd5b505050565b6040805160609390931b6001600160601b0319166020808501919091526034808501939093528151808503909301835260549093019052805191012090565b604080516001600160f81b031960208083019190915260609390931b6001600160601b03191660218201526035810194909452605580850193909352805180850390930183526075909301909252805191012090565b3b151590565b6102b180610eee83390190565b60aa8061119f83390190565b610135806112498339019056fe60a060405234801561001057600080fd5b50336001600160a01b0316631da0505d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561004a57600080fd5b505afa15801561005e573d6000803e3d6000fd5b505050506040513d602081101561007457600080fd5b5051606081901b6001600160601b0319166080526001600160a01b031661020a6100a7600039806046525061020a6000f3fe60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a610031565b6101b0565b565b60405160009081906060906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083818181855afa9150503d806000811461009d576040519150601f19603f3d011682016040523d82523d6000602084013e6100a2565b606091505b50915091508181906101325760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156100f75781810151838201526020016100df565b50505050905090810190601f1680156101245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600081806020019051602081101561014a57600080fd5b505190506001600160a01b0381166101a9576040805162461bcd60e51b815260206004820152601760248201527f4552525f4e554c4c5f494d504c454d454e544154494f4e000000000000000000604482015290519081900360640190fd5b9250505090565b3660008037600080366000845af43d6000803e8080156101cf573d6000f35b3d6000fdfea26469706673582212205ea5c736a3ee4de523d494d0cd9fdcf7acaceb69007e4fe31ab218aa7aef409e64736f6c6343000608003360a0604052348015600f57600080fd5b5033606081901b608052607d61002d60003980600f5250607d6000f3fe6080604052336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614603f5760005460005260206000f35b60003560005500fea2646970667358221220110007ea8963cb63ac49d82ebbe9c527d671784f58c4ddbee2d3f38423bfeaa964736f6c6343000608003360a060405234801561001057600080fd5b5033606081901b60805261010561003060003980603252506101056000f3fe608060405236601057600e6013565b005b600e5b60196027565b602560216087565b60ac565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614606057605c6025565b6025565b6000357f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a55005b7f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a5490565b3660008037600080366000845af43d6000803e80801560ca573d6000f35b3d6000fdfea2646970667358221220fa349e8a6a3294fc03f618900c3f4393f3c494bd3c2c07860da7ac1bc54a0c6b64736f6c63430006080033a26469706673582212206a94237a2fe077a81c0805041a540b092d885ef1f2438784c95500dd5948e81464736f6c63430006080033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063964c406111610097578063db97034011610066578063db97034014610289578063dc7faa07146102af578063dde5c32f146102e9578063f962854214610315576100f5565b8063964c4061146101e2578063c3242d6b1461020e578063d07ad4981461023a578063d083bc861461026c576100f5565b80635b54cf96116100d35780635b54cf96146101695780635e4ccacf1461018f5780636813a3c2146101ac578063893d20e8146101da576100f5565b806313af4035146100fa5780631a5e5bc5146101225780631da0505d14610161575b600080fd5b6101206004803603602081101561011057600080fd5b50356001600160a01b0316610341565b005b6101456004803603604081101561013857600080fd5b5080359060200135610432565b604080516001600160a01b039092168252519081900360200190f35b6101456105ba565b6101206004803603602081101561017f57600080fd5b50356001600160a01b03166105c9565b610145600480360360208110156101a557600080fd5b5035610674565b610120600480360360408110156101c257600080fd5b506001600160a01b03813581169160200135166106b0565b610145610752565b610120600480360360408110156101f857600080fd5b50803590602001356001600160a01b0316610761565b6101206004803603604081101561022457600080fd5b50803590602001356001600160a01b0316610843565b6101456004803603606081101561025057600080fd5b506001600160a01b038135169060208101359060400135610946565b6101456004803603602081101561028257600080fd5b5035610973565b6101206004803603602081101561029f57600080fd5b50356001600160a01b031661098e565b6102d5600480360360208110156102c557600080fd5b50356001600160a01b0316610a35565b604080519115158252519081900360200190f35b610145600480360360408110156102ff57600080fd5b506001600160a01b038135169060200135610a53565b6101456004803603604081101561032b57600080fd5b50803590602001356001600160a01b0316610a7e565b6000546001600160a01b03163314610390576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b0381166103de576040805162461bcd60e51b815260206004820152601060248201526f4552525f4e554c4c5f4144445245535360801b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe29181900360200190a150565b600080546001600160a01b031633148061045b57503360009081526001602052604090205460ff165b61049f576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d054141493d5915160821b604482015290519081900360640190fd5b6000838152600260205260409020546001600160a01b031680610501576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b600061050e338686610b4a565b600380546001600160a01b0319166001600160a01b03851617905560405190915061055c90600090839061054460208201610ec7565b601f1982820381018352601f90910116604052610b92565b600380546001600160a01b0319169055604080518781526001600160a01b038316602082015281519295507f7b2f1f9260fa3ce14c2f36f34469f302e66164e3da9dbff6b24c723bcd39d115929081900390910190a1505092915050565b6003546001600160a01b031690565b6000546001600160a01b03163314610618576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b038116600081815260016020818152604092839020805460ff1916909217909155815192835290517fa8320d9911124be4bd8a47fe086523f921e913be4659887a823d16c1a7c567b39281900390910190a150565b60006106aa826040518060200161068a90610ed4565b6020820181038252601f19601f8201166040525080519060200120610ca3565b92915050565b6000546001600160a01b031633146106ff576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6107098282610cb7565b604080516001600160a01b0380851682528316602082015281517f52f99278569fbf4dd0ee15eb946bc8d758d614d1917ff0faf9b326dd4aada643929181900390910190a15050565b6000546001600160a01b031690565b6000546001600160a01b031633146107b0576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b60006107c86000846040518060200161054490610ed4565b600084815260026020526040902080546001600160a01b0319166001600160a01b03831617905590506107fb8183610cb7565b604080518481526001600160a01b038416602082015281517f06e1ff8de03513a819420b2e2f57764e89938cd88b8769998326edf2703c2338929181900390910190a1505050565b6000546001600160a01b03163314610892576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6000828152600260205260409020546001600160a01b0316806108f4576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6108fe8183610cb7565b604080518481526001600160a01b038416602082015281517f43440a819e0e769fd70fc34ea1c8462915e7170e4396fb7595b450a09d0cdf38929181900390910190a1505050565b600080610954858585610b4a565b905061096a816040518060200161068a90610ec7565b95945050505050565b6000908152600260205260409020546001600160a01b031690565b6000546001600160a01b031633146109dd576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b038116600081815260016020908152604091829020805460ff19169055815192835290517ff0f9ad55989ce899961b5c41524ba369cda0a1fcd9301dd0c868430e69c41b759281900390910190a150565b6001600160a01b031660009081526001602052604090205460ff1690565b600080610a608484610e2c565b9050610a76816040518060200161068a90610ee0565b949350505050565b600080546001600160a01b03163314610ace576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6000610ada3385610e2c565b9050610af26000826040518060200161054490610ee0565b9150610afe8284610cb7565b604080516001600160a01b0380851682528516602082015281517f66708f841fd2ea7b5488d47d39951f9f79cb1033a9c5e0d1e98f76cdb8ba1e88929181900390910190a15092915050565b6040805160609490941b6001600160601b0319166020808601919091526034850193909352605480850192909252805180850390920182526074909301909252815191012090565b60008084471015610bea576040805162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b8251610c3d576040805162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015290519081900360640190fd5b8383516020850187f590506001600160a01b038116610a76576040805162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015290519081900360640190fd5b6000610cb0838330610e6b565b9392505050565b610cc081610ec1565b610d04576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d0d3d395149050d560821b604482015290519081900360640190fd5b6000826001600160a01b03168260405160200180826001600160a01b03166001600160a01b031681526020019150506040516020818303038152906040526040518082805190602001908083835b60208310610d715780518252601f199092019160209182019101610d52565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610dd3576040519150601f19603f3d011682016040523d82523d6000602084013e610dd8565b606091505b5050905080610e27576040805162461bcd60e51b815260206004820152601660248201527511549497d4d15517d05111149154d4d7d4915591549560521b604482015290519081900360640190fd5b505050565b6040805160609390931b6001600160601b0319166020808501919091526034808501939093528151808503909301835260549093019052805191012090565b604080516001600160f81b031960208083019190915260609390931b6001600160601b03191660218201526035810194909452605580850193909352805180850390930183526075909301909252805191012090565b3b151590565b6102b180610eee83390190565b60aa8061119f83390190565b610135806112498339019056fe60a060405234801561001057600080fd5b50336001600160a01b0316631da0505d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561004a57600080fd5b505afa15801561005e573d6000803e3d6000fd5b505050506040513d602081101561007457600080fd5b5051606081901b6001600160601b0319166080526001600160a01b031661020a6100a7600039806046525061020a6000f3fe60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a610031565b6101b0565b565b60405160009081906060906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083818181855afa9150503d806000811461009d576040519150601f19603f3d011682016040523d82523d6000602084013e6100a2565b606091505b50915091508181906101325760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156100f75781810151838201526020016100df565b50505050905090810190601f1680156101245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600081806020019051602081101561014a57600080fd5b505190506001600160a01b0381166101a9576040805162461bcd60e51b815260206004820152601760248201527f4552525f4e554c4c5f494d504c454d454e544154494f4e000000000000000000604482015290519081900360640190fd5b9250505090565b3660008037600080366000845af43d6000803e8080156101cf573d6000f35b3d6000fdfea26469706673582212205ea5c736a3ee4de523d494d0cd9fdcf7acaceb69007e4fe31ab218aa7aef409e64736f6c6343000608003360a0604052348015600f57600080fd5b5033606081901b608052607d61002d60003980600f5250607d6000f3fe6080604052336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614603f5760005460005260206000f35b60003560005500fea2646970667358221220110007ea8963cb63ac49d82ebbe9c527d671784f58c4ddbee2d3f38423bfeaa964736f6c6343000608003360a060405234801561001057600080fd5b5033606081901b60805261010561003060003980603252506101056000f3fe608060405236601057600e6013565b005b600e5b60196027565b602560216087565b60ac565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614606057605c6025565b6025565b6000357f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a55005b7f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a5490565b3660008037600080366000845af43d6000803e80801560ca573d6000f35b3d6000fdfea2646970667358221220fa349e8a6a3294fc03f618900c3f4393f3c494bd3c2c07860da7ac1bc54a0c6b64736f6c63430006080033a26469706673582212206a94237a2fe077a81c0805041a540b092d885ef1f2438784c95500dd5948e81464736f6c63430006080033", + "solcInputHash": "0xd54b2fd043b0d0ad87e570456bf439f2f7ceafbd68a1e6b5b75539fd97bf62e4", + "metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"DeploymentApprovalGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"DeploymentApprovalRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ImplementationCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"ManyToOne_ImplementationLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ImplementationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ProxyDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"name\":\"OneToOne_ImplementationLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"OneToOne_ImplementationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"OneToOne_ProxyDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"approveDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"computeHolderAddressManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originator\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"computeProxyAddressManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originator\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"computeProxyAddressOneToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"createManyToOneProxyRelationship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"deployProxyManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"deployProxyOneToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getImplementationHolder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"getImplementationHolder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"isApprovedDeployer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"isImplementationLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"name\":\"isImplementationLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"lockImplementationManyToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"name\":\"lockImplementationOneToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"revokeDeployerApproval\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"setImplementationAddressManyToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"setImplementationAddressOneToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Contract that manages deployment and upgrades of delegatecall proxies. An implementation identifier can be created on the proxy manager which is used to specify the logic address for a particular contract type, and to upgrade the implementation as needed. ====== Proxy Types ====== A one-to-one proxy is a single proxy contract with an upgradeable implementation address. A many-to-one proxy is a single upgradeable implementation address that may be used by many proxy contracts. ====== Access Control ====== The proxy manager has a single address as its owner. The owner is the sole account with the following permissions: - Create new many-to-one implementations - Create new one-to-one proxies - Modify the implementation address of existing proxies - Lock proxies - Designate approved deployers - Remove approved deployers - Modify the owner address Approved deployers may only deploy many-to-one proxies. ====== Upgrades ====== Proxies can be upgraded by the owner if they are not locked. Many-to-one proxy implementations are upgraded by calling the holder contract for the implementation ID being upgraded. One-to-one proxies are upgraded by calling the proxy contract directly. The owner can lock a one-to-one proxy or many-to-one implementation ID so that it becomes impossible to upgrade.\",\"kind\":\"dev\",\"methods\":{\"approveDeployer(address)\":{\"details\":\"Allows `deployer` to deploy many-to-one proxies.\"},\"computeHolderAddressManyToOne(bytes32)\":{\"details\":\"Computes the create2 address of the implementation holder for `implementationID`.\",\"params\":{\"implementationID\":\"The identifier for the contract implementation.\"}},\"computeProxyAddressManyToOne(address,bytes32,bytes32)\":{\"details\":\"Computes the create2 address for a many-to-one proxy for the implementation `implementationID` requested by `originator` using `suppliedSalt`.\",\"params\":{\"implementationID\":\"The identifier for the contract implementation.\",\"originator\":\"Address of the account requesting deployment.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"computeProxyAddressOneToOne(address,bytes32)\":{\"details\":\"Computes the create2 address for a one-to-one proxy requested by `originator` using `suppliedSalt`.\",\"params\":{\"originator\":\"Address of the account requesting deployment.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"createManyToOneProxyRelationship(bytes32,address)\":{\"details\":\"Creates a many-to-one proxy relationship. Deploys an implementation holder contract which stores the implementation address for many proxies. The implementation address can be updated on the holder to change the runtime code used by all its proxies.\",\"params\":{\"implementation\":\"Address with the runtime code the proxies should use.\",\"implementationID\":\"ID for the implementation, used to identify the proxies that use it. Also used as the salt in the create2 call when deploying the implementation holder contract.\"}},\"deployProxyManyToOne(bytes32,bytes32)\":{\"details\":\"Deploy a proxy with a many-to-one relationship with its implemenation. The proxy will call the implementation holder for every transaction to determine the address to use in calls.\",\"params\":{\"implementationID\":\"Identifier for the proxy's implementation.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"deployProxyOneToOne(bytes32,address)\":{\"details\":\"Deploy a proxy contract with a one-to-one relationship with its implementation. The proxy will have its own implementation address which can be updated by the proxy manager.\",\"params\":{\"implementation\":\"Address of the contract with the runtime code that the proxy should use.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"getImplementationHolder()\":{\"details\":\"Queries the temporary storage value `_implementationHolder`. This is used in the constructor of the many-to-one proxy contract so that the create2 address is static (adding constructor arguments would change the codehash) and the implementation holder can be stored as a constant.\"},\"getImplementationHolder(bytes32)\":{\"details\":\"Returns the address of the implementation holder contract for `implementationID`.\"},\"isApprovedDeployer(address)\":{\"details\":\"Returns a boolean stating whether `deployer` is allowed to deploy many-to-one proxies.\"},\"isImplementationLocked(address)\":{\"details\":\"Returns a boolean stating whether `proxyAddress` is locked.\"},\"isImplementationLocked(bytes32)\":{\"details\":\"Returns a boolean stating whether `implementationID` is locked.\"},\"lockImplementationManyToOne(bytes32)\":{\"details\":\"Lock the current implementation for `implementationID` so that it can never be upgraded again.\"},\"lockImplementationOneToOne(address)\":{\"details\":\"Lock the current implementation for `proxyAddress` so that it can never be upgraded again.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"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.\"},\"revokeDeployerApproval(address)\":{\"details\":\"Prevents `deployer` from deploying many-to-one proxies.\"},\"setImplementationAddressManyToOne(bytes32,address)\":{\"details\":\"Updates the implementation address for a many-to-one proxy relationship.\",\"params\":{\"implementation\":\"Address with the runtime code the proxies should use.\",\"implementationID\":\"Identifier for the implementation.\"}},\"setImplementationAddressOneToOne(address,address)\":{\"details\":\"Updates the implementation address for a one-to-one proxy. Note: This could work for many-to-one as well if the caller provides the implementation holder address in place of the proxy address, as they use the same access control and update mechanism.\",\"params\":{\"implementation\":\"Address with the runtime code for the proxy to use.\",\"proxyAddress\":\"Address of the deployed proxy\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/DelegateCallProxyManager.sol\":\"DelegateCallProxyManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/GSN/Context.sol\":{\"keccak256\":\"0xdb26cbf4d028490f49831a7865c2fe1b28db44b535ca8d343785a3b768aae183\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://840b14ce0315c47d49ba328f1f9fa7654ded1c9e1559e6c5e777a7b2dc28bf0a\",\"dweb:/ipfs/QmTLLabn4wcfGro9LEmUXUN2nwKqZSotXMvjDCLXEnLtZP\"]},\"@openzeppelin/contracts/access/Ownable.sol\":{\"keccak256\":\"0x4bd6402ca6b3419008c2b482aff54e66836e8cb4eba2680e42ac5884ae6424fc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8f9f711fb8d0d92aeea1c327e3845d13ca1fa8f142e47f8723cd5b3106fb29a3\",\"dweb:/ipfs/QmVQUReDW9f4zGqhizwHnyU8EntMs95tbASdqkGncnikba\"]},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"keccak256\":\"0x302c3404769f7a5a3d68a7035b9ed71a4b1f8a1669afa7895558a11b6accebfa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c413ff3bdda059e93afc96fbcc44c700e5578b7752eb1a3f166dd52d80e27a31\",\"dweb:/ipfs/QmY9xsG9pPtCdwVDWZ58Gmah6dgFBMWTZYQvqLxikKTYdU\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0xf5fa8cbdffa5ef8be49b246b5628facc30b71707e78a45d80d93b64eff3fe390\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://774e78a9ff32792cc95db4d2ceaf3a7965bb7f0bea5e6cb7cff182b450d44b37\",\"dweb:/ipfs/QmRRMC4uj7eAcLW7chynA3sNEYULMFazdLwQHKHQPyzAbA\"]},\"@openzeppelin/contracts/utils/Create2.sol\":{\"keccak256\":\"0x16926b3c19504ea52f73abe41dfa9c1ef9c328d6088b82162d475caecaa47a6d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc578656a08c07f33ecf4a54324bad5f951afdcd990cdab1dcde493d6bb49d9c\",\"dweb:/ipfs/QmbXLJtTaqBg7WwC4p9gsRjA3VEwNwGc6W9afJeAaacF71\"]},\"contracts/CodeHashes.sol\":{\"keccak256\":\"0x2c82d565ac205e9f0de57beba110dc60a816baf11d95a5bfa7a86f5bc93100d9\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6ff1117b88b6ff6e43e634f2d0ac398da58c55bd434a2af3b470795d3aa90ab3\",\"dweb:/ipfs/QmVG71LRUcYwmTNHS2ZJccd8uFqKPCYXt4ahCkRKDHfUvd\"]},\"contracts/DelegateCallProxyManager.sol\":{\"keccak256\":\"0xad6004d879a171c7a111333aa5f0a56b18434f87fa96e741c91e94d38c31dfbb\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6c0da285745e3657792b3b416d925180a2f95c30167807fed994fc84681753bd\",\"dweb:/ipfs/QmeBHdkjm69YCZxnXbmxtiqGpi9s2AaR8HWbxqr46UWvQn\"]},\"contracts/DelegateCallProxyManyToOne.sol\":{\"keccak256\":\"0x24a20a3778980eba1ab27c08c82c973addc1c5b1e64f9efa9535b4275cc86d98\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://e9eb96528c406fccbd50c52ceabfbb6b1815c008cb7bb8e846c0b24eee9050ad\",\"dweb:/ipfs/QmaMFwJ5Pdx7kvtrBs6BUPJJzP6NmHKs1KQiVqCLbxurnn\"]},\"contracts/DelegateCallProxyOneToOne.sol\":{\"keccak256\":\"0xdacbe19ff830076669630ccf0a392a98cbccd4234b656e2dd51cf98899b74bf7\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://8d37ea6c81c79b027dec9702517bbd0e286da01a1bacdc6e40afc8186b52b94b\",\"dweb:/ipfs/QmT4rSUa2K979rd1o6jV1jXk7dgDBCTqfNLg5psQ9uBBMH\"]},\"contracts/ManyToOneImplementationHolder.sol\":{\"keccak256\":\"0x7045007870fb6ef7000a640ccf4a508dad6bfa33280270c42f1cc3ff006fb075\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://be5cab4a88e7e7035501292df790c21c6d42586fde105628d5bbaee8045f9743\",\"dweb:/ipfs/Qmaifp4Txt7TBGBXKNUQemusDGJyESVf9E4aDcjfoKxTUW\"]},\"contracts/SaltyLib.sol\":{\"keccak256\":\"0xdd4f18bcfc3f0761c822c079c2b8177f317edd40c84f85c77fa07a1827b1796b\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://ef7e1818cb47a6ff6ab364162f051d6a3444eb8438015259a71fefd547ccb98e\",\"dweb:/ipfs/QmV2gNBns5YTiF2ENEf7B5SZNUeC6Thw89jGECUoRG5FnN\"]},\"contracts/interfaces/IDelegateCallProxyManager.sol\":{\"keccak256\":\"0x24f7aa01dd4c8592b889d6d81badd244ad9e602232406be5941413418d171421\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://3edfca6e8b608f4e4fd2c86a3eb3146202f9bfd7f26ff4608172894313ea911d\",\"dweb:/ipfs/QmdSvcGykCzAgfkyzofX6DEwbtFnAtjtnb9KddA7YJVtHZ\"]}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b61193c8061007d6000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80639225ce23116100ad578063db97034011610071578063db9703401461033c578063dc7faa0714610362578063dde5c32f14610388578063f2fde38b146103b4578063f9628542146103da5761012c565b80639225ce231461026f578063964c406114610295578063c3242d6b146102c1578063d07ad498146102ed578063d083bc861461031f5761012c565b80635e4ccacf116100f45780635e4ccacf146101ee5780636813a3c21461020b5780636daf503514610239578063715018a61461025f5780638da5cb5b146102675761012c565b80631a5e5bc5146101315780631da0505d146101705780632275a830146101785780634f85f3ea146101975780635b54cf96146101c8575b600080fd5b6101546004803603604081101561014757600080fd5b5080359060200135610406565b604080516001600160a01b039092168252519081900360200190f35b6101546105ba565b6101956004803603602081101561018e57600080fd5b50356105c9565b005b6101b4600480360360208110156101ad57600080fd5b50356106df565b604080519115158252519081900360200190f35b610195600480360360208110156101de57600080fd5b50356001600160a01b0316610762565b6101546004803603602081101561020457600080fd5b5035610816565b6101956004803603604081101561022157600080fd5b506001600160a01b0381358116916020013516610848565b6101956004803603602081101561024f57600080fd5b50356001600160a01b031661095d565b610195610a10565b610154610ab2565b6101b46004803603602081101561028557600080fd5b50356001600160a01b0316610ac1565b610195600480360360408110156102ab57600080fd5b50803590602001356001600160a01b0316610adf565b610195600480360360408110156102d757600080fd5b50803590602001356001600160a01b0316610bca565b6101546004803603606081101561030357600080fd5b506001600160a01b038135169060208101359060400135610d40565b6101546004803603602081101561033557600080fd5b5035610d83565b6101956004803603602081101561035257600080fd5b50356001600160a01b0316610d9e565b6101b46004803603602081101561037857600080fd5b50356001600160a01b0316610e4e565b6101546004803603604081101561039e57600080fd5b506001600160a01b038135169060200135610e6c565b610195600480360360208110156103ca57600080fd5b50356001600160a01b0316610ead565b610154600480360360408110156103f057600080fd5b50803590602001356001600160a01b0316610fa5565b600080610411611082565b6001600160a01b03811660009081526001602052604090205490915060ff1680610453575061043e610ab2565b6001600160a01b0316816001600160a01b0316145b610497576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d054141493d5915160821b604482015290519081900360640190fd5b6000848152600260205260409020546001600160a01b0316806104f9576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b600061050d610506611082565b8787611086565b600480546001600160a01b0319166001600160a01b03851617905560405190915061055b9060009083906105436020820161140a565b601f1982820381018352601f909101166040526110d3565b600480546001600160a01b0319169055604080518881526001600160a01b038316602082015281519296507f7b2f1f9260fa3ce14c2f36f34469f302e66164e3da9dbff6b24c723bcd39d115929081900390910190a150505092915050565b6004546001600160a01b031690565b6105d1611082565b6000546001600160a01b03908116911614610621576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000818152600260205260409020546001600160a01b031680610683576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b038116600090815260036020908152604091829020805460ff19166001179055815184815291517fd62bff6e969424de31ee669b9853f7f90fc209ef41f5721bf62c502e7b2a3d089281900390910190a15050565b6000818152600260205260408120546001600160a01b031680610741576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b031660009081526003602052604090205460ff1692915050565b61076a611082565b6000546001600160a01b039081169116146107ba576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260016020818152604092839020805460ff1916909217909155815192835290517fa8320d9911124be4bd8a47fe086523f921e913be4659887a823d16c1a7c567b39281900390910190a150565b6000610842827ffc7aed17e5c5d36a15e443235cb9c59bae4a013202cde6ab3e657fa1176d7f3e6111e4565b92915050565b610850611082565b6000546001600160a01b039081169116146108a0576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b03821660009081526003602052604090205460ff161561090a576040805162461bcd60e51b815260206004820152601960248201527811549497d2535413115351539510551253d397d313d0d2d151603a1b604482015290519081900360640190fd5b61091482826111f8565b604080516001600160a01b0380851682528316602082015281517f52f99278569fbf4dd0ee15eb946bc8d758d614d1917ff0faf9b326dd4aada643929181900390910190a15050565b610965611082565b6000546001600160a01b039081169116146109b5576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260036020908152604091829020805460ff19166001179055815192835290517ff51e53e36caf2e8338b84c69c3919eb728c75e5961f866d09697d8cdce7432df9281900390910190a150565b610a18611082565b6000546001600160a01b03908116911614610a68576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6001600160a01b031660009081526003602052604090205460ff1690565b610ae7611082565b6000546001600160a01b03908116911614610b37576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000610b4f6000846040518060200161054390611417565b600084815260026020526040902080546001600160a01b0319166001600160a01b0383161790559050610b8281836111f8565b604080518481526001600160a01b038416602082015281517f06e1ff8de03513a819420b2e2f57764e89938cd88b8769998326edf2703c2338929181900390910190a1505050565b610bd2611082565b6000546001600160a01b03908116911614610c22576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000828152600260205260409020546001600160a01b031680610c84576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b03811660009081526003602052604090205460ff1615610cee576040805162461bcd60e51b815260206004820152601960248201527811549497d2535413115351539510551253d397d313d0d2d151603a1b604482015290519081900360640190fd5b610cf881836111f8565b604080518481526001600160a01b038416602082015281517f43440a819e0e769fd70fc34ea1c8462915e7170e4396fb7595b450a09d0cdf38929181900390910190a1505050565b600080610d4e858585611086565b9050610d7a817f8fb4522edc5e0645a7ae5cfdbfe3b34d4a14de9e0279b74da795856b5ef4f1e66111e4565b95945050505050565b6000908152600260205260409020546001600160a01b031690565b610da6611082565b6000546001600160a01b03908116911614610df6576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260016020908152604091829020805460ff19169055815192835290517ff0f9ad55989ce899961b5c41524ba369cda0a1fcd9301dd0c868430e69c41b759281900390910190a150565b6001600160a01b031660009081526001602052604090205460ff1690565b600080610e798484611364565b9050610ea5817fdf533b6e999d326280ce88ca39ea2eddf95ed96f6c153ed5642d9b0a95dba4a26111e4565b949350505050565b610eb5611082565b6000546001600160a01b03908116911614610f05576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4a5760405162461bcd60e51b81526004018080602001828103825260268152602001806118c16026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610faf611082565b6000546001600160a01b03908116911614610fff576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b600061101261100c611082565b85611364565b905061102a6000826040518060200161054390611423565b915061103682846111f8565b604080516001600160a01b0380851682528516602082015281517f66708f841fd2ea7b5488d47d39951f9f79cb1033a9c5e0d1e98f76cdb8ba1e88929181900390910190a15092915050565b3390565b6040805160609490941b6bffffffffffffffffffffffff19166020808601919091526034850193909352605480850192909252805180850390920182526074909301909252815191012090565b6000808447101561112b576040805162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b825161117e576040805162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015290519081900360640190fd5b8383516020850187f590506001600160a01b038116610ea5576040805162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015290519081900360640190fd5b60006111f18383306113a9565b9392505050565b61120181611404565b611245576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d0d3d395149050d560821b604482015290519081900360640190fd5b6000826001600160a01b03168260405160200180826001600160a01b031681526020019150506040516020818303038152906040526040518082805190602001908083835b602083106112a95780518252601f19909201916020918201910161128a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461130b576040519150601f19603f3d011682016040523d82523d6000602084013e611310565b606091505b505090508061135f576040805162461bcd60e51b815260206004820152601660248201527511549497d4d15517d05111149154d4d7d4915591549560521b604482015290519081900360640190fd5b505050565b6000828260405160200180836001600160a01b031660601b81526014018281526020019250505060405160208183030381529060405280519060200120905092915050565b604080516001600160f81b031960208083019190915260609390931b6bffffffffffffffffffffffff191660218201526035810194909452605580850193909352805180850390930183526075909301909252805191012090565b3b151590565b6102b18061143183390190565b60aa806116e283390190565b6101358061178c8339019056fe60a060405234801561001057600080fd5b50336001600160a01b0316631da0505d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561004a57600080fd5b505afa15801561005e573d6000803e3d6000fd5b505050506040513d602081101561007457600080fd5b5051606081901b6001600160601b0319166080526001600160a01b031661020a6100a7600039806046525061020a6000f3fe60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a610031565b6101b0565b565b60405160009081906060906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083818181855afa9150503d806000811461009d576040519150601f19603f3d011682016040523d82523d6000602084013e6100a2565b606091505b50915091508181906101325760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156100f75781810151838201526020016100df565b50505050905090810190601f1680156101245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600081806020019051602081101561014a57600080fd5b505190506001600160a01b0381166101a9576040805162461bcd60e51b815260206004820152601760248201527f4552525f4e554c4c5f494d504c454d454e544154494f4e000000000000000000604482015290519081900360640190fd5b9250505090565b3660008037600080366000845af43d6000803e8080156101cf573d6000f35b3d6000fdfea2646970667358221220a87867c818d1cc630f8c80138e49dc1cd74c60b8055aff3acb3df87a306c802464736f6c634300060c003360a0604052348015600f57600080fd5b5033606081901b608052607d61002d60003980600f5250607d6000f3fe6080604052336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614603f5760005460005260206000f35b60003560005500fea26469706673582212207b7be31d5f4c47a2747eeb08f94f4d95410f4b18c218276fbf64166c0847879f64736f6c634300060c003360a060405234801561001057600080fd5b5033606081901b60805261010561003060003980603252506101056000f3fe608060405236601057600e6013565b005b600e5b60196027565b602560216087565b60ac565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614606057605c6025565b6025565b6000357f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a55005b7f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a5490565b3660008037600080366000845af43d6000803e80801560ca573d6000f35b3d6000fdfea26469706673582212201d5d6ac3fbe2ff956c757ddb03b461d8f29475cb9a2baf6e1fc8bf35fcdbc70564736f6c634300060c00334f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220da21269baf9a935b77c35af61305bb6bb8c95863bbcf7758f6caa6a1594110e564736f6c634300060c0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80639225ce23116100ad578063db97034011610071578063db9703401461033c578063dc7faa0714610362578063dde5c32f14610388578063f2fde38b146103b4578063f9628542146103da5761012c565b80639225ce231461026f578063964c406114610295578063c3242d6b146102c1578063d07ad498146102ed578063d083bc861461031f5761012c565b80635e4ccacf116100f45780635e4ccacf146101ee5780636813a3c21461020b5780636daf503514610239578063715018a61461025f5780638da5cb5b146102675761012c565b80631a5e5bc5146101315780631da0505d146101705780632275a830146101785780634f85f3ea146101975780635b54cf96146101c8575b600080fd5b6101546004803603604081101561014757600080fd5b5080359060200135610406565b604080516001600160a01b039092168252519081900360200190f35b6101546105ba565b6101956004803603602081101561018e57600080fd5b50356105c9565b005b6101b4600480360360208110156101ad57600080fd5b50356106df565b604080519115158252519081900360200190f35b610195600480360360208110156101de57600080fd5b50356001600160a01b0316610762565b6101546004803603602081101561020457600080fd5b5035610816565b6101956004803603604081101561022157600080fd5b506001600160a01b0381358116916020013516610848565b6101956004803603602081101561024f57600080fd5b50356001600160a01b031661095d565b610195610a10565b610154610ab2565b6101b46004803603602081101561028557600080fd5b50356001600160a01b0316610ac1565b610195600480360360408110156102ab57600080fd5b50803590602001356001600160a01b0316610adf565b610195600480360360408110156102d757600080fd5b50803590602001356001600160a01b0316610bca565b6101546004803603606081101561030357600080fd5b506001600160a01b038135169060208101359060400135610d40565b6101546004803603602081101561033557600080fd5b5035610d83565b6101956004803603602081101561035257600080fd5b50356001600160a01b0316610d9e565b6101b46004803603602081101561037857600080fd5b50356001600160a01b0316610e4e565b6101546004803603604081101561039e57600080fd5b506001600160a01b038135169060200135610e6c565b610195600480360360208110156103ca57600080fd5b50356001600160a01b0316610ead565b610154600480360360408110156103f057600080fd5b50803590602001356001600160a01b0316610fa5565b600080610411611082565b6001600160a01b03811660009081526001602052604090205490915060ff1680610453575061043e610ab2565b6001600160a01b0316816001600160a01b0316145b610497576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d054141493d5915160821b604482015290519081900360640190fd5b6000848152600260205260409020546001600160a01b0316806104f9576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b600061050d610506611082565b8787611086565b600480546001600160a01b0319166001600160a01b03851617905560405190915061055b9060009083906105436020820161140a565b601f1982820381018352601f909101166040526110d3565b600480546001600160a01b0319169055604080518881526001600160a01b038316602082015281519296507f7b2f1f9260fa3ce14c2f36f34469f302e66164e3da9dbff6b24c723bcd39d115929081900390910190a150505092915050565b6004546001600160a01b031690565b6105d1611082565b6000546001600160a01b03908116911614610621576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000818152600260205260409020546001600160a01b031680610683576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b038116600090815260036020908152604091829020805460ff19166001179055815184815291517fd62bff6e969424de31ee669b9853f7f90fc209ef41f5721bf62c502e7b2a3d089281900390910190a15050565b6000818152600260205260408120546001600160a01b031680610741576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b031660009081526003602052604090205460ff1692915050565b61076a611082565b6000546001600160a01b039081169116146107ba576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260016020818152604092839020805460ff1916909217909155815192835290517fa8320d9911124be4bd8a47fe086523f921e913be4659887a823d16c1a7c567b39281900390910190a150565b6000610842827ffc7aed17e5c5d36a15e443235cb9c59bae4a013202cde6ab3e657fa1176d7f3e6111e4565b92915050565b610850611082565b6000546001600160a01b039081169116146108a0576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b03821660009081526003602052604090205460ff161561090a576040805162461bcd60e51b815260206004820152601960248201527811549497d2535413115351539510551253d397d313d0d2d151603a1b604482015290519081900360640190fd5b61091482826111f8565b604080516001600160a01b0380851682528316602082015281517f52f99278569fbf4dd0ee15eb946bc8d758d614d1917ff0faf9b326dd4aada643929181900390910190a15050565b610965611082565b6000546001600160a01b039081169116146109b5576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260036020908152604091829020805460ff19166001179055815192835290517ff51e53e36caf2e8338b84c69c3919eb728c75e5961f866d09697d8cdce7432df9281900390910190a150565b610a18611082565b6000546001600160a01b03908116911614610a68576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6001600160a01b031660009081526003602052604090205460ff1690565b610ae7611082565b6000546001600160a01b03908116911614610b37576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000610b4f6000846040518060200161054390611417565b600084815260026020526040902080546001600160a01b0319166001600160a01b0383161790559050610b8281836111f8565b604080518481526001600160a01b038416602082015281517f06e1ff8de03513a819420b2e2f57764e89938cd88b8769998326edf2703c2338929181900390910190a1505050565b610bd2611082565b6000546001600160a01b03908116911614610c22576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000828152600260205260409020546001600160a01b031680610c84576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b03811660009081526003602052604090205460ff1615610cee576040805162461bcd60e51b815260206004820152601960248201527811549497d2535413115351539510551253d397d313d0d2d151603a1b604482015290519081900360640190fd5b610cf881836111f8565b604080518481526001600160a01b038416602082015281517f43440a819e0e769fd70fc34ea1c8462915e7170e4396fb7595b450a09d0cdf38929181900390910190a1505050565b600080610d4e858585611086565b9050610d7a817f8fb4522edc5e0645a7ae5cfdbfe3b34d4a14de9e0279b74da795856b5ef4f1e66111e4565b95945050505050565b6000908152600260205260409020546001600160a01b031690565b610da6611082565b6000546001600160a01b03908116911614610df6576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260016020908152604091829020805460ff19169055815192835290517ff0f9ad55989ce899961b5c41524ba369cda0a1fcd9301dd0c868430e69c41b759281900390910190a150565b6001600160a01b031660009081526001602052604090205460ff1690565b600080610e798484611364565b9050610ea5817fdf533b6e999d326280ce88ca39ea2eddf95ed96f6c153ed5642d9b0a95dba4a26111e4565b949350505050565b610eb5611082565b6000546001600160a01b03908116911614610f05576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4a5760405162461bcd60e51b81526004018080602001828103825260268152602001806118c16026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610faf611082565b6000546001600160a01b03908116911614610fff576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b600061101261100c611082565b85611364565b905061102a6000826040518060200161054390611423565b915061103682846111f8565b604080516001600160a01b0380851682528516602082015281517f66708f841fd2ea7b5488d47d39951f9f79cb1033a9c5e0d1e98f76cdb8ba1e88929181900390910190a15092915050565b3390565b6040805160609490941b6bffffffffffffffffffffffff19166020808601919091526034850193909352605480850192909252805180850390920182526074909301909252815191012090565b6000808447101561112b576040805162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b825161117e576040805162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015290519081900360640190fd5b8383516020850187f590506001600160a01b038116610ea5576040805162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015290519081900360640190fd5b60006111f18383306113a9565b9392505050565b61120181611404565b611245576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d0d3d395149050d560821b604482015290519081900360640190fd5b6000826001600160a01b03168260405160200180826001600160a01b031681526020019150506040516020818303038152906040526040518082805190602001908083835b602083106112a95780518252601f19909201916020918201910161128a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461130b576040519150601f19603f3d011682016040523d82523d6000602084013e611310565b606091505b505090508061135f576040805162461bcd60e51b815260206004820152601660248201527511549497d4d15517d05111149154d4d7d4915591549560521b604482015290519081900360640190fd5b505050565b6000828260405160200180836001600160a01b031660601b81526014018281526020019250505060405160208183030381529060405280519060200120905092915050565b604080516001600160f81b031960208083019190915260609390931b6bffffffffffffffffffffffff191660218201526035810194909452605580850193909352805180850390930183526075909301909252805191012090565b3b151590565b6102b18061143183390190565b60aa806116e283390190565b6101358061178c8339019056fe60a060405234801561001057600080fd5b50336001600160a01b0316631da0505d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561004a57600080fd5b505afa15801561005e573d6000803e3d6000fd5b505050506040513d602081101561007457600080fd5b5051606081901b6001600160601b0319166080526001600160a01b031661020a6100a7600039806046525061020a6000f3fe60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a610031565b6101b0565b565b60405160009081906060906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083818181855afa9150503d806000811461009d576040519150601f19603f3d011682016040523d82523d6000602084013e6100a2565b606091505b50915091508181906101325760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156100f75781810151838201526020016100df565b50505050905090810190601f1680156101245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600081806020019051602081101561014a57600080fd5b505190506001600160a01b0381166101a9576040805162461bcd60e51b815260206004820152601760248201527f4552525f4e554c4c5f494d504c454d454e544154494f4e000000000000000000604482015290519081900360640190fd5b9250505090565b3660008037600080366000845af43d6000803e8080156101cf573d6000f35b3d6000fdfea2646970667358221220a87867c818d1cc630f8c80138e49dc1cd74c60b8055aff3acb3df87a306c802464736f6c634300060c003360a0604052348015600f57600080fd5b5033606081901b608052607d61002d60003980600f5250607d6000f3fe6080604052336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614603f5760005460005260206000f35b60003560005500fea26469706673582212207b7be31d5f4c47a2747eeb08f94f4d95410f4b18c218276fbf64166c0847879f64736f6c634300060c003360a060405234801561001057600080fd5b5033606081901b60805261010561003060003980603252506101056000f3fe608060405236601057600e6013565b005b600e5b60196027565b602560216087565b60ac565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614606057605c6025565b6025565b6000357f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a55005b7f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a5490565b3660008037600080366000845af43d6000803e80801560ca573d6000f35b3d6000fdfea26469706673582212201d5d6ac3fbe2ff956c757ddb03b461d8f29475cb9a2baf6e1fc8bf35fcdbc70564736f6c634300060c00334f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220da21269baf9a935b77c35af61305bb6bb8c95863bbcf7758f6caa6a1594110e564736f6c634300060c0033", "devdoc": { - "details": "Contract that manages deployment and upgrades of delegatecall proxies. * An implementation identifier can be created on the proxy manager which is used to specify the logic address for a particular contract type, and to upgrade the implementation as needed. * A one-to-one proxy is a single proxy contract with an upgradeable implementation address. * A many-to-one proxy is a single upgradeable implementation address that may be used by many proxy contracts.", + "details": "Contract that manages deployment and upgrades of delegatecall proxies. An implementation identifier can be created on the proxy manager which is used to specify the logic address for a particular contract type, and to upgrade the implementation as needed. ====== Proxy Types ====== A one-to-one proxy is a single proxy contract with an upgradeable implementation address. A many-to-one proxy is a single upgradeable implementation address that may be used by many proxy contracts. ====== Access Control ====== The proxy manager has a single address as its owner. The owner is the sole account with the following permissions: - Create new many-to-one implementations - Create new one-to-one proxies - Modify the implementation address of existing proxies - Lock proxies - Designate approved deployers - Remove approved deployers - Modify the owner address Approved deployers may only deploy many-to-one proxies. ====== Upgrades ====== Proxies can be upgraded by the owner if they are not locked. Many-to-one proxy implementations are upgraded by calling the holder contract for the implementation ID being upgraded. One-to-one proxies are upgraded by calling the proxy contract directly. The owner can lock a one-to-one proxy or many-to-one implementation ID so that it becomes impossible to upgrade.", + "kind": "dev", "methods": { "approveDeployer(address)": { "details": "Allows `deployer` to deploy many-to-one proxies." @@ -466,21 +585,21 @@ } }, "createManyToOneProxyRelationship(bytes32,address)": { - "details": "Creates a many-to-one proxy relationship. * Deploys an implementation holder contract which stores the implementation address for many proxies. The implementation address can be updated on the holder to change the runtime code used by all its proxies.", + "details": "Creates a many-to-one proxy relationship. Deploys an implementation holder contract which stores the implementation address for many proxies. The implementation address can be updated on the holder to change the runtime code used by all its proxies.", "params": { "implementation": "Address with the runtime code the proxies should use.", "implementationID": "ID for the implementation, used to identify the proxies that use it. Also used as the salt in the create2 call when deploying the implementation holder contract." } }, "deployProxyManyToOne(bytes32,bytes32)": { - "details": "Deploy a proxy with a many-to-one relationship with its implemenation. * The proxy will call the implementation holder for every transaction to determine the address to use in calls.", + "details": "Deploy a proxy with a many-to-one relationship with its implemenation. The proxy will call the implementation holder for every transaction to determine the address to use in calls.", "params": { "implementationID": "Identifier for the proxy's implementation.", "suppliedSalt": "Salt provided by the account requesting deployment." } }, "deployProxyOneToOne(bytes32,address)": { - "details": "Deploy a proxy contract with a one-to-one relationship with its implementation. * The proxy will have its own implementation address which can be updated by the proxy manager.", + "details": "Deploy a proxy contract with a one-to-one relationship with its implementation. The proxy will have its own implementation address which can be updated by the proxy manager.", "params": { "implementation": "Address of the contract with the runtime code that the proxy should use.", "suppliedSalt": "Salt provided by the account requesting deployment." @@ -492,6 +611,27 @@ "getImplementationHolder(bytes32)": { "details": "Returns the address of the implementation holder contract for `implementationID`." }, + "isApprovedDeployer(address)": { + "details": "Returns a boolean stating whether `deployer` is allowed to deploy many-to-one proxies." + }, + "isImplementationLocked(address)": { + "details": "Returns a boolean stating whether `proxyAddress` is locked." + }, + "isImplementationLocked(bytes32)": { + "details": "Returns a boolean stating whether `implementationID` is locked." + }, + "lockImplementationManyToOne(bytes32)": { + "details": "Lock the current implementation for `implementationID` so that it can never be upgraded again." + }, + "lockImplementationOneToOne(address)": { + "details": "Lock the current implementation for `proxyAddress` so that it can never be upgraded again." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "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." + }, "revokeDeployerApproval(address)": { "details": "Prevents `deployer` from deploying many-to-one proxies." }, @@ -503,21 +643,27 @@ } }, "setImplementationAddressOneToOne(address,address)": { - "details": "Updates the implementation address for a one-to-one proxy. * Note: This could work for many-to-one as well if the caller provides the implementation holder address in place of the proxy address, as they use the same access control and update mechanism.", + "details": "Updates the implementation address for a one-to-one proxy. Note: This could work for many-to-one as well if the caller provides the implementation holder address in place of the proxy address, as they use the same access control and update mechanism.", "params": { "implementation": "Address with the runtime code for the proxy to use.", "proxyAddress": "Address of the deployed proxy" } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." } - } + }, + "version": 1 }, "userdoc": { - "methods": {} + "kind": "user", + "methods": {}, + "version": 1 }, "storageLayout": { "storage": [ { - "astId": 9110, + "astId": 8108, "contract": "contracts/DelegateCallProxyManager.sol:DelegateCallProxyManager", "label": "_owner", "offset": 0, @@ -525,7 +671,7 @@ "type": "t_address" }, { - "astId": 8518, + "astId": 8650, "contract": "contracts/DelegateCallProxyManager.sol:DelegateCallProxyManager", "label": "_approvedDeployers", "offset": 0, @@ -533,7 +679,7 @@ "type": "t_mapping(t_address,t_bool)" }, { - "astId": 8522, + "astId": 8654, "contract": "contracts/DelegateCallProxyManager.sol:DelegateCallProxyManager", "label": "_implementationHolders", "offset": 0, @@ -541,11 +687,19 @@ "type": "t_mapping(t_bytes32,t_address)" }, { - "astId": 8524, + "astId": 8658, "contract": "contracts/DelegateCallProxyManager.sol:DelegateCallProxyManager", - "label": "_implementationHolder", + "label": "_lockedImplementations", "offset": 0, "slot": "3", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 8660, + "contract": "contracts/DelegateCallProxyManager.sol:DelegateCallProxyManager", + "label": "_implementationHolder", + "offset": 0, + "slot": "4", "type": "t_address" } ], @@ -583,26 +737,31 @@ }, "gasEstimates": { "creation": { - "codeDepositCost": "1008600", - "executionCost": "21888", - "totalCost": "1030488" + "codeDepositCost": "1292000", + "executionCost": "23777", + "totalCost": "1315777" }, "external": { - "approveDeployer(address)": "23058", - "computeHolderAddressManyToOne(bytes32)": "887", - "computeProxyAddressManyToOne(address,bytes32,bytes32)": "1438", - "computeProxyAddressOneToOne(address,bytes32)": "1239", + "approveDeployer(address)": "infinite", + "computeHolderAddressManyToOne(bytes32)": "626", + "computeProxyAddressManyToOne(address,bytes32,bytes32)": "1015", + "computeProxyAddressOneToOne(address,bytes32)": "939", "createManyToOneProxyRelationship(bytes32,address)": "infinite", "deployProxyManyToOne(bytes32,bytes32)": "infinite", "deployProxyOneToOne(bytes32,address)": "infinite", - "getImplementationHolder()": "1105", - "getImplementationHolder(bytes32)": "1234", - "getOwner()": "1126", + "getImplementationHolder()": "1083", + "getImplementationHolder(bytes32)": "1256", "isApprovedDeployer(address)": "1198", - "revokeDeployerApproval(address)": "23045", + "isImplementationLocked(address)": "1177", + "isImplementationLocked(bytes32)": "2137", + "lockImplementationManyToOne(bytes32)": "infinite", + "lockImplementationOneToOne(address)": "infinite", + "owner()": "1148", + "renounceOwnership()": "infinite", + "revokeDeployerApproval(address)": "infinite", "setImplementationAddressManyToOne(bytes32,address)": "infinite", "setImplementationAddressOneToOne(address,address)": "infinite", - "setOwner(address)": "23028" + "transferOwnership(address)": "infinite" }, "internal": { "_setImplementation(address,address)": "infinite" diff --git a/deployments/rinkeby/proxyManager.json b/deployments/rinkeby/proxyManager.json index 9316de1..d363a29 100644 --- a/deployments/rinkeby/proxyManager.json +++ b/deployments/rinkeby/proxyManager.json @@ -50,6 +50,19 @@ "name": "ManyToOne_ImplementationCreated", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "implementationID", + "type": "bytes32" + } + ], + "name": "ManyToOne_ImplementationLocked", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -88,6 +101,19 @@ "name": "ManyToOne_ProxyDeployed", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "name": "OneToOne_ImplementationLocked", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -130,13 +156,19 @@ "anonymous": false, "inputs": [ { - "indexed": false, + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], - "name": "OwnerSet", + "name": "OwnershipTransferred", "type": "event" }, { @@ -323,15 +355,40 @@ "type": "function" }, { - "inputs": [], - "name": "getOwner", - "outputs": [ + "inputs": [ { "internalType": "address", - "name": "", + "name": "deployer", "type": "address" } ], + "name": "isApprovedDeployer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "implementationID", + "type": "bytes32" + } + ], + "name": "isImplementationLocked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, @@ -339,11 +396,11 @@ "inputs": [ { "internalType": "address", - "name": "deployer", + "name": "proxyAddress", "type": "address" } ], - "name": "isApprovedDeployer", + "name": "isImplementationLocked", "outputs": [ { "internalType": "bool", @@ -354,6 +411,52 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "implementationID", + "type": "bytes32" + } + ], + "name": "lockImplementationManyToOne", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "name": "lockImplementationOneToOne", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -407,11 +510,11 @@ "inputs": [ { "internalType": "address", - "name": "owner", + "name": "newOwner", "type": "address" } ], - "name": "setOwner", + "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -420,26 +523,42 @@ "receipt": { "to": null, "from": "0x8740d0EF44FFd926302E36CfAf7A38e61dAD550e", - "contractAddress": "0x242836cdb4578d4C7ce43E07669cDcDcf9cA7483", - "transactionIndex": 9, - "gasUsed": "1161898", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x9dbedf7c69147707c31f31ed592c47151e9284e4705e27db425ada241fd50548", - "transactionHash": "0x22b481e8e5a819da23bf513b82a5558e013120aed4e5e456d0b92b99204c985b", - "logs": [], - "blockNumber": 7381608, - "cumulativeGasUsed": "2428110", + "contractAddress": "0x68Cf58DD7d90bBcfAc51D52bF5005c202B17974c", + "transactionIndex": 14, + "gasUsed": "1470753", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000001000800000000000000000000000000000000020000000000000000000808000000000000000000000000000000400020000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000800000000000000000000000000000000", + "blockHash": "0x06f9ed5267cb04f36ee6fde154c839fe768264b2407e07f9b2a5da8060549553", + "transactionHash": "0xbd5931a4305ad6197b98fe83bacf1003a793d8f975eb6ecf5f4c8c104d73cfbc", + "logs": [ + { + "transactionIndex": 14, + "blockNumber": 7423024, + "transactionHash": "0xbd5931a4305ad6197b98fe83bacf1003a793d8f975eb6ecf5f4c8c104d73cfbc", + "address": "0x68Cf58DD7d90bBcfAc51D52bF5005c202B17974c", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000008740d0ef44ffd926302e36cfaf7a38e61dad550e" + ], + "data": "0x", + "logIndex": 9, + "blockHash": "0x06f9ed5267cb04f36ee6fde154c839fe768264b2407e07f9b2a5da8060549553" + } + ], + "blockNumber": 7423024, + "cumulativeGasUsed": "2762048", "status": 1, "byzantium": true }, - "address": "0x242836cdb4578d4C7ce43E07669cDcDcf9cA7483", + "address": "0x68Cf58DD7d90bBcfAc51D52bF5005c202B17974c", "args": [], - "solcInputHash": "0x77b59efc8347393893a776470c3750c5d736f4c9b50771234cbd2970849fde64", - "metadata": "{\"compiler\":{\"version\":\"0.6.8+commit.0bbfe453\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"DeploymentApprovalGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"DeploymentApprovalRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ImplementationCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ImplementationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ProxyDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"OneToOne_ImplementationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"OneToOne_ProxyDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnerSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"approveDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"computeHolderAddressManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originator\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"computeProxyAddressManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originator\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"computeProxyAddressOneToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"createManyToOneProxyRelationship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"deployProxyManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"deployProxyOneToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getImplementationHolder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"getImplementationHolder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"isApprovedDeployer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"revokeDeployerApproval\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"setImplementationAddressManyToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"setImplementationAddressOneToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"setOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Contract that manages deployment and upgrades of delegatecall proxies. * An implementation identifier can be created on the proxy manager which is used to specify the logic address for a particular contract type, and to upgrade the implementation as needed. * A one-to-one proxy is a single proxy contract with an upgradeable implementation address. * A many-to-one proxy is a single upgradeable implementation address that may be used by many proxy contracts.\",\"methods\":{\"approveDeployer(address)\":{\"details\":\"Allows `deployer` to deploy many-to-one proxies.\"},\"computeHolderAddressManyToOne(bytes32)\":{\"details\":\"Computes the create2 address of the implementation holder for `implementationID`.\",\"params\":{\"implementationID\":\"The identifier for the contract implementation.\"}},\"computeProxyAddressManyToOne(address,bytes32,bytes32)\":{\"details\":\"Computes the create2 address for a many-to-one proxy for the implementation `implementationID` requested by `originator` using `suppliedSalt`.\",\"params\":{\"implementationID\":\"The identifier for the contract implementation.\",\"originator\":\"Address of the account requesting deployment.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"computeProxyAddressOneToOne(address,bytes32)\":{\"details\":\"Computes the create2 address for a one-to-one proxy requested by `originator` using `suppliedSalt`.\",\"params\":{\"originator\":\"Address of the account requesting deployment.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"createManyToOneProxyRelationship(bytes32,address)\":{\"details\":\"Creates a many-to-one proxy relationship. * Deploys an implementation holder contract which stores the implementation address for many proxies. The implementation address can be updated on the holder to change the runtime code used by all its proxies.\",\"params\":{\"implementation\":\"Address with the runtime code the proxies should use.\",\"implementationID\":\"ID for the implementation, used to identify the proxies that use it. Also used as the salt in the create2 call when deploying the implementation holder contract.\"}},\"deployProxyManyToOne(bytes32,bytes32)\":{\"details\":\"Deploy a proxy with a many-to-one relationship with its implemenation. * The proxy will call the implementation holder for every transaction to determine the address to use in calls.\",\"params\":{\"implementationID\":\"Identifier for the proxy's implementation.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"deployProxyOneToOne(bytes32,address)\":{\"details\":\"Deploy a proxy contract with a one-to-one relationship with its implementation. * The proxy will have its own implementation address which can be updated by the proxy manager.\",\"params\":{\"implementation\":\"Address of the contract with the runtime code that the proxy should use.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"getImplementationHolder()\":{\"details\":\"Queries the temporary storage value `_implementationHolder`. This is used in the constructor of the many-to-one proxy contract so that the create2 address is static (adding constructor arguments would change the codehash) and the implementation holder can be stored as a constant.\"},\"getImplementationHolder(bytes32)\":{\"details\":\"Returns the address of the implementation holder contract for `implementationID`.\"},\"revokeDeployerApproval(address)\":{\"details\":\"Prevents `deployer` from deploying many-to-one proxies.\"},\"setImplementationAddressManyToOne(bytes32,address)\":{\"details\":\"Updates the implementation address for a many-to-one proxy relationship.\",\"params\":{\"implementation\":\"Address with the runtime code the proxies should use.\",\"implementationID\":\"Identifier for the implementation.\"}},\"setImplementationAddressOneToOne(address,address)\":{\"details\":\"Updates the implementation address for a one-to-one proxy. * Note: This could work for many-to-one as well if the caller provides the implementation holder address in place of the proxy address, as they use the same access control and update mechanism.\",\"params\":{\"implementation\":\"Address with the runtime code for the proxy to use.\",\"proxyAddress\":\"Address of the deployed proxy\"}}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"contracts/DelegateCallProxyManager.sol\":\"DelegateCallProxyManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"keccak256\":\"0x302c3404769f7a5a3d68a7035b9ed71a4b1f8a1669afa7895558a11b6accebfa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c413ff3bdda059e93afc96fbcc44c700e5578b7752eb1a3f166dd52d80e27a31\",\"dweb:/ipfs/QmY9xsG9pPtCdwVDWZ58Gmah6dgFBMWTZYQvqLxikKTYdU\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0xf5fa8cbdffa5ef8be49b246b5628facc30b71707e78a45d80d93b64eff3fe390\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://774e78a9ff32792cc95db4d2ceaf3a7965bb7f0bea5e6cb7cff182b450d44b37\",\"dweb:/ipfs/QmRRMC4uj7eAcLW7chynA3sNEYULMFazdLwQHKHQPyzAbA\"]},\"@openzeppelin/contracts/utils/Create2.sol\":{\"keccak256\":\"0x16926b3c19504ea52f73abe41dfa9c1ef9c328d6088b82162d475caecaa47a6d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc578656a08c07f33ecf4a54324bad5f951afdcd990cdab1dcde493d6bb49d9c\",\"dweb:/ipfs/QmbXLJtTaqBg7WwC4p9gsRjA3VEwNwGc6W9afJeAaacF71\"]},\"contracts/DelegateCallProxyManager.sol\":{\"keccak256\":\"0xd431a917a91b1a3017e41aece6f48c87fd0107ce7c615e629d2e589ee30f9611\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://1a349d8e39285c5b6e9916d9985aea6eb097de838ceea922e3de62b1f67454b3\",\"dweb:/ipfs/QmVtXsFDg4ke76oSBeJgvhfRynAvKJJE7NPJw39pjLNZwB\"]},\"contracts/DelegateCallProxyManyToOne.sol\":{\"keccak256\":\"0x5c66e1743cbe75b81bbe28afbfaf9449fff116ec1b23257142c874c5bcb38145\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://c9eb69092d20725d4e7df4206778367a60b7d6b9f6fbc02ee8a3d35fcc31e45f\",\"dweb:/ipfs/QmdJ2fwyFp6bP6VsDaG1WehgZ3Z7kyL2Zw8izscLEc6J2f\"]},\"contracts/DelegateCallProxyOneToOne.sol\":{\"keccak256\":\"0xf53b3eab5905040869620aab77a3b57ff4f9c0eea1c4c4e3be3ff6ff33d330f3\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://b7c075d6175b1f28d39f3459f9a311e5195a6bc4a19f33dc580ec7295f604518\",\"dweb:/ipfs/QmSf6KKjVrCc6MLikYgbx6Pd3wgxztnRBWYmjYtF8kMAL2\"]},\"contracts/ManyToOneImplementationHolder.sol\":{\"keccak256\":\"0xd4494c0c40e500143f1f10f713a25869d9e3cfaff6ef393e4769acb68a0e26cd\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://c41b62221661fd0705c09535b052d7d0ee040062d0798fe601bfe69918fd66f4\",\"dweb:/ipfs/QmPak26ZFQwngHQh449LSg6scUAfL8XPvSwYePSGEAjp9L\"]},\"contracts/Owned.sol\":{\"keccak256\":\"0xf3c02fc9ab55ea71f89816bb782f08b3075d5304d1a53dfc43a0e16bad715b1a\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://51023d3e8aa43481a0d072f677dfae2ff66597608533a6d2ec0dbc9dea0e5662\",\"dweb:/ipfs/QmT579XAaDGfEfKQJe4XjxN1hob7bQGkjoHxeyzPf4MeiX\"]},\"contracts/SaltyLib.sol\":{\"keccak256\":\"0x6758976f7afbcaa4ae63eaa4c07486a441bdc55b86c67ce1f9d7dd34e4e78b3c\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://8a73823874aac91e0d2130b0da61ce67726c8e951e16239d7c0223eb33100f16\",\"dweb:/ipfs/QmWpVSpdD1tgeZkmdiHxhYoU8ZFVb6Yf1HsXQjuwUUtitA\"]},\"contracts/interfaces/IDelegateCallProxyManager.sol\":{\"keccak256\":\"0xb31182461a22068986b28376d337cd5b62045a3626e1df6fe4a8bc4dc5341f65\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6d64b71cd1ca41dca7c17a353c1546c2941b787708da32e4297c10611ff5071c\",\"dweb:/ipfs/Qmexmn1w7wmPgnMLeQCqTThWMZR5kr9whipsct3cEj9gem\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b031916331790556113b3806100326000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063964c406111610097578063db97034011610066578063db97034014610289578063dc7faa07146102af578063dde5c32f146102e9578063f962854214610315576100f5565b8063964c4061146101e2578063c3242d6b1461020e578063d07ad4981461023a578063d083bc861461026c576100f5565b80635b54cf96116100d35780635b54cf96146101695780635e4ccacf1461018f5780636813a3c2146101ac578063893d20e8146101da576100f5565b806313af4035146100fa5780631a5e5bc5146101225780631da0505d14610161575b600080fd5b6101206004803603602081101561011057600080fd5b50356001600160a01b0316610341565b005b6101456004803603604081101561013857600080fd5b5080359060200135610432565b604080516001600160a01b039092168252519081900360200190f35b6101456105ba565b6101206004803603602081101561017f57600080fd5b50356001600160a01b03166105c9565b610145600480360360208110156101a557600080fd5b5035610674565b610120600480360360408110156101c257600080fd5b506001600160a01b03813581169160200135166106b0565b610145610752565b610120600480360360408110156101f857600080fd5b50803590602001356001600160a01b0316610761565b6101206004803603604081101561022457600080fd5b50803590602001356001600160a01b0316610843565b6101456004803603606081101561025057600080fd5b506001600160a01b038135169060208101359060400135610946565b6101456004803603602081101561028257600080fd5b5035610973565b6101206004803603602081101561029f57600080fd5b50356001600160a01b031661098e565b6102d5600480360360208110156102c557600080fd5b50356001600160a01b0316610a35565b604080519115158252519081900360200190f35b610145600480360360408110156102ff57600080fd5b506001600160a01b038135169060200135610a53565b6101456004803603604081101561032b57600080fd5b50803590602001356001600160a01b0316610a7e565b6000546001600160a01b03163314610390576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b0381166103de576040805162461bcd60e51b815260206004820152601060248201526f4552525f4e554c4c5f4144445245535360801b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe29181900360200190a150565b600080546001600160a01b031633148061045b57503360009081526001602052604090205460ff165b61049f576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d054141493d5915160821b604482015290519081900360640190fd5b6000838152600260205260409020546001600160a01b031680610501576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b600061050e338686610b4a565b600380546001600160a01b0319166001600160a01b03851617905560405190915061055c90600090839061054460208201610ec7565b601f1982820381018352601f90910116604052610b92565b600380546001600160a01b0319169055604080518781526001600160a01b038316602082015281519295507f7b2f1f9260fa3ce14c2f36f34469f302e66164e3da9dbff6b24c723bcd39d115929081900390910190a1505092915050565b6003546001600160a01b031690565b6000546001600160a01b03163314610618576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b038116600081815260016020818152604092839020805460ff1916909217909155815192835290517fa8320d9911124be4bd8a47fe086523f921e913be4659887a823d16c1a7c567b39281900390910190a150565b60006106aa826040518060200161068a90610ed4565b6020820181038252601f19601f8201166040525080519060200120610ca3565b92915050565b6000546001600160a01b031633146106ff576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6107098282610cb7565b604080516001600160a01b0380851682528316602082015281517f52f99278569fbf4dd0ee15eb946bc8d758d614d1917ff0faf9b326dd4aada643929181900390910190a15050565b6000546001600160a01b031690565b6000546001600160a01b031633146107b0576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b60006107c86000846040518060200161054490610ed4565b600084815260026020526040902080546001600160a01b0319166001600160a01b03831617905590506107fb8183610cb7565b604080518481526001600160a01b038416602082015281517f06e1ff8de03513a819420b2e2f57764e89938cd88b8769998326edf2703c2338929181900390910190a1505050565b6000546001600160a01b03163314610892576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6000828152600260205260409020546001600160a01b0316806108f4576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6108fe8183610cb7565b604080518481526001600160a01b038416602082015281517f43440a819e0e769fd70fc34ea1c8462915e7170e4396fb7595b450a09d0cdf38929181900390910190a1505050565b600080610954858585610b4a565b905061096a816040518060200161068a90610ec7565b95945050505050565b6000908152600260205260409020546001600160a01b031690565b6000546001600160a01b031633146109dd576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b038116600081815260016020908152604091829020805460ff19169055815192835290517ff0f9ad55989ce899961b5c41524ba369cda0a1fcd9301dd0c868430e69c41b759281900390910190a150565b6001600160a01b031660009081526001602052604090205460ff1690565b600080610a608484610e2c565b9050610a76816040518060200161068a90610ee0565b949350505050565b600080546001600160a01b03163314610ace576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6000610ada3385610e2c565b9050610af26000826040518060200161054490610ee0565b9150610afe8284610cb7565b604080516001600160a01b0380851682528516602082015281517f66708f841fd2ea7b5488d47d39951f9f79cb1033a9c5e0d1e98f76cdb8ba1e88929181900390910190a15092915050565b6040805160609490941b6001600160601b0319166020808601919091526034850193909352605480850192909252805180850390920182526074909301909252815191012090565b60008084471015610bea576040805162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b8251610c3d576040805162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015290519081900360640190fd5b8383516020850187f590506001600160a01b038116610a76576040805162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015290519081900360640190fd5b6000610cb0838330610e6b565b9392505050565b610cc081610ec1565b610d04576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d0d3d395149050d560821b604482015290519081900360640190fd5b6000826001600160a01b03168260405160200180826001600160a01b03166001600160a01b031681526020019150506040516020818303038152906040526040518082805190602001908083835b60208310610d715780518252601f199092019160209182019101610d52565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610dd3576040519150601f19603f3d011682016040523d82523d6000602084013e610dd8565b606091505b5050905080610e27576040805162461bcd60e51b815260206004820152601660248201527511549497d4d15517d05111149154d4d7d4915591549560521b604482015290519081900360640190fd5b505050565b6040805160609390931b6001600160601b0319166020808501919091526034808501939093528151808503909301835260549093019052805191012090565b604080516001600160f81b031960208083019190915260609390931b6001600160601b03191660218201526035810194909452605580850193909352805180850390930183526075909301909252805191012090565b3b151590565b6102b180610eee83390190565b60aa8061119f83390190565b610135806112498339019056fe60a060405234801561001057600080fd5b50336001600160a01b0316631da0505d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561004a57600080fd5b505afa15801561005e573d6000803e3d6000fd5b505050506040513d602081101561007457600080fd5b5051606081901b6001600160601b0319166080526001600160a01b031661020a6100a7600039806046525061020a6000f3fe60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a610031565b6101b0565b565b60405160009081906060906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083818181855afa9150503d806000811461009d576040519150601f19603f3d011682016040523d82523d6000602084013e6100a2565b606091505b50915091508181906101325760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156100f75781810151838201526020016100df565b50505050905090810190601f1680156101245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600081806020019051602081101561014a57600080fd5b505190506001600160a01b0381166101a9576040805162461bcd60e51b815260206004820152601760248201527f4552525f4e554c4c5f494d504c454d454e544154494f4e000000000000000000604482015290519081900360640190fd5b9250505090565b3660008037600080366000845af43d6000803e8080156101cf573d6000f35b3d6000fdfea26469706673582212205ea5c736a3ee4de523d494d0cd9fdcf7acaceb69007e4fe31ab218aa7aef409e64736f6c6343000608003360a0604052348015600f57600080fd5b5033606081901b608052607d61002d60003980600f5250607d6000f3fe6080604052336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614603f5760005460005260206000f35b60003560005500fea2646970667358221220110007ea8963cb63ac49d82ebbe9c527d671784f58c4ddbee2d3f38423bfeaa964736f6c6343000608003360a060405234801561001057600080fd5b5033606081901b60805261010561003060003980603252506101056000f3fe608060405236601057600e6013565b005b600e5b60196027565b602560216087565b60ac565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614606057605c6025565b6025565b6000357f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a55005b7f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a5490565b3660008037600080366000845af43d6000803e80801560ca573d6000f35b3d6000fdfea2646970667358221220fa349e8a6a3294fc03f618900c3f4393f3c494bd3c2c07860da7ac1bc54a0c6b64736f6c63430006080033a26469706673582212206a94237a2fe077a81c0805041a540b092d885ef1f2438784c95500dd5948e81464736f6c63430006080033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063964c406111610097578063db97034011610066578063db97034014610289578063dc7faa07146102af578063dde5c32f146102e9578063f962854214610315576100f5565b8063964c4061146101e2578063c3242d6b1461020e578063d07ad4981461023a578063d083bc861461026c576100f5565b80635b54cf96116100d35780635b54cf96146101695780635e4ccacf1461018f5780636813a3c2146101ac578063893d20e8146101da576100f5565b806313af4035146100fa5780631a5e5bc5146101225780631da0505d14610161575b600080fd5b6101206004803603602081101561011057600080fd5b50356001600160a01b0316610341565b005b6101456004803603604081101561013857600080fd5b5080359060200135610432565b604080516001600160a01b039092168252519081900360200190f35b6101456105ba565b6101206004803603602081101561017f57600080fd5b50356001600160a01b03166105c9565b610145600480360360208110156101a557600080fd5b5035610674565b610120600480360360408110156101c257600080fd5b506001600160a01b03813581169160200135166106b0565b610145610752565b610120600480360360408110156101f857600080fd5b50803590602001356001600160a01b0316610761565b6101206004803603604081101561022457600080fd5b50803590602001356001600160a01b0316610843565b6101456004803603606081101561025057600080fd5b506001600160a01b038135169060208101359060400135610946565b6101456004803603602081101561028257600080fd5b5035610973565b6101206004803603602081101561029f57600080fd5b50356001600160a01b031661098e565b6102d5600480360360208110156102c557600080fd5b50356001600160a01b0316610a35565b604080519115158252519081900360200190f35b610145600480360360408110156102ff57600080fd5b506001600160a01b038135169060200135610a53565b6101456004803603604081101561032b57600080fd5b50803590602001356001600160a01b0316610a7e565b6000546001600160a01b03163314610390576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b0381166103de576040805162461bcd60e51b815260206004820152601060248201526f4552525f4e554c4c5f4144445245535360801b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe29181900360200190a150565b600080546001600160a01b031633148061045b57503360009081526001602052604090205460ff165b61049f576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d054141493d5915160821b604482015290519081900360640190fd5b6000838152600260205260409020546001600160a01b031680610501576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b600061050e338686610b4a565b600380546001600160a01b0319166001600160a01b03851617905560405190915061055c90600090839061054460208201610ec7565b601f1982820381018352601f90910116604052610b92565b600380546001600160a01b0319169055604080518781526001600160a01b038316602082015281519295507f7b2f1f9260fa3ce14c2f36f34469f302e66164e3da9dbff6b24c723bcd39d115929081900390910190a1505092915050565b6003546001600160a01b031690565b6000546001600160a01b03163314610618576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b038116600081815260016020818152604092839020805460ff1916909217909155815192835290517fa8320d9911124be4bd8a47fe086523f921e913be4659887a823d16c1a7c567b39281900390910190a150565b60006106aa826040518060200161068a90610ed4565b6020820181038252601f19601f8201166040525080519060200120610ca3565b92915050565b6000546001600160a01b031633146106ff576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6107098282610cb7565b604080516001600160a01b0380851682528316602082015281517f52f99278569fbf4dd0ee15eb946bc8d758d614d1917ff0faf9b326dd4aada643929181900390910190a15050565b6000546001600160a01b031690565b6000546001600160a01b031633146107b0576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b60006107c86000846040518060200161054490610ed4565b600084815260026020526040902080546001600160a01b0319166001600160a01b03831617905590506107fb8183610cb7565b604080518481526001600160a01b038416602082015281517f06e1ff8de03513a819420b2e2f57764e89938cd88b8769998326edf2703c2338929181900390910190a1505050565b6000546001600160a01b03163314610892576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6000828152600260205260409020546001600160a01b0316806108f4576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6108fe8183610cb7565b604080518481526001600160a01b038416602082015281517f43440a819e0e769fd70fc34ea1c8462915e7170e4396fb7595b450a09d0cdf38929181900390910190a1505050565b600080610954858585610b4a565b905061096a816040518060200161068a90610ec7565b95945050505050565b6000908152600260205260409020546001600160a01b031690565b6000546001600160a01b031633146109dd576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6001600160a01b038116600081815260016020908152604091829020805460ff19169055815192835290517ff0f9ad55989ce899961b5c41524ba369cda0a1fcd9301dd0c868430e69c41b759281900390910190a150565b6001600160a01b031660009081526001602052604090205460ff1690565b600080610a608484610e2c565b9050610a76816040518060200161068a90610ee0565b949350505050565b600080546001600160a01b03163314610ace576040805162461bcd60e51b815260206004820152600d60248201526c22a9292fa727aa2fa7aba722a960991b604482015290519081900360640190fd5b6000610ada3385610e2c565b9050610af26000826040518060200161054490610ee0565b9150610afe8284610cb7565b604080516001600160a01b0380851682528516602082015281517f66708f841fd2ea7b5488d47d39951f9f79cb1033a9c5e0d1e98f76cdb8ba1e88929181900390910190a15092915050565b6040805160609490941b6001600160601b0319166020808601919091526034850193909352605480850192909252805180850390920182526074909301909252815191012090565b60008084471015610bea576040805162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b8251610c3d576040805162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015290519081900360640190fd5b8383516020850187f590506001600160a01b038116610a76576040805162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015290519081900360640190fd5b6000610cb0838330610e6b565b9392505050565b610cc081610ec1565b610d04576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d0d3d395149050d560821b604482015290519081900360640190fd5b6000826001600160a01b03168260405160200180826001600160a01b03166001600160a01b031681526020019150506040516020818303038152906040526040518082805190602001908083835b60208310610d715780518252601f199092019160209182019101610d52565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610dd3576040519150601f19603f3d011682016040523d82523d6000602084013e610dd8565b606091505b5050905080610e27576040805162461bcd60e51b815260206004820152601660248201527511549497d4d15517d05111149154d4d7d4915591549560521b604482015290519081900360640190fd5b505050565b6040805160609390931b6001600160601b0319166020808501919091526034808501939093528151808503909301835260549093019052805191012090565b604080516001600160f81b031960208083019190915260609390931b6001600160601b03191660218201526035810194909452605580850193909352805180850390930183526075909301909252805191012090565b3b151590565b6102b180610eee83390190565b60aa8061119f83390190565b610135806112498339019056fe60a060405234801561001057600080fd5b50336001600160a01b0316631da0505d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561004a57600080fd5b505afa15801561005e573d6000803e3d6000fd5b505050506040513d602081101561007457600080fd5b5051606081901b6001600160601b0319166080526001600160a01b031661020a6100a7600039806046525061020a6000f3fe60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a610031565b6101b0565b565b60405160009081906060906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083818181855afa9150503d806000811461009d576040519150601f19603f3d011682016040523d82523d6000602084013e6100a2565b606091505b50915091508181906101325760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156100f75781810151838201526020016100df565b50505050905090810190601f1680156101245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600081806020019051602081101561014a57600080fd5b505190506001600160a01b0381166101a9576040805162461bcd60e51b815260206004820152601760248201527f4552525f4e554c4c5f494d504c454d454e544154494f4e000000000000000000604482015290519081900360640190fd5b9250505090565b3660008037600080366000845af43d6000803e8080156101cf573d6000f35b3d6000fdfea26469706673582212205ea5c736a3ee4de523d494d0cd9fdcf7acaceb69007e4fe31ab218aa7aef409e64736f6c6343000608003360a0604052348015600f57600080fd5b5033606081901b608052607d61002d60003980600f5250607d6000f3fe6080604052336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614603f5760005460005260206000f35b60003560005500fea2646970667358221220110007ea8963cb63ac49d82ebbe9c527d671784f58c4ddbee2d3f38423bfeaa964736f6c6343000608003360a060405234801561001057600080fd5b5033606081901b60805261010561003060003980603252506101056000f3fe608060405236601057600e6013565b005b600e5b60196027565b602560216087565b60ac565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614606057605c6025565b6025565b6000357f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a55005b7f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a5490565b3660008037600080366000845af43d6000803e80801560ca573d6000f35b3d6000fdfea2646970667358221220fa349e8a6a3294fc03f618900c3f4393f3c494bd3c2c07860da7ac1bc54a0c6b64736f6c63430006080033a26469706673582212206a94237a2fe077a81c0805041a540b092d885ef1f2438784c95500dd5948e81464736f6c63430006080033", + "solcInputHash": "0xd54b2fd043b0d0ad87e570456bf439f2f7ceafbd68a1e6b5b75539fd97bf62e4", + "metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"DeploymentApprovalGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"DeploymentApprovalRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ImplementationCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"ManyToOne_ImplementationLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ImplementationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"name\":\"ManyToOne_ProxyDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"name\":\"OneToOne_ImplementationLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"OneToOne_ImplementationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"}],\"name\":\"OneToOne_ProxyDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"approveDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"computeHolderAddressManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originator\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"computeProxyAddressManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originator\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"computeProxyAddressOneToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"createManyToOneProxyRelationship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"}],\"name\":\"deployProxyManyToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"suppliedSalt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"deployProxyOneToOne\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getImplementationHolder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"getImplementationHolder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"isApprovedDeployer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"isImplementationLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"name\":\"isImplementationLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"}],\"name\":\"lockImplementationManyToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"name\":\"lockImplementationOneToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"revokeDeployerApproval\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"implementationID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"setImplementationAddressManyToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"setImplementationAddressOneToOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Contract that manages deployment and upgrades of delegatecall proxies. An implementation identifier can be created on the proxy manager which is used to specify the logic address for a particular contract type, and to upgrade the implementation as needed. ====== Proxy Types ====== A one-to-one proxy is a single proxy contract with an upgradeable implementation address. A many-to-one proxy is a single upgradeable implementation address that may be used by many proxy contracts. ====== Access Control ====== The proxy manager has a single address as its owner. The owner is the sole account with the following permissions: - Create new many-to-one implementations - Create new one-to-one proxies - Modify the implementation address of existing proxies - Lock proxies - Designate approved deployers - Remove approved deployers - Modify the owner address Approved deployers may only deploy many-to-one proxies. ====== Upgrades ====== Proxies can be upgraded by the owner if they are not locked. Many-to-one proxy implementations are upgraded by calling the holder contract for the implementation ID being upgraded. One-to-one proxies are upgraded by calling the proxy contract directly. The owner can lock a one-to-one proxy or many-to-one implementation ID so that it becomes impossible to upgrade.\",\"kind\":\"dev\",\"methods\":{\"approveDeployer(address)\":{\"details\":\"Allows `deployer` to deploy many-to-one proxies.\"},\"computeHolderAddressManyToOne(bytes32)\":{\"details\":\"Computes the create2 address of the implementation holder for `implementationID`.\",\"params\":{\"implementationID\":\"The identifier for the contract implementation.\"}},\"computeProxyAddressManyToOne(address,bytes32,bytes32)\":{\"details\":\"Computes the create2 address for a many-to-one proxy for the implementation `implementationID` requested by `originator` using `suppliedSalt`.\",\"params\":{\"implementationID\":\"The identifier for the contract implementation.\",\"originator\":\"Address of the account requesting deployment.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"computeProxyAddressOneToOne(address,bytes32)\":{\"details\":\"Computes the create2 address for a one-to-one proxy requested by `originator` using `suppliedSalt`.\",\"params\":{\"originator\":\"Address of the account requesting deployment.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"createManyToOneProxyRelationship(bytes32,address)\":{\"details\":\"Creates a many-to-one proxy relationship. Deploys an implementation holder contract which stores the implementation address for many proxies. The implementation address can be updated on the holder to change the runtime code used by all its proxies.\",\"params\":{\"implementation\":\"Address with the runtime code the proxies should use.\",\"implementationID\":\"ID for the implementation, used to identify the proxies that use it. Also used as the salt in the create2 call when deploying the implementation holder contract.\"}},\"deployProxyManyToOne(bytes32,bytes32)\":{\"details\":\"Deploy a proxy with a many-to-one relationship with its implemenation. The proxy will call the implementation holder for every transaction to determine the address to use in calls.\",\"params\":{\"implementationID\":\"Identifier for the proxy's implementation.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"deployProxyOneToOne(bytes32,address)\":{\"details\":\"Deploy a proxy contract with a one-to-one relationship with its implementation. The proxy will have its own implementation address which can be updated by the proxy manager.\",\"params\":{\"implementation\":\"Address of the contract with the runtime code that the proxy should use.\",\"suppliedSalt\":\"Salt provided by the account requesting deployment.\"}},\"getImplementationHolder()\":{\"details\":\"Queries the temporary storage value `_implementationHolder`. This is used in the constructor of the many-to-one proxy contract so that the create2 address is static (adding constructor arguments would change the codehash) and the implementation holder can be stored as a constant.\"},\"getImplementationHolder(bytes32)\":{\"details\":\"Returns the address of the implementation holder contract for `implementationID`.\"},\"isApprovedDeployer(address)\":{\"details\":\"Returns a boolean stating whether `deployer` is allowed to deploy many-to-one proxies.\"},\"isImplementationLocked(address)\":{\"details\":\"Returns a boolean stating whether `proxyAddress` is locked.\"},\"isImplementationLocked(bytes32)\":{\"details\":\"Returns a boolean stating whether `implementationID` is locked.\"},\"lockImplementationManyToOne(bytes32)\":{\"details\":\"Lock the current implementation for `implementationID` so that it can never be upgraded again.\"},\"lockImplementationOneToOne(address)\":{\"details\":\"Lock the current implementation for `proxyAddress` so that it can never be upgraded again.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"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.\"},\"revokeDeployerApproval(address)\":{\"details\":\"Prevents `deployer` from deploying many-to-one proxies.\"},\"setImplementationAddressManyToOne(bytes32,address)\":{\"details\":\"Updates the implementation address for a many-to-one proxy relationship.\",\"params\":{\"implementation\":\"Address with the runtime code the proxies should use.\",\"implementationID\":\"Identifier for the implementation.\"}},\"setImplementationAddressOneToOne(address,address)\":{\"details\":\"Updates the implementation address for a one-to-one proxy. Note: This could work for many-to-one as well if the caller provides the implementation holder address in place of the proxy address, as they use the same access control and update mechanism.\",\"params\":{\"implementation\":\"Address with the runtime code for the proxy to use.\",\"proxyAddress\":\"Address of the deployed proxy\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/DelegateCallProxyManager.sol\":\"DelegateCallProxyManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/GSN/Context.sol\":{\"keccak256\":\"0xdb26cbf4d028490f49831a7865c2fe1b28db44b535ca8d343785a3b768aae183\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://840b14ce0315c47d49ba328f1f9fa7654ded1c9e1559e6c5e777a7b2dc28bf0a\",\"dweb:/ipfs/QmTLLabn4wcfGro9LEmUXUN2nwKqZSotXMvjDCLXEnLtZP\"]},\"@openzeppelin/contracts/access/Ownable.sol\":{\"keccak256\":\"0x4bd6402ca6b3419008c2b482aff54e66836e8cb4eba2680e42ac5884ae6424fc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8f9f711fb8d0d92aeea1c327e3845d13ca1fa8f142e47f8723cd5b3106fb29a3\",\"dweb:/ipfs/QmVQUReDW9f4zGqhizwHnyU8EntMs95tbASdqkGncnikba\"]},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"keccak256\":\"0x302c3404769f7a5a3d68a7035b9ed71a4b1f8a1669afa7895558a11b6accebfa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c413ff3bdda059e93afc96fbcc44c700e5578b7752eb1a3f166dd52d80e27a31\",\"dweb:/ipfs/QmY9xsG9pPtCdwVDWZ58Gmah6dgFBMWTZYQvqLxikKTYdU\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0xf5fa8cbdffa5ef8be49b246b5628facc30b71707e78a45d80d93b64eff3fe390\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://774e78a9ff32792cc95db4d2ceaf3a7965bb7f0bea5e6cb7cff182b450d44b37\",\"dweb:/ipfs/QmRRMC4uj7eAcLW7chynA3sNEYULMFazdLwQHKHQPyzAbA\"]},\"@openzeppelin/contracts/utils/Create2.sol\":{\"keccak256\":\"0x16926b3c19504ea52f73abe41dfa9c1ef9c328d6088b82162d475caecaa47a6d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc578656a08c07f33ecf4a54324bad5f951afdcd990cdab1dcde493d6bb49d9c\",\"dweb:/ipfs/QmbXLJtTaqBg7WwC4p9gsRjA3VEwNwGc6W9afJeAaacF71\"]},\"contracts/CodeHashes.sol\":{\"keccak256\":\"0x2c82d565ac205e9f0de57beba110dc60a816baf11d95a5bfa7a86f5bc93100d9\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6ff1117b88b6ff6e43e634f2d0ac398da58c55bd434a2af3b470795d3aa90ab3\",\"dweb:/ipfs/QmVG71LRUcYwmTNHS2ZJccd8uFqKPCYXt4ahCkRKDHfUvd\"]},\"contracts/DelegateCallProxyManager.sol\":{\"keccak256\":\"0xad6004d879a171c7a111333aa5f0a56b18434f87fa96e741c91e94d38c31dfbb\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6c0da285745e3657792b3b416d925180a2f95c30167807fed994fc84681753bd\",\"dweb:/ipfs/QmeBHdkjm69YCZxnXbmxtiqGpi9s2AaR8HWbxqr46UWvQn\"]},\"contracts/DelegateCallProxyManyToOne.sol\":{\"keccak256\":\"0x24a20a3778980eba1ab27c08c82c973addc1c5b1e64f9efa9535b4275cc86d98\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://e9eb96528c406fccbd50c52ceabfbb6b1815c008cb7bb8e846c0b24eee9050ad\",\"dweb:/ipfs/QmaMFwJ5Pdx7kvtrBs6BUPJJzP6NmHKs1KQiVqCLbxurnn\"]},\"contracts/DelegateCallProxyOneToOne.sol\":{\"keccak256\":\"0xdacbe19ff830076669630ccf0a392a98cbccd4234b656e2dd51cf98899b74bf7\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://8d37ea6c81c79b027dec9702517bbd0e286da01a1bacdc6e40afc8186b52b94b\",\"dweb:/ipfs/QmT4rSUa2K979rd1o6jV1jXk7dgDBCTqfNLg5psQ9uBBMH\"]},\"contracts/ManyToOneImplementationHolder.sol\":{\"keccak256\":\"0x7045007870fb6ef7000a640ccf4a508dad6bfa33280270c42f1cc3ff006fb075\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://be5cab4a88e7e7035501292df790c21c6d42586fde105628d5bbaee8045f9743\",\"dweb:/ipfs/Qmaifp4Txt7TBGBXKNUQemusDGJyESVf9E4aDcjfoKxTUW\"]},\"contracts/SaltyLib.sol\":{\"keccak256\":\"0xdd4f18bcfc3f0761c822c079c2b8177f317edd40c84f85c77fa07a1827b1796b\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://ef7e1818cb47a6ff6ab364162f051d6a3444eb8438015259a71fefd547ccb98e\",\"dweb:/ipfs/QmV2gNBns5YTiF2ENEf7B5SZNUeC6Thw89jGECUoRG5FnN\"]},\"contracts/interfaces/IDelegateCallProxyManager.sol\":{\"keccak256\":\"0x24f7aa01dd4c8592b889d6d81badd244ad9e602232406be5941413418d171421\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://3edfca6e8b608f4e4fd2c86a3eb3146202f9bfd7f26ff4608172894313ea911d\",\"dweb:/ipfs/QmdSvcGykCzAgfkyzofX6DEwbtFnAtjtnb9KddA7YJVtHZ\"]}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b61193c8061007d6000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80639225ce23116100ad578063db97034011610071578063db9703401461033c578063dc7faa0714610362578063dde5c32f14610388578063f2fde38b146103b4578063f9628542146103da5761012c565b80639225ce231461026f578063964c406114610295578063c3242d6b146102c1578063d07ad498146102ed578063d083bc861461031f5761012c565b80635e4ccacf116100f45780635e4ccacf146101ee5780636813a3c21461020b5780636daf503514610239578063715018a61461025f5780638da5cb5b146102675761012c565b80631a5e5bc5146101315780631da0505d146101705780632275a830146101785780634f85f3ea146101975780635b54cf96146101c8575b600080fd5b6101546004803603604081101561014757600080fd5b5080359060200135610406565b604080516001600160a01b039092168252519081900360200190f35b6101546105ba565b6101956004803603602081101561018e57600080fd5b50356105c9565b005b6101b4600480360360208110156101ad57600080fd5b50356106df565b604080519115158252519081900360200190f35b610195600480360360208110156101de57600080fd5b50356001600160a01b0316610762565b6101546004803603602081101561020457600080fd5b5035610816565b6101956004803603604081101561022157600080fd5b506001600160a01b0381358116916020013516610848565b6101956004803603602081101561024f57600080fd5b50356001600160a01b031661095d565b610195610a10565b610154610ab2565b6101b46004803603602081101561028557600080fd5b50356001600160a01b0316610ac1565b610195600480360360408110156102ab57600080fd5b50803590602001356001600160a01b0316610adf565b610195600480360360408110156102d757600080fd5b50803590602001356001600160a01b0316610bca565b6101546004803603606081101561030357600080fd5b506001600160a01b038135169060208101359060400135610d40565b6101546004803603602081101561033557600080fd5b5035610d83565b6101956004803603602081101561035257600080fd5b50356001600160a01b0316610d9e565b6101b46004803603602081101561037857600080fd5b50356001600160a01b0316610e4e565b6101546004803603604081101561039e57600080fd5b506001600160a01b038135169060200135610e6c565b610195600480360360208110156103ca57600080fd5b50356001600160a01b0316610ead565b610154600480360360408110156103f057600080fd5b50803590602001356001600160a01b0316610fa5565b600080610411611082565b6001600160a01b03811660009081526001602052604090205490915060ff1680610453575061043e610ab2565b6001600160a01b0316816001600160a01b0316145b610497576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d054141493d5915160821b604482015290519081900360640190fd5b6000848152600260205260409020546001600160a01b0316806104f9576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b600061050d610506611082565b8787611086565b600480546001600160a01b0319166001600160a01b03851617905560405190915061055b9060009083906105436020820161140a565b601f1982820381018352601f909101166040526110d3565b600480546001600160a01b0319169055604080518881526001600160a01b038316602082015281519296507f7b2f1f9260fa3ce14c2f36f34469f302e66164e3da9dbff6b24c723bcd39d115929081900390910190a150505092915050565b6004546001600160a01b031690565b6105d1611082565b6000546001600160a01b03908116911614610621576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000818152600260205260409020546001600160a01b031680610683576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b038116600090815260036020908152604091829020805460ff19166001179055815184815291517fd62bff6e969424de31ee669b9853f7f90fc209ef41f5721bf62c502e7b2a3d089281900390910190a15050565b6000818152600260205260408120546001600160a01b031680610741576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b031660009081526003602052604090205460ff1692915050565b61076a611082565b6000546001600160a01b039081169116146107ba576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260016020818152604092839020805460ff1916909217909155815192835290517fa8320d9911124be4bd8a47fe086523f921e913be4659887a823d16c1a7c567b39281900390910190a150565b6000610842827ffc7aed17e5c5d36a15e443235cb9c59bae4a013202cde6ab3e657fa1176d7f3e6111e4565b92915050565b610850611082565b6000546001600160a01b039081169116146108a0576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b03821660009081526003602052604090205460ff161561090a576040805162461bcd60e51b815260206004820152601960248201527811549497d2535413115351539510551253d397d313d0d2d151603a1b604482015290519081900360640190fd5b61091482826111f8565b604080516001600160a01b0380851682528316602082015281517f52f99278569fbf4dd0ee15eb946bc8d758d614d1917ff0faf9b326dd4aada643929181900390910190a15050565b610965611082565b6000546001600160a01b039081169116146109b5576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260036020908152604091829020805460ff19166001179055815192835290517ff51e53e36caf2e8338b84c69c3919eb728c75e5961f866d09697d8cdce7432df9281900390910190a150565b610a18611082565b6000546001600160a01b03908116911614610a68576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6001600160a01b031660009081526003602052604090205460ff1690565b610ae7611082565b6000546001600160a01b03908116911614610b37576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000610b4f6000846040518060200161054390611417565b600084815260026020526040902080546001600160a01b0319166001600160a01b0383161790559050610b8281836111f8565b604080518481526001600160a01b038416602082015281517f06e1ff8de03513a819420b2e2f57764e89938cd88b8769998326edf2703c2338929181900390910190a1505050565b610bd2611082565b6000546001600160a01b03908116911614610c22576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000828152600260205260409020546001600160a01b031680610c84576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b03811660009081526003602052604090205460ff1615610cee576040805162461bcd60e51b815260206004820152601960248201527811549497d2535413115351539510551253d397d313d0d2d151603a1b604482015290519081900360640190fd5b610cf881836111f8565b604080518481526001600160a01b038416602082015281517f43440a819e0e769fd70fc34ea1c8462915e7170e4396fb7595b450a09d0cdf38929181900390910190a1505050565b600080610d4e858585611086565b9050610d7a817f8fb4522edc5e0645a7ae5cfdbfe3b34d4a14de9e0279b74da795856b5ef4f1e66111e4565b95945050505050565b6000908152600260205260409020546001600160a01b031690565b610da6611082565b6000546001600160a01b03908116911614610df6576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260016020908152604091829020805460ff19169055815192835290517ff0f9ad55989ce899961b5c41524ba369cda0a1fcd9301dd0c868430e69c41b759281900390910190a150565b6001600160a01b031660009081526001602052604090205460ff1690565b600080610e798484611364565b9050610ea5817fdf533b6e999d326280ce88ca39ea2eddf95ed96f6c153ed5642d9b0a95dba4a26111e4565b949350505050565b610eb5611082565b6000546001600160a01b03908116911614610f05576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4a5760405162461bcd60e51b81526004018080602001828103825260268152602001806118c16026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610faf611082565b6000546001600160a01b03908116911614610fff576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b600061101261100c611082565b85611364565b905061102a6000826040518060200161054390611423565b915061103682846111f8565b604080516001600160a01b0380851682528516602082015281517f66708f841fd2ea7b5488d47d39951f9f79cb1033a9c5e0d1e98f76cdb8ba1e88929181900390910190a15092915050565b3390565b6040805160609490941b6bffffffffffffffffffffffff19166020808601919091526034850193909352605480850192909252805180850390920182526074909301909252815191012090565b6000808447101561112b576040805162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b825161117e576040805162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015290519081900360640190fd5b8383516020850187f590506001600160a01b038116610ea5576040805162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015290519081900360640190fd5b60006111f18383306113a9565b9392505050565b61120181611404565b611245576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d0d3d395149050d560821b604482015290519081900360640190fd5b6000826001600160a01b03168260405160200180826001600160a01b031681526020019150506040516020818303038152906040526040518082805190602001908083835b602083106112a95780518252601f19909201916020918201910161128a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461130b576040519150601f19603f3d011682016040523d82523d6000602084013e611310565b606091505b505090508061135f576040805162461bcd60e51b815260206004820152601660248201527511549497d4d15517d05111149154d4d7d4915591549560521b604482015290519081900360640190fd5b505050565b6000828260405160200180836001600160a01b031660601b81526014018281526020019250505060405160208183030381529060405280519060200120905092915050565b604080516001600160f81b031960208083019190915260609390931b6bffffffffffffffffffffffff191660218201526035810194909452605580850193909352805180850390930183526075909301909252805191012090565b3b151590565b6102b18061143183390190565b60aa806116e283390190565b6101358061178c8339019056fe60a060405234801561001057600080fd5b50336001600160a01b0316631da0505d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561004a57600080fd5b505afa15801561005e573d6000803e3d6000fd5b505050506040513d602081101561007457600080fd5b5051606081901b6001600160601b0319166080526001600160a01b031661020a6100a7600039806046525061020a6000f3fe60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a610031565b6101b0565b565b60405160009081906060906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083818181855afa9150503d806000811461009d576040519150601f19603f3d011682016040523d82523d6000602084013e6100a2565b606091505b50915091508181906101325760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156100f75781810151838201526020016100df565b50505050905090810190601f1680156101245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600081806020019051602081101561014a57600080fd5b505190506001600160a01b0381166101a9576040805162461bcd60e51b815260206004820152601760248201527f4552525f4e554c4c5f494d504c454d454e544154494f4e000000000000000000604482015290519081900360640190fd5b9250505090565b3660008037600080366000845af43d6000803e8080156101cf573d6000f35b3d6000fdfea2646970667358221220a87867c818d1cc630f8c80138e49dc1cd74c60b8055aff3acb3df87a306c802464736f6c634300060c003360a0604052348015600f57600080fd5b5033606081901b608052607d61002d60003980600f5250607d6000f3fe6080604052336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614603f5760005460005260206000f35b60003560005500fea26469706673582212207b7be31d5f4c47a2747eeb08f94f4d95410f4b18c218276fbf64166c0847879f64736f6c634300060c003360a060405234801561001057600080fd5b5033606081901b60805261010561003060003980603252506101056000f3fe608060405236601057600e6013565b005b600e5b60196027565b602560216087565b60ac565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614606057605c6025565b6025565b6000357f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a55005b7f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a5490565b3660008037600080366000845af43d6000803e80801560ca573d6000f35b3d6000fdfea26469706673582212201d5d6ac3fbe2ff956c757ddb03b461d8f29475cb9a2baf6e1fc8bf35fcdbc70564736f6c634300060c00334f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220da21269baf9a935b77c35af61305bb6bb8c95863bbcf7758f6caa6a1594110e564736f6c634300060c0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80639225ce23116100ad578063db97034011610071578063db9703401461033c578063dc7faa0714610362578063dde5c32f14610388578063f2fde38b146103b4578063f9628542146103da5761012c565b80639225ce231461026f578063964c406114610295578063c3242d6b146102c1578063d07ad498146102ed578063d083bc861461031f5761012c565b80635e4ccacf116100f45780635e4ccacf146101ee5780636813a3c21461020b5780636daf503514610239578063715018a61461025f5780638da5cb5b146102675761012c565b80631a5e5bc5146101315780631da0505d146101705780632275a830146101785780634f85f3ea146101975780635b54cf96146101c8575b600080fd5b6101546004803603604081101561014757600080fd5b5080359060200135610406565b604080516001600160a01b039092168252519081900360200190f35b6101546105ba565b6101956004803603602081101561018e57600080fd5b50356105c9565b005b6101b4600480360360208110156101ad57600080fd5b50356106df565b604080519115158252519081900360200190f35b610195600480360360208110156101de57600080fd5b50356001600160a01b0316610762565b6101546004803603602081101561020457600080fd5b5035610816565b6101956004803603604081101561022157600080fd5b506001600160a01b0381358116916020013516610848565b6101956004803603602081101561024f57600080fd5b50356001600160a01b031661095d565b610195610a10565b610154610ab2565b6101b46004803603602081101561028557600080fd5b50356001600160a01b0316610ac1565b610195600480360360408110156102ab57600080fd5b50803590602001356001600160a01b0316610adf565b610195600480360360408110156102d757600080fd5b50803590602001356001600160a01b0316610bca565b6101546004803603606081101561030357600080fd5b506001600160a01b038135169060208101359060400135610d40565b6101546004803603602081101561033557600080fd5b5035610d83565b6101956004803603602081101561035257600080fd5b50356001600160a01b0316610d9e565b6101b46004803603602081101561037857600080fd5b50356001600160a01b0316610e4e565b6101546004803603604081101561039e57600080fd5b506001600160a01b038135169060200135610e6c565b610195600480360360208110156103ca57600080fd5b50356001600160a01b0316610ead565b610154600480360360408110156103f057600080fd5b50803590602001356001600160a01b0316610fa5565b600080610411611082565b6001600160a01b03811660009081526001602052604090205490915060ff1680610453575061043e610ab2565b6001600160a01b0316816001600160a01b0316145b610497576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d054141493d5915160821b604482015290519081900360640190fd5b6000848152600260205260409020546001600160a01b0316806104f9576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b600061050d610506611082565b8787611086565b600480546001600160a01b0319166001600160a01b03851617905560405190915061055b9060009083906105436020820161140a565b601f1982820381018352601f909101166040526110d3565b600480546001600160a01b0319169055604080518881526001600160a01b038316602082015281519296507f7b2f1f9260fa3ce14c2f36f34469f302e66164e3da9dbff6b24c723bcd39d115929081900390910190a150505092915050565b6004546001600160a01b031690565b6105d1611082565b6000546001600160a01b03908116911614610621576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000818152600260205260409020546001600160a01b031680610683576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b038116600090815260036020908152604091829020805460ff19166001179055815184815291517fd62bff6e969424de31ee669b9853f7f90fc209ef41f5721bf62c502e7b2a3d089281900390910190a15050565b6000818152600260205260408120546001600160a01b031680610741576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b031660009081526003602052604090205460ff1692915050565b61076a611082565b6000546001600160a01b039081169116146107ba576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260016020818152604092839020805460ff1916909217909155815192835290517fa8320d9911124be4bd8a47fe086523f921e913be4659887a823d16c1a7c567b39281900390910190a150565b6000610842827ffc7aed17e5c5d36a15e443235cb9c59bae4a013202cde6ab3e657fa1176d7f3e6111e4565b92915050565b610850611082565b6000546001600160a01b039081169116146108a0576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b03821660009081526003602052604090205460ff161561090a576040805162461bcd60e51b815260206004820152601960248201527811549497d2535413115351539510551253d397d313d0d2d151603a1b604482015290519081900360640190fd5b61091482826111f8565b604080516001600160a01b0380851682528316602082015281517f52f99278569fbf4dd0ee15eb946bc8d758d614d1917ff0faf9b326dd4aada643929181900390910190a15050565b610965611082565b6000546001600160a01b039081169116146109b5576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260036020908152604091829020805460ff19166001179055815192835290517ff51e53e36caf2e8338b84c69c3919eb728c75e5961f866d09697d8cdce7432df9281900390910190a150565b610a18611082565b6000546001600160a01b03908116911614610a68576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6001600160a01b031660009081526003602052604090205460ff1690565b610ae7611082565b6000546001600160a01b03908116911614610b37576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000610b4f6000846040518060200161054390611417565b600084815260026020526040902080546001600160a01b0319166001600160a01b0383161790559050610b8281836111f8565b604080518481526001600160a01b038416602082015281517f06e1ff8de03513a819420b2e2f57764e89938cd88b8769998326edf2703c2338929181900390910190a1505050565b610bd2611082565b6000546001600160a01b03908116911614610c22576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6000828152600260205260409020546001600160a01b031680610c84576040805162461bcd60e51b815260206004820152601560248201527411549497d2535413115351539510551253d397d251605a1b604482015290519081900360640190fd5b6001600160a01b03811660009081526003602052604090205460ff1615610cee576040805162461bcd60e51b815260206004820152601960248201527811549497d2535413115351539510551253d397d313d0d2d151603a1b604482015290519081900360640190fd5b610cf881836111f8565b604080518481526001600160a01b038416602082015281517f43440a819e0e769fd70fc34ea1c8462915e7170e4396fb7595b450a09d0cdf38929181900390910190a1505050565b600080610d4e858585611086565b9050610d7a817f8fb4522edc5e0645a7ae5cfdbfe3b34d4a14de9e0279b74da795856b5ef4f1e66111e4565b95945050505050565b6000908152600260205260409020546001600160a01b031690565b610da6611082565b6000546001600160a01b03908116911614610df6576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260016020908152604091829020805460ff19169055815192835290517ff0f9ad55989ce899961b5c41524ba369cda0a1fcd9301dd0c868430e69c41b759281900390910190a150565b6001600160a01b031660009081526001602052604090205460ff1690565b600080610e798484611364565b9050610ea5817fdf533b6e999d326280ce88ca39ea2eddf95ed96f6c153ed5642d9b0a95dba4a26111e4565b949350505050565b610eb5611082565b6000546001600160a01b03908116911614610f05576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4a5760405162461bcd60e51b81526004018080602001828103825260268152602001806118c16026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610faf611082565b6000546001600160a01b03908116911614610fff576040805162461bcd60e51b815260206004820181905260248201526000805160206118e7833981519152604482015290519081900360640190fd5b600061101261100c611082565b85611364565b905061102a6000826040518060200161054390611423565b915061103682846111f8565b604080516001600160a01b0380851682528516602082015281517f66708f841fd2ea7b5488d47d39951f9f79cb1033a9c5e0d1e98f76cdb8ba1e88929181900390910190a15092915050565b3390565b6040805160609490941b6bffffffffffffffffffffffff19166020808601919091526034850193909352605480850192909252805180850390920182526074909301909252815191012090565b6000808447101561112b576040805162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b825161117e576040805162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015290519081900360640190fd5b8383516020850187f590506001600160a01b038116610ea5576040805162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015290519081900360640190fd5b60006111f18383306113a9565b9392505050565b61120181611404565b611245576040805162461bcd60e51b815260206004820152601060248201526f11549497d393d517d0d3d395149050d560821b604482015290519081900360640190fd5b6000826001600160a01b03168260405160200180826001600160a01b031681526020019150506040516020818303038152906040526040518082805190602001908083835b602083106112a95780518252601f19909201916020918201910161128a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461130b576040519150601f19603f3d011682016040523d82523d6000602084013e611310565b606091505b505090508061135f576040805162461bcd60e51b815260206004820152601660248201527511549497d4d15517d05111149154d4d7d4915591549560521b604482015290519081900360640190fd5b505050565b6000828260405160200180836001600160a01b031660601b81526014018281526020019250505060405160208183030381529060405280519060200120905092915050565b604080516001600160f81b031960208083019190915260609390931b6bffffffffffffffffffffffff191660218201526035810194909452605580850193909352805180850390930183526075909301909252805191012090565b3b151590565b6102b18061143183390190565b60aa806116e283390190565b6101358061178c8339019056fe60a060405234801561001057600080fd5b50336001600160a01b0316631da0505d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561004a57600080fd5b505afa15801561005e573d6000803e3d6000fd5b505050506040513d602081101561007457600080fd5b5051606081901b6001600160601b0319166080526001600160a01b031661020a6100a7600039806046525061020a6000f3fe60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a610031565b6101b0565b565b60405160009081906060906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083818181855afa9150503d806000811461009d576040519150601f19603f3d011682016040523d82523d6000602084013e6100a2565b606091505b50915091508181906101325760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156100f75781810151838201526020016100df565b50505050905090810190601f1680156101245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600081806020019051602081101561014a57600080fd5b505190506001600160a01b0381166101a9576040805162461bcd60e51b815260206004820152601760248201527f4552525f4e554c4c5f494d504c454d454e544154494f4e000000000000000000604482015290519081900360640190fd5b9250505090565b3660008037600080366000845af43d6000803e8080156101cf573d6000f35b3d6000fdfea2646970667358221220a87867c818d1cc630f8c80138e49dc1cd74c60b8055aff3acb3df87a306c802464736f6c634300060c003360a0604052348015600f57600080fd5b5033606081901b608052607d61002d60003980600f5250607d6000f3fe6080604052336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614603f5760005460005260206000f35b60003560005500fea26469706673582212207b7be31d5f4c47a2747eeb08f94f4d95410f4b18c218276fbf64166c0847879f64736f6c634300060c003360a060405234801561001057600080fd5b5033606081901b60805261010561003060003980603252506101056000f3fe608060405236601057600e6013565b005b600e5b60196027565b602560216087565b60ac565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614606057605c6025565b6025565b6000357f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a55005b7f913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a5490565b3660008037600080366000845af43d6000803e80801560ca573d6000f35b3d6000fdfea26469706673582212201d5d6ac3fbe2ff956c757ddb03b461d8f29475cb9a2baf6e1fc8bf35fcdbc70564736f6c634300060c00334f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220da21269baf9a935b77c35af61305bb6bb8c95863bbcf7758f6caa6a1594110e564736f6c634300060c0033", "devdoc": { - "details": "Contract that manages deployment and upgrades of delegatecall proxies. * An implementation identifier can be created on the proxy manager which is used to specify the logic address for a particular contract type, and to upgrade the implementation as needed. * A one-to-one proxy is a single proxy contract with an upgradeable implementation address. * A many-to-one proxy is a single upgradeable implementation address that may be used by many proxy contracts.", + "details": "Contract that manages deployment and upgrades of delegatecall proxies. An implementation identifier can be created on the proxy manager which is used to specify the logic address for a particular contract type, and to upgrade the implementation as needed. ====== Proxy Types ====== A one-to-one proxy is a single proxy contract with an upgradeable implementation address. A many-to-one proxy is a single upgradeable implementation address that may be used by many proxy contracts. ====== Access Control ====== The proxy manager has a single address as its owner. The owner is the sole account with the following permissions: - Create new many-to-one implementations - Create new one-to-one proxies - Modify the implementation address of existing proxies - Lock proxies - Designate approved deployers - Remove approved deployers - Modify the owner address Approved deployers may only deploy many-to-one proxies. ====== Upgrades ====== Proxies can be upgraded by the owner if they are not locked. Many-to-one proxy implementations are upgraded by calling the holder contract for the implementation ID being upgraded. One-to-one proxies are upgraded by calling the proxy contract directly. The owner can lock a one-to-one proxy or many-to-one implementation ID so that it becomes impossible to upgrade.", + "kind": "dev", "methods": { "approveDeployer(address)": { "details": "Allows `deployer` to deploy many-to-one proxies." @@ -466,21 +585,21 @@ } }, "createManyToOneProxyRelationship(bytes32,address)": { - "details": "Creates a many-to-one proxy relationship. * Deploys an implementation holder contract which stores the implementation address for many proxies. The implementation address can be updated on the holder to change the runtime code used by all its proxies.", + "details": "Creates a many-to-one proxy relationship. Deploys an implementation holder contract which stores the implementation address for many proxies. The implementation address can be updated on the holder to change the runtime code used by all its proxies.", "params": { "implementation": "Address with the runtime code the proxies should use.", "implementationID": "ID for the implementation, used to identify the proxies that use it. Also used as the salt in the create2 call when deploying the implementation holder contract." } }, "deployProxyManyToOne(bytes32,bytes32)": { - "details": "Deploy a proxy with a many-to-one relationship with its implemenation. * The proxy will call the implementation holder for every transaction to determine the address to use in calls.", + "details": "Deploy a proxy with a many-to-one relationship with its implemenation. The proxy will call the implementation holder for every transaction to determine the address to use in calls.", "params": { "implementationID": "Identifier for the proxy's implementation.", "suppliedSalt": "Salt provided by the account requesting deployment." } }, "deployProxyOneToOne(bytes32,address)": { - "details": "Deploy a proxy contract with a one-to-one relationship with its implementation. * The proxy will have its own implementation address which can be updated by the proxy manager.", + "details": "Deploy a proxy contract with a one-to-one relationship with its implementation. The proxy will have its own implementation address which can be updated by the proxy manager.", "params": { "implementation": "Address of the contract with the runtime code that the proxy should use.", "suppliedSalt": "Salt provided by the account requesting deployment." @@ -492,6 +611,27 @@ "getImplementationHolder(bytes32)": { "details": "Returns the address of the implementation holder contract for `implementationID`." }, + "isApprovedDeployer(address)": { + "details": "Returns a boolean stating whether `deployer` is allowed to deploy many-to-one proxies." + }, + "isImplementationLocked(address)": { + "details": "Returns a boolean stating whether `proxyAddress` is locked." + }, + "isImplementationLocked(bytes32)": { + "details": "Returns a boolean stating whether `implementationID` is locked." + }, + "lockImplementationManyToOne(bytes32)": { + "details": "Lock the current implementation for `implementationID` so that it can never be upgraded again." + }, + "lockImplementationOneToOne(address)": { + "details": "Lock the current implementation for `proxyAddress` so that it can never be upgraded again." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "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." + }, "revokeDeployerApproval(address)": { "details": "Prevents `deployer` from deploying many-to-one proxies." }, @@ -503,21 +643,27 @@ } }, "setImplementationAddressOneToOne(address,address)": { - "details": "Updates the implementation address for a one-to-one proxy. * Note: This could work for many-to-one as well if the caller provides the implementation holder address in place of the proxy address, as they use the same access control and update mechanism.", + "details": "Updates the implementation address for a one-to-one proxy. Note: This could work for many-to-one as well if the caller provides the implementation holder address in place of the proxy address, as they use the same access control and update mechanism.", "params": { "implementation": "Address with the runtime code for the proxy to use.", "proxyAddress": "Address of the deployed proxy" } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." } - } + }, + "version": 1 }, "userdoc": { - "methods": {} + "kind": "user", + "methods": {}, + "version": 1 }, "storageLayout": { "storage": [ { - "astId": 9110, + "astId": 8108, "contract": "contracts/DelegateCallProxyManager.sol:DelegateCallProxyManager", "label": "_owner", "offset": 0, @@ -525,7 +671,7 @@ "type": "t_address" }, { - "astId": 8518, + "astId": 8650, "contract": "contracts/DelegateCallProxyManager.sol:DelegateCallProxyManager", "label": "_approvedDeployers", "offset": 0, @@ -533,7 +679,7 @@ "type": "t_mapping(t_address,t_bool)" }, { - "astId": 8522, + "astId": 8654, "contract": "contracts/DelegateCallProxyManager.sol:DelegateCallProxyManager", "label": "_implementationHolders", "offset": 0, @@ -541,11 +687,19 @@ "type": "t_mapping(t_bytes32,t_address)" }, { - "astId": 8524, + "astId": 8658, "contract": "contracts/DelegateCallProxyManager.sol:DelegateCallProxyManager", - "label": "_implementationHolder", + "label": "_lockedImplementations", "offset": 0, "slot": "3", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 8660, + "contract": "contracts/DelegateCallProxyManager.sol:DelegateCallProxyManager", + "label": "_implementationHolder", + "offset": 0, + "slot": "4", "type": "t_address" } ], @@ -583,26 +737,31 @@ }, "gasEstimates": { "creation": { - "codeDepositCost": "1008600", - "executionCost": "21888", - "totalCost": "1030488" + "codeDepositCost": "1292000", + "executionCost": "23777", + "totalCost": "1315777" }, "external": { - "approveDeployer(address)": "23058", - "computeHolderAddressManyToOne(bytes32)": "887", - "computeProxyAddressManyToOne(address,bytes32,bytes32)": "1438", - "computeProxyAddressOneToOne(address,bytes32)": "1239", + "approveDeployer(address)": "infinite", + "computeHolderAddressManyToOne(bytes32)": "626", + "computeProxyAddressManyToOne(address,bytes32,bytes32)": "1015", + "computeProxyAddressOneToOne(address,bytes32)": "939", "createManyToOneProxyRelationship(bytes32,address)": "infinite", "deployProxyManyToOne(bytes32,bytes32)": "infinite", "deployProxyOneToOne(bytes32,address)": "infinite", - "getImplementationHolder()": "1105", - "getImplementationHolder(bytes32)": "1234", - "getOwner()": "1126", + "getImplementationHolder()": "1083", + "getImplementationHolder(bytes32)": "1256", "isApprovedDeployer(address)": "1198", - "revokeDeployerApproval(address)": "23045", + "isImplementationLocked(address)": "1177", + "isImplementationLocked(bytes32)": "2137", + "lockImplementationManyToOne(bytes32)": "infinite", + "lockImplementationOneToOne(address)": "infinite", + "owner()": "1148", + "renounceOwnership()": "infinite", + "revokeDeployerApproval(address)": "infinite", "setImplementationAddressManyToOne(bytes32,address)": "infinite", "setImplementationAddressOneToOne(address,address)": "infinite", - "setOwner(address)": "23028" + "transferOwnership(address)": "infinite" }, "internal": { "_setImplementation(address,address)": "infinite" diff --git a/deployments/rinkeby/solcInputs/0x77b59efc8347393893a776470c3750c5d736f4c9b50771234cbd2970849fde64.json b/deployments/rinkeby/solcInputs/0xd54b2fd043b0d0ad87e570456bf439f2f7ceafbd68a1e6b5b75539fd97bf62e4.json similarity index 67% rename from deployments/rinkeby/solcInputs/0x77b59efc8347393893a776470c3750c5d736f4c9b50771234cbd2970849fde64.json rename to deployments/rinkeby/solcInputs/0xd54b2fd043b0d0ad87e570456bf439f2f7ceafbd68a1e6b5b75539fd97bf62e4.json index 52b7dda..5855a70 100644 --- a/deployments/rinkeby/solcInputs/0x77b59efc8347393893a776470c3750c5d736f4c9b50771234cbd2970849fde64.json +++ b/deployments/rinkeby/solcInputs/0xd54b2fd043b0d0ad87e570456bf439f2f7ceafbd68a1e6b5b75539fd97bf62e4.json @@ -1,8 +1,11 @@ { "language": "Solidity", "sources": { + "contracts/CodeHashes.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.6.0;\n\n\n/**\n * @dev Because we use the code hashes of the proxy contracts for proxy address\n * derivation, it is important that other packages have access to the correct\n * values when they import the salt library.\n */\nlibrary CodeHashes {\n bytes32 internal constant ONE_TO_ONE_CODEHASH = 0xdf533b6e999d326280ce88ca39ea2eddf95ed96f6c153ed5642d9b0a95dba4a2;\n bytes32 internal constant MANY_TO_ONE_CODEHASH = 0x8fb4522edc5e0645a7ae5cfdbfe3b34d4a14de9e0279b74da795856b5ef4f1e6;\n bytes32 internal constant IMPLEMENTATION_HOLDER_CODEHASH = 0xfc7aed17e5c5d36a15e443235cb9c59bae4a013202cde6ab3e657fa1176d7f3e;\n}" + }, "contracts/DelegateCallProxyManager.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.6.0;\n\n/* --- External Libraries --- */\nimport { Create2 } from \"@openzeppelin/contracts/utils/Create2.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\n/* --- Proxy Contracts --- */\nimport \"./ManyToOneImplementationHolder.sol\";\nimport { DelegateCallProxyManyToOne } from \"./DelegateCallProxyManyToOne.sol\";\nimport { DelegateCallProxyOneToOne } from \"./DelegateCallProxyOneToOne.sol\";\n\n/* --- Internal Libraries --- */\nimport { SaltyLib as Salty } from \"./SaltyLib.sol\";\n\n/* --- Inheritance --- */\nimport \"./Owned.sol\";\nimport \"./interfaces/IDelegateCallProxyManager.sol\";\n\n\n/**\n * @dev Contract that manages deployment and upgrades of delegatecall proxies.\n *\n * An implementation identifier can be created on the proxy manager which is\n * used to specify the logic address for a particular contract type, and to\n * upgrade the implementation as needed.\n *\n * A one-to-one proxy is a single proxy contract with an upgradeable implementation\n * address.\n *\n * A many-to-one proxy is a single upgradeable implementation address that may be\n * used by many proxy contracts.\n */\ncontract DelegateCallProxyManager is Owned, IDelegateCallProxyManager {\n/* --- Constants --- */\n bytes32 internal constant ONE_TO_ONE_CODEHASH\n = keccak256(type(DelegateCallProxyOneToOne).creationCode);\n\n bytes32 internal constant MANY_TO_ONE_CODEHASH\n = keccak256(type(DelegateCallProxyManyToOne).creationCode);\n\n bytes32 internal constant IMPLEMENTATION_HOLDER_CODEHASH\n = keccak256(type(ManyToOneImplementationHolder).creationCode);\n\n/* --- Events --- */\n\n event DeploymentApprovalGranted(address deployer);\n event DeploymentApprovalRevoked(address deployer);\n\n event ManyToOne_ImplementationCreated(\n bytes32 implementationID,\n address implementationAddress\n );\n\n event ManyToOne_ImplementationUpdated(\n bytes32 implementationID,\n address implementationAddress\n );\n\n event ManyToOne_ProxyDeployed(\n bytes32 implementationID,\n address proxyAddress\n );\n\n event OneToOne_ProxyDeployed(\n address proxyAddress,\n address implementationAddress\n );\n\n event OneToOne_ImplementationUpdated(\n address proxyAddress,\n address implementationAddress\n );\n\n/* --- Storage --- */\n // Addresses allowed to deploy many-to-one proxies.\n mapping(address => bool) internal _approvedDeployers;\n\n // Maps implementation holders to their implementation IDs.\n mapping(bytes32 => address) internal _implementationHolders;\n\n // Temporary value used in the many-to-one proxy constructor.\n // The many-to-one proxy contract is deployed with create2 and\n // uses static initialization code for simple address derivation,\n // so it calls the proxy manager in the constructor to get this\n // address in order to save it as an immutable in the bytecode.\n address internal _implementationHolder;\n\n/* --- Modifiers --- */\n\n modifier _admin_ {\n require(\n msg.sender == _owner || _approvedDeployers[msg.sender],\n \"ERR_NOT_APPROVED\"\n );\n _;\n }\n\n/* --- Constructor --- */\n\n constructor() public Owned(msg.sender) {}\n\n/* --- Controls --- */\n\n /**\n * @dev Allows `deployer` to deploy many-to-one proxies.\n */\n function approveDeployer(address deployer) external override _owner_ {\n _approvedDeployers[deployer] = true;\n emit DeploymentApprovalGranted(deployer);\n }\n\n /**\n * @dev Prevents `deployer` from deploying many-to-one proxies.\n */\n function revokeDeployerApproval(address deployer) external override _owner_ {\n _approvedDeployers[deployer] = false;\n emit DeploymentApprovalRevoked(deployer);\n }\n\n/* --- Implementation Management --- */\n\n /**\n * @dev Creates a many-to-one proxy relationship.\n *\n * Deploys an implementation holder contract which stores the\n * implementation address for many proxies. The implementation\n * address can be updated on the holder to change the runtime\n * code used by all its proxies.\n *\n * @param implementationID ID for the implementation, used to identify the\n * proxies that use it. Also used as the salt in the create2 call when\n * deploying the implementation holder contract.\n * @param implementation Address with the runtime code the proxies\n * should use.\n */\n function createManyToOneProxyRelationship(\n bytes32 implementationID,\n address implementation\n )\n external\n override\n _owner_\n {\n // Deploy the implementation holder contract with the implementation\n // ID as the create2 salt.\n address implementationHolder = Create2.deploy(\n 0,\n implementationID,\n type(ManyToOneImplementationHolder).creationCode\n );\n\n // Store the implementation holder address\n _implementationHolders[implementationID] = implementationHolder;\n\n // Sets the implementation address.\n _setImplementation(implementationHolder, implementation);\n\n emit ManyToOne_ImplementationCreated(\n implementationID,\n implementation\n );\n }\n\n /**\n * @dev Updates the implementation address for a many-to-one\n * proxy relationship.\n *\n * @param implementationID Identifier for the implementation.\n * @param implementation Address with the runtime code the proxies\n * should use.\n */\n function setImplementationAddressManyToOne(\n bytes32 implementationID,\n address implementation\n )\n external\n override\n _owner_\n {\n // Read the implementation holder address from storage.\n address implementationHolder = _implementationHolders[implementationID];\n\n // Verify that the implementation exists.\n require(implementationHolder != address(0), \"ERR_IMPLEMENTATION_ID\");\n\n // Set the implementation address\n _setImplementation(implementationHolder, implementation);\n\n emit ManyToOne_ImplementationUpdated(\n implementationID,\n implementation\n );\n }\n\n /**\n * @dev Updates the implementation address for a one-to-one proxy.\n *\n * Note: This could work for many-to-one as well if the caller\n * provides the implementation holder address in place of the\n * proxy address, as they use the same access control and update\n * mechanism.\n *\n * @param proxyAddress Address of the deployed proxy\n * @param implementation Address with the runtime code for\n * the proxy to use.\n */\n function setImplementationAddressOneToOne(\n address proxyAddress,\n address implementation\n )\n external\n override\n _owner_\n {\n // Set the implementation address\n _setImplementation(proxyAddress, implementation);\n\n emit OneToOne_ImplementationUpdated(proxyAddress, implementation);\n }\n\n/* --- Proxy Deployment --- */\n\n /**\n * @dev Deploy a proxy contract with a one-to-one relationship\n * with its implementation.\n *\n * The proxy will have its own implementation address which can\n * be updated by the proxy manager.\n *\n * @param suppliedSalt Salt provided by the account requesting deployment.\n * @param implementation Address of the contract with the runtime\n * code that the proxy should use.\n */\n function deployProxyOneToOne(\n bytes32 suppliedSalt,\n address implementation\n )\n external\n override\n _owner_\n returns(address proxyAddress)\n {\n // Derive the create2 salt from the deployment requester's address\n // and the requester-supplied salt.\n bytes32 salt = Salty.deriveOneToOneSalt(msg.sender, suppliedSalt);\n\n // Deploy the proxy\n proxyAddress = Create2.deploy(\n 0,\n salt,\n type(DelegateCallProxyOneToOne).creationCode\n );\n\n // Set the implementation address on the new proxy.\n _setImplementation(proxyAddress, implementation);\n\n emit OneToOne_ProxyDeployed(proxyAddress, implementation);\n }\n\n /**\n * @dev Deploy a proxy with a many-to-one relationship with its implemenation.\n *\n * The proxy will call the implementation holder for every transaction to\n * determine the address to use in calls.\n *\n * @param implementationID Identifier for the proxy's implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function deployProxyManyToOne(bytes32 implementationID, bytes32 suppliedSalt)\n external\n override\n _admin_\n returns(address proxyAddress)\n {\n // Read the implementation holder address from storage.\n address implementationHolder = _implementationHolders[implementationID];\n\n // Verify that the implementation exists.\n require(implementationHolder != address(0), \"ERR_IMPLEMENTATION_ID\");\n\n // Derive the create2 salt from the deployment requester's address, the\n // implementation ID and the requester-supplied salt.\n bytes32 salt = Salty.deriveManyToOneSalt(\n msg.sender,\n implementationID,\n suppliedSalt\n );\n\n // Set the implementation holder address in storage so the proxy\n // constructor can query it.\n _implementationHolder = implementationHolder;\n\n // Deploy the proxy, which will query the implementation holder address\n // and save it as an immutable in the contract bytecode.\n proxyAddress = Create2.deploy(\n 0,\n salt,\n type(DelegateCallProxyManyToOne).creationCode\n );\n\n // Remove the address from temporary storage.\n _implementationHolder = address(0);\n\n emit ManyToOne_ProxyDeployed(\n implementationID,\n proxyAddress\n );\n }\n\n/* --- Queries --- */\n\n function isApprovedDeployer(address deployer) external override view returns (bool) {\n return _approvedDeployers[deployer];\n }\n\n /**\n * @dev Queries the temporary storage value `_implementationHolder`.\n * This is used in the constructor of the many-to-one proxy contract\n * so that the create2 address is static (adding constructor arguments\n * would change the codehash) and the implementation holder can be\n * stored as a constant.\n */\n function getImplementationHolder()\n external\n override\n view\n returns (address)\n {\n return _implementationHolder;\n }\n\n /**\n * @dev Returns the address of the implementation holder contract\n * for `implementationID`.\n */\n function getImplementationHolder(\n bytes32 implementationID\n )\n external\n override\n view\n returns (address)\n {\n return _implementationHolders[implementationID];\n }\n\n /**\n * @dev Computes the create2 address for a one-to-one proxy requested\n * by `originator` using `suppliedSalt`.\n *\n * @param originator Address of the account requesting deployment.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressOneToOne(\n address originator,\n bytes32 suppliedSalt\n )\n external\n override\n view\n returns (address)\n {\n bytes32 salt = Salty.deriveOneToOneSalt(originator, suppliedSalt);\n return Create2.computeAddress(salt, ONE_TO_ONE_CODEHASH);\n }\n\n /**\n * @dev Computes the create2 address for a many-to-one proxy for the\n * implementation `implementationID` requested by `originator` using\n * `suppliedSalt`.\n *\n * @param originator Address of the account requesting deployment.\n * @param implementationID The identifier for the contract implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressManyToOne(\n address originator,\n bytes32 implementationID,\n bytes32 suppliedSalt\n )\n external\n override\n view\n returns (address)\n {\n\n bytes32 salt = Salty.deriveManyToOneSalt(\n originator,\n implementationID,\n suppliedSalt\n );\n return Create2.computeAddress(salt, MANY_TO_ONE_CODEHASH);\n }\n\n /**\n * @dev Computes the create2 address of the implementation holder\n * for `implementationID`.\n *\n * @param implementationID The identifier for the contract implementation.\n */\n function computeHolderAddressManyToOne(bytes32 implementationID)\n public\n override\n view\n returns (address)\n {\n return Create2.computeAddress(\n implementationID,\n IMPLEMENTATION_HOLDER_CODEHASH\n );\n }\n\n/* --- Internal Functions --- */\n\n /**\n * @dev Sets the implementation address for a one-to-one proxy or\n * many-to-one implementation holder. Both use the same access\n * control and update mechanism, which is the receipt of a call\n * from the proxy manager with the abi-encoded implementation address\n * as the only calldata.\n *\n * Note: Verifies that the implementation address is a contract.\n *\n * @param proxyOrHolder Address of the one-to-one proxy or\n * many-to-one implementation holder contract.\n * @param implementation Address of the contract with the runtime\n * code that the proxy or proxies should use.\n */\n function _setImplementation(\n address proxyOrHolder,\n address implementation\n ) internal {\n // Verify that the implementation address is a contract.\n require(Address.isContract(implementation), \"ERR_NOT_CONTRACT\");\n // Set the implementation address on the contract.\n\n // solium-disable-next-line security/no-low-level-calls\n (bool success,) = proxyOrHolder.call(abi.encode(implementation));\n require(success, \"ERR_SET_ADDRESS_REVERT\");\n }\n}" + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity =0.6.12;\n\n/* ========== External Libraries ========== */\nimport { Create2 } from \"@openzeppelin/contracts/utils/Create2.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/* ========== Proxy Contracts ========== */\nimport \"./ManyToOneImplementationHolder.sol\";\nimport { DelegateCallProxyManyToOne } from \"./DelegateCallProxyManyToOne.sol\";\nimport { DelegateCallProxyOneToOne } from \"./DelegateCallProxyOneToOne.sol\";\n\n/* ========== Internal Libraries ========== */\nimport { SaltyLib as Salty } from \"./SaltyLib.sol\";\nimport { CodeHashes } from \"./CodeHashes.sol\";\n\n/* ========== Inheritance ========== */\nimport \"./interfaces/IDelegateCallProxyManager.sol\";\n\n\n/**\n * @dev Contract that manages deployment and upgrades of delegatecall proxies.\n *\n * An implementation identifier can be created on the proxy manager which is\n * used to specify the logic address for a particular contract type, and to\n * upgrade the implementation as needed.\n *\n * ====== Proxy Types ======\n * A one-to-one proxy is a single proxy contract with an upgradeable implementation\n * address.\n *\n * A many-to-one proxy is a single upgradeable implementation address that may be\n * used by many proxy contracts.\n *\n * ====== Access Control ======\n * The proxy manager has a single address as its owner.\n *\n * The owner is the sole account with the following permissions:\n * - Create new many-to-one implementations\n * - Create new one-to-one proxies\n * - Modify the implementation address of existing proxies\n * - Lock proxies\n * - Designate approved deployers\n * - Remove approved deployers\n * - Modify the owner address\n *\n * Approved deployers may only deploy many-to-one proxies.\n *\n * ====== Upgrades ======\n * Proxies can be upgraded by the owner if they are not locked.\n *\n * Many-to-one proxy implementations are upgraded by calling the holder contract\n * for the implementation ID being upgraded.\n * One-to-one proxies are upgraded by calling the proxy contract directly.\n *\n * The owner can lock a one-to-one proxy or many-to-one implementation ID so that\n * it becomes impossible to upgrade.\n */\ncontract DelegateCallProxyManager is Ownable, IDelegateCallProxyManager {\n/* ========== Events ========== */\n\n event DeploymentApprovalGranted(address deployer);\n event DeploymentApprovalRevoked(address deployer);\n\n event ManyToOne_ImplementationCreated(\n bytes32 implementationID,\n address implementationAddress\n );\n\n event ManyToOne_ImplementationUpdated(\n bytes32 implementationID,\n address implementationAddress\n );\n\n event ManyToOne_ImplementationLocked(bytes32 implementationID);\n\n event ManyToOne_ProxyDeployed(\n bytes32 implementationID,\n address proxyAddress\n );\n\n event OneToOne_ProxyDeployed(\n address proxyAddress,\n address implementationAddress\n );\n\n event OneToOne_ImplementationUpdated(\n address proxyAddress,\n address implementationAddress\n );\n\n event OneToOne_ImplementationLocked(address proxyAddress);\n\n/* ========== Storage ========== */\n\n // Addresses allowed to deploy many-to-one proxies.\n mapping(address => bool) internal _approvedDeployers;\n\n // Maps implementation holders to their implementation IDs.\n mapping(bytes32 => address) internal _implementationHolders;\n\n // Maps implementation holders & proxy addresses to bool stating if they are locked.\n mapping(address => bool) internal _lockedImplementations;\n\n // Temporary value used in the many-to-one proxy constructor.\n // The many-to-one proxy contract is deployed with create2 and\n // uses static initialization code for simple address derivation,\n // so it calls the proxy manager in the constructor to get this\n // address in order to save it as an immutable in the bytecode.\n address internal _implementationHolder;\n\n/* ========== Modifiers ========== */\n\n modifier onlyApprovedDeployer {\n address sender = _msgSender();\n require(_approvedDeployers[sender] || sender == owner(), \"ERR_NOT_APPROVED\");\n _;\n }\n\n/* ========== Constructor ========== */\n\n constructor() public Ownable() {}\n\n/* ========== Access Control ========== */\n\n /**\n * @dev Allows `deployer` to deploy many-to-one proxies.\n */\n function approveDeployer(address deployer) external override onlyOwner {\n _approvedDeployers[deployer] = true;\n emit DeploymentApprovalGranted(deployer);\n }\n\n /**\n * @dev Prevents `deployer` from deploying many-to-one proxies.\n */\n function revokeDeployerApproval(address deployer) external override onlyOwner {\n _approvedDeployers[deployer] = false;\n emit DeploymentApprovalRevoked(deployer);\n }\n\n/* ========== Implementation Management ========== */\n\n /**\n * @dev Creates a many-to-one proxy relationship.\n *\n * Deploys an implementation holder contract which stores the\n * implementation address for many proxies. The implementation\n * address can be updated on the holder to change the runtime\n * code used by all its proxies.\n *\n * @param implementationID ID for the implementation, used to identify the\n * proxies that use it. Also used as the salt in the create2 call when\n * deploying the implementation holder contract.\n * @param implementation Address with the runtime code the proxies\n * should use.\n */\n function createManyToOneProxyRelationship(\n bytes32 implementationID,\n address implementation\n )\n external\n override\n onlyOwner\n {\n // Deploy the implementation holder contract with the implementation\n // ID as the create2 salt.\n address implementationHolder = Create2.deploy(\n 0,\n implementationID,\n type(ManyToOneImplementationHolder).creationCode\n );\n\n // Store the implementation holder address\n _implementationHolders[implementationID] = implementationHolder;\n\n // Sets the implementation address.\n _setImplementation(implementationHolder, implementation);\n\n emit ManyToOne_ImplementationCreated(\n implementationID,\n implementation\n );\n }\n\n /**\n * @dev Lock the current implementation for `implementationID` so that it can never be upgraded again.\n */\n function lockImplementationManyToOne(bytes32 implementationID) external override onlyOwner {\n // Read the implementation holder address from storage.\n address implementationHolder = _implementationHolders[implementationID];\n // Verify that the implementation exists.\n require(implementationHolder != address(0), \"ERR_IMPLEMENTATION_ID\");\n _lockedImplementations[implementationHolder] = true;\n emit ManyToOne_ImplementationLocked(implementationID);\n }\n\n /**\n * @dev Lock the current implementation for `proxyAddress` so that it can never be upgraded again.\n */\n function lockImplementationOneToOne(address proxyAddress) external override onlyOwner {\n _lockedImplementations[proxyAddress] = true;\n emit OneToOne_ImplementationLocked(proxyAddress);\n }\n\n /**\n * @dev Updates the implementation address for a many-to-one\n * proxy relationship.\n *\n * @param implementationID Identifier for the implementation.\n * @param implementation Address with the runtime code the proxies\n * should use.\n */\n function setImplementationAddressManyToOne(\n bytes32 implementationID,\n address implementation\n )\n external\n override\n onlyOwner\n {\n // Read the implementation holder address from storage.\n address implementationHolder = _implementationHolders[implementationID];\n\n // Verify that the implementation exists.\n require(implementationHolder != address(0), \"ERR_IMPLEMENTATION_ID\");\n\n // Verify implementation is not locked\n require(!_lockedImplementations[implementationHolder], \"ERR_IMPLEMENTATION_LOCKED\");\n\n // Set the implementation address\n _setImplementation(implementationHolder, implementation);\n\n emit ManyToOne_ImplementationUpdated(\n implementationID,\n implementation\n );\n }\n\n /**\n * @dev Updates the implementation address for a one-to-one proxy.\n *\n * Note: This could work for many-to-one as well if the caller\n * provides the implementation holder address in place of the\n * proxy address, as they use the same access control and update\n * mechanism.\n *\n * @param proxyAddress Address of the deployed proxy\n * @param implementation Address with the runtime code for\n * the proxy to use.\n */\n function setImplementationAddressOneToOne(\n address proxyAddress,\n address implementation\n )\n external\n override\n onlyOwner\n {\n // Verify proxy is not locked\n require(!_lockedImplementations[proxyAddress], \"ERR_IMPLEMENTATION_LOCKED\");\n\n // Set the implementation address\n _setImplementation(proxyAddress, implementation);\n\n emit OneToOne_ImplementationUpdated(proxyAddress, implementation);\n }\n\n/* ========== Proxy Deployment ========== */\n\n /**\n * @dev Deploy a proxy contract with a one-to-one relationship\n * with its implementation.\n *\n * The proxy will have its own implementation address which can\n * be updated by the proxy manager.\n *\n * @param suppliedSalt Salt provided by the account requesting deployment.\n * @param implementation Address of the contract with the runtime\n * code that the proxy should use.\n */\n function deployProxyOneToOne(\n bytes32 suppliedSalt,\n address implementation\n )\n external\n override\n onlyOwner\n returns(address proxyAddress)\n {\n // Derive the create2 salt from the deployment requester's address\n // and the requester-supplied salt.\n bytes32 salt = Salty.deriveOneToOneSalt(_msgSender(), suppliedSalt);\n\n // Deploy the proxy\n proxyAddress = Create2.deploy(\n 0,\n salt,\n type(DelegateCallProxyOneToOne).creationCode\n );\n\n // Set the implementation address on the new proxy.\n _setImplementation(proxyAddress, implementation);\n\n emit OneToOne_ProxyDeployed(proxyAddress, implementation);\n }\n\n /**\n * @dev Deploy a proxy with a many-to-one relationship with its implemenation.\n *\n * The proxy will call the implementation holder for every transaction to\n * determine the address to use in calls.\n *\n * @param implementationID Identifier for the proxy's implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function deployProxyManyToOne(bytes32 implementationID, bytes32 suppliedSalt)\n external\n override\n onlyApprovedDeployer\n returns(address proxyAddress)\n {\n // Read the implementation holder address from storage.\n address implementationHolder = _implementationHolders[implementationID];\n\n // Verify that the implementation exists.\n require(implementationHolder != address(0), \"ERR_IMPLEMENTATION_ID\");\n\n // Derive the create2 salt from the deployment requester's address, the\n // implementation ID and the requester-supplied salt.\n bytes32 salt = Salty.deriveManyToOneSalt(\n _msgSender(),\n implementationID,\n suppliedSalt\n );\n\n // Set the implementation holder address in storage so the proxy\n // constructor can query it.\n _implementationHolder = implementationHolder;\n\n // Deploy the proxy, which will query the implementation holder address\n // and save it as an immutable in the contract bytecode.\n proxyAddress = Create2.deploy(\n 0,\n salt,\n type(DelegateCallProxyManyToOne).creationCode\n );\n\n // Remove the address from temporary storage.\n _implementationHolder = address(0);\n\n emit ManyToOne_ProxyDeployed(\n implementationID,\n proxyAddress\n );\n }\n\n/* ========== Queries ========== */\n\n /**\n * @dev Returns a boolean stating whether `implementationID` is locked.\n */\n function isImplementationLocked(bytes32 implementationID) external override view returns (bool) {\n // Read the implementation holder address from storage.\n address implementationHolder = _implementationHolders[implementationID];\n\n // Verify that the implementation exists.\n require(implementationHolder != address(0), \"ERR_IMPLEMENTATION_ID\");\n\n return _lockedImplementations[implementationHolder];\n }\n\n /**\n * @dev Returns a boolean stating whether `proxyAddress` is locked.\n */\n function isImplementationLocked(address proxyAddress) external override view returns (bool) {\n return _lockedImplementations[proxyAddress];\n }\n\n /**\n * @dev Returns a boolean stating whether `deployer` is allowed to deploy many-to-one\n * proxies.\n */\n function isApprovedDeployer(address deployer) external override view returns (bool) {\n return _approvedDeployers[deployer];\n }\n\n /**\n * @dev Queries the temporary storage value `_implementationHolder`.\n * This is used in the constructor of the many-to-one proxy contract\n * so that the create2 address is static (adding constructor arguments\n * would change the codehash) and the implementation holder can be\n * stored as a constant.\n */\n function getImplementationHolder()\n external\n override\n view\n returns (address)\n {\n return _implementationHolder;\n }\n\n /**\n * @dev Returns the address of the implementation holder contract\n * for `implementationID`.\n */\n function getImplementationHolder(\n bytes32 implementationID\n )\n external\n override\n view\n returns (address)\n {\n return _implementationHolders[implementationID];\n }\n\n /**\n * @dev Computes the create2 address for a one-to-one proxy requested\n * by `originator` using `suppliedSalt`.\n *\n * @param originator Address of the account requesting deployment.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressOneToOne(\n address originator,\n bytes32 suppliedSalt\n )\n external\n override\n view\n returns (address)\n {\n bytes32 salt = Salty.deriveOneToOneSalt(originator, suppliedSalt);\n return Create2.computeAddress(salt, CodeHashes.ONE_TO_ONE_CODEHASH);\n }\n\n /**\n * @dev Computes the create2 address for a many-to-one proxy for the\n * implementation `implementationID` requested by `originator` using\n * `suppliedSalt`.\n *\n * @param originator Address of the account requesting deployment.\n * @param implementationID The identifier for the contract implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressManyToOne(\n address originator,\n bytes32 implementationID,\n bytes32 suppliedSalt\n )\n external\n override\n view\n returns (address)\n {\n\n bytes32 salt = Salty.deriveManyToOneSalt(\n originator,\n implementationID,\n suppliedSalt\n );\n return Create2.computeAddress(salt, CodeHashes.MANY_TO_ONE_CODEHASH);\n }\n\n /**\n * @dev Computes the create2 address of the implementation holder\n * for `implementationID`.\n *\n * @param implementationID The identifier for the contract implementation.\n */\n function computeHolderAddressManyToOne(bytes32 implementationID)\n public\n override\n view\n returns (address)\n {\n return Create2.computeAddress(\n implementationID,\n CodeHashes.IMPLEMENTATION_HOLDER_CODEHASH\n );\n }\n\n/* ========== Internal Functions ========== */\n\n /**\n * @dev Sets the implementation address for a one-to-one proxy or\n * many-to-one implementation holder. Both use the same access\n * control and update mechanism, which is the receipt of a call\n * from the proxy manager with the abi-encoded implementation address\n * as the only calldata.\n *\n * Note: Verifies that the implementation address is a contract.\n *\n * @param proxyOrHolder Address of the one-to-one proxy or\n * many-to-one implementation holder contract.\n * @param implementation Address of the contract with the runtime\n * code that the proxy or proxies should use.\n */\n function _setImplementation(\n address proxyOrHolder,\n address implementation\n ) internal {\n // Verify that the implementation address is a contract.\n require(Address.isContract(implementation), \"ERR_NOT_CONTRACT\");\n // Set the implementation address on the contract.\n\n // solium-disable-next-line security/no-low-level-calls\n (bool success,) = proxyOrHolder.call(abi.encode(implementation));\n require(success, \"ERR_SET_ADDRESS_REVERT\");\n }\n}" }, "@openzeppelin/contracts/utils/Create2.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint256(_data));\n }\n}\n" @@ -10,29 +13,32 @@ "@openzeppelin/contracts/utils/Address.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.2;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies in extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return _functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n return _functionCallWithValue(target, data, value, errorMessage);\n }\n\n function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"../GSN/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/GSN/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, "contracts/ManyToOneImplementationHolder.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.6.0;\n\n\n/**\n * @dev Stores a single implementation address which is used by\n * many proxies.\n *\n * Inspired by the DharmaUpgradeBeacon from 0age\n * dharma-eng/dharma-smart-wallet/contracts/upgradeability/DharmaUpgradeBeacon.sol\n */\ncontract ManyToOneImplementationHolder {\n/* --- Storage --- */\n address internal immutable _owner;\n address internal _implementation;\n\n/* --- Constructor --- */\n constructor() public {\n _owner = msg.sender;\n }\n\n /**\n * @dev Fallback function for the contract.\n *\n * Used by proxies to read the implementation address and used\n * by the proxy manager to set the implementation address.\n *\n * If called by the owner, reads the implementation address from\n * calldata (must be abi-encoded) and stores it to the first slot.\n *\n * Otherwise, returns the stored implementation address.\n */\n fallback() external payable {\n if (msg.sender != _owner) {\n assembly {\n mstore(0, sload(0))\n return(0, 32)\n }\n }\n assembly { sstore(0, calldataload(0)) }\n }\n}" + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity =0.6.12;\n\n\n/**\n * @dev The ManyToOneImplementationHolder stores an upgradeable implementation address\n * in storage, which many-to-one proxies query at execution time to determine which\n * contract to delegate to.\n *\n * The manager can upgrade the implementation address by calling the holder with the\n * abi-encoded address as calldata. If any other account calls the implementation holder,\n * it will return the implementation address.\n *\n * This pattern was inspired by the DharmaUpgradeBeacon from 0age\n * https://github.com/dharma-eng/dharma-smart-wallet/blob/master/contracts/upgradeability/smart-wallet/DharmaUpgradeBeacon.sol\n */\ncontract ManyToOneImplementationHolder {\n/* --- Storage --- */\n address internal immutable _manager;\n address internal _implementation;\n\n/* --- Constructor --- */\n constructor() public {\n _manager = msg.sender;\n }\n\n /**\n * @dev Fallback function for the contract.\n *\n * Used by proxies to read the implementation address and used\n * by the proxy manager to set the implementation address.\n *\n * If called by the owner, reads the implementation address from\n * calldata (must be abi-encoded) and stores it to the first slot.\n *\n * Otherwise, returns the stored implementation address.\n */\n fallback() external payable {\n if (msg.sender != _manager) {\n assembly {\n mstore(0, sload(0))\n return(0, 32)\n }\n }\n assembly { sstore(0, calldataload(0)) }\n }\n}" }, "contracts/DelegateCallProxyManyToOne.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.6.0;\n\nimport { Proxy } from \"@openzeppelin/contracts/proxy/Proxy.sol\";\n\n\n/**\n * @dev Proxy contract which uses an implementation address shared with many\n * other proxies.\n *\n * An implementation holder contract stores the upgradeable logic address.\n * The proxy contract calls the implementation holder to execute each delegated\n * transaction.\n *\n * Note: This contract does not verify that the implementation\n * address is a valid delegation target. The manager must perform\n * this safety check before updating the implementation on the holder.\n */\ncontract DelegateCallProxyManyToOne is Proxy {\n/* --- Constants --- */\n\n // Address that stores the implementation address.\n address internal immutable _implementationHolder;\n\n/* --- Constructor --- */\n\n constructor() public {\n // Calls the sender rather than receiving the address in the constructor\n // arguments so that the address is computable using create2.\n _implementationHolder = ProxyDeployer(msg.sender).getImplementationHolder();\n }\n\n/* --- Internal Overrides --- */\n\n /**\n * @dev Queries the implementation address from the implementation holder.\n */\n function _implementation() internal override view returns (address) {\n // Queries the implementation address from the implementation holder.\n (bool success, bytes memory data) = _implementationHolder.staticcall(\"\");\n require(success, string(data));\n address implementation = abi.decode((data), (address));\n require(implementation != address(0), \"ERR_NULL_IMPLEMENTATION\");\n return implementation;\n }\n}\n\ninterface ProxyDeployer {\n function getImplementationHolder() external view returns (address);\n}" + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity =0.6.12;\n\nimport { Proxy } from \"@openzeppelin/contracts/proxy/Proxy.sol\";\n\n\n/**\n * @dev Proxy contract which uses an implementation address shared with many\n * other proxies.\n *\n * An implementation holder contract stores the upgradeable implementation address.\n * When the proxy is called, it queries the implementation address from the holder\n * contract and delegatecalls the returned address, forwarding the received calldata\n * and ether.\n *\n * Note: This contract does not verify that the implementation\n * address is a valid delegation target. The manager must perform\n * this safety check before updating the implementation on the holder.\n */\ncontract DelegateCallProxyManyToOne is Proxy {\n/* ========== Constants ========== */\n\n // Address that stores the implementation address.\n address internal immutable _implementationHolder;\n\n/* ========== Constructor ========== */\n\n constructor() public {\n // Calls the sender rather than receiving the address in the constructor\n // arguments so that the address is computable using create2.\n _implementationHolder = ProxyDeployer(msg.sender).getImplementationHolder();\n }\n\n/* ========== Internal Overrides ========== */\n\n /**\n * @dev Queries the implementation address from the implementation holder.\n */\n function _implementation() internal override view returns (address) {\n // Queries the implementation address from the implementation holder.\n (bool success, bytes memory data) = _implementationHolder.staticcall(\"\");\n require(success, string(data));\n address implementation = abi.decode((data), (address));\n require(implementation != address(0), \"ERR_NULL_IMPLEMENTATION\");\n return implementation;\n }\n}\n\ninterface ProxyDeployer {\n function getImplementationHolder() external view returns (address);\n}" }, "@openzeppelin/contracts/proxy/Proxy.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n * \n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n * \n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n * \n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 { revert(0, returndatasize()) }\n default { return(0, returndatasize()) }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal virtual view returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n * \n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback () payable external {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive () payable external {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n * \n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {\n }\n}\n" }, "contracts/DelegateCallProxyOneToOne.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.6.0;\n\nimport { Proxy } from \"@openzeppelin/contracts/proxy/Proxy.sol\";\n\n\n/**\n * @dev Upgradeable delegatecall proxy for a single contract.\n *\n * This proxy stores an implementation address which can be\n * upgraded by the proxy manager.\n *\n * The storage slot for the implementation address is:\n * `bytes32(uint256(keccak256(\"IMPLEMENTATION_ADDRESS\")) + 1)`\n * This slot must not be used by the implementation contract.\n *\n * To upgrade the proxy, the manager calls the proxy with the\n * abi encoded implementation address.\n *\n * Note: This contract does not verify that the implementation\n * address is a valid delegation target. The manager must perform\n * this safety check.\n */\ncontract DelegateCallProxyOneToOne is Proxy {\n/* --- Constants --- */\n address internal immutable _owner;\n\n/* --- Constructor --- */\n constructor() public {\n _owner = msg.sender ;\n }\n\n/* --- Internal Overrides --- */\n\n /**\n * @dev Reads the implementation address from storage.\n */\n function _implementation() internal override view returns (address) {\n address implementation;\n assembly {\n implementation := sload(\n // bytes32(uint256(keccak256(\"IMPLEMENTATION_ADDRESS\")) + 1)\n 0x913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a\n )\n }\n return implementation;\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation.\n *\n * Checks if the call is from the owner.\n * If it is, reads the abi-encoded implementation address from calldata and stores\n * it at the slot `bytes32(uint256(keccak256(\"IMPLEMENTATION_ADDRESS\")) + 1)`,\n * then returns with no data.\n * If it is not, continues execution with the fallback function.\n */\n function _beforeFallback() internal override {\n if (msg.sender != _owner) {\n super._beforeFallback();\n } else {\n assembly {\n sstore(\n // bytes32(uint256(keccak256(\"IMPLEMENTATION_ADDRESS\")) + 1)\n 0x913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a,\n calldataload(0)\n )\n return(0, 0)\n }\n }\n }\n}\n" + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity =0.6.12;\n\nimport { Proxy } from \"@openzeppelin/contracts/proxy/Proxy.sol\";\n\n\n/**\n * @dev Upgradeable delegatecall proxy for a single contract.\n *\n * This proxy stores an implementation address which can be upgraded by the proxy manager.\n *\n * To upgrade the implementation, the manager calls the proxy with the abi encoded implementation address.\n *\n * If any other account calls the proxy, it will delegatecall the implementation address with the received\n * calldata and ether. If the call succeeds, it will return with the received returndata.\n * If it reverts, it will revert with the received revert data.\n *\n * Note: The storage slot for the implementation address is:\n * `bytes32(uint256(keccak256(\"IMPLEMENTATION_ADDRESS\")) + 1)`\n * This slot must not be used by the implementation contract.\n *\n * Note: This contract does not verify that the implementation address is a valid delegation target.\n * The manager must perform this safety check.\n */\ncontract DelegateCallProxyOneToOne is Proxy {\n/* ========== Constants ========== */\n address internal immutable _manager;\n\n/* ========== Constructor ========== */\n constructor() public {\n _manager = msg.sender ;\n }\n\n/* ========== Internal Overrides ========== */\n\n /**\n * @dev Reads the implementation address from storage.\n */\n function _implementation() internal override view returns (address) {\n address implementation;\n assembly {\n implementation := sload(\n // bytes32(uint256(keccak256(\"IMPLEMENTATION_ADDRESS\")) + 1)\n 0x913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a\n )\n }\n return implementation;\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation.\n *\n * Checks if the call is from the owner.\n * If it is, reads the abi-encoded implementation address from calldata and stores\n * it at the slot `bytes32(uint256(keccak256(\"IMPLEMENTATION_ADDRESS\")) + 1)`,\n * then returns with no data.\n * If it is not, continues execution with the fallback function.\n */\n function _beforeFallback() internal override {\n if (msg.sender != _manager) {\n super._beforeFallback();\n } else {\n assembly {\n sstore(\n // bytes32(uint256(keccak256(\"IMPLEMENTATION_ADDRESS\")) + 1)\n 0x913bd12b32b36f36cedaeb6e043912bceb97022755958701789d3108d33a045a,\n calldataload(0)\n )\n return(0, 0)\n }\n }\n }\n}\n" }, "contracts/SaltyLib.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.6.0;\n\n/* --- External Libraries --- */\nimport { Create2 } from \"@openzeppelin/contracts/utils/Create2.sol\";\n\n/* --- Proxy Contracts --- */\nimport \"./ManyToOneImplementationHolder.sol\";\nimport { DelegateCallProxyManyToOne } from \"./DelegateCallProxyManyToOne.sol\";\nimport { DelegateCallProxyOneToOne } from \"./DelegateCallProxyOneToOne.sol\";\n\n\nlibrary SaltyLib {\n/* --- Constants --- */\n bytes32 internal constant ONE_TO_ONE_CODEHASH = keccak256(\n type(DelegateCallProxyOneToOne).creationCode\n );\n\n bytes32 internal constant MANY_TO_ONE_CODEHASH = keccak256(\n type(DelegateCallProxyManyToOne).creationCode\n );\n\n bytes32 internal constant IMPLEMENTATION_HOLDER_CODEHASH = keccak256(\n type(ManyToOneImplementationHolder).creationCode\n );\n\n/* --- Salt Derivation --- */\n\n /**\n * @dev Derives the create2 salt for a many-to-one proxy.\n *\n * Many different contracts in the Indexed framework may use the\n * same implementation contract, and they all use the same init\n * code, so we derive the actual create2 salt from a combination\n * of the implementation ID, the address of the account requesting\n * deployment and the user-supplied salt.\n *\n * @param originator Address of the account requesting deployment.\n * @param implementationID The identifier for the contract implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function deriveManyToOneSalt(\n address originator,\n bytes32 implementationID,\n bytes32 suppliedSalt\n )\n internal\n pure\n returns (bytes32)\n {\n return keccak256(\n abi.encodePacked(\n originator,\n implementationID,\n suppliedSalt\n )\n );\n }\n\n /**\n * @dev Derives the create2 salt for a one-to-one proxy.\n *\n * @param originator Address of the account requesting deployment.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function deriveOneToOneSalt(\n address originator,\n bytes32 suppliedSalt\n )\n internal\n pure\n returns (bytes32)\n {\n return keccak256(abi.encodePacked(originator, suppliedSalt));\n }\n\n/* --- Address Derivation --- */\n\n /**\n * @dev Computes the create2 address for a one-to-one proxy deployed\n * by `deployer` (the factory) when requested by `originator` using\n * `suppliedSalt`.\n *\n * @param deployer Address of the proxy factory.\n * @param originator Address of the account requesting deployment.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressOneToOne(\n address deployer,\n address originator,\n bytes32 suppliedSalt\n )\n internal\n pure\n returns (address)\n {\n bytes32 salt = deriveOneToOneSalt(originator, suppliedSalt);\n return Create2.computeAddress(salt, ONE_TO_ONE_CODEHASH, deployer);\n }\n\n /**\n * @dev Computes the create2 address for a many-to-one proxy for the\n * implementation `implementationID` deployed by `deployer` (the factory)\n * when requested by `originator` using `suppliedSalt`.\n *\n * @param deployer Address of the proxy factory.\n * @param originator Address of the account requesting deployment.\n * @param implementationID The identifier for the contract implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressManyToOne(\n address deployer,\n address originator,\n bytes32 implementationID,\n bytes32 suppliedSalt\n )\n internal\n pure\n returns (address)\n {\n bytes32 salt = deriveManyToOneSalt(\n originator,\n implementationID,\n suppliedSalt\n );\n return Create2.computeAddress(salt, MANY_TO_ONE_CODEHASH, deployer);\n }\n\n /**\n * @dev Computes the create2 address of the implementation holder\n * for `implementationID`.\n *\n * @param deployer Address of the proxy factory.\n * @param implementationID The identifier for the contract implementation.\n */\n function computeHolderAddressManyToOne(\n address deployer,\n bytes32 implementationID\n )\n internal\n pure\n returns (address)\n {\n return Create2.computeAddress(\n implementationID,\n IMPLEMENTATION_HOLDER_CODEHASH,\n deployer\n );\n }\n}" - }, - "contracts/Owned.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.6.0;\n\n\ncontract Owned {\n event OwnerSet(address newOwner);\n\n address internal _owner;\n\n modifier _owner_ {\n require(msg.sender == _owner, \"ERR_NOT_OWNER\");\n _;\n }\n\n constructor(address owner) public {\n _owner = owner;\n }\n\n function getOwner() external view returns (address) {\n return _owner;\n }\n\n function setOwner(address owner) external _owner_ {\n require(owner != address(0), \"ERR_NULL_ADDRESS\");\n _owner = owner;\n emit OwnerSet(owner);\n }\n}" + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.6.0;\n\n/* --- External Libraries --- */\nimport { Create2 } from \"@openzeppelin/contracts/utils/Create2.sol\";\n\n/* --- Proxy Contracts --- */\nimport { CodeHashes } from \"./CodeHashes.sol\";\n\n\n/**\n * @dev Library for computing create2 salts and addresses for proxies\n * deployed by `DelegateCallProxyManager`.\n *\n * Because the proxy factory is meant to be used by multiple contracts,\n * we use a salt derivation pattern that includes the address of the\n * contract that requested the proxy deployment, a salt provided by that\n * contract and the implementation ID used (for many-to-one proxies only).\n */\nlibrary SaltyLib {\n/* --- Salt Derivation --- */\n\n /**\n * @dev Derives the create2 salt for a many-to-one proxy.\n *\n * Many different contracts in the Indexed framework may use the\n * same implementation contract, and they all use the same init\n * code, so we derive the actual create2 salt from a combination\n * of the implementation ID, the address of the account requesting\n * deployment and the user-supplied salt.\n *\n * @param originator Address of the account requesting deployment.\n * @param implementationID The identifier for the contract implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function deriveManyToOneSalt(\n address originator,\n bytes32 implementationID,\n bytes32 suppliedSalt\n )\n internal\n pure\n returns (bytes32)\n {\n return keccak256(\n abi.encodePacked(\n originator,\n implementationID,\n suppliedSalt\n )\n );\n }\n\n /**\n * @dev Derives the create2 salt for a one-to-one proxy.\n *\n * @param originator Address of the account requesting deployment.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function deriveOneToOneSalt(\n address originator,\n bytes32 suppliedSalt\n )\n internal\n pure\n returns (bytes32)\n {\n return keccak256(abi.encodePacked(originator, suppliedSalt));\n }\n\n/* --- Address Derivation --- */\n\n /**\n * @dev Computes the create2 address for a one-to-one proxy deployed\n * by `deployer` (the factory) when requested by `originator` using\n * `suppliedSalt`.\n *\n * @param deployer Address of the proxy factory.\n * @param originator Address of the account requesting deployment.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressOneToOne(\n address deployer,\n address originator,\n bytes32 suppliedSalt\n )\n internal\n pure\n returns (address)\n {\n bytes32 salt = deriveOneToOneSalt(originator, suppliedSalt);\n return Create2.computeAddress(salt, CodeHashes.ONE_TO_ONE_CODEHASH, deployer);\n }\n\n /**\n * @dev Computes the create2 address for a many-to-one proxy for the\n * implementation `implementationID` deployed by `deployer` (the factory)\n * when requested by `originator` using `suppliedSalt`.\n *\n * @param deployer Address of the proxy factory.\n * @param originator Address of the account requesting deployment.\n * @param implementationID The identifier for the contract implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressManyToOne(\n address deployer,\n address originator,\n bytes32 implementationID,\n bytes32 suppliedSalt\n )\n internal\n pure\n returns (address)\n {\n bytes32 salt = deriveManyToOneSalt(\n originator,\n implementationID,\n suppliedSalt\n );\n return Create2.computeAddress(salt, CodeHashes.MANY_TO_ONE_CODEHASH, deployer);\n }\n\n /**\n * @dev Computes the create2 address of the implementation holder\n * for `implementationID`.\n *\n * @param deployer Address of the proxy factory.\n * @param implementationID The identifier for the contract implementation.\n */\n function computeHolderAddressManyToOne(\n address deployer,\n bytes32 implementationID\n )\n internal\n pure\n returns (address)\n {\n return Create2.computeAddress(\n implementationID,\n CodeHashes.IMPLEMENTATION_HOLDER_CODEHASH,\n deployer\n );\n }\n}" }, "contracts/interfaces/IDelegateCallProxyManager.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.6.0;\n\n\n/**\n * @dev Contract that manages deployment and upgrades of delegatecall proxies.\n *\n * An implementation identifier can be created on the proxy manager which is\n * used to specify the logic address for a particular contract type, and to\n * upgrade the implementation as needed.\n *\n * A one-to-one proxy is a single proxy contract with an upgradeable implementation\n * address.\n *\n * A many-to-one proxy is a single upgradeable implementation address that may be\n * used by many proxy contracts.\n */\ninterface IDelegateCallProxyManager {\n/* --- Events --- */\n\n event DeploymentApprovalGranted(address deployer);\n event DeploymentApprovalRevoked(address deployer);\n\n event ManyToOne_ImplementationCreated(\n bytes32 implementationID,\n address implementationAddress\n );\n\n event ManyToOne_ImplementationUpdated(\n bytes32 implementationID,\n address implementationAddress\n );\n\n event ManyToOne_ProxyDeployed(\n bytes32 implementationID,\n address proxyAddress\n );\n\n event OneToOne_ProxyDeployed(\n address proxyAddress,\n address implementationAddress\n );\n\n event OneToOne_ImplementationUpdated(\n address proxyAddress,\n address implementationAddress\n );\n\n/* --- Controls --- */\n\n /**\n * @dev Allows `deployer` to deploy many-to-one proxies.\n */\n function approveDeployer(address deployer) external;\n\n /**\n * @dev Prevents `deployer` from deploying many-to-one proxies.\n */\n function revokeDeployerApproval(address deployer) external;\n\n/* --- Implementation Management --- */\n\n /**\n * @dev Creates a many-to-one proxy relationship.\n *\n * Deploys an implementation holder contract which stores the\n * implementation address for many proxies. The implementation\n * address can be updated on the holder to change the runtime\n * code used by all its proxies.\n *\n * @param implementationID ID for the implementation, used to identify the\n * proxies that use it. Also used as the salt in the create2 call when\n * deploying the implementation holder contract.\n * @param implementation Address with the runtime code the proxies\n * should use.\n */\n function createManyToOneProxyRelationship(\n bytes32 implementationID,\n address implementation\n ) external;\n\n /**\n * @dev Updates the implementation address for a many-to-one\n * proxy relationship.\n *\n * @param implementationID Identifier for the implementation.\n * @param implementation Address with the runtime code the proxies\n * should use.\n */\n function setImplementationAddressManyToOne(\n bytes32 implementationID,\n address implementation\n ) external;\n\n /**\n * @dev Updates the implementation address for a one-to-one proxy.\n *\n * Note: This could work for many-to-one as well if the caller\n * provides the implementation holder address in place of the\n * proxy address, as they use the same access control and update\n * mechanism.\n *\n * @param proxyAddress Address of the deployed proxy\n * @param implementation Address with the runtime code for\n * the proxy to use.\n */\n function setImplementationAddressOneToOne(\n address proxyAddress,\n address implementation\n ) external;\n\n/* --- Proxy Deployment --- */\n\n /**\n * @dev Deploy a proxy contract with a one-to-one relationship\n * with its implementation.\n *\n * The proxy will have its own implementation address which can\n * be updated by the proxy manager.\n *\n * @param suppliedSalt Salt provided by the account requesting deployment.\n * @param implementation Address of the contract with the runtime\n * code that the proxy should use.\n */\n function deployProxyOneToOne(\n bytes32 suppliedSalt,\n address implementation\n ) external returns(address proxyAddress);\n\n /**\n * @dev Deploy a proxy with a many-to-one relationship with its implemenation.\n *\n * The proxy will call the implementation holder for every transaction to\n * determine the address to use in calls.\n *\n * @param implementationID Identifier for the proxy's implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function deployProxyManyToOne(\n bytes32 implementationID,\n bytes32 suppliedSalt\n ) external returns(address proxyAddress);\n\n/* --- Queries --- */\n\n function isApprovedDeployer(address deployer) external view returns (bool);\n\n /**\n * @dev Queries the temporary storage value `_implementationHolder`.\n * This is used in the constructor of the many-to-one proxy contract\n * so that the create2 address is static (adding constructor arguments\n * would change the codehash) and the implementation holder can be\n * stored as a constant.\n */\n function getImplementationHolder() external view returns (address);\n\n /**\n * @dev Returns the address of the implementation holder contract\n * for `implementationID`.\n */\n function getImplementationHolder(bytes32 implementationID) external view returns (address);\n\n /**\n * @dev Computes the create2 address for a one-to-one proxy requested\n * by `originator` using `suppliedSalt`.\n *\n * @param originator Address of the account requesting deployment.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressOneToOne(\n address originator,\n bytes32 suppliedSalt\n ) external view returns (address);\n\n /**\n * @dev Computes the create2 address for a many-to-one proxy for the\n * implementation `implementationID` requested by `originator` using\n * `suppliedSalt`.\n *\n * @param originator Address of the account requesting deployment.\n * @param implementationID The identifier for the contract implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressManyToOne(\n address originator,\n bytes32 implementationID,\n bytes32 suppliedSalt\n ) external view returns (address);\n\n /**\n * @dev Computes the create2 address of the implementation holder\n * for `implementationID`.\n *\n * @param implementationID The identifier for the contract implementation.\n */\n function computeHolderAddressManyToOne(bytes32 implementationID) external view returns (address);\n}" + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.6.0;\n\n\n/**\n * @dev Contract that manages deployment and upgrades of delegatecall proxies.\n *\n * An implementation identifier can be created on the proxy manager which is\n * used to specify the logic address for a particular contract type, and to\n * upgrade the implementation as needed.\n *\n * A one-to-one proxy is a single proxy contract with an upgradeable implementation\n * address.\n *\n * A many-to-one proxy is a single upgradeable implementation address that may be\n * used by many proxy contracts.\n */\ninterface IDelegateCallProxyManager {\n/* ========== Events ========== */\n\n event DeploymentApprovalGranted(address deployer);\n event DeploymentApprovalRevoked(address deployer);\n\n event ManyToOne_ImplementationCreated(\n bytes32 implementationID,\n address implementationAddress\n );\n\n event ManyToOne_ImplementationUpdated(\n bytes32 implementationID,\n address implementationAddress\n );\n\n event ManyToOne_ProxyDeployed(\n bytes32 implementationID,\n address proxyAddress\n );\n\n event OneToOne_ProxyDeployed(\n address proxyAddress,\n address implementationAddress\n );\n\n event OneToOne_ImplementationUpdated(\n address proxyAddress,\n address implementationAddress\n );\n\n/* ========== Controls ========== */\n\n /**\n * @dev Allows `deployer` to deploy many-to-one proxies.\n */\n function approveDeployer(address deployer) external;\n\n /**\n * @dev Prevents `deployer` from deploying many-to-one proxies.\n */\n function revokeDeployerApproval(address deployer) external;\n\n/* ========== Implementation Management ========== */\n\n /**\n * @dev Creates a many-to-one proxy relationship.\n *\n * Deploys an implementation holder contract which stores the\n * implementation address for many proxies. The implementation\n * address can be updated on the holder to change the runtime\n * code used by all its proxies.\n *\n * @param implementationID ID for the implementation, used to identify the\n * proxies that use it. Also used as the salt in the create2 call when\n * deploying the implementation holder contract.\n * @param implementation Address with the runtime code the proxies\n * should use.\n */\n function createManyToOneProxyRelationship(\n bytes32 implementationID,\n address implementation\n ) external;\n\n /**\n * @dev Lock the current implementation for `proxyAddress` so that it can never be upgraded again.\n */\n function lockImplementationManyToOne(bytes32 implementationID) external;\n\n /**\n * @dev Lock the current implementation for `proxyAddress` so that it can never be upgraded again.\n */\n function lockImplementationOneToOne(address proxyAddress) external;\n\n /**\n * @dev Updates the implementation address for a many-to-one\n * proxy relationship.\n *\n * @param implementationID Identifier for the implementation.\n * @param implementation Address with the runtime code the proxies\n * should use.\n */\n function setImplementationAddressManyToOne(\n bytes32 implementationID,\n address implementation\n ) external;\n\n /**\n * @dev Updates the implementation address for a one-to-one proxy.\n *\n * Note: This could work for many-to-one as well if the caller\n * provides the implementation holder address in place of the\n * proxy address, as they use the same access control and update\n * mechanism.\n *\n * @param proxyAddress Address of the deployed proxy\n * @param implementation Address with the runtime code for\n * the proxy to use.\n */\n function setImplementationAddressOneToOne(\n address proxyAddress,\n address implementation\n ) external;\n\n/* ========== Proxy Deployment ========== */\n\n /**\n * @dev Deploy a proxy contract with a one-to-one relationship\n * with its implementation.\n *\n * The proxy will have its own implementation address which can\n * be updated by the proxy manager.\n *\n * @param suppliedSalt Salt provided by the account requesting deployment.\n * @param implementation Address of the contract with the runtime\n * code that the proxy should use.\n */\n function deployProxyOneToOne(\n bytes32 suppliedSalt,\n address implementation\n ) external returns(address proxyAddress);\n\n /**\n * @dev Deploy a proxy with a many-to-one relationship with its implemenation.\n *\n * The proxy will call the implementation holder for every transaction to\n * determine the address to use in calls.\n *\n * @param implementationID Identifier for the proxy's implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function deployProxyManyToOne(\n bytes32 implementationID,\n bytes32 suppliedSalt\n ) external returns(address proxyAddress);\n\n/* ========== Queries ========== */\n\n /**\n * @dev Returns a boolean stating whether `implementationID` is locked.\n */\n function isImplementationLocked(bytes32 implementationID) external view returns (bool);\n\n /**\n * @dev Returns a boolean stating whether `proxyAddress` is locked.\n */\n function isImplementationLocked(address proxyAddress) external view returns (bool);\n\n /**\n * @dev Returns a boolean stating whether `deployer` is allowed to deploy many-to-one\n * proxies.\n */\n function isApprovedDeployer(address deployer) external view returns (bool);\n\n /**\n * @dev Queries the temporary storage value `_implementationHolder`.\n * This is used in the constructor of the many-to-one proxy contract\n * so that the create2 address is static (adding constructor arguments\n * would change the codehash) and the implementation holder can be\n * stored as a constant.\n */\n function getImplementationHolder() external view returns (address);\n\n /**\n * @dev Returns the address of the implementation holder contract\n * for `implementationID`.\n */\n function getImplementationHolder(bytes32 implementationID) external view returns (address);\n\n /**\n * @dev Computes the create2 address for a one-to-one proxy requested\n * by `originator` using `suppliedSalt`.\n *\n * @param originator Address of the account requesting deployment.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressOneToOne(\n address originator,\n bytes32 suppliedSalt\n ) external view returns (address);\n\n /**\n * @dev Computes the create2 address for a many-to-one proxy for the\n * implementation `implementationID` requested by `originator` using\n * `suppliedSalt`.\n *\n * @param originator Address of the account requesting deployment.\n * @param implementationID The identifier for the contract implementation.\n * @param suppliedSalt Salt provided by the account requesting deployment.\n */\n function computeProxyAddressManyToOne(\n address originator,\n bytes32 implementationID,\n bytes32 suppliedSalt\n ) external view returns (address);\n\n /**\n * @dev Computes the create2 address of the implementation holder\n * for `implementationID`.\n *\n * @param implementationID The identifier for the contract implementation.\n */\n function computeHolderAddressManyToOne(bytes32 implementationID) external view returns (address);\n}" }, "contracts/mocks/ProxyTest.sol": { - "content": "pragma solidity ^0.6.0;\n\nimport { DelegateCallProxyManager, DelegateCallProxyManyToOne } from \"../DelegateCallProxyManager.sol\";\nimport { SaltyLib as Salty } from \"../SaltyLib.sol\";\nimport \"./TestOrder.sol\";\nimport \"@nomiclabs/buidler/console.sol\";\n\ncontract MockProxyLogic1 {\n uint256 internal _value = 0;\n\n function incrementValue() external {\n _value += 1;\n }\n\n function decrementValue() external {\n _value -= 1;\n }\n\n function getValue() external view returns (uint) {\n return _value;\n }\n}\n\n\ncontract MockProxyLogic2 {\n uint256 internal _value = 0;\n\n function incrementValue() external {\n _value += 2;\n }\n\n function decrementValue() external {\n _value -= 2;\n }\n\n function getValue() external view returns (uint) {\n return _value;\n }\n}\n\n\ncontract ApprovalTest {\n bytes32 internal constant TEST_IMPLEMENTATION_ID = keccak256(\"ProxyLogic.sol\");\n function deploy(DelegateCallProxyManager manager, bytes32 salt) external returns (address proxyAddress) {\n return manager.deployProxyManyToOne(TEST_IMPLEMENTATION_ID, salt);\n }\n}\n\n\ncontract ErroneousHolder1 {\n fallback() external payable {\n bytes memory errorMsg = \"CUSTOM_HOLDER_REVERT_MSG\";\n assembly { revert(add(errorMsg, 32), mload(errorMsg)) }\n }\n}\n\n\ncontract ErroneousHolder2 {\n fallback() external payable {\n bytes memory retMsg = abi.encode(address(0));\n assembly { return(add(retMsg, 32), mload(retMsg)) }\n }\n}\n\n\ncontract ProxyTest is TestOrder {\n bytes32 internal constant TEST_IMPLEMENTATION_ID = keccak256(\"ProxyLogic.sol\");\n DelegateCallProxyManager public manager;\n ApprovalTest internal _approvalTest;\n MockProxyLogic1 implementation1;\n MockProxyLogic2 implementation2;\n address proxyAddressMT1;\n address proxyAddress1T1;\n ErroneousHolder1 errorHolder1;\n ErroneousHolder2 errorHolder2;\n\n constructor() public {\n manager = new DelegateCallProxyManager();\n _approvalTest = new ApprovalTest();\n implementation1 = new MockProxyLogic1();\n implementation2 = new MockProxyLogic2();\n }\n\n function test_deployInvalidImplementation() external testIndex(0) {\n console.log(\"� Unrecognized implementation deployment\");\n try manager.deployProxyManyToOne(TEST_IMPLEMENTATION_ID, keccak256(\"Salt1\")) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_IMPLEMENTATION_ID\"),\n \"Error: Expected ERR_IMPLEMENTATION_ID error message.\"\n );\n }\n console.log(\" ✓ Fails to deploy proxy for unrecognized implementation.\");\n }\n\n function test_createManyToOneProxyRelationship() external testIndex(1) {\n console.log(\"🔗 Many-to-one relationship creation\");\n manager.createManyToOneProxyRelationship(TEST_IMPLEMENTATION_ID, address(implementation1));\n console.log(\" ✓ Creates a many-to-one relationship.\");\n address implHolder = manager.getImplementationHolder(TEST_IMPLEMENTATION_ID);\n console.log(\" ✓ Queries the implementation holder address.\");\n require(\n implHolder == manager.computeHolderAddressManyToOne(TEST_IMPLEMENTATION_ID),\n \"Error: Unexpected implementation holder address returned by proxy manager.\"\n );\n console.log(\" ✓ Manager computes the correct holder address.\");\n require(\n implHolder == Salty.computeHolderAddressManyToOne(address(manager), TEST_IMPLEMENTATION_ID),\n \"Error: Unexpected implementation holder address returned by Salty.\"\n );\n console.log(\" ✓ Salty computes the correct holder address.\");\n (bool success, bytes memory data) = implHolder.call(\"\");\n require(success, \"Error: Failed to query implementation address.\");\n require(\n abi.decode((data), (address)) == address(implementation1),\n \"Error: Implementation holder returned unexpected implementation address.\"\n );\n console.log(\" ✓ Implementation holder returns the correct implementation.\");\n }\n\n function test_unapprovedDeployer() external testIndex(2) {\n console.log(\"🚫 Unapproved deployment\");\n try _approvalTest.deploy(manager, keccak256(\"Salt1\")) {\n revert(\"Expected error\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_APPROVED\"),\n \"Error: Expected ERR_NOT_APPROVED error message.\"\n );\n }\n console.log(\" ✓ Unapproved deployment fails.\");\n }\n\n function test_approveDeployer() external testIndex(3) {\n console.log(\"🔓 Deployer approval\");\n manager.approveDeployer(address(_approvalTest));\n console.log(\" ✓ Approves deployer.\");\n require(\n manager.isApprovedDeployer(address(_approvalTest)),\n \"Error: Deployer not approved.\"\n );\n console.log(\" ✓ Manager shows deployer as approved.\");\n }\n\n function test_deployProxyManyToOne() external testIndex(4) {\n console.log(\"🆕 Many-to-one proxy deployment\");\n proxyAddressMT1 = _approvalTest.deploy(manager, keccak256(\"Salt1\"));\n console.log(\" ✓ Deploys a many-to-one proxy with the approved contract.\");\n require(\n proxyAddressMT1 == Salty.computeProxyAddressManyToOne(\n address(manager),\n address(_approvalTest),\n TEST_IMPLEMENTATION_ID,\n keccak256(\"Salt1\")\n ),\n \"Error: Unexpected proxy address returned by Salty.\"\n );\n console.log(\" ✓ Salty computes the correct address.\");\n require(\n proxyAddressMT1 == manager.computeProxyAddressManyToOne(\n address(_approvalTest),\n TEST_IMPLEMENTATION_ID,\n keccak256(\"Salt1\")\n ),\n \"Error: Unexpected proxy address returned by manager.\"\n );\n console.log(\" ✓ Manager computes the correct address.\");\n MockProxyLogic1 proxy = MockProxyLogic1(proxyAddressMT1);\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n proxy.incrementValue();\n require(proxy.getValue() == 1, \"Error: Expected proxy to return 1 for stored value.\");\n proxy.decrementValue();\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n console.log(\" ✓ Proxy forwards calls to upgraded implementation.\");\n }\n\n function test_revokeDeployerApproval() external testIndex(5) {\n console.log(\"🔐 Approval revocation\");\n manager.revokeDeployerApproval(address(_approvalTest));\n console.log(\" ✓ Revokes deployer approval.\");\n try _approvalTest.deploy(manager, keccak256(\"Salt2\")) {\n revert(\"Expected error\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_APPROVED\"),\n \"Error: Expected ERR_NOT_APPROVED error message.\"\n );\n }\n console.log(\" ✓ Unapproved deployer fails to deploy proxy.\");\n }\n\n function test_setImplementationAddressManyToOne() external testIndex(6) {\n console.log(\"⏫ Many-to-one proxy implementation upgrade\");\n try manager.setImplementationAddressManyToOne(bytes32(0), address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_IMPLEMENTATION_ID\"),\n \"Error: Expected ERR_IMPLEMENTATION_ID error message.\"\n );\n }\n console.log(\" ✓ Fails to set implementation for unrecognized ID.\");\n try manager.setImplementationAddressManyToOne(TEST_IMPLEMENTATION_ID, address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_CONTRACT\"),\n \"Error: Expected ERR_NOT_CONTRACT error message.\"\n );\n }\n console.log(\" ✓ Fails to set non-contract implementation.\");\n manager.setImplementationAddressManyToOne(TEST_IMPLEMENTATION_ID, address(implementation2));\n console.log(\" ✓ Updates proxy implementation.\");\n MockProxyLogic2 proxy = MockProxyLogic2(proxyAddressMT1);\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n proxy.incrementValue();\n require(proxy.getValue() == 2, \"Error: Expected proxy to return 2 for stored value.\");\n proxy.decrementValue();\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n console.log(\" ✓ Proxy forwards calls to upgraded implementation.\");\n }\n\n function test_deployProxyOneToOne() external testIndex(7) {\n console.log(\"🆕 One-to-one proxy deployment\");\n proxyAddress1T1 = manager.deployProxyOneToOne(\n keccak256(\"Salty\"), address(implementation1)\n );\n console.log(\" ✓ Deploys a one-to-one proxy.\");\n require(\n proxyAddress1T1 == Salty.computeProxyAddressOneToOne(\n address(manager),\n address(this),\n keccak256(\"Salty\")\n ),\n \"Error: Unexpected proxy address.\"\n );\n console.log(\" ✓ Salty computes correct address.\");\n require(\n proxyAddress1T1 == manager.computeProxyAddressOneToOne(\n address(this),\n keccak256(\"Salty\")\n ),\n \"Error: Unexpected proxy address.\"\n );\n console.log(\" ✓ Manager computes correct address.\");\n MockProxyLogic1 proxy = MockProxyLogic1(proxyAddress1T1);\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n proxy.incrementValue();\n require(proxy.getValue() == 1, \"Error: Expected proxy to return 1 for stored value.\");\n proxy.decrementValue();\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n console.log(\" ✓ Proxy forwards calls to implementation.\");\n }\n\n function test_setImplementationAddressOneToOne() external testIndex(8) {\n console.log(\"🔼 One-to-one proxy implementation upgrade\");\n try manager.setImplementationAddressOneToOne(proxyAddress1T1, address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_CONTRACT\"),\n \"Error: Expected ERR_NOT_CONTRACT error message.\"\n );\n }\n console.log(\" ✓ Fails to set non-contract implementation.\");\n try manager.setImplementationAddressOneToOne(address(this), address(this)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_SET_ADDRESS_REVERT\"),\n \"Error: Expected ERR_SET_ADDRESS_REVERT error message.\"\n );\n }\n console.log(\" ✓ Reverts on call to non-proxy.\");\n manager.setImplementationAddressOneToOne(proxyAddress1T1, address(implementation2));\n console.log(\" ✓ Updates proxy implementation.\");\n MockProxyLogic2 proxy = MockProxyLogic2(proxyAddress1T1);\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n proxy.incrementValue();\n require(proxy.getValue() == 2, \"Error: Expected proxy to return 2 for stored value.\");\n proxy.decrementValue();\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n console.log(\" ✓ Proxy forwards calls to upgraded implementation.\");\n }\n\n function test_setOwner() external testIndex(9) {\n console.log(\"👑 Ownership transferral\");\n try manager.setOwner(address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NULL_ADDRESS\"),\n \"Error: Expected ERR_NULL_ADDRESS error message.\"\n );\n }\n console.log(\" ✓ Fails to transfer ownership to null address.\");\n manager.setOwner(address(32));\n console.log(\" ✓ Transfers ownership to non-null address.\");\n require(address(32) == manager.getOwner(), \"Error: Manager returned unexpected owner address.\");\n console.log(\" ✓ Returns updated owner address.\");\n }\n\n function test_badImplementationHolder() external testIndex(10) {\n console.log(\"🔥 Proxy failure conditions\");\n errorHolder1 = new ErroneousHolder1();\n address proxy = address(new DelegateCallProxyManyToOne());\n // \"Error: Bad implementation holder.\"\n try MockProxyLogic2(proxy).getValue() {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"CUSTOM_HOLDER_REVERT_MSG\"),\n \"Error: Expected CUSTOM_HOLDER_REVERT_MSG error message.\"\n );\n }\n console.log(\" ✓ Returns the revert message if the call to the holder fails.\");\n errorHolder2 = new ErroneousHolder2();\n proxy = address(new DelegateCallProxyManyToOne());\n try MockProxyLogic2(proxy).getValue() {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NULL_IMPLEMENTATION\"),\n \"Error: Expected ERR_NULL_IMPLEMENTATION error message.\"\n );\n }\n console.log(\" ✓ Reverts if the holder returns a null address.\");\n }\n\n function test_onlyOwner() external testIndex(11) {\n console.log(\"🔒 Owner restrictions\");\n try manager.approveDeployer(address(this)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_OWNER\"),\n \"Error: Expected ERR_NOT_OWNER error message.\"\n );\n }\n console.log(\" ✓ approveDeployer(): Reverts when called by non-owner.\");\n\n try manager.revokeDeployerApproval(address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_OWNER\"),\n \"Error: Expected ERR_NOT_OWNER error message.\"\n );\n }\n console.log(\" ✓ revokeDeployerApproval(): Reverts when called by non-owner.\");\n\n try manager.deployProxyOneToOne(keccak256(\"Salty\"), address(implementation1)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_OWNER\"),\n \"Error: Expected ERR_NOT_OWNER error message.\"\n );\n }\n console.log(\" ✓ deployProxyOneToOne(): Reverts when called by non-owner.\");\n\n try manager.createManyToOneProxyRelationship(keccak256(\"Salty\"), address(implementation1)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_OWNER\"),\n \"Error: Expected ERR_NOT_OWNER error message.\"\n );\n }\n console.log(\" ✓ createManyToOneProxyRelationship(): Reverts when called by non-owner.\");\n\n try manager.setImplementationAddressOneToOne(proxyAddress1T1, address(implementation2)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_OWNER\"),\n \"Error: Expected ERR_NOT_OWNER error message.\"\n );\n }\n console.log(\" ✓ setImplementationAddressOneToOne(): Reverts when called by non-owner.\");\n\n try manager.setImplementationAddressManyToOne(bytes32(0), address(implementation2)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_OWNER\"),\n \"Error: Expected ERR_NOT_OWNER error message.\"\n );\n }\n console.log(\" ✓ setImplementationAddressManyToOne(): Reverts when called by non-owner.\");\n }\n\n function getImplementationHolder() external view returns(address) {\n if (address(errorHolder2) != address(0)) return address(errorHolder2);\n return address(errorHolder1);\n }\n}" + "content": "pragma solidity ^0.6.0;\n\nimport { DelegateCallProxyManager, DelegateCallProxyManyToOne } from \"../DelegateCallProxyManager.sol\";\nimport { SaltyLib as Salty } from \"../SaltyLib.sol\";\nimport \"./TestOrder.sol\";\nimport \"@nomiclabs/buidler/console.sol\";\n\ncontract MockProxyLogic1 {\n uint256 internal _value = 0;\n\n function incrementValue() external {\n _value += 1;\n }\n\n function decrementValue() external {\n _value -= 1;\n }\n\n function getValue() external view returns (uint) {\n return _value;\n }\n}\n\n\ncontract MockProxyLogic2 {\n uint256 internal _value = 0;\n\n function incrementValue() external {\n _value += 2;\n }\n\n function decrementValue() external {\n _value -= 2;\n }\n\n function getValue() external view returns (uint) {\n return _value;\n }\n}\n\n\ncontract ApprovalTest {\n bytes32 internal constant TEST_IMPLEMENTATION_ID = keccak256(\"ProxyLogic.sol\");\n function deploy(DelegateCallProxyManager manager, bytes32 salt) external returns (address proxyAddress) {\n return manager.deployProxyManyToOne(TEST_IMPLEMENTATION_ID, salt);\n }\n}\n\n\ncontract ErroneousHolder1 {\n fallback() external payable {\n bytes memory errorMsg = \"CUSTOM_HOLDER_REVERT_MSG\";\n assembly { revert(add(errorMsg, 32), mload(errorMsg)) }\n }\n}\n\n\ncontract ErroneousHolder2 {\n fallback() external payable {\n bytes memory retMsg = abi.encode(address(0));\n assembly { return(add(retMsg, 32), mload(retMsg)) }\n }\n}\n\n\ncontract ProxyTest is TestOrder {\n bytes32 internal constant TEST_IMPLEMENTATION_ID = keccak256(\"ProxyLogic.sol\");\n DelegateCallProxyManager public manager;\n ApprovalTest internal _approvalTest;\n MockProxyLogic1 implementation1;\n MockProxyLogic2 implementation2;\n address proxyAddressMT1;\n address proxyAddress1T1;\n ErroneousHolder1 errorHolder1;\n ErroneousHolder2 errorHolder2;\n\n constructor() public {\n manager = new DelegateCallProxyManager();\n _approvalTest = new ApprovalTest();\n implementation1 = new MockProxyLogic1();\n implementation2 = new MockProxyLogic2();\n }\n\n function test_deployInvalidImplementation() external testIndex(0) {\n console.log(\"� Unrecognized implementation deployment\");\n try manager.deployProxyManyToOne(TEST_IMPLEMENTATION_ID, keccak256(\"Salt1\")) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_IMPLEMENTATION_ID\"),\n \"Error: Expected ERR_IMPLEMENTATION_ID error message.\"\n );\n }\n console.log(\" ✓ Fails to deploy proxy for unrecognized implementation.\");\n }\n\n function test_createManyToOneProxyRelationship() external testIndex(1) {\n console.log(\"🔗 Many-to-one relationship creation\");\n manager.createManyToOneProxyRelationship(TEST_IMPLEMENTATION_ID, address(implementation1));\n console.log(\" ✓ Creates a many-to-one relationship.\");\n address implHolder = manager.getImplementationHolder(TEST_IMPLEMENTATION_ID);\n console.log(\" ✓ Queries the implementation holder address.\");\n require(\n implHolder == manager.computeHolderAddressManyToOne(TEST_IMPLEMENTATION_ID),\n \"Error: Unexpected implementation holder address returned by proxy manager.\"\n );\n console.log(\" ✓ Manager computes the correct holder address.\");\n require(\n implHolder == Salty.computeHolderAddressManyToOne(address(manager), TEST_IMPLEMENTATION_ID),\n \"Error: Unexpected implementation holder address returned by Salty.\"\n );\n console.log(\" ✓ Salty computes the correct holder address.\");\n (bool success, bytes memory data) = implHolder.call(\"\");\n require(success, \"Error: Failed to query implementation address.\");\n require(\n abi.decode((data), (address)) == address(implementation1),\n \"Error: Implementation holder returned unexpected implementation address.\"\n );\n console.log(\" ✓ Implementation holder returns the correct implementation.\");\n }\n\n function test_unapprovedDeployer() external testIndex(2) {\n console.log(\"🚫 Unapproved deployment\");\n try _approvalTest.deploy(manager, keccak256(\"Salt1\")) {\n revert(\"Expected error\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_APPROVED\"),\n \"Error: Expected ERR_NOT_APPROVED error message.\"\n );\n }\n console.log(\" ✓ Unapproved deployment fails.\");\n }\n\n function test_approveDeployer() external testIndex(3) {\n console.log(\"🔓 Deployer approval\");\n manager.approveDeployer(address(_approvalTest));\n console.log(\" ✓ Approves deployer.\");\n require(\n manager.isApprovedDeployer(address(_approvalTest)),\n \"Error: Deployer not approved.\"\n );\n console.log(\" ✓ Manager shows deployer as approved.\");\n }\n\n function test_deployProxyManyToOne() external testIndex(4) {\n console.log(\"🆕 Many-to-one proxy deployment\");\n proxyAddressMT1 = _approvalTest.deploy(manager, keccak256(\"Salt1\"));\n console.log(\" ✓ Deploys a many-to-one proxy with the approved contract.\");\n require(\n proxyAddressMT1 == Salty.computeProxyAddressManyToOne(\n address(manager),\n address(_approvalTest),\n TEST_IMPLEMENTATION_ID,\n keccak256(\"Salt1\")\n ),\n \"Error: Unexpected proxy address returned by Salty.\"\n );\n console.log(\" ✓ Salty computes the correct address.\");\n require(\n proxyAddressMT1 == manager.computeProxyAddressManyToOne(\n address(_approvalTest),\n TEST_IMPLEMENTATION_ID,\n keccak256(\"Salt1\")\n ),\n \"Error: Unexpected proxy address returned by manager.\"\n );\n console.log(\" ✓ Manager computes the correct address.\");\n MockProxyLogic1 proxy = MockProxyLogic1(proxyAddressMT1);\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n proxy.incrementValue();\n require(proxy.getValue() == 1, \"Error: Expected proxy to return 1 for stored value.\");\n proxy.decrementValue();\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n console.log(\" ✓ Proxy forwards calls to upgraded implementation.\");\n }\n\n function test_revokeDeployerApproval() external testIndex(5) {\n console.log(\"🔐 Approval revocation\");\n manager.revokeDeployerApproval(address(_approvalTest));\n console.log(\" ✓ Revokes deployer approval.\");\n try _approvalTest.deploy(manager, keccak256(\"Salt2\")) {\n revert(\"Expected error\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_APPROVED\"),\n \"Error: Expected ERR_NOT_APPROVED error message.\"\n );\n }\n console.log(\" ✓ Unapproved deployer fails to deploy proxy.\");\n }\n\n function test_setImplementationAddressManyToOne() external testIndex(6) {\n console.log(\"⏫ Many-to-one proxy implementation upgrade\");\n try manager.setImplementationAddressManyToOne(bytes32(0), address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_IMPLEMENTATION_ID\"),\n \"Error: Expected ERR_IMPLEMENTATION_ID error message.\"\n );\n }\n console.log(\" ✓ Fails to set implementation for unrecognized ID.\");\n try manager.setImplementationAddressManyToOne(TEST_IMPLEMENTATION_ID, address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_CONTRACT\"),\n \"Error: Expected ERR_NOT_CONTRACT error message.\"\n );\n }\n console.log(\" ✓ Fails to set non-contract implementation.\");\n manager.setImplementationAddressManyToOne(TEST_IMPLEMENTATION_ID, address(implementation2));\n console.log(\" ✓ Updates proxy implementation.\");\n MockProxyLogic2 proxy = MockProxyLogic2(proxyAddressMT1);\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n proxy.incrementValue();\n require(proxy.getValue() == 2, \"Error: Expected proxy to return 2 for stored value.\");\n proxy.decrementValue();\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n console.log(\" ✓ Proxy forwards calls to upgraded implementation.\");\n }\n\n function test_deployProxyOneToOne() external testIndex(7) {\n console.log(\"🆕 One-to-one proxy deployment\");\n proxyAddress1T1 = manager.deployProxyOneToOne(\n keccak256(\"Salty\"), address(implementation1)\n );\n console.log(\" ✓ Deploys a one-to-one proxy.\");\n require(\n proxyAddress1T1 == Salty.computeProxyAddressOneToOne(\n address(manager),\n address(this),\n keccak256(\"Salty\")\n ),\n \"Error: Unexpected proxy address.\"\n );\n console.log(\" ✓ Salty computes correct address.\");\n require(\n proxyAddress1T1 == manager.computeProxyAddressOneToOne(\n address(this),\n keccak256(\"Salty\")\n ),\n \"Error: Unexpected proxy address.\"\n );\n console.log(\" ✓ Manager computes correct address.\");\n MockProxyLogic1 proxy = MockProxyLogic1(proxyAddress1T1);\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n proxy.incrementValue();\n require(proxy.getValue() == 1, \"Error: Expected proxy to return 1 for stored value.\");\n proxy.decrementValue();\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n console.log(\" ✓ Proxy forwards calls to implementation.\");\n }\n\n function test_setImplementationAddressOneToOne() external testIndex(8) {\n console.log(\"🔼 One-to-one proxy implementation upgrade\");\n try manager.setImplementationAddressOneToOne(proxyAddress1T1, address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NOT_CONTRACT\"),\n \"Error: Expected ERR_NOT_CONTRACT error message.\"\n );\n }\n console.log(\" ✓ Fails to set non-contract implementation.\");\n try manager.setImplementationAddressOneToOne(address(this), address(this)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_SET_ADDRESS_REVERT\"),\n \"Error: Expected ERR_SET_ADDRESS_REVERT error message.\"\n );\n }\n console.log(\" ✓ Reverts on call to non-proxy.\");\n manager.setImplementationAddressOneToOne(proxyAddress1T1, address(implementation2));\n console.log(\" ✓ Updates proxy implementation.\");\n MockProxyLogic2 proxy = MockProxyLogic2(proxyAddress1T1);\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n proxy.incrementValue();\n require(proxy.getValue() == 2, \"Error: Expected proxy to return 2 for stored value.\");\n proxy.decrementValue();\n require(proxy.getValue() == 0, \"Error: Expected proxy to return 0 for stored value.\");\n console.log(\" ✓ Proxy forwards calls to upgraded implementation.\");\n }\n\n function test_lockImplementationOneToOne() external testIndex(9) {\n console.log(\"🔓 One-to-one implementation locked\");\n bool isLocked = manager.isImplementationLocked(proxyAddress1T1);\n require(!isLocked, \"Error: Expected isImplementationLocked to return false.\");\n manager.lockImplementationOneToOne(proxyAddress1T1);\n isLocked = manager.isImplementationLocked(proxyAddress1T1);\n require(isLocked, \"Error: Expected isImplementationLocked to return true.\");\n console.log(\" ✓ Locks one-to-one proxy implementation.\");\n\n try manager.setImplementationAddressOneToOne(proxyAddress1T1, address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_IMPLEMENTATION_LOCKED\"),\n \"Error: Expected ERR_IMPLEMENTATION_LOCKED error message.\"\n );\n }\n console.log(\" ✓ Fails to upgrade locked implementation.\");\n }\n\n function test_lockImplementationManyToOne() external testIndex(10) {\n console.log(\"🔓 Many-to-one implementation locked\");\n bool isLocked = manager.isImplementationLocked(TEST_IMPLEMENTATION_ID);\n require(!isLocked, \"Error: Expected isImplementationLocked to return false.\");\n manager.lockImplementationManyToOne(TEST_IMPLEMENTATION_ID);\n isLocked = manager.isImplementationLocked(TEST_IMPLEMENTATION_ID);\n require(isLocked, \"Error: Expected isImplementationLocked to return true.\");\n console.log(\" ✓ Locks many-to-one proxy implementation.\");\n\n try manager.setImplementationAddressManyToOne(TEST_IMPLEMENTATION_ID, address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_IMPLEMENTATION_LOCKED\"),\n \"Error: Expected ERR_IMPLEMENTATION_LOCKED error message.\"\n );\n }\n console.log(\" ✓ Fails to upgrade locked implementation.\");\n try manager.lockImplementationManyToOne(bytes32(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_IMPLEMENTATION_ID\"),\n \"Error: Expected ERR_IMPLEMENTATION_ID error message.\"\n );\n }\n console.log(\" ✓ Fails to lock unrecognized implementation.\");\n try manager.isImplementationLocked(bytes32(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_IMPLEMENTATION_ID\"),\n \"Error: Expected ERR_IMPLEMENTATION_ID error message.\"\n );\n }\n console.log(\" ✓ Fails to query unrecognized implementation.\");\n }\n\n function test_transferOwnership() external testIndex(11) {\n console.log(\"👑 Ownership transferral\");\n try manager.transferOwnership(address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"Ownable: new owner is the zero address\"),\n \"Error: Expected 'Ownable: new owner is the zero address' error message.\"\n );\n }\n console.log(\" ✓ Fails to transfer ownership to null address.\");\n manager.transferOwnership(address(32));\n console.log(\" ✓ Transfers ownership to non-null address.\");\n require(address(32) == manager.owner(), \"Error: Manager returned unexpected owner address.\");\n console.log(\" ✓ Returns updated owner address.\");\n }\n\n function test_badImplementationHolder() external testIndex(12) {\n console.log(\"🔥 Proxy failure conditions\");\n errorHolder1 = new ErroneousHolder1();\n address proxy = address(new DelegateCallProxyManyToOne());\n // \"Error: Bad implementation holder.\"\n try MockProxyLogic2(proxy).getValue() {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"CUSTOM_HOLDER_REVERT_MSG\"),\n \"Error: Expected CUSTOM_HOLDER_REVERT_MSG error message.\"\n );\n }\n console.log(\" ✓ Returns the revert message if the call to the holder fails.\");\n errorHolder2 = new ErroneousHolder2();\n proxy = address(new DelegateCallProxyManyToOne());\n try MockProxyLogic2(proxy).getValue() {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"ERR_NULL_IMPLEMENTATION\"),\n \"Error: Expected ERR_NULL_IMPLEMENTATION error message.\"\n );\n }\n console.log(\" ✓ Reverts if the holder returns a null address.\");\n }\n\n function test_onlyOwner() external testIndex(13) {\n console.log(\"🔒 Owner restrictions\");\n try manager.approveDeployer(address(this)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"Ownable: caller is not the owner\"),\n \"Error: Expected Ownable: caller is not the owner error message.\"\n );\n }\n console.log(\" ✓ approveDeployer(): Reverts when called by non-owner.\");\n\n try manager.revokeDeployerApproval(address(0)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"Ownable: caller is not the owner\"),\n \"Error: Expected Ownable: caller is not the owner error message.\"\n );\n }\n console.log(\" ✓ revokeDeployerApproval(): Reverts when called by non-owner.\");\n\n try manager.deployProxyOneToOne(keccak256(\"Salty\"), address(implementation1)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"Ownable: caller is not the owner\"),\n \"Error: Expected Ownable: caller is not the owner error message.\"\n );\n }\n console.log(\" ✓ deployProxyOneToOne(): Reverts when called by non-owner.\");\n\n try manager.createManyToOneProxyRelationship(keccak256(\"Salty\"), address(implementation1)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"Ownable: caller is not the owner\"),\n \"Error: Expected Ownable: caller is not the owner error message.\"\n );\n }\n console.log(\" ✓ createManyToOneProxyRelationship(): Reverts when called by non-owner.\");\n\n try manager.setImplementationAddressOneToOne(proxyAddress1T1, address(implementation2)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"Ownable: caller is not the owner\"),\n \"Error: Expected Ownable: caller is not the owner error message.\"\n );\n }\n console.log(\" ✓ setImplementationAddressOneToOne(): Reverts when called by non-owner.\");\n\n try manager.setImplementationAddressManyToOne(bytes32(0), address(implementation2)) {\n revert(\"Expected error.\");\n } catch Error(string memory errorMsg) {\n require(\n keccak256(abi.encodePacked(errorMsg)) == keccak256(\"Ownable: caller is not the owner\"),\n \"Error: Expected Ownable: caller is not the owner error message.\"\n );\n }\n console.log(\" ✓ setImplementationAddressManyToOne(): Reverts when called by non-owner.\");\n }\n\n function getImplementationHolder() external view returns(address) {\n if (address(errorHolder2) != address(0)) return address(errorHolder2);\n return address(errorHolder1);\n }\n}" }, "contracts/mocks/TestOrder.sol": { "content": "pragma solidity ^0.6.0;\n\n\ncontract TestOrder {\n uint256 internal _testStep;\n uint256 internal _timestampLast;\n\n modifier testIndex(uint256 i) {\n require(_testStep++ == i, \"Error: Wrong test order.\");\n _;\n }\n\n modifier markTime {\n _timestampLast = block.timestamp;\n _;\n }\n\n modifier forceDelay(uint256 delay) {\n require(block.timestamp - _timestampLast >= delay, \"Error: test requires time delay\");\n _timestampLast = block.timestamp;\n _;\n }\n}" From 83899d69f3cedd0a62e8ee6a9c4b1ca5a5541945 Mon Sep 17 00:00:00 2001 From: dillon Date: Fri, 23 Oct 2020 20:28:13 -0500 Subject: [PATCH 7/7] Set package version to 1.0.12 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1ac1b7b..2e0d3fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@indexed-finance/proxies", - "version": "1.0.11", + "version": "1.0.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9b27c7e..69b9713 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@indexed-finance/proxies", - "version": "1.0.11", + "version": "1.0.12", "description": "Solidity delegatecall proxy contracts.", "repository": { "url": "https://github.com/indexed-finance/proxies"