Main Contract
  • Introduction
  • Money on Chain platform
    • Main concepts
    • System states
    • Public actions
      • User actions
      • Process actions
    • Contracts architecture
      • MoC
      • CommissionSplitter
      • MoCState
      • MoCBucketContainer
      • MoCSettlement
      • MoCHelperLib
      • MoCLibConnection
      • MoCConverter
      • MoCExchange
      • MoCConnector
      • MoCBProxManager
      • MoCInrate
      • MoCVendors
      • MoCWhitelist
      • MoCBase
      • OwnerBurnableToken
      • BProToken
      • DocToken
      • MoCToken
      • PriceProvider
    • Contract mocks
    • Relevant patterns and choices
    • Data dictionary
    • Getting started
  • Integration with MoC platform
    • Introduction to MoC
      • The MoC Contract
      • MoC Precisions
      • MoC State Contracts
    • Getting BPros
      • Minting BitPros
      • Redeeming BitPros
    • Getting DoCs
      • Minting DoCs
      • Redeeming DoCs
        • On Settlement: redeemDocRequest
        • On Settlement: alterRedeemRequestAmount
        • Outside Settlement: redeemFreeDocVendors
        • On Liquidation State: redeemAllDoc
        • How-to
    • Commission fees values
    • Vendors
    • Fees calculation
    • From outside the blockchain
      • Using RSK nodes
      • Using web3
      • Official Money on Chain ABIs
      • Events
      • Example code minting BPros
      • Example code minting BPros without Truffle
      • Example code redeeming BPros
      • Example code redeeming BPros without Truffle
      • Example code minting DOC
      • Example code redeeming free DOC
      • Example code redeeming DOC Request
      • Example code redeeming all DOC
  • Smart contracts
    • Contracts verification
    • ABIs documentation
      • BProToken
      • BtcPriceProviderMock
      • DocToken
      • ERC20Mintable
      • Governed
      • Initializable
      • MakeStoppable
      • MakeUnstoppable
      • MoC
      • MoCBProxManager
      • MoCBucketContainer
      • MoCConnector
      • MoCConverter
      • MoCEMACalculator
      • MoCExchange
      • MoCHelperLib
      • MoCHelperLibMock
      • MoCInrate
      • MoCLibConnection
      • MoCPriceProviderMock
      • MoCSettlement
      • MoCSettlementMock
      • MoCState
      • MoCStateMock
      • MoCToken
      • MoCVendors
      • MoCWhitelist
      • MockMakeStoppable
      • MockMakeUnstoppable
      • MockStopper
      • MockUpgradeDelegator
      • MockUpgraderTemplate
      • OwnerBurnableToken
      • Pausable
      • PriceFeed
      • PriceFeederAdder
      • PriceFeederRemover
      • PriceProvider
      • RevertingOnSend
      • Stoppable
      • Stopper
      • UpgradeDelegator
      • UpgraderTemplate
Powered by GitBook
On this page
  • Contract Members
  • Functions
  • initialize
  • getProxyImplementation
  • getProxyAdmin
  • changeProxyAdmin
  • upgrade
  • upgradeAndCall
  1. Smart contracts
  2. ABIs documentation

UpgradeDelegator

PreviousStopperNextUpgraderTemplate

Last updated 3 years ago

View Source:

↗ Extends: ↘ Derived Contracts:

UpgradeDelegator - version: 0.1.12

Dispatches to the proxyAdmin any call made through the governance systemAdapter between our governance system and the zeppelinOS proxyAdmin. This is needed to be able to upgrade governance through the same system

Contract Members

Constants & Variables

contract ProxyAdmin public proxyAdmin;

Functions

initialize

Initialize the contract with the basic settingsThis initialize replaces the constructor but it is not called automatically. It is necessary because of the upgradeability of the contracts

function initialize(IGovernor _governor, ProxyAdmin _proxyAdmin) public nonpayable initializer 

Arguments

Name
Type
Description

_governor

IGovernor

Governor address of this system

_proxyAdmin

ProxyAdmin

ProxyAdmin that we will forward the call to

getProxyImplementation

Returns the current implementation of a proxy. This is needed because only the proxy admin can query it.

function getProxyImplementation(AdminUpgradeabilityProxy proxy) public view
returns(address)

Returns

The address of the current implementation of the proxy.

Arguments

Name
Type
Description

proxy

AdminUpgradeabilityProxy

getProxyAdmin

Returns the admin of a proxy. Only the admin can query it.

function getProxyAdmin(AdminUpgradeabilityProxy proxy) public view
returns(address)

Returns

The address of the current admin of the proxy.

Arguments

Name
Type
Description

proxy

AdminUpgradeabilityProxy

changeProxyAdmin

Changes the admin of a proxy.

function changeProxyAdmin(AdminUpgradeabilityProxy proxy, address newAdmin) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

proxy

AdminUpgradeabilityProxy

Proxy to change admin.

newAdmin

address

Address to transfer proxy administration to.

upgrade

Upgrades a proxy to the newest implementation of a contract.

function upgrade(AdminUpgradeabilityProxy proxy, address implementation) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

proxy

AdminUpgradeabilityProxy

Proxy to be upgraded.

implementation

address

the address of the Implementation.

upgradeAndCall

Upgrades a proxy to the newest implementation of a contract and forwards a function call to it. This is useful to initialize the proxied contract.

function upgradeAndCall(AdminUpgradeabilityProxy proxy, address implementation, bytes data) public payable onlyAuthorizedChanger 

Arguments

Name
Type
Description

proxy

AdminUpgradeabilityProxy

Proxy to be upgraded.

implementation

address

Address of the Implementation.

data

bytes

Data to send as msg.data in the low level call.It should include the signature and the parameters of the function to be called, as described inhttps://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.

moc-governance/contracts/Upgradeability/UpgradeDelegator.sol
Governed
MockUpgradeDelegator
initialize(IGovernor _governor, ProxyAdmin _proxyAdmin)
getProxyImplementation(AdminUpgradeabilityProxy proxy)
getProxyAdmin(AdminUpgradeabilityProxy proxy)
changeProxyAdmin(AdminUpgradeabilityProxy proxy, address newAdmin)
upgrade(AdminUpgradeabilityProxy proxy, address implementation)
upgradeAndCall(AdminUpgradeabilityProxy proxy, address implementation, bytes data)