Adapted version of https://github.com/DistributedCollective/Sovryn-smart-contracts/blob/development/contracts/proxy/UpgradableProxy.sol (UpgradableProxy.sol)
View Source: contracts/Proxy/UpgradableProxy.sol
↗ Extends: Proxy
UpgradableProxy
A disadvantage of the immutable ledger is that nobody can change the source code of a smart contract after it’s been deployed. In order to fix bugs or introduce new features, smart contracts need to be upgradable somehow. Although it is not possible to upgrade the code of an already deployed smart contract, it is possible to set-up a proxy contract architecture that will allow to use new deployed contracts as if the main logic had been upgraded. A proxy architecture pattern is such that all message calls go through a Proxy contract that will redirect them to the latest deployed contract logic. To upgrade, a new version of the contract is deployed, and the Proxy is updated to reference the new contract address.
Set address of the implementation.
function setImplementation(address _implementation) public nonpayable onlyOwner
Arguments
Name | Type | Description |
---|---|---|
_implementation | address | Address of the implementation. |
Source Code
nction setImplementation(address _implementation) public onlyOwner {
_setImplementation(_implementation);
}
- ActivePool
- ActivePoolStorage
- BaseMath
- BorrowerOperations
- BorrowerOperationsScript
- BorrowerOperationsStorage
- BorrowerWrappersScript
- CheckContract
- CollSurplusPool
- CollSurplusPoolStorage
- console
- Context
- DefaultPool
- DefaultPoolStorage
- DocsCover
- DSAuth
- DSAuthEvents
- DSAuthority
- DSNote
- DSProxy
- DSProxyCache
- DSProxyFactory
- ERC20
- ETHTransferScript
- FeeDistributor
- FeeDistributorStorage
- GasPool
- HintHelpers
- HintHelpersStorage
- IActivePool
- IBalanceRedirectPresale
- IBorrowerOperations
- ICollSurplusPool
- IDefaultPool
- IERC20
- IERC2612
- IExternalPriceFeed
- IFeeDistributor
- IFeeSharingProxy
- ILiquityBase
- ILiquityBaseParams
- IMasset
- IMoCBaseOracle
- Initializable
- IPool
- IPriceFeed
- IRSKOracle
- ISortedTroves
- IStabilityPool
- ITroveManager
- IWrbtc
- IZUSDToken
- LiquityBase
- LiquityBaseParams
- LiquityMath
- LiquitySafeMath128
- MoCMedianizer
- MultiTroveGetter
- MultiTroveGetterStorage
- NueToken
- Ownable
- PriceFeed
- PriceFeedStorage
- ProxiableContract
- ProxiableContract2
- Proxy
- RskOracle
- SafeMath
- SortedTroves
- SortedTrovesStorage
- StabilityPool
- StabilityPoolScript
- StabilityPoolStorage
- Storage
- Storage2
- TokenScript
- TroveManager
- TroveManagerBase
- TroveManagerBase1MinuteBootstrap
- TroveManagerRedeemOps
- TroveManagerScript
- TroveManagerStorage
- UpgradableProxy
- ZUSDToken
- ZUSDTokenStorage