Skip to content

CoreInternals ​

SigsSlot ​

solidity
struct SigsSlot {
  bytes4[] value;
}

_ADMIN_SLOT ​

solidity
bytes32 _ADMIN_SLOT

Storage slot with the admin of the contract. This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is validated in the constructor.

_DUMMY_IMPLEMENTATION_SLOT ​

solidity
bytes32 _DUMMY_IMPLEMENTATION_SLOT

Storage slot with the address of the current dummy-implementation. This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is validated in the constructor.

_SIG_SLOT_BASE ​

solidity
bytes32 _SIG_SLOT_BASE

use EIP1967 proxy slot (see _DUMMY_IMPLEMENTATION_SLOT) except for first 4 bytes,

_getSlotImplSigsSlot ​

solidity
function _getSlotImplSigsSlot(address implementation_) internal pure returns (bytes32)

Returns the storage slot which stores the sigs array set for the implementation.

_getSlotSigsImplSlot ​

solidity
function _getSlotSigsImplSlot(bytes4 sig_) internal pure returns (bytes32 result_)

Returns the storage slot which stores the implementation address for the function sig.

_getAddressSlot ​

solidity
function _getAddressSlot(bytes32 slot_) internal view returns (address data_)

_Returns an address data_located atslot*.*

_setAddressSlot ​

solidity
function _setAddressSlot(bytes32 slot_, address data_) internal

_Sets an address data_located atslot*.*

_getSigsSlot ​

solidity
function _getSigsSlot(bytes32 slot_) internal pure returns (struct CoreInternals.SigsSlot _r)

Returns an SigsSlot with member value located at slot.

_setImplementationSigs ​

solidity
function _setImplementationSigs(address implementation_, bytes4[] sigs_) internal

Sets new implementation and adds mapping from implementation to sigs and sig to implementation.

_removeImplementationSigs ​

solidity
function _removeImplementationSigs(address implementation_) internal

Removes implementation and the mappings corresponding to it.

_getImplementationSigs ​

solidity
function _getImplementationSigs(address implementation_) internal view returns (bytes4[])

Returns bytes4[] sigs from implementation address. If implemenatation is not registered then returns empty array.

_getSigImplementation ​

solidity
function _getSigImplementation(bytes4 sig_) internal view returns (address implementation_)

Returns implementation address from bytes4 sig. If sig is not registered then returns address(0).

_getAdmin ​

solidity
function _getAdmin() internal view returns (address)

Returns the current admin.

_getDummyImplementation ​

solidity
function _getDummyImplementation() internal view returns (address)

Returns the current dummy-implementation.

_setAdmin ​

solidity
function _setAdmin(address newAdmin_) internal

Stores a new address in the EIP1967 admin slot.

_setDummyImplementation ​

solidity
function _setDummyImplementation(address newDummyImplementation_) internal

Stores a new address in the EIP1967 implementation slot.

AdminInternals ​

onlyAdmin ​

solidity
modifier onlyAdmin()

Only admin guard

constructor ​

solidity
constructor(address admin_, address dummyImplementation_) public

setAdmin ​

solidity
function setAdmin(address newAdmin_) external

Sets new admin.

setDummyImplementation ​

solidity
function setDummyImplementation(address newDummyImplementation_) external

Sets new dummy-implementation.

addImplementation ​

solidity
function addImplementation(address implementation_, bytes4[] sigs_) external

Adds new implementation address.

removeImplementation ​

solidity
function removeImplementation(address implementation_) external

Removes an existing implementation address.

Proxy ​

This abstract contract provides a fallback function that delegates all calls to another contract using the EVM. It implements the Instadapp infinite-proxy: https://github.com/Instadapp/infinite-proxy

constructor ​

solidity
constructor(address admin_, address dummyImplementation_) internal

getAdmin ​

solidity
function getAdmin() external view returns (address)

Returns admin's address.

getDummyImplementation ​

solidity
function getDummyImplementation() external view returns (address)

Returns dummy-implementations's address.

getImplementationSigs ​

solidity
function getImplementationSigs(address impl_) external view returns (bytes4[])

Returns bytes4[] sigs from implementation address If not registered then returns empty array.

getSigsImplementation ​

solidity
function getSigsImplementation(bytes4 sig_) external view returns (address)

Returns implementation address from bytes4 sig. If sig is not registered then returns address(0).

fallback ​

solidity
fallback() external payable

Fallback function that delegates calls to the address returned by Implementations registry.

receive ​

solidity
receive() external payable