TUPProxy

Kiln

TUPProxy (Transparent Upgradeable Pausable Proxy)

This contract extends the Transparent Upgradeable proxy and adds a system wide pause feature. When the system is paused, the fallback will fail no matter what calls are made. Address Zero is allowed to perform calls even if paused to allow view calls made from RPC providers to properly work.

Methods

admin

function admin() external nonpayable returns (address admin_)

Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[eth_getStorageAt] RPC call. 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103

Returns

NameTypeDescription

admin_

address

undefined

changeAdmin

function changeAdmin(address newAdmin) external nonpayable

Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.

Parameters

NameTypeDescription

newAdmin

address

undefined

implementation

function implementation() external nonpayable returns (address implementation_)

Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[eth_getStorageAt] RPC call. 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc

Returns

NameTypeDescription

implementation_

address

undefined

pause

function pause() external nonpayable

Pauses system

paused

function paused() external nonpayable returns (bool)

Retrieves Paused state

Returns

NameTypeDescription

_0

bool

Paused state

unpause

function unpause() external nonpayable

Unpauses system

upgradeTo

function upgradeTo(address newImplementation) external nonpayable

Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.

Parameters

NameTypeDescription

newImplementation

address

undefined

upgradeToAndCall

function upgradeToAndCall(address newImplementation, bytes data) external payable

Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by data, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.

Parameters

NameTypeDescription

newImplementation

address

undefined

data

bytes

undefined

Events

AdminChanged

event AdminChanged(address previousAdmin, address newAdmin)

Parameters

NameTypeDescription

previousAdmin

address

undefined

newAdmin

address

undefined

BeaconUpgraded

event BeaconUpgraded(address indexed beacon)

Parameters

NameTypeDescription

beacon indexed

address

undefined

Paused

event Paused(address admin)

The system is now paused

Parameters

NameTypeDescription

admin

address

The admin at the time of the pause event

Unpaused

event Unpaused(address admin)

The system is now unpaused

Parameters

NameTypeDescription

admin

address

The admin at the time of the unpause event

Upgraded

event Upgraded(address indexed implementation)

Parameters

NameTypeDescription

implementation indexed

address

undefined

Errors

CallWhenPaused

error CallWhenPaused()

A call happened while the system was paused

Last updated