Blockwell

TrueUSD

About

Stats

Public Functions 7
Event Types 3
Code Size 7,184 bytes

Events (3) keyboard_arrow_up

NewPendingOwner Event

Parameters help
currentOwner
address help
pendingOwner
address help

ProxyOwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Upgraded Event

Parameters help
implementation
address help

proxyOwnerPosition Constant

bytes32 help

pendingProxyOwnerPosition Constant

bytes32 help

implementationPosition Constant

bytes32 help

Functions Expand All Collapse All

implementation keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function implementation() public view returns (address impl) {
  bytes32 position = implementationPosition;
  assembly {
    impl := sload(position)
  }
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
function() external payable {
  address _impl = implementation();
  require(_impl != address(0), "implementation contract not set");

  assembly {
    let ptr := mload(0x40)
    calldatacopy(ptr, 0, calldatasize)
    let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0)
    let size := returndatasize
    returndatacopy(ptr, 0, size)

    switch result
    case 0 {
      revert(ptr, size)
    }
    default {
      return(ptr, size)
    }
  }
}

proxyOwner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function proxyOwner() public view returns (address owner) {
  bytes32 position = proxyOwnerPosition;
  assembly {
    owner := sload(position)
  }
}

pendingProxyOwner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function pendingProxyOwner() public view returns (address pendingOwner) {
  bytes32 position = pendingProxyOwnerPosition;
  assembly {
    pendingOwner := sload(position)
  }
}

transferProxyOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
function transferProxyOwnership(address newOwner) external onlyProxyOwner {
  require(newOwner != address(0));
  _setPendingUpgradeabilityOwner(newOwner);
  emit NewPendingOwner(proxyOwner(), newOwner);
}

claimProxyOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function claimProxyOwnership() external onlyPendingProxyOwner {
  emit ProxyOwnershipTransferred(proxyOwner(), pendingProxyOwner());
  _setUpgradeabilityOwner(pendingProxyOwner());
  _setPendingUpgradeabilityOwner(address(0));
}

upgradeTo keyboard_arrow_up

Parameters help

Name Type
implementation
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function upgradeTo(address implementation) external onlyProxyOwner {
  _upgradeTo(implementation);
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.

internal OwnedUpgradeabilityProxy._setUpgradeabilityOwner keyboard_arrow_up

Parameters help

Name Type
newProxyOwner
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _setUpgradeabilityOwner(address newProxyOwner) internal {
  bytes32 position = proxyOwnerPosition;
  assembly {
    sstore(position, newProxyOwner)
  }
}

internal OwnedUpgradeabilityProxy._setPendingUpgradeabilityOwner keyboard_arrow_up

Parameters help

Name Type
newPendingProxyOwner
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _setPendingUpgradeabilityOwner(address newPendingProxyOwner) internal {
  bytes32 position = pendingProxyOwnerPosition;
  assembly {
    sstore(position, newPendingProxyOwner)
  }
}

internal UpgradeabilityProxy._setImplementation keyboard_arrow_up

Parameters help

Name Type
newImplementation
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _setImplementation(address newImplementation) internal {
  bytes32 position = implementationPosition;
  assembly {
    sstore(position, newImplementation)
  }
}

internal UpgradeabilityProxy._upgradeTo keyboard_arrow_up

Parameters help

Name Type
newImplementation
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _upgradeTo(address newImplementation) internal {
  address currentImplementation = implementation();
  require(currentImplementation != newImplementation);
  _setImplementation(newImplementation);
  emit Upgraded(newImplementation);
}