Blockwell

Synth sUSD

ERC20

This contract is an ERC20 token.

Name Synth sUSD
Symbol sUSD
Decimals 18
Total Supply 240,792,619 sUSD

About link

sUSD (SUSD) is a cryptocurrency and operates on the Ethereum platform. sUSD has a current supply of 237,004,591.37163785. The last known price of sUSD is 1.00759401 USD and is up 0.30 over the last 24 hours. It is currently trading on 31 active market(s) with $9,494,723.21 traded over the last 24 hours. More information can be found at https://www.synthetix.io/.

Stats

Public Functions 18
Event Types 5
Code Size 15,178 bytes

Events (5) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint help

OwnerChanged Event

Parameters help
oldOwner
address help
newOwner
address help

OwnerNominated Event

Parameters help
newOwner
address help

TargetUpdated Event

Parameters help
newTarget
Proxyable help

Transfer Event

Parameters help
from
address help
to
address help
value
uint help

target Variable

address help

useDELEGATECALL Variable

bool help

owner Variable

address help

nominatedOwner Variable

address help

Functions Expand All Collapse All

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function totalSupply() public view returns (uint256) {
  // Immutable static call from target contract
  return IERC20(target).totalSupply();
}

Parameters help

Name Type
owner
address help

Properties

Visibility help public
Mutability help view
Source Code
function balanceOf(address owner) public view returns (uint256) {
  // Immutable static call from target contract
  return IERC20(target).balanceOf(owner);
}

Parameters help

Name Type
owner
address help
spender
address help

Properties

Visibility help public
Mutability help view
Source Code
function allowance(address owner, address spender)
  public
  view
  returns (uint256)
{
  // Immutable static call from target contract
  return IERC20(target).allowance(owner, spender);
}

Parameters help

Name Type
to
address help
value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address to, uint256 value) public returns (bool);

Parameters help

Name Type
spender
address help
value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address spender, uint256 value) public returns (bool);

Parameters help

Name Type
from
address help
to
address help
value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address from,
  address to,
  uint256 value
) public returns (bool);

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function name() public view returns (string) {
  // Immutable static call from target contract
  return IERC20(target).name();
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function symbol() public view returns (string) {
  // Immutable static call from target contract
  return IERC20(target).symbol();
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function decimals() public view returns (uint8) {
  // Immutable static call from target contract
  return IERC20(target).decimals();
}

nominateNewOwner keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function nominateNewOwner(address _owner) external onlyOwner {
  nominatedOwner = _owner;
  emit OwnerNominated(_owner);
}

acceptOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function acceptOwnership() external {
  require(
    msg.sender == nominatedOwner,
    "You must be nominated before you can accept ownership"
  );
  emit OwnerChanged(owner, nominatedOwner);
  owner = nominatedOwner;
  nominatedOwner = address(0);
}

setTarget keyboard_arrow_up

Parameters help

Name Type
_target
Proxyable help

Properties

Visibility help public
Mutability help transaction
Source Code
function setTarget(Proxyable _target) external onlyOwner {
  target = _target;
  emit TargetUpdated(_target);
}

setUseDELEGATECALL keyboard_arrow_up

Parameters help

Name Type
value
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
function setUseDELEGATECALL(bool value) external onlyOwner {
  useDELEGATECALL = value;
}

_emit keyboard_arrow_up

Parameters help

Name Type
callData
bytes help
numTopics
uint help
topic1
bytes32 help
topic2
bytes32 help
topic3
bytes32 help
topic4
bytes32 help

Properties

Visibility help public
Mutability help transaction
Source Code
function _emit(
  bytes callData,
  uint256 numTopics,
  bytes32 topic1,
  bytes32 topic2,
  bytes32 topic3,
  bytes32 topic4
) external onlyTarget {
  uint256 size = callData.length;
  bytes memory _callData = callData;

  assembly {
    /* The first 32 bytes of callData contain its length (as specified by the abi).
     * Length is assumed to be a uint256 and therefore maximum of 32 bytes
     * in length. It is also leftpadded to be a multiple of 32 bytes.
     * This means moving call_data across 32 bytes guarantees we correctly access
     * the data itself. */
    switch numTopics
    case 0 {
      log0(add(_callData, 32), size)
    }
    case 1 {
      log1(add(_callData, 32), size, topic1)
    }
    case 2 {
      log2(add(_callData, 32), size, topic1, topic2)
    }
    case 3 {
      log3(add(_callData, 32), size, topic1, topic2, topic3)
    }
    case 4 {
      log4(add(_callData, 32), size, topic1, topic2, topic3, topic4)
    }
  }
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function() external payable {
  if (useDELEGATECALL) {
    assembly {
      /* Copy call data into free memory region. */
      let free_ptr := mload(0x40)
      calldatacopy(free_ptr, 0, calldatasize)

      /* Forward all gas and call data to the target contract. */
      let result := delegatecall(
        gas,
        sload(target_slot),
        free_ptr,
        calldatasize,
        0,
        0
      )
      returndatacopy(free_ptr, 0, returndatasize)

      /* Revert if the call failed, otherwise return the result. */
      if iszero(result) {
        revert(free_ptr, returndatasize)
      }
      return(free_ptr, returndatasize)
    }
  } else {
    /* Here we are as above, but must send the messageSender explicitly
     * since we are using CALL rather than DELEGATECALL. */
    target.setMessageSender(msg.sender);
    assembly {
      let free_ptr := mload(0x40)
      calldatacopy(free_ptr, 0, calldatasize)

      /* We must explicitly forward ether to the underlying contract as well. */
      let result := call(
        gas,
        sload(target_slot),
        callvalue,
        free_ptr,
        calldatasize,
        0,
        0
      )
      returndatacopy(free_ptr, 0, returndatasize)

      if iszero(result) {
        revert(free_ptr, returndatasize)
      }
      return(free_ptr, returndatasize)
    }
  }
}

Parameters help

Name Type
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address to, uint256 value) public returns (bool) {
  // Mutable state call requires the proxy to tell the target who the msg.sender is.
  target.setMessageSender(msg.sender);

  // Forward the ERC20 call to the target contract
  IERC20(target).transfer(to, value);

  // Event emitting will occur via Synthetix.Proxy._emit()
  return true;
}

Parameters help

Name Type
spender
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address spender, uint256 value) public returns (bool) {
  // Mutable state call requires the proxy to tell the target who the msg.sender is.
  target.setMessageSender(msg.sender);

  // Forward the ERC20 call to the target contract
  IERC20(target).approve(spender, value);

  // Event emitting will occur via Synthetix.Proxy._emit()
  return true;
}

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address from,
  address to,
  uint256 value
) public returns (bool) {
  // Mutable state call requires the proxy to tell the target who the msg.sender is.
  target.setMessageSender(msg.sender);

  // Forward the ERC20 call to the target contract
  IERC20(target).transferFrom(from, to, value);

  // Event emitting will occur via Synthetix.Proxy._emit()
  return true;
}

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.