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/.
Identical Contracts
The following contracts have identical source code.
Stats
Public Functions
18
Event Types
5
Code Size
15,178 bytes
Events (5) keyboard_arrow_up
Functions
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
allowance keyboard_arrow_up
Source Code
function allowance(address owner, address spender)
public
view
returns (uint256)
{
// Immutable static call from target contract
return IERC20(target).allowance(owner, spender);
}
transfer keyboard_arrow_up
approve keyboard_arrow_up
transferFrom keyboard_arrow_up
name keyboard_arrow_up
symbol keyboard_arrow_up
decimals keyboard_arrow_up
nominateNewOwner keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function nominateNewOwner(address _owner) external onlyOwner {
nominatedOwner = _owner;
emit OwnerNominated(_owner);
}
acceptOwnership keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
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
Modifiers help
onlyOwner checks for the following:
Source Code
function setTarget(Proxyable _target) external onlyOwner {
target = _target;
emit TargetUpdated(_target);
}
setUseDELEGATECALL keyboard_arrow_up
_emit keyboard_arrow_up
Parameters help
Modifiers help
onlyTarget checks for the following:
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.
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)
}
}
}
transfer keyboard_arrow_up
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;
}
approve keyboard_arrow_up
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;
}
transferFrom keyboard_arrow_up
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
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.